/*
 * Inventario > Movimientos — rediseño exclusivo para tablet.
 * Reutiliza la vista enriquecida móvil sin alterar teléfono ni escritorio.
 */
@media (min-width:681px) and (max-width:820px),
       (min-width:821px) and (max-width:1366px) and (pointer:coarse) and (min-height:500px),
       (min-width:821px) and (max-width:1366px) and (hover:none) and (min-height:500px) {
    html body #pvf-shell .pvf-main-body.pvf-view-inventario .rv-inv-desktop-render:has(#pv-hist-mov-inv-card-desktop) {
        display: none !important;
    }

    html body #pvf-shell .pvf-main-body.pvf-view-inventario .rv-inv-mobile-render:has(.rv-mov-module) {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    html body #pvf-shell .pvf-main-body .rv-mov-module {
        gap: 14px !important;
    }

    html body #pvf-shell .pvf-main-body .rv-mov-hero {
        display: grid !important;
        grid-template-columns: 48px minmax(220px, 1fr) minmax(250px, .9fr) !important;
        grid-template-rows: auto !important;
        align-items: center !important;
        gap: 14px !important;
        padding: 16px 18px !important;
        border-radius: 20px !important;
    }

    html body #pvf-shell .pvf-main-body .rv-mov-hero-icon {
        grid-column: 1 !important;
        grid-row: 1 !important;
        width: 48px !important;
        height: 48px !important;
        border-radius: 14px !important;
    }

    html body #pvf-shell .pvf-main-body .rv-mov-hero-copy {
        grid-column: 2 !important;
        grid-row: 1 !important;
        min-width: 0 !important;
    }

    html body #pvf-shell .pvf-main-body .rv-mov-hero-copy > small {
        font-size: 8px !important;
    }

    html body #pvf-shell .pvf-main-body .rv-mov-hero-copy h2 {
        font-size: 18px !important;
    }

    html body #pvf-shell .pvf-main-body .rv-mov-hero-copy p {
        font-size: 10px !important;
    }

    html body #pvf-shell .pvf-main-body .rv-mov-hero-stats {
        grid-column: 3 !important;
        grid-row: 1 !important;
        align-self: center !important;
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 7px !important;
        width: 100% !important;
    }

    html body #pvf-shell .pvf-main-body .rv-mov-hero-stats > span {
        min-height: 46px !important;
        padding: 7px 4px !important;
        border-radius: 12px !important;
    }

    html body #pvf-shell .pvf-main-body .rv-mov-hero-stats strong {
        font-size: 15px !important;
    }

    html body #pvf-shell .pvf-main-body .rv-mov-hero-stats small {
        font-size: 7px !important;
    }

    html body #pvf-shell .pvf-main-body .rv-mov-toolbar {
        display: grid !important;
        grid-template-columns: minmax(220px, 1fr) minmax(300px, .95fr) !important;
        align-items: center !important;
        gap: 16px !important;
        margin: 0 0 12px !important;
        padding: 14px 16px !important;
        border-radius: 18px !important;
    }

    html body #pvf-shell .pvf-main-body .rv-mov-toolbar-copy h2 {
        font-size: 17px !important;
    }

    html body #pvf-shell .pvf-main-body .rv-mov-toolbar-copy p {
        font-size: 9px !important;
    }

    html body #pvf-shell .pvf-main-body .rv-mov-search .pv-historial-buscar-input {
        height: 46px !important;
        min-height: 46px !important;
        padding-right: 14px !important;
        font-size: 11px !important;
    }

    html body #pvf-shell .pvf-main-body #pv-hist-mov-inv {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 12px !important;
        align-items: stretch !important;
    }

    html body #pvf-shell .pvf-main-body #pv-hist-mov-inv .rv-mov-table-row:not(.pv-historial-header) {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
        grid-template-areas:
            "tipo fecha"
            "producto producto"
            "almacen cantidad"
            "motivo motivo"
            "acciones acciones" !important;
        align-content: start !important;
        gap: 10px !important;
        min-height: 300px !important;
        padding: 14px 14px 12px 17px !important;
        border-radius: 18px !important;
        box-shadow: 0 9px 24px rgba(27, 34, 55, .07) !important;
    }

    html body #pvf-shell .pvf-main-body #pv-hist-mov-inv .rv-mov-product strong {
        font-size: 13px !important;
    }

    html body #pvf-shell .pvf-main-body #pv-hist-mov-inv .rv-mov-warehouse,
    html body #pvf-shell .pvf-main-body #pv-hist-mov-inv .rv-mov-quantity {
        min-height: 60px !important;
    }

    html body #pvf-shell .pvf-main-body #pv-hist-mov-inv .rv-mov-warehouse {
        grid-template-columns: minmax(0, 1fr) !important;
        align-content: center !important;
        padding: 9px !important;
    }

    html body #pvf-shell .pvf-main-body #pv-hist-mov-inv .rv-mov-warehouse .rv-mov-metric-icon {
        display: none !important;
    }

    html body #pvf-shell .pvf-main-body #pv-hist-mov-inv .rv-mov-warehouse > span:last-child {
        grid-column: 1 !important;
        display: flex !important;
        align-items: flex-start !important;
        flex-direction: column !important;
        gap: 4px !important;
    }

    html body #pvf-shell .pvf-main-body #pv-hist-mov-inv .rv-mov-warehouse strong,
    html body #pvf-shell .pvf-main-body #pv-hist-mov-inv .rv-mov-impact-copy strong {
        font-size: 10px !important;
    }

    html body #pvf-shell .pvf-main-body #pv-hist-mov-inv .rv-mov-reason strong {
        font-size: 9.5px !important;
    }

    html body #pvf-shell .pvf-main-body #pv-hist-mov-inv .rv-mov-actions {
        align-self: end !important;
    }

    html body #pvf-shell .pvf-main-body #pv-hist-mov-inv .rv-mov-delete-label {
        font-size: 9px !important;
    }

    html body #pvf-shell .pvf-main-body #pv-hist-mov-inv-card .pv-paginacion {
        max-width: 420px !important;
        margin: 14px auto 0 !important;
    }
}
