body .app-shell .mobile-filter-toggle { display: none !important; }
@media (max-width: 720px) {
    body .app-shell .pedidos-search-actions:has(> .mobile-filter-toggle) {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        width: 100% !important;
        min-width: 0;
        gap: 8px;
    }
    body .app-shell .pedidos-search-actions:has(> .mobile-filter-toggle) > .erp-list-desktop-control[aria-expanded] {
        display: none !important;
    }
    body .app-shell .panel:is(.list-toolbar-panel, .crm-filter-panel, .informe-filter-panel) :is(.list-toolbar-actions, .facturacion-search-actions, .crm-filter-actions, .automation-filter-actions, .treasury-filter-actions, .stock-filter-actions, .proyecto-filtros-acciones, .informe-actions)[data-search-actions] {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        grid-column: 1 / -1 !important;
        width: 100% !important;
        max-width: none !important;
        min-width: 0;
        gap: 8px;
        margin-left: 0;
    }
    body .app-shell .panel:is(.list-toolbar-panel, .crm-filter-panel, .informe-filter-panel) button.erp-action-button.mobile-filter-toggle {
        display: inline-flex !important;
        order: 3;
        grid-column: 1 / -1;
        width: 100% !important;
        max-width: none !important;
        flex-basis: 100% !important;
    }
    body .app-shell :is(.list-toolbar-panel, .crm-filter-panel, .informe-filter-panel):has(.mobile-filter-toggle:not(.is-expanded)) [data-mobile-filter] {
        display: none !important;
    }
    body .app-shell .pedidos-filter-row > .pedidos-status-field { order: 0; }
    body .app-shell .pedidos-filter-row > .pedidos-commercial-field { order: 1; }
    body .app-shell .pedidos-filter-row > .erp-date-range { order: 2; }
    body .app-shell .pedidos-search-toolbar > :is(.pedidos-status-field, .pedidos-commercial-field) { order: 2; }
    body .app-shell .pedidos-search-toolbar > .erp-date-range { order: 3; }
    body .app-shell .pedidos-filter-row > :is(.pedidos-status-field, .pedidos-commercial-field) {
        flex: 1 1 calc(50% - 7px) !important;
        width: calc(50% - 7px) !important;
        max-width: none !important;
    }
}
body :is(.app-shell, .erp-popup) button.erp-query-action:not(.erp-action-secondary):not([aria-expanded="true"]),
body .app-shell button.mobile-filter-toggle:not(.is-expanded),
body .app-shell .pedidos-search-actions > button.erp-action-button:not(.erp-action-secondary):not([aria-expanded="true"]) {
    background: #fff !important;
    color: #334155 !important;
    border-color: #cbd5e1 !important;
    opacity: 1;
}
body :is(.app-shell, .erp-popup) button.erp-query-action:disabled {
    background: #e5eaf0 !important;
    color: #58677a !important;
    cursor: not-allowed;
}
body .app-shell .panel .informe-actions > button.erp-ribbon-button.erp-query-action {
    background: #fff !important; color: #334155 !important; border-color: #cbd5e1 !important;
}

/* Query and disclosure states use the default template without changing handlers. */
body :is(.app-shell, .erp-popup) button.erp-query-action.erp-action-secondary:not(:disabled) { background:var(--erp-action-secondary) !important; border-color:var(--erp-action-secondary) !important; color:#fff !important; }
body .app-shell button.mobile-filter-toggle.is-expanded:not(:disabled) { background:var(--erp-soft-surface) !important; border-color:var(--erp-soft-border) !important; color:var(--erp-soft-text) !important; }
