/**
 * Historial de fabricación compacto para tablet.
 * Replica la jerarquía visual de las tarjetas del historial de pedidos.
 */

@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 #pv-fab-hist-card #pv-fab-hist-tabla {
        display: block !important;
        box-sizing: border-box !important;
        width: 100% !important;
        padding: 0 !important;
        overflow: visible !important;
        background: transparent !important;
    }

    html body #pvf-shell #pv-fab-hist-card .pv-fh-table-row.pv-historial-header {
        display: none !important;
    }

    html body #pvf-shell #pv-fab-hist-card .pv-fh-data-row {
        position: relative !important;
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) 140px !important;
        grid-template-areas:
            "pedido estado"
            "cliente total"
            "items acciones" !important;
        grid-template-rows: 42px 32px 36px !important;
        align-items: center !important;
        column-gap: 14px !important;
        row-gap: 4px !important;
        box-sizing: border-box !important;
        width: 100% !important;
        min-width: 0 !important;
        min-height: 138px !important;
        margin: 0 0 10px !important;
        padding: 10px 14px 10px 18px !important;
        overflow: hidden !important;
        border: 1px solid #E1E6EF !important;
        border-radius: 14px !important;
        background: linear-gradient(135deg, #FFFFFF 72%, #FBF9FF 100%) !important;
        box-shadow: 0 7px 20px rgba(16, 24, 40, .05) !important;
    }

    html body #pvf-shell #pv-fab-hist-card .pv-fh-data-row::after {
        content: "" !important;
        position: absolute !important;
        z-index: 2 !important;
        inset: 12px auto 12px 0 !important;
        width: 4px !important;
        height: auto !important;
        border-radius: 0 999px 999px 0 !important;
        background: linear-gradient(180deg, #7042ED 0%, #B126B7 58%, #F50158 100%) !important;
        pointer-events: none !important;
    }

    html body #pvf-shell #pv-fab-hist-card .pv-fh-data-row > div {
        box-sizing: border-box !important;
        min-width: 0 !important;
        max-width: none !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
    }

    html body #pvf-shell #pv-fab-hist-card .pv-fh-order-cell {
        grid-area: pedido !important;
        display: grid !important;
        grid-template-columns: 42px minmax(0, 1fr) !important;
        align-items: center !important;
        align-self: center !important;
        gap: 9px !important;
        padding: 0 !important;
        border: 0 !important;
    }

    html body #pvf-shell #pv-fab-hist-card .pv-fh-order-icon {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-sizing: border-box !important;
        width: 42px !important;
        height: 42px !important;
        border: 1px solid #E1D9FF !important;
        border-radius: 12px !important;
        background: #F2EDFF !important;
        color: #7042ED !important;
    }

    html body #pvf-shell #pv-fab-hist-card .pv-fh-order-icon svg {
        width: 19px !important;
        height: 19px !important;
    }

    html body #pvf-shell #pv-fab-hist-card .pv-fh-order-copy {
        display: flex !important;
        min-width: 0 !important;
        flex-direction: column !important;
        gap: 3px !important;
    }

    html body #pvf-shell #pv-fab-hist-card .pv-fh-order-copy strong {
        overflow: hidden !important;
        color: #202A3E !important;
        font-size: 12px !important;
        font-weight: 900 !important;
        line-height: 1.08 !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    html body #pvf-shell #pv-fab-hist-card .pv-fh-order-copy small {
        color: #8390A5 !important;
        font-size: 8.5px !important;
        font-weight: 700 !important;
        line-height: 1 !important;
    }

    html body #pvf-shell #pv-fab-hist-card .pv-fh-status-cell {
        grid-area: estado !important;
        display: flex !important;
        align-items: flex-start !important;
        align-self: start !important;
        justify-content: flex-end !important;
        justify-self: end !important;
        min-width: 0 !important;
        width: auto !important;
    }

    html body #pvf-shell #pv-fab-hist-card .pv-fh-status-cell .pv-estado-badge {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-sizing: border-box !important;
        max-width: 140px !important;
        min-height: 24px !important;
        padding: 0 10px !important;
        overflow: hidden !important;
        border-radius: 999px !important;
        font-size: 7.8px !important;
        font-weight: 850 !important;
        line-height: 1 !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    html body #pvf-shell #pv-fab-hist-card .pv-fh-client-cell {
        grid-area: cliente !important;
        display: flex !important;
        min-width: 0 !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        align-self: center !important;
        justify-content: center !important;
        gap: 3px !important;
    }

    html body #pvf-shell #pv-fab-hist-card .pv-fh-client-cell::before {
        content: none !important;
        display: none !important;
    }

    html body #pvf-shell #pv-fab-hist-card .pv-fh-client-cell::after {
        content: "Pedido de fabricación" !important;
        display: block !important;
        color: #8793A7 !important;
        font-size: 8px !important;
        font-weight: 650 !important;
        line-height: 1 !important;
    }

    html body #pvf-shell #pv-fab-hist-card .pv-fh-client-cell strong {
        display: block !important;
        max-width: 100% !important;
        overflow: hidden !important;
        color: #273247 !important;
        font-size: 10.5px !important;
        font-weight: 850 !important;
        line-height: 1.1 !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    html body #pvf-shell #pv-fab-hist-card .pv-fh-total-cell {
        grid-area: total !important;
        display: flex !important;
        min-width: 0 !important;
        width: auto !important;
        flex-direction: row !important;
        align-items: baseline !important;
        align-self: center !important;
        justify-content: flex-end !important;
        justify-self: stretch !important;
        gap: 5px !important;
    }

    html body #pvf-shell #pv-fab-hist-card .pv-fh-total-cell::before {
        content: "Total" !important;
        position: absolute !important;
        margin-top: -24px !important;
        color: #8591A5 !important;
        font-size: 7px !important;
        font-weight: 900 !important;
        letter-spacing: .045em !important;
        line-height: 1 !important;
        text-transform: uppercase !important;
    }

    html body #pvf-shell #pv-fab-hist-card .pv-fh-total-cell strong {
        color: #202A3E !important;
        font-size: 13px !important;
        font-weight: 950 !important;
        line-height: 1 !important;
        white-space: nowrap !important;
    }

    html body #pvf-shell #pv-fab-hist-card .pv-fh-total-cell .pv-cod-moneda {
        margin: 0 !important;
        padding: 0 !important;
        background: transparent !important;
        color: #6840DA !important;
        font-size: 7.5px !important;
        font-weight: 900 !important;
        line-height: 1 !important;
    }

    html body #pvf-shell #pv-fab-hist-card .pv-fh-items-cell {
        grid-area: items !important;
        display: inline-flex !important;
        align-items: center !important;
        align-self: end !important;
        justify-content: flex-start !important;
        justify-self: start !important;
        gap: 5px !important;
        width: auto !important;
        min-width: 0 !important;
        min-height: 24px !important;
        padding: 0 10px !important;
        border-radius: 999px !important;
        background: #F2EDFF !important;
        color: #6840DA !important;
    }

    html body #pvf-shell #pv-fab-hist-card .pv-fh-items-cell::before {
        content: "Ítems" !important;
        display: block !important;
        margin: 0 !important;
        color: #6840DA !important;
        font-size: 7.6px !important;
        font-weight: 850 !important;
        letter-spacing: 0 !important;
        line-height: 1 !important;
        text-transform: none !important;
    }

    html body #pvf-shell #pv-fab-hist-card .pv-fh-items-cell strong {
        color: #6840DA !important;
        font-size: 9px !important;
        font-weight: 950 !important;
        line-height: 1 !important;
    }

    html body #pvf-shell #pv-fab-hist-card .pv-fh-actions {
        grid-area: acciones !important;
        display: flex !important;
        align-items: flex-end !important;
        align-self: end !important;
        justify-content: flex-end !important;
        justify-self: end !important;
        box-sizing: border-box !important;
        width: auto !important;
        min-width: 0 !important;
        min-height: 34px !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
    }

    html body #pvf-shell #pv-fab-hist-card .pv-fh-actions::before {
        display: none !important;
    }

    html body #pvf-shell #pv-fab-hist-card .pv-fh-view-btn {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-sizing: border-box !important;
        width: 104px !important;
        min-width: 104px !important;
        height: 34px !important;
        min-height: 34px !important;
        margin: 0 !important;
        padding: 0 10px !important;
        border: 0 !important;
        border-radius: 10px !important;
        background: linear-gradient(105deg, #7042ED 0%, #A72CB8 64%, #E31761 100%) !important;
        color: #FFFFFF !important;
        box-shadow: 0 7px 16px rgba(112, 66, 237, .16) !important;
        font-size: 8.2px !important;
        font-weight: 900 !important;
        line-height: 1 !important;
        text-align: center !important;
        text-decoration: none !important;
    }

    html body #pvf-shell #pv-fab-hist-card .pv-fh-actions > .pv-muted {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-sizing: border-box !important;
        width: 36px !important;
        min-width: 36px !important;
        height: 34px !important;
        min-height: 34px !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 1px solid #DDD6F7 !important;
        border-radius: 10px !important;
        background: #FBFAFF !important;
        color: #8A7EB2 !important;
        font-size: 12px !important;
        line-height: 1 !important;
    }
}
