/**
 * Filtros — layout mobile do painel admin (≤1024px)
 * Aplica em todas as telas que usam .filtros-wrapper
 */
@media (max-width: 1024px) {
    .filtros-wrapper {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        flex-wrap: wrap !important;
        gap: 12px !important;
        padding: 12px 14px !important;
        margin: 0 auto 10px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: visible !important;
    }

    .filtros-wrapper > form,
    .filtros-wrapper > .filtros-container {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .filtros-container {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        flex-wrap: wrap !important;
        gap: 10px !important;
        width: 100% !important;
        max-width: 100% !important;
        margin-bottom: 0 !important;
        justify-content: flex-start !important;
        overflow: visible !important;
    }

    .filtros-wrapper .filtro-input,
    .filtros-wrapper .filtro-input-rde,
    .filtros-wrapper select.filtro-input,
    .filtros-wrapper input.filtro-input,
    .filtros-wrapper textarea.filtro-input {
        width: 50% !important;
        max-width: 50% !important;
        min-width: 0 !important;
        flex: 0 0 calc(50% - 5px) !important;
        box-sizing: border-box !important;
        font-size: 14px !important;
        min-height: 40px !important;
        height: auto !important;
    }

    .filtros-wrapper .select2-container {
        width: 50% !important;
        max-width: 50% !important;
        flex: 0 0 calc(50% - 5px) !important;
        display: block !important;
        box-sizing: border-box !important;
    }

    .filtros-wrapper .select2-container .select2-selection--single {
        min-height: 40px !important;
        display: flex !important;
        align-items: center !important;
    }

    .filtros-wrapper .btn-buscar,
    .filtros-wrapper .btn-limpar,
    .filtros-wrapper a.btn-limpar,
    .filtros-wrapper .btn-primary-custom,
    .filtros-wrapper .filtro-btn-buscar,
    .filtros-wrapper .filtro-btn-limpar {
        width: 50% !important;
        max-width: 50% !important;
        flex: 0 0 calc(50% - 5px) !important;
        min-height: 40px !important;
        margin: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-sizing: border-box !important;
    }

    /* Botões de ação ao lado do form de filtros (ex.: inbound) */
    .filtros-wrapper > .actions-buttons,
    .filtros-wrapper > form.actions-buttons {
        width: 100% !important;
        max-width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .filtros-wrapper .actions-buttons .btn-action-primary,
    .filtros-wrapper .actions-buttons .btn-action-secondary,
    .filtros-wrapper .actions-buttons button,
    .filtros-wrapper .actions-buttons a {
        width: 100% !important;
        max-width: 100% !important;
        min-height: 40px !important;
        flex: 1 1 auto !important;
        justify-content: center !important;
        text-align: center !important;
    }

    /* Módulos com overflow horizontal no desktop */
    .inbound-module .filtros-wrapper,
    .content-wrapper .filtros-wrapper {
        overflow-x: visible !important;
        flex-wrap: wrap !important;
    }

    .inbound-module .filtros-container {
        flex-direction: row !important;
        flex-wrap: wrap !important;
        overflow-x: visible !important;
    }

    /* Área interna do ibox — evita cortar filtros */
    .ibox .filtros-wrapper {
        border-radius: 0;
    }

    .fix-fixed .filtros-wrapper {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}
