/**
 * Cuentas por pagar/cobrar · todos los controles en una fila en tablet.
 */

@media (min-width: 681px) and (max-width: 1024px),
       (min-width: 1025px) and (max-width: 1366px) and (pointer: coarse) and (min-height: 500px) {
    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-cuentas_pendientes
    :is(#pv-hist-pagar, #pv-hist-cobrar) .rv-cxp-resumen {
        grid-template-columns: 40px minmax(0, 1fr) clamp(160px, 24vw, 190px) !important;
        grid-template-areas:
            "avatar name name"
            "amount amount amount"
            "actions actions arrow" !important;
        column-gap: 10px !important;
        justify-items: center !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-cuentas_pendientes
    :is(#pv-hist-pagar, #pv-hist-cobrar) .rv-cxp-acciones {
        align-self: center !important;
        justify-self: stretch !important;
        box-sizing: border-box !important;
        width: 100% !important;
        max-width: none !important;
        height: 46px !important;
        min-height: 46px !important;
        margin: 0 !important;
        overflow: visible !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-cuentas_pendientes
    :is(#pv-hist-pagar, #pv-hist-cobrar) .rv-cxp-monto {
        position: relative !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-cuentas_pendientes
    :is(#pv-hist-pagar, #pv-hist-cobrar) .rv-cxp-monto .pv-moneda-badge {
        position: absolute !important;
        top: 50% !important;
        right: 12px !important;
        left: auto !important;
        margin: 0 !important;
        transform: translateY(-50%) !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-cuentas_pendientes
    #pv-hist-pagar .rv-cxp-acciones {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        align-items: center !important;
        gap: 10px !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-cuentas_pendientes
    #pv-hist-cobrar .rv-cxp-acciones {
        display: grid !important;
        grid-template-columns: 42px minmax(0, 1fr) minmax(0, 1fr) 42px !important;
        align-items: center !important;
        gap: 8px !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-cuentas_pendientes
    :is(#pv-hist-pagar, #pv-hist-cobrar) .rv-cxp-acciones
    > :is(.rv-cxp-pagar-btn, .rv-cxp-abonar-btn) {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 7px !important;
        box-sizing: border-box !important;
        width: 100% !important;
        min-width: 0 !important;
        height: 46px !important;
        min-height: 46px !important;
        margin: 0 !important;
        padding: 0 10px !important;
        overflow: hidden !important;
        font-size: 9.5px !important;
        line-height: 1 !important;
        text-align: center !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-cuentas_pendientes
    #pv-hist-cobrar .rv-cxp-acciones
    > :is(.rv-cxp-mas-btn, .pv-icon-btn) {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-sizing: border-box !important;
        width: 42px !important;
        min-width: 42px !important;
        max-width: 42px !important;
        height: 46px !important;
        min-height: 46px !important;
        max-height: 46px !important;
        margin: 0 !important;
        padding: 0 !important;
        border-radius: 11px !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-cuentas_pendientes
    :is(#pv-hist-pagar, #pv-hist-cobrar) .rv-cxp-resumen button.pv-detalle-flecha {
        grid-area: arrow !important;
        align-self: center !important;
        justify-self: stretch !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 12px !important;
        box-sizing: border-box !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        height: 46px !important;
        min-height: 46px !important;
        max-height: 46px !important;
        margin: 0 !important;
        padding: 0 16px !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-cuentas_pendientes
    :is(#pv-hist-pagar, #pv-hist-cobrar) .rv-cxp-resumen button.pv-detalle-flecha::after {
        position: static !important;
        top: auto !important;
        right: auto !important;
        flex: 0 0 8px !important;
        transform: rotate(45deg) !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-cuentas_pendientes
    :is(#pv-hist-pagar, #pv-hist-cobrar) .rv-cxp-resumen button.pv-detalle-flecha.open::after {
        transform: rotate(225deg) !important;
    }
}

/* Historial de pagos · resumen horizontal también en tablets de 540–680 px CSS. */
@media (min-width: 540px) and (max-width: 1366px) {
    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-cuentas_pendientes
    .rv-cxp-history .pv-entity-history-group-head {
        grid-template-columns:
            38px
            minmax(100px, 1.2fr)
            minmax(112px, .9fr)
            minmax(105px, .85fr)
            32px !important;
        grid-template-areas: "avatar copy latest total chevron" !important;
        grid-template-rows: auto !important;
        align-items: center !important;
        gap: 8px !important;
        box-sizing: border-box !important;
        width: 100% !important;
        min-height: 72px !important;
        padding: 10px 12px !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-cuentas_pendientes
    .rv-cxp-history .pv-entity-history-group-head .pv-entity-history-avatar {
        grid-area: avatar !important;
        width: 38px !important;
        min-width: 38px !important;
        height: 38px !important;
        min-height: 38px !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-cuentas_pendientes
    .rv-cxp-history .pv-entity-history-group-head .pv-entity-history-copy {
        grid-area: copy !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-cuentas_pendientes
    .rv-cxp-history .pv-entity-history-group-head .pv-entity-history-latest {
        grid-area: latest !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-cuentas_pendientes
    .rv-cxp-history .pv-entity-history-group-head .pv-entity-history-total {
        grid-area: total !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-cuentas_pendientes
    .rv-cxp-history .pv-entity-history-group-head .pv-entity-history-chevron {
        grid-area: chevron !important;
        align-self: center !important;
        justify-self: end !important;
        width: 32px !important;
        min-width: 32px !important;
        height: 32px !important;
        min-height: 32px !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-cuentas_pendientes
    .rv-cxp-history .pv-entity-history-group-head :is(
        .pv-entity-history-copy,
        .pv-entity-history-latest,
        .pv-entity-history-total
    ) {
        box-sizing: border-box !important;
        width: 100% !important;
        min-width: 0 !important;
        padding-top: 0 !important;
        overflow: hidden !important;
        border-top: 0 !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-cuentas_pendientes
    .rv-cxp-history .pv-entity-history-group-head .pv-entity-history-latest {
        align-items: flex-start !important;
        justify-content: center !important;
        text-align: left !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-cuentas_pendientes
    .rv-cxp-history .pv-entity-history-group-head .pv-entity-history-total {
        align-items: flex-end !important;
        justify-content: center !important;
        text-align: right !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-cuentas_pendientes
    .rv-cxp-history .pv-entity-history-group-head .pv-entity-history-latest > strong {
        display: -webkit-box !important;
        max-width: 100% !important;
        overflow: hidden !important;
        font-size: 9px !important;
        line-height: 1.2 !important;
        text-overflow: clip !important;
        white-space: normal !important;
        overflow-wrap: normal !important;
        -webkit-box-orient: vertical !important;
        -webkit-line-clamp: 2 !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-cuentas_pendientes
    .rv-cxp-history .pv-entity-history-group-head .pv-entity-history-total > strong {
        max-width: 100% !important;
        font-size: 10.5px !important;
        white-space: nowrap !important;
    }
}

/* Historial de cuentas · tarjetas horizontales compactas en tablet. */
@media (min-width: 681px) and (max-width: 1024px),
       (min-width: 1025px) and (max-width: 1366px) and (pointer: coarse) and (min-height: 500px),
       (min-width: 1025px) and (max-width: 1366px) and (hover: none) and (min-height: 500px) {
    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-historial_cuentas
    .rv-hist-table-wrap {
        box-sizing: border-box !important;
        width: 100% !important;
        min-width: 0 !important;
        overflow: visible !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-historial_cuentas
    table#pv-hist-cuentas-tabla.rv-hist-table {
        display: block !important;
        box-sizing: border-box !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        border: 0 !important;
        background: transparent !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-historial_cuentas
    #pv-hist-cuentas-tabla > thead {
        display: none !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-historial_cuentas
    #pv-hist-cuentas-tabla > tbody {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 12px !important;
        box-sizing: border-box !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-historial_cuentas
    #pv-hist-cuentas-tabla > tbody > tr.pv-hist-cuentas-fila {
        position: relative !important;
        display: grid !important;
        grid-template-columns:
            minmax(105px, .75fr)
            minmax(105px, .8fr)
            minmax(170px, 1.25fr)
            minmax(135px, .9fr) !important;
        grid-template-areas:
            "movement movement movement operation"
            "date user bank amount" !important;
        align-items: stretch !important;
        box-sizing: border-box !important;
        width: 100% !important;
        min-width: 0 !important;
        height: auto !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 12px 12px 12px 18px !important;
        gap: 9px 10px !important;
        overflow: hidden !important;
        border: 1px solid #E3DEF0 !important;
        border-radius: 17px !important;
        background: linear-gradient(145deg, #FFFFFF 0%, #FBFAFE 100%) !important;
        box-shadow: 0 7px 20px rgba(43, 34, 72, .065) !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-historial_cuentas
    #pv-hist-cuentas-tabla > tbody > tr.pv-hist-cuentas-fila::before {
        top: 12px !important;
        bottom: 12px !important;
        left: 7px !important;
        width: 4px !important;
        border-radius: 5px !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-historial_cuentas
    #pv-hist-cuentas-tabla > tbody > tr.pv-hist-cuentas-fila > td {
        box-sizing: border-box !important;
        width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        overflow: hidden !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-historial_cuentas
    #pv-hist-cuentas-tabla > tbody > tr.pv-hist-cuentas-fila > td:first-child {
        grid-area: movement !important;
        position: static !important;
        display: block !important;
        min-height: 55px !important;
        padding: 1px 8px 7px 0 !important;
        overflow: hidden !important;
        border: 0 !important;
        border-bottom: 1px solid #EEEAF5 !important;
        border-radius: 0 !important;
        background: transparent !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-historial_cuentas
    #pv-hist-cuentas-tabla .rv-hist-movement-cell .rv-hist-modules {
        max-width: 100% !important;
        min-height: 20px !important;
        margin: 0 0 5px !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-historial_cuentas
    #pv-hist-cuentas-tabla .rv-hist-movement-cell .rv-hist-module {
        height: 20px !important;
        padding: 0 8px !important;
        font-size: 7.5px !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-historial_cuentas
    #pv-hist-cuentas-tabla .rv-hist-movement-cell > strong {
        margin: 0 0 2px !important;
        overflow: hidden !important;
        font-size: 12.5px !important;
        line-height: 1.2 !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-historial_cuentas
    #pv-hist-cuentas-tabla .rv-hist-movement-cell > small {
        display: -webkit-box !important;
        max-height: 26px !important;
        overflow: hidden !important;
        font-size: 9px !important;
        line-height: 1.35 !important;
        text-overflow: ellipsis !important;
        white-space: normal !important;
        -webkit-box-orient: vertical !important;
        -webkit-line-clamp: 2 !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-historial_cuentas
    #pv-hist-cuentas-tabla > tbody > tr.pv-hist-cuentas-fila > td:nth-child(2) {
        grid-area: date !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-historial_cuentas
    #pv-hist-cuentas-tabla > tbody > tr.pv-hist-cuentas-fila > td:nth-child(3) {
        grid-area: user !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-historial_cuentas
    #pv-hist-cuentas-tabla > tbody > tr.pv-hist-cuentas-fila > td:nth-child(2),
    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-historial_cuentas
    #pv-hist-cuentas-tabla > tbody > tr.pv-hist-cuentas-fila > td:nth-child(3),
    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-historial_cuentas
    #pv-hist-cuentas-tabla > tbody > tr.pv-hist-cuentas-fila > td:nth-child(5),
    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-historial_cuentas
    #pv-hist-cuentas-tabla > tbody > tr.pv-hist-cuentas-fila > td:nth-child(6) {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        justify-content: center !important;
        min-height: 58px !important;
        padding: 8px 9px !important;
        border: 1px solid #ECE8F3 !important;
        border-radius: 11px !important;
        background: #FAF9FC !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-historial_cuentas
    #pv-hist-cuentas-tabla > tbody > tr.pv-hist-cuentas-fila > td:nth-child(4) {
        grid-area: operation !important;
        position: static !important;
        inset: auto !important;
        align-self: start !important;
        justify-self: end !important;
        display: flex !important;
        align-items: flex-start !important;
        justify-content: flex-end !important;
        width: auto !important;
        min-width: 0 !important;
        padding: 1px 0 0 !important;
        overflow: visible !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-historial_cuentas
    #pv-hist-cuentas-tabla > tbody > tr.pv-hist-cuentas-fila > td:nth-child(5) {
        grid-area: bank !important;
        grid-column: auto !important;
        background: linear-gradient(145deg, #FAF8FF, #F7F5FC) !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-historial_cuentas
    #pv-hist-cuentas-tabla > tbody > tr.pv-hist-cuentas-fila > td:nth-child(6) {
        grid-area: amount !important;
        grid-column: auto !important;
        align-items: flex-end !important;
        justify-content: center !important;
        padding: 8px 9px !important;
        border: 1px solid #E6DDF8 !important;
        background: linear-gradient(145deg, #FCFAFF, #F7F4FF) !important;
        text-align: right !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-historial_cuentas
    #pv-hist-cuentas-tabla > tbody > tr.pv-hist-cuentas-fila > td:nth-child(2)::before,
    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-historial_cuentas
    #pv-hist-cuentas-tabla > tbody > tr.pv-hist-cuentas-fila > td:nth-child(3)::before,
    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-historial_cuentas
    #pv-hist-cuentas-tabla > tbody > tr.pv-hist-cuentas-fila > td:nth-child(5)::before,
    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-historial_cuentas
    #pv-hist-cuentas-tabla > tbody > tr.pv-hist-cuentas-fila > td:nth-child(6)::before {
        display: block !important;
        align-self: stretch !important;
        width: 100% !important;
        margin: 0 0 5px !important;
        color: #8995AA !important;
        font-size: 7px !important;
        font-weight: 900 !important;
        line-height: 1 !important;
        letter-spacing: .06em !important;
        text-align: inherit !important;
        white-space: nowrap !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-historial_cuentas
    #pv-hist-cuentas-tabla .rv-hist-bank {
        gap: 7px !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-historial_cuentas
    #pv-hist-cuentas-tabla .rv-hist-bank-arrow {
        flex-basis: 26px !important;
        width: 26px !important;
        height: 26px !important;
        border-radius: 8px !important;
        font-size: 12px !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-historial_cuentas
    #pv-hist-cuentas-tabla .rv-hist-bank strong,
    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-historial_cuentas
    #pv-hist-cuentas-tabla .rv-hist-user {
        max-width: 100% !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-historial_cuentas
    #pv-hist-cuentas-tabla .rv-hist-amount > strong {
        font-size: 12.5px !important;
        line-height: 1.1 !important;
        white-space: nowrap !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-historial_cuentas
    #pv-hist-cuentas-tabla .rv-hist-amount > span {
        display: block !important;
        margin-top: 3px !important;
        font-size: 7.5px !important;
        white-space: nowrap !important;
    }
}

/* Modal de cuenta pendiente · selector de divisa compacto en tablet. */
@media (min-width: 681px) and (max-width: 1024px),
       (min-width: 1025px) and (max-width: 1366px) and (pointer: coarse) and (min-height: 500px),
       (min-width: 1025px) and (max-width: 1366px) and (hover: none) and (min-height: 500px) {
    html body #pvf-shell#pvf-shell #pv-modal-cuenta-pendiente
    .rv-cxp-entry-form .pvf-row:has(> .pv-divisa-chips) {
        align-items: center !important;
    }

    html body #pvf-shell#pvf-shell #pv-modal-cuenta-pendiente
    .rv-cxp-entry-form .pvf-row:has(> .pv-divisa-chips) > label {
        box-sizing: border-box !important;
        width: min(100%, 420px) !important;
        margin-inline: auto !important;
    }

    html body #pvf-shell#pvf-shell #pv-modal-cuenta-pendiente
    .rv-cxp-entry-form .pv-divisa-chips.pv-moneda-switches {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        box-sizing: border-box !important;
        width: min(100%, 420px) !important;
        min-width: 0 !important;
        max-width: 420px !important;
        height: 42px !important;
        min-height: 42px !important;
        margin: 0 auto !important;
        padding: 4px !important;
        gap: 4px !important;
        border-radius: 13px !important;
    }

    html body #pvf-shell#pvf-shell #pv-modal-cuenta-pendiente
    .rv-cxp-entry-form .pv-divisa-chips.pv-moneda-switches > .pv-chip-radio {
        box-sizing: border-box !important;
        width: 100% !important;
        min-width: 0 !important;
        height: 32px !important;
        min-height: 32px !important;
        max-height: 32px !important;
        margin: 0 !important;
        padding: 0 10px !important;
        border-radius: 9px !important;
    }
}

/* Historial de pagos por fecha · tarjetas compactas de dos columnas en tablet. */
@media (min-width: 681px) and (max-width: 1024px),
       (min-width: 1025px) and (max-width: 1366px) and (pointer: coarse) and (min-height: 500px),
       (min-width: 1025px) and (max-width: 1366px) and (hover: none) and (min-height: 500px) {
    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-cuentas_pendientes
    .rv-cxp-history-card .rv-cxp-history-table {
        box-sizing: border-box !important;
        width: 100% !important;
        min-width: 0 !important;
        border-collapse: separate !important;
        border-spacing: 0 !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-cuentas_pendientes
    .rv-cxp-history-card .rv-cxp-history-table > thead {
        display: none !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-cuentas_pendientes
    .rv-cxp-history-card .rv-cxp-history-table > tbody {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 14px !important;
        box-sizing: border-box !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-cuentas_pendientes
    .rv-cxp-history-card .rv-cxp-history-table > tbody > tr.pv-historial-fila {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        align-items: stretch !important;
        gap: 8px 10px !important;
        box-sizing: border-box !important;
        width: 100% !important;
        min-width: 0 !important;
        height: auto !important;
        margin: 0 !important;
        padding: 10px !important;
        overflow: hidden !important;
        border: 1px solid #E4E7F0 !important;
        border-radius: 18px !important;
        background: #FFFFFF !important;
        box-shadow: 0 7px 20px rgba(57, 46, 91, .06) !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-cuentas_pendientes
    .rv-cxp-history-card .rv-cxp-history-table > tbody > tr.pv-historial-fila > td {
        position: relative !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        justify-content: flex-start !important;
        gap: 0 !important;
        box-sizing: border-box !important;
        width: 100% !important;
        min-width: 0 !important;
        min-height: 56px !important;
        margin: 0 !important;
        padding: 8px 10px !important;
        overflow: hidden !important;
        border: 1px solid #ECE8F7 !important;
        border-radius: 13px !important;
        background: #FAF9FE !important;
        color: #283349 !important;
        text-align: left !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-cuentas_pendientes
    .rv-cxp-history-card .rv-cxp-history-table > tbody > tr.pv-historial-fila > td:first-child {
        grid-column: 1 / -1 !important;
        min-height: 60px !important;
        justify-content: center !important;
        border-color: #DED5FF !important;
        background: linear-gradient(135deg, #F8F5FF 0%, #FFF7FB 100%) !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-cuentas_pendientes
    .rv-cxp-history-card .rv-cxp-history-table > tbody > tr.pv-historial-fila > td::before {
        content: attr(data-label) !important;
        position: static !important;
        display: block !important;
        box-sizing: border-box !important;
        width: 100% !important;
        margin: 0 0 4px !important;
        color: #8995AC !important;
        font-size: 8.5px !important;
        font-weight: 900 !important;
        line-height: 1.1 !important;
        letter-spacing: .055em !important;
        text-align: left !important;
        text-transform: uppercase !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-cuentas_pendientes
    .rv-cxp-history-card .rv-cxp-history-table > tbody > tr.pv-historial-fila > td > * {
        box-sizing: border-box !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        margin-inline: 0 !important;
        text-align: left !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-cuentas_pendientes
    .rv-cxp-history-card :is(
        .rv-cxp-history-movement,
        .rv-cxp-history-entity,
        .rv-cxp-history-date,
        .rv-cxp-history-bank,
        .rv-cxp-history-amount
    ) {
        align-items: flex-start !important;
        justify-content: center !important;
        min-width: 0 !important;
        text-align: left !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-cuentas_pendientes
    .rv-cxp-history-card :is(
        .rv-cxp-history-movement,
        .rv-cxp-history-entity,
        .rv-cxp-history-date,
        .rv-cxp-history-bank,
        .rv-cxp-history-amount
    ) :is(strong, small) {
        display: block !important;
        max-width: 100% !important;
        overflow: visible !important;
        text-overflow: clip !important;
        white-space: normal !important;
        overflow-wrap: anywhere !important;
        text-align: left !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-cuentas_pendientes
    .rv-cxp-history-card .rv-cxp-history-movement {
        flex-direction: row !important;
        align-items: center !important;
        gap: 8px !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-cuentas_pendientes
    .rv-cxp-history-card .rv-cxp-history-movement .rv-cxp-history-kind {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex: 0 0 34px !important;
        width: 34px !important;
        min-width: 34px !important;
        height: 34px !important;
        min-height: 34px !important;
        border-radius: 10px !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-cuentas_pendientes
    .rv-cxp-history-card .rv-cxp-history-amount > strong {
        color: #261B48 !important;
        font-size: 14px !important;
        font-weight: 900 !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-cuentas_pendientes
    .rv-cxp-history-card :is(.rv-cxp-history-ref, .rv-cxp-history-no-proof) {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: auto !important;
        min-width: 0 !important;
        min-height: 26px !important;
        padding: 4px 9px !important;
        border-radius: 9px !important;
        white-space: normal !important;
        overflow-wrap: anywhere !important;
        text-align: center !important;
    }
}

/* Historial de pagos por persona · resumen horizontal y sin datos truncados. */
@media (min-width: 681px) and (max-width: 1024px),
       (min-width: 1025px) and (max-width: 1366px) and (pointer: coarse) and (min-height: 500px),
       (min-width: 1025px) and (max-width: 1366px) and (hover: none) and (min-height: 500px) {
    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-cuentas_pendientes
    .rv-cxp-history .pv-entity-history-group-head {
        grid-template-columns: 38px minmax(170px, 1fr) minmax(130px, .55fr) minmax(125px, .6fr) 32px !important;
        grid-template-areas: "avatar copy latest total chevron" !important;
        grid-template-rows: auto !important;
        align-items: center !important;
        column-gap: 10px !important;
        row-gap: 0 !important;
        box-sizing: border-box !important;
        width: 100% !important;
        min-width: 0 !important;
        height: auto !important;
        min-height: 72px !important;
        padding: 10px 12px !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-cuentas_pendientes
    .rv-cxp-history .pv-entity-history-group-head :is(
        .pv-entity-history-copy,
        .pv-entity-history-latest,
        .pv-entity-history-total
    ) {
        box-sizing: border-box !important;
        width: 100% !important;
        min-width: 0 !important;
        min-height: 0 !important;
        padding-top: 0 !important;
        overflow: hidden !important;
        border-top: 0 !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-cuentas_pendientes
    .rv-cxp-history .pv-entity-history-group-head .pv-entity-history-copy {
        align-items: flex-start !important;
        justify-content: center !important;
        text-align: left !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-cuentas_pendientes
    .rv-cxp-history .pv-entity-history-group-head .pv-entity-history-latest {
        align-items: flex-start !important;
        justify-content: center !important;
        text-align: left !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-cuentas_pendientes
    .rv-cxp-history .pv-entity-history-group-head .pv-entity-history-total {
        align-items: flex-end !important;
        justify-content: center !important;
        text-align: right !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-cuentas_pendientes
    .rv-cxp-history .pv-entity-history-group-head :is(
        .pv-entity-history-copy,
        .pv-entity-history-latest,
        .pv-entity-history-total
    ) > * {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-cuentas_pendientes
    .rv-cxp-history .pv-entity-history-group-head .pv-entity-history-chevron {
        align-self: center !important;
        justify-self: end !important;
        width: 32px !important;
        min-width: 32px !important;
        height: 32px !important;
        min-height: 32px !important;
    }
}

@media (min-width: 681px) and (max-width: 720px) {
    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-cuentas_pendientes
    .rv-cxp-history .pv-entity-history-group-head {
        grid-template-columns: 38px minmax(0, 1fr) minmax(120px, 150px) 32px !important;
        grid-template-areas:
            "avatar copy copy chevron"
            "latest latest total total" !important;
        grid-template-rows: auto auto !important;
        row-gap: 8px !important;
        min-height: 96px !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-cuentas_pendientes
    .rv-cxp-history .pv-entity-history-group-head :is(
        .pv-entity-history-latest,
        .pv-entity-history-total
    ) {
        padding-top: 7px !important;
        border-top: 1px solid #ECEEF4 !important;
    }
}

/* Historial de cobros · resumen completo y legible en tablet. */
@media (min-width: 681px) and (max-width: 1024px),
       (min-width: 1025px) and (max-width: 1366px) and (pointer: coarse) and (min-height: 500px),
       (min-width: 1025px) and (max-width: 1366px) and (hover: none) and (min-height: 500px) {
    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-cuentas_pendientes
    .rv-cxc-history .pv-entity-history-group-head {
        grid-template-columns: 48px minmax(0, 1fr) minmax(150px, 180px) 36px !important;
        grid-template-areas:
            "avatar copy copy chevron"
            "latest latest total total" !important;
        grid-template-rows: auto auto !important;
        align-items: center !important;
        column-gap: 10px !important;
        row-gap: 12px !important;
        box-sizing: border-box !important;
        width: 100% !important;
        min-width: 0 !important;
        height: auto !important;
        min-height: 124px !important;
        padding: 14px !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-cuentas_pendientes
    .rv-cxc-history .pv-entity-history-group-head .pv-entity-history-avatar {
        box-sizing: border-box !important;
        width: 48px !important;
        min-width: 48px !important;
        height: 48px !important;
        min-height: 48px !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-cuentas_pendientes
    .rv-cxc-history .pv-entity-history-group-head .pv-entity-history-copy {
        align-items: flex-start !important;
        width: 100% !important;
        min-width: 0 !important;
        text-align: left !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-cuentas_pendientes
    .rv-cxc-history .pv-entity-history-group-head :is(
        .pv-entity-history-latest,
        .pv-entity-history-total
    ) {
        box-sizing: border-box !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        height: auto !important;
        min-height: 38px !important;
        overflow: visible !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-cuentas_pendientes
    .rv-cxc-history .pv-entity-history-group-head .pv-entity-history-latest {
        align-items: flex-start !important;
        justify-content: center !important;
        text-align: left !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-cuentas_pendientes
    .rv-cxc-history .pv-entity-history-group-head .pv-entity-history-total {
        align-items: flex-end !important;
        justify-content: center !important;
        text-align: right !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-cuentas_pendientes
    .rv-cxc-history .pv-entity-history-group-head :is(
        .pv-entity-history-latest,
        .pv-entity-history-total
    ) > :is(span, strong) {
        display: block !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: 100% !important;
        overflow: visible !important;
        text-overflow: clip !important;
        white-space: normal !important;
        overflow-wrap: anywhere !important;
    }

    html body #pvf-shell#pvf-shell .pvf-main-body.pvf-view-cuentas_pendientes
    .rv-cxc-history .pv-entity-history-group-head .pv-entity-history-chevron {
        box-sizing: border-box !important;
        width: 36px !important;
        min-width: 36px !important;
        height: 36px !important;
        min-height: 36px !important;
    }
}

/* Cuentas pendientes · formato modal tablet Noalyx. */
@media (min-width: 681px) and (max-width: 1024px),
       (min-width: 1025px) and (max-width: 1366px) and (pointer: coarse) and (min-height: 500px),
       (min-width: 1025px) and (max-width: 1366px) and (hover: none) and (min-height: 500px) {
    html body #pvf-shell#pvf-shell #pv-modal-cuenta-pendiente#pv-modal-cuenta-pendiente[hidden] {
        display: none !important;
    }

    html body #pvf-shell#pvf-shell #pv-modal-cuenta-pendiente#pv-modal-cuenta-pendiente:not([hidden]) {
        position: fixed !important;
        inset: 0 !important;
        z-index: 999999 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-sizing: border-box !important;
        width: 100vw !important;
        height: 100dvh !important;
        min-height: 100dvh !important;
        max-height: none !important;
        padding: 20px !important;
        overflow: hidden !important;
    }

    html body #pvf-shell#pvf-shell #pv-modal-cuenta-pendiente#pv-modal-cuenta-pendiente:not([hidden])
    > .rv-cxp-entry-modal {
        position: relative !important;
        display: flex !important;
        flex-direction: column !important;
        box-sizing: border-box !important;
        width: min(760px, calc(100vw - 40px)) !important;
        min-width: 0 !important;
        max-width: 760px !important;
        height: min(680px, calc(100dvh - 40px)) !important;
        min-height: 0 !important;
        max-height: calc(100dvh - 40px) !important;
        margin: auto !important;
        overflow: hidden !important;
        border-radius: 22px !important;
    }

    html body #pvf-shell#pvf-shell #pv-modal-cuenta-pendiente#pv-modal-cuenta-pendiente
    .rv-cxp-entry-head {
        position: relative !important;
        flex: 0 0 auto !important;
        align-items: center !important;
        box-sizing: border-box !important;
        width: 100% !important;
        min-height: 72px !important;
        padding: 14px 64px 14px 20px !important;
    }

    html body #pvf-shell#pvf-shell #pv-modal-cuenta-pendiente#pv-modal-cuenta-pendiente
    .rv-cxp-entry-head .pv-modal-close[aria-label="Cerrar"] {
        position: absolute !important;
        z-index: 25 !important;
        top: 50% !important;
        right: 16px !important;
        bottom: auto !important;
        left: auto !important;
        display: grid !important;
        place-items: center !important;
        box-sizing: border-box !important;
        width: 36px !important;
        min-width: 36px !important;
        max-width: 36px !important;
        height: 36px !important;
        min-height: 36px !important;
        max-height: 36px !important;
        margin: 0 !important;
        padding: 0 !important;
        border-radius: 10px !important;
        transform: translateY(-50%) !important;
    }

    html body #pvf-shell#pvf-shell #pv-modal-cuenta-pendiente#pv-modal-cuenta-pendiente
    .rv-cxp-entry-body {
        flex: 1 1 auto !important;
        box-sizing: border-box !important;
        width: 100% !important;
        min-width: 0 !important;
        min-height: 0 !important;
        height: auto !important;
        max-height: none !important;
        padding: 18px 20px 22px !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        overscroll-behavior: contain !important;
    }

    html body #pvf-shell#pvf-shell #pv-modal-cuenta-pendiente#pv-modal-cuenta-pendiente
    :is(.rv-cxp-entry-form, .pv-campos-fila, .pvf-row, .pv-items-card, .pv-items-row) {
        box-sizing: border-box !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }

    html body #pvf-shell#pvf-shell #pv-modal-cuenta-pendiente#pv-modal-cuenta-pendiente
    .rv-cxp-entry-form > .pv-campos-fila {
        display: grid !important;
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
        align-items: start !important;
        gap: 12px !important;
        width: 100% !important;
    }

    html body #pvf-shell#pvf-shell #pv-modal-cuenta-pendiente#pv-modal-cuenta-pendiente
    .rv-cxp-entry-form > .pv-campos-fila > .pvf-row {
        width: 100% !important;
        margin: 0 !important;
    }

    html body #pvf-shell#pvf-shell #pv-modal-cuenta-pendiente#pv-modal-cuenta-pendiente
    .rv-cxp-entry-actions {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        align-items: stretch !important;
        gap: 12px !important;
        width: 100% !important;
    }

    html body #pvf-shell#pvf-shell #pv-modal-cuenta-pendiente#pv-modal-cuenta-pendiente
    .rv-cxp-entry-actions > :where(button, .pvf-btn) {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-sizing: border-box !important;
        width: 100% !important;
        min-width: 0 !important;
        min-height: 44px !important;
        margin: 0 !important;
    }
}
