<div class="d-flex flex-wrap align-items-end gap-2 p-3 bg-light rounded"> 
    <div class="form-group">
        <label for="nombre">Nombre</label>
        <input type="text" id="nombre" class="form-control form-control-sm" placeholder="Ej: Juan Pérez">
    </div>
    <div class="form-group">
        <label for="area">Área</label>
        <input type="text" id="area" class="form-control form-control-sm" placeholder="Ej: Recursos Humanos">
    </div>
    <div class="form-group">
        <label for="contrato">Tipo de Contrato</label>
        <select id="contrato" class="form-control form-control-sm">
            <option value="">Todos</option>
            <option value="Indefinido">Indefinido</option>
            <option value="Temporal">Temporal</option>
            <option value="Practicante">Practicante</option>
        </select>
    </div>
    <div class="form-group">
        <label for="empresa">Empresa</label>
        <input type="text" id="empresa" class="form-control form-control-sm" placeholder="Ej: ABC S.A.">
    </div>

    <!-- Botones compactos con íconos -->
    <div class="d-flex gap-2">
        <button class="btn btn-primary btn-sm" id="btnFiltrar"><i class="fa-solid fa-filter"></i> Filtrar</button>
        <button class="btn btn-secondary btn-sm" id="btnLimpiar"><i class="fa-solid fa-eraser"></i> Limpiar</button>
        <button onclick="imprimirTabla()" class="btn btn-dark"><i class="bi bi-printer"></i> Imprimir</button>


        <button class="btn btn-success btn-sm" id="btnExportar">
    <i class="fa-solid fa-file-excel"></i> Exportar
</button>

<script>
document.getElementById("btnExportar").addEventListener("click", function () {
    window.location.href = "exportar.php";
});
</script>

<script>
function imprimirTabla() {
    let table = $('#tablaTrabajadores').DataTable();

    // Guardar configuración actual de la tabla
    let oldStart = table.page.info().start;

    // Mostrar todas las filas temporalmente
    table.page.len(-1).draw();

    setTimeout(() => {
        window.print();

        // Restaurar la paginación original
        table.page.len(10).draw();
        table.page(oldStart / 10).draw();
    }, 500);
}
</script>


    </div>
</div>



