Influence of landscape and livestock management on dung beetle diversity in tropical cattle pastures

To achieve a balance between conservation and livestock production in the context of highly degraded tropical landscapes, we need a research approach that considers relationships among biodiversity, landscape structure, and farming practices. Given that dung beetles are sensitive to both landscape changes and local scale management practices, these insects are used as ecological indicators that provide information regarding the pasture’s health. We assessed the response of dung beetle diversity to livestock management practices and landscape structure in 22 cattle pastures from a regional relictual landscape dominated by productive land uses. Livestock management practices were the best predictors for species richness, Shannon diversity, and number of individuals. Macrocyclic lactone use was negatively related to species richness and number of individuals; high cattle densities increased Shannon diversity in the studied ranches. Patches of old secondary forest cover had a positive significant relationship with every response variable and was the best predictor for biomass, but also contributed to maintaining high species richness in cattle pastures, suggesting that secondary forests provide favorable microclimatic conditions for dung beetles in highly degraded landscapes. This study provides evidence that conservation of old secondary forests in highly modified landscapes and the rational use of macrocyclic lactones can be useful management tools to favor dung beetle diversity and the ecosystem services they provide, thus ensuring pasture health.


Introduction
The expansion of the agricultural frontier is considered the main driver of climate change, soil degradation, water and soil nutrient pollution, landscape simplification, and biodiversity loss worldwide (Machovina et al. 2015;Chopin et al. 2019). Specifically, induced pastures used for livestock production cover over a quarter of the global land surface; moreover, it is estimated that around 20% of the world's pastures are in a severely degraded condition because of overgrazing and other management practices (Herrero et al. 2015;Gilbert et al. 2018;Gordon 2018). A large proportion of this degradation has occurred in tropical areas, being tropical America one of the most affected, with ~ 157 million ha of degraded pastures (Michalk et al. 2019). This compromises the long-term conservation of tropical forests, as well as pasture health and livestock producers' livelihoods.
Ecosystem services provided by biodiversity contribute to improve the productivity of livestock systems (Teillard et al. 2016). In order to preserve ecosystem services, it is necessary to reduce the use of agrochemicals, overgrazing, and other unsustainable practices that lead to negative environmental impacts (Teillard et al. 2016;Alvarado et al. 2018). Ensuring cattle production while preserving biodiversity and ecosystem services in livestockdominated landscapes has become a major ecological and socio-economic issue worldwide (Teillard et al. 2016). Therefore, to achieve a balance between biodiversity conservation, ecosystem services, and livestock production, it is necessary to develop an integrative approach that incorporates the relationships between landscape characteristics and local cattle farming practices and their effect on biological communities (Fahrig 2003;Benoît et al. 2012;Sayer et al. 2013).
Agricultural landscapes are mosaics of land uses, where crops and grazing pastures are interspersed with forest patches of different conservation status and age, as well as live fences, isolated trees, and human settlements (Luck and Daily 2003;Basile et al. 2016). Some of these landscapes, where intensive agricultural development has left < 10% of native vegetation after landscape modification, are considered relictual landscapes (McIntyre and Hobbs 1999). In this context, species richness and abundance have declined considerably, jeopardizing the viability of populations, and driving local species extinctions, with negative effects on ecosystem functions (Fischer and Lindenmayer 2007). In addition, the magnitude of the effects of habitat loss to biodiversity may be influenced by the anthropogenic matrixes in which cattle pastures are embedded (Franklin and Lindenmayer 2009;Prevedello and Vieira 2010;Fahrig et al. 2011). The role of matrix characteristics has important implications for biodiversity conservation in agricultural landscapes. By identifying the land uses that provide complementary and supplementary resources for several species, facilitate dispersal between habitat remnants, and/or create low-contrast edge zones (Kupfer et al. 2006), producers may be able to reduce the negative impact of primary habitat loss by increasing the area that these land uses occupy. This strategy has the potential to enhance biodiversity more quickly and cost-effectively than recreating previously cleared native vegetation; it also reduces tradeoffs between conservation and production land uses (Duru et al. 2015;Lindenmayer 2019).
Livestock production not only drives changes in landscape structure, but also changes in conditions related to animal and pasture management that occur at the local scale. Farming practices have an important role in pasture degradation because of soil contamination and changes of soil properties evident in loss of soil inorganic carbon and reduced water infiltration (Tscharntke et al. 2005). Several studies indicate that livestock management practices like overgrazing or excessive use of veterinary drugs are the main drivers of 1 3 productivity reduction of cattle pastures (Isselstein et al. 2005;Kemp and Michalk 2007) and declines of soil insects related to key ecological processes such as decomposition of organic matter in pastures (Sharma et al. 2018;Sanchez-Bayo and Wyckhuys 2019). However, establishing which management practices have the strongest impact on biodiversity is an ongoing challenge, as management practices can change drastically at the regional level (Herzog et al. 2006).
Scarabaeine dung beetles are intimately linked to vertebrates, mainly herbivorous mammals, and they are responsible for dung removal in cattle pastures, performing key ecological functions related to nutrient redistribution, soil fertilization, and biological control of pest flies and mammal intestinal parasites (Nichols et al. 2008).. In areas originally covered by tropical forests in the Neotropical region, dung beetle diversity in cattle pastures is strongly related to the amount of native forest at the landscape scale (Sánchez-de-Jesús et al. 2016;Alvarado et al. 2018). However, in the context of relictual landscapes where native forests have been severely reduced, it is not yet clear how dung beetle diversity and species composition are affected by other vegetation covers such as secondary forests, tree plantations, and crops. In addition, dung beetle populations are affected by agrochemical residues (e.g., fertilizers and antiparasitics) as these directly reduce physiological condition and reproductive fitness of individuals (Villada-Bedoya et al. 2019, 2021 with potential demographic effects on populations, which in the long term could impact on how dung beetles perform ecosystem functions like dung removal (Huerta et al. 2018;Alvarado et al. 2019). Given their sensitivity to landscape changes and local scale management practices, these insects provide information regarding pasture health, which has made them a useful ecological disturbance indicator (Nichols and Gardner 2011).
In this study, we analyzed the influence of landscape structure and local scale management practices on dung beetle diversity (species richness, Shannon diversity, number of individuals, and biomass) and species composition in cattle pastures in a region originally covered by tropical rainforests. Given the relationship of dung beetles with the amount of native forest (Halffter and Matthews 1966;Sánchez-de-Jesus et al. 2016), we expect that dung beetle diversity will be higher in landscapes with more shaded environments such as secondary forests, tree plantations, riparian vegetation and live fences, because vegetation maintains microclimatic conditions for some species of beetles in agricultural landscapes. Considering the high heterogeneity in landscape structure and cattle management practices in our study sites, we expect that species substitution (spatial turnover sensu Baselga, 2010) will explain the variation in species composition (β-diversity) in the landscape better than nestedness (due to species losses). Finally, we predict that the use of agrochemicals, in particular fertilizers (Evans and Sanderson 2018), herbicides (González-Tokman et al. 2017) and veterinary medicines such as macrocyclic lactones (Martinez et al., 2017) will exert a negative influence on dung beetle diversity. The results of this study could be used as guidance to understand management practices considering the landscape context in order to enhance dung beetle diversity and their ecosystem functions.

Study area
The northernmost rainforests of the Americas are in the Gulf of Mexico (Challenger and Caballero 1998). Part of these rainforests are recognized as the "Veracruz moist forests 1 3 ecoregion", covering the area from the Sierra Madre Oriental westward to the coast of the Gulf of Mexico and, this has been considered a center of bird and plant endemism (WWF 2014). In this region, bovine livestock production started in the fifteenth century with European arrival and intensified in the 1950s, resulting in landscapes dominated by pastures and fodder crops (Huerta et al. 2013;González-Montagut 2018). Large portions of the native tropical forests have already been eliminated and very little of the current remnant vegetation corresponds to the original plant associations; thus, the forests have become restricted to scattered small patches throughout our study area (CEIEG 2019).
The state of Veracruz has an extension of 71,820 km 2 and is the leading producer of meat in Mexico (~ 258,228 tons/year), where the land dedicated for livestock activities occupies 54% of its total area (SIAP 2017;Villegas 2018). We carried out the study in Papantla (20° 09′ to 20° 41′ N; 97° 06′ to 97° 32′ W; Fig. 1), one of the municipalities with the greatest livestock activity in Veracruz. The climate is tropical-humid, with rain during seven months of the year (mean annual temperature: 20-24 °C; mean annual rainfall: 1100-1600 mm) (CEIEG 2019).

Sampling design
We selected 22 cattle ranches where owners were willing to share information about their livestock management practices. Using a combination of Sentinel-1 and Sentinel-2 layers (Copernicus Sentinel data 2017, processed by ESA) with Random Trees learning classifier in ARCMAP v10.6, we were able to obtain a 10 m resolution detailed supervised classification of each land use that surrounds the pastures acknowledged by ranch owners in a 1 km buffer centered on each studied ranch. Land use categories were: (i) cattle pastures, (ii) old secondary forest (tree height > 3 m), (iii) young secondary forest (tree height < 3 m), (iv) riparian forest, (v) crops (mainly corn and banana), (vi) tree plantations (citric, litchi, and others), (vii) live fences and isolated trees, (viii) urban areas and nude soil, and (ix) water ( Fig. 1). This classification was groundtruthed using field observations at 250 sampling points for each classified landscape, obtaining percentage of accuracy from 83 to 96% in Kappa confusion matrices. The 1 km buffers are large enough to account for interspecific differences in the Neotropical dung beetle's daily movement, home ranges, and behavior at the local scale (da Silva and Hernández 2016; Alvarado et al. 2018). Although two of the buffers had some degree of overlap (~ 25%), there is theoretical and empirical evidence that landscape overlapping does not contribute to spatial autocorrelation (Zuckerberg et al. 2012), and the minimum distance between these ranches was > 1000 m, far enough to avoid intertrap influence from neighboring sites.

Dung beetle sampling
We sampled during the wet season, in August-September 2018, when dung beetles are more active and abundant in the study area (Ortiz-Domínguez et al. 2013). Beetles were captured using pitfall traps. Because we were interested in the beetle community associated with cow dung due to the ecosystem services dung beetles may provide in cattle pastures, we used cow manure as bait. Each trap consisted of a 3 L container filled with soil up to three quarters, buried to ground level. A support wire mesh (25 mm aperture) was placed on top of the soil, with 500 g of fresh cow dung on top of it, so dung beetles could bury manure in the container, but could not dug out. To protect the dung and avoid container flooding in case of rain, a plastic dish was placed on top of the container supported by four wires.
As we wanted to obtain the accumulated alpha diversity (i.e., the total number of species in a certain sampling site in a determinate time lapse; Halffter and Moreno 2005), four traps were set in a linear transect in each cattle ranch at least 15 m apart from each other and were left in place for 24 h. To reduce the effect of cattle grazing and a subsequent rise in the density of cattle dung, we selected areas without cattle in each pasture. All captured beetles were placed in 70% ethyl alcohol for later identification. Beetles were identified to species level using taxonomic keys (Howden and Cartwright 1963;Morón 1979Morón , 2003Kohlmann and Solís 1997;Delgado and Kohlmann 2007). Dung beetle biomass was estimated by drying 1-20 individuals per species at 60 °C for 72 h, and then weighing them on a digital balance (± 0.0001 g).

Response variables
We used the sample coverage recommended by Chao and Jost (2012) to estimate the accuracy of inventories; this method considers the proportion represented by individuals of each species in the sample, with respect to the total number of individuals: where Ĉ n denotes the estimated sample coverage for the reference sample, f 1 and f 2 are the number of species with one or two individuals in the sample, respectively, and n is the number of individuals.
We evaluated species diversity using the "effective numbers of species", equivalent to Hill numbers ( q D, sensu Jost 2006) with the iNEXT package for R (Hsieh et al. 2016). q D is an ecologically intuitive measure for describing and comparing diversity (Jost 2006). We considered Hill numbers of orders 0 ( 0 D, species richness) and 1 ( 1 D, Shannon diversity). The number of species ( 0 D) is not sensitive to species abundance, so it gives a disproportionate weight to rare species (Jost 2006). On the other hand, Shannon diversity ( 1 D) weights each species according to its proportional abundance in the sample; therefore, it can be interpreted as the number of common species in the community (Jost 2006). To assess changes on the dung beetle's community structure, we also considered two abundance measurements: number of individuals and biomass.
We also obtained total beta diversity composition among the cattle pastures using the turnover fraction of Jaccard's dissimilarity index in order to determine whether the composition differences between cattle ranches resulted from species turnover (βjtu) or nestedness (βjne). Turnover measures the replacement of species between sites and results Ĉ n = 1 − f 1 n (n − 1)f 1 (n − 1)f 1 + 2f 2 from environmental differences, disturbance, or competition. Nestedness results from species losses, usually due to differences in local conditions or ecological niches, where the species-poorer site contains a subset of the species present in the species-richer site (Legendre 2014). We partitioned turnover and nestedness components using Baselga's approach (Baselga and Orme 2012). This analysis was performed using the betapart library in R (Baselga and Orme 2012).

Landscape composition and configuration
For landscape composition metrics we considered percentage of landscape (PLAND) occupied by each land use. For landscape configuration metrics, we calculated the total number of patches (NP) and total length of edge (TE) of each land cover class. These metrics have been used in previous studies assessing dung beetle diversity at the landscape scale (LaScaleia et al. 2018). All landscape metrics were calculated in Fragstats v4.2. Land use patches were delimited using the eight neighbor rule, which considers eight adjacent cells, four orthogonal and four diagonals, that share a side with the focal cell, preventing misclassification of pixels (McGarigal et al. 2012).
In order to narrow down the number of variables for the analyses, we first summarized variation of the landscape metrics using Principal Component Analysis (Fig. S1). The first two axes of the PCA explained 45% of the total variance. Then, we identified the landscape metrics above the cutoff of expected average contribution of the resulting first principal component (~ 30% ; Fig. S2). If the contribution of the variables were uniform, the expected value would be 1/length(variables) = 1/10 = 10%. For a given component, a variable with a contribution larger than the cutoff of expected average contribution could be considered as important in contributing to the component (Kassambara 2017). Of the ten variables above the cut off, we decided to use the number of patches of old secondary forest (NP.osf) as one of the variables in the analyses because of the importance of the amount of forest cover for dung beetle communities in the Neotropic in areas originally covered by tropical forest (Barragán et al. 2014;Sánchez-de-Jesús et al. 2016;Alvarado et al. 2018). In addition, we eliminate landscape metrics correlated with total number of patches of old secondary forests (Fig. S3), which left us with number of patches of tree plantations (NP.tp), number of patches of crops (NP.cr), urban and nude soil (NP.ur), as well as total edge of crops (TE.cr) as the remaining variables used for the analysis.
As the number of pasture patches (NP.pas) and live fences (NP.lf) might be highly correlated with NP.sf, we tested independently the relation of these landscape variables with all dung beetle community attributes using simplification of generalized lineal models (GLMs) according to Crawley (2013). We assumed Poisson error distribution for species richness ( 0 D) and number of individuals, and gaussian error distributions for Shannon diversity ( 1 D) and biomass (Crawley 2013). After ensuring that neither NP.pas and NP.lf had a significant relation with dung beetle community attributes, they were discarded from subsequent models.

Local scale management practices
To quantify livestock management practices in each ranch, we conducted 22 semistructured interviews with all the ranch managers or owners. We collected information regarding the physical characteristics of each ranch and management practices (Supplementary material S2). Livestock management practices vary from one neighboring ranch to another and depend entirely on production goals and owner's judgment on "what's best for business," so we found that the information regarding agrochemical use (e.g., products used, number of annual applications, quantities applied, among other details) was either highly variable or vague and difficult to analyze (González-Gómez et al. 2018). To avoid misinterpretation of the results, we chose the most common practices as explanatory variables: cattle density, herbicide use, fertilizer use and macrocyclic lactone use, assessed in a binary manner. To establish cattle density, we first used the calculations proposed by the National Institute of Forestry, Crop and Livestock Research, Mexico (INIFAP, for its acronym in Spanish) to determine the adequate number of animals that can graze in a month without compromising grass productivity (animal units/ha) (INIFAP 2005). Whereas cattle density, herbicide use and macrocyclic lactone use have known negative effects on dung beetles, fertilizer use can affect soil arthropod communities by affecting the availability of chemical elements (Evans and Sanderson 2017;González-Tokman et al. 2017;Martínez et al. 2017, Villada-Bedoya et al. 2019. Then, we calculated the real cattle density of each pasture (animal units/ha). If the observed cattle density exceeded the adequate cattle density value obtained for a given pasture, then cattle density was considered high. If the observed cattle density was equal to or lower than the adequate cattle density value, then cattle density was considered low.

Data analyses
All statistical analyses were done using the R statistical program (R Core Team 2016). We used analyses of deviance of generalized lineal models (GLMs) to test the additive effects of the landscape composition and configuration metrics, as well as local scale management practices on each response variable. We assumed Poisson error distribution for species richness ( 0 D) and number of individuals, and gaussian error distributions for Shannon diversity ( 1 D) and biomass (Crawley 2013). The best supported models were selected by reducing each global model based on the Akaike information criterion corrected for small samples (AICc).
To evaluate patterns of species turnover we constructed a triangular Q-mode matrix of similarity taking into account species presence / absence with a Jaccard index. The index ranged from 0 (no species in common between samples) to 1 (identical species composition). We used non metric multidimensional scaling (NMDS) to graphically represent the overall differences in species composition between cattle ranches. We chose NMDS because neither normality nor linearity of data is required (Kruskal and Wish 1978). To evaluate how many dimensions are needed to reproduce similarity between cattle ranches, we calculated a stress value, which represents the disagreement between 2D configuration and predicted values from the regression. If the stress value is high (> 0.3), more than two dimensions are required. Cattle ranches ordination resulting of NMDS was correlated with both the cattle management practices and landscape metrics using the envfit function of the package Vegan (Oksanen et al. 2017).

Results
We collected a total of 1,101 individuals belonging to 12 species and 7 genera in 19 of the 22 studied ranches; in three of them no beetles were collected (Table 1). In most of the ranches, the sample coverage was over 90%, indicating that sampling effort was adequate (overall range: 82% -100%; Table 1). We found that three small sized species (< 10 mm body length) accounted for 84% of all individuals: Onthophagus corrosus was the most abundant species (58%), followed by Onthophagus landolti (18%) and the exotic species, Digitonthophagus gazella (8%) ( Table 1). The total biomass was 24 g, and two large beetle species (> 15 mm body length), Dichotomius colonicus and Copris incertus, accounted for 66% of the total biomass, but they represented only 9% of all collected individuals (Table 1). Additionally, the Jaccard pair-wise dissimilarity value was 0.91; 87% of this dissimilarity was due to species turnover (βjtu = 0.79) and 13% due to nestedness (βjne = 0.12).
The amount of deviance accounted for by the best supported models for species richness ( 0 D), Shannon diversity ( 1 D), number of individuals, and biomass are shown in Table 2. The models explained between 45 and 63% of the deviance (Table 2). When assessing the relative importance of the explanatory variables considered in all models for each response variable, we found that the number of patches of old secondary forest was the most important predictor for species richness ( 0 D) and Shannon diversity ( 1 D); whereas local scale management practices were the most important predictors for number of individuals and biomass ( Table 2). Regardless of macrocyclic lactones use and cattle density both species richness ( 0 D) and Shannon diversity ( 1 D) responded to an increase of patches of old secondary forest at the landscape scale (Fig. 2a, b). Although trend lines predicted an increase of species richness ( 0 D) and Shannon diversity ( 1 D) as the number of patches of old secondary forest increased, in both cases the maximum values were found in landscapes with ~ 30 patches of old secondary forest, after which the values do not seem to increase (Fig. 2a, b). Notably, landscape composition metrics did not influence dung beetle diversity, as they were not retained by the best supported models ( Table 2).
The use of macrocyclic lactones explained 15% of the total variation of species richness ( 0 D) and 27% of the variation in the number of individuals (Table 2). Both species richness ( 0 D) and number of individuals decreased significantly with macrocyclic lactone use (Fig. 3a, c). The median species richness decreased by half in ranches that use macrocyclic lactones, while the number of individuals decreased by about 10 times (Fig. 3a, c). A lower biomass of dung beetles was also found in cattle ranches that use herbicides, where the median decreased by half in ranches that used herbicides (Fig. 3d). Other landscape predictors that were related to dung beetle diversity include the number of patches of tree plantations which had a negative relationship with Shannon diversity ( 1 D) and explained 22% of the deviance.
The NMDS analysis (stress = 0.09) based on the presence/absence of dung beetle species indicated that the first two dimensions are sufficient to explain the ordination of cattle ranches according to their species composition. Two groups are recognized (Fig. 4): the first group (green dashed line ellipse) is made up of cattle ranches surrounded by more than 35 patches of old secondary forest in the landscape. Regarding management practices, more than half of the ranches of this group do not use macrocyclic lactones, herbicides or fertilizers. In this group, 96% of total individuals and all species were captured, being Copris lugubris, C. laeviceps, Eurysternus mexicanum, Onthophagus corrosus, O. landoti, O. batesi, Canthon floridanus and C. indigaceus chevrolati only found on these ranches ( Table 1). The second group (Fig. 4, orange dashed line ellipse) corresponds to six cattle ranches with less than 35 patches of old secondary forest in the landscape; where all but one ranch use macrocyclic lactones, and use of herbicides and fertilizers was predominant in more than half of them. In this group, only five species were captured, which represented less than 4% of the total dung beetles captured, and all species in this group were shared with the group I (Table 1).

Discussion
This study examined the landscape attributes and local livestock management practices that best predicted the dung beetle diversity in cattle ranches located in the northernmost part of the neotropical rainforest distribution. Three findings deserve special attention: (1) The number of patches of old secondary forest are the best predictors of species richness ( 0 D), Shannon diversity ( 1 D) and species composition, (2) local livestock management practices best predicted the number of individuals and biomass of dung beetles and, (3)   Table 2 Fig. 3 Livestock management practices significantly related to dung beetle richness ( 0 D) and number of individuals in relation to no use or use of macrocyclic lactones (a, c), Shannon diversity ( 1 D) in relation to cattle density (b) and, biomass in relation to no use or use of herbicides (d). Black dots represent out layers. P values are presented in Table 2 the dung beetle diversity in our study area resembles other tropical communities that are highly threatened by severe habitat loss and excessive agrochemical use.
Our results show that richness in cattle pastures varied between zero and eight species, while Shannon diversity ( 1 D) did not exceed four species. The total dung beetle species in this study represent 50% of the species known for the region, where around 24 species are recognized (González-Gómez, unpublished data), including two exotic species, Digitonthophagus gazella and Euoniticellus intermedius, which were introduced in the 1970s in the United States and recorded in Mexico 10 years later (Kohlmann 1994;Montes de Oca and Halffter, 1998). The current dung beetle fauna associated to pastures in our study region has been reduced to a few opportunistic and open environment species of Copris and Onthophagus genera of Holarctic affinity, where have also species originating from the Afrotropical region penetrate (D. gazella and E. intermedius), which often constitute the functional community core (Floate and Kadiri 2013) in many livestock systems of Tropical America (Noriega et al. 2020). Regarding beta diversity, our results show that species turnover is the primary driver of dung beetle diversity found in the studied cattle pastures. In the studied cattle pastures, small sized species that have a high tolerance  lected in ranches 8, 9, 10 to habitat disturbance are favored, as observed in other tropical agricultural landscapes (Alvarado et al. 2018;Rivera et al. 2021). The anthropic disturbances and the heterogeneous landscape favor the high turnover since dung beetles are especially susceptible to environmental variability (Arellano et al 2008a), big sized species, in particular, cannot cope with the drastic changes in temperature and humidity characteristic of grazed sites, probably due to physiological constraints (Verdú et al. 2006). However, preliminary biological surveys in the study area show that at least eight species associated to cow dung can be found in both old secondary forest and cattle pastures (Table 1), and only three species, two large sized (Dichotomius amplicollis, Deltochilum scabriusculum) and one small sized (Ateuchus illaesum), are restricted to old secondary forests in low abundance (González-Gómez, unpublished data). This suggests that land covers that provide shade, in this case the patches of advanced vegetal succession surrounding cattle pastures, do provide favorable microclimatic conditions and alternative resources to dung beetles while allowing the exploitation of cattle manure as resource for food and reproduction (Favila 2012), although species assemblages might not be as diverse as those found in in well preserved native forest (Navarrete and Halffter 2008;Barragán et al. 2011;Alvarado et al. 2018). Thus, the number of patches of the old secondary forest, regardless their area, are key elements to increase dung beetle diversity in cattle pastures, indicating that dung beetles might be favored by forest fragmentation in highly degraded landscapes (Fahrig 2003).
Of the assessed variables in our study, local livestock management practices best predicted dung beetle number of individuals and biomass, and they were strong predictors of species richness ( 0 D) and Shannon diversity ( 1 D). Whereas ranches with high cattle density showed greater Shannon diversity ( 1 D), potentially associated to a larger amount of dung, macrocyclic lactone use strongly reduced the number of individuals and species richness ( 0 D). Macrocyclic lactones have been widely used for decades, even as a preventive treatment for cattle without symptoms of parasitic infection in most of our studied ranches (González-Gómez et al. 2018). Such that our results support previous findings, both in laboratory and natural conditions, indicating that macrocyclic lactones are one of the most severe threats for dung beetles associated to livestock management (Verdú et al. 2015;González-Tokman et al. 2017;Alvarado et al. 2018;Villada-Bedoya et al. 2019). It has been documented that extensive livestock production and management practices, especially the application of agrochemicals, have caused soil and water pollution as well as changes to the physical and chemical soil properties, which negatively affect dung beetle communities (de Farias and Hernández 2017;Martínez et al. 2017;Pulido et al. 2018;Evans and Sanderson 2018). The current state of dung beetle diversity in the studied pastures implies that livestock producers may not be able to take advantage of the economic contribution of dung beetles for cleaning services in pastures, which has been estimated at an annual mean of $277 million USD for the tropical grasslands of Veracruz (up to $400 USD per cow; Lopez-Collado et al. 2017).
How to best conserve biodiversity in agricultural fields is an ongoing challenge, with researchers and stakeholders debating between strategies that reduce local management intensity (e.g., reduction of agrochemicals) or landscape level approaches that incorporate natural and semi natural areas in landscapes surrounding farms (Gonthier et al. 2014). In the studied cattle ranches, our results suggest that the pressure that livestock practices put on dung beetle diversity in each pasture could be intensified or mitigated by the surrounding land uses to an extent, so future conservation strategies should consider which local management practices are detrimental to biodiversity in a given landscape context when aiming to preserve and enhance it (Tscharntke et al. 2005;Gardiner et al. 2018). Around 45% of our studied cattle ranches are embedded in landscapes with few patches 1 3 of old secondary forest, where macrocyclic lactones, herbicides and fertilizers were generally used. Noticeably, in three of the studied cattle ranches (14%), no beetles were captured (Table 1). The absence of dung beetles in these pastures could indicate detrimental effects associated with the absence of shady vegetation and the long term use of agrochemicals (Table S1). Also, our analysis showed between 37 to 55% of deviance could not be explained by the cattle ranch management and landscape variables evaluated, which implies that other factors that we did not include in the present study influence dung beetle communities. Such factors can include soil properties (e.g., moisture, compactation), or factors related to cattle production or to the landscape structure that require deeper study.
Due to the economic importance and positive impact of dung removal by dung beetles in pasture productivity, this ecological function is considered an important ecosystem service in cattle production systems (Huerta et al. 2018;Alvarado et al. 2019). In general, it is known that certain land uses can facilitate species movement at a landscape scale and also serve as complementary habitats for vertebrates and insects, including dung beetles (Arellano et al. 2008b;Prevedello et al. 2017;Barretto et al. 2019), allowing many species to guarantee access to food and resources for reproduction which can assure population viability in the long term (Hendrickx et al. 2007).Thus, in order to enhance dung beetle ecological functions in tropical cattle pastures, canopy cover must increase within cattle ranches or in the surrounding landscape, either by enlarging old secondary forest patches or by incuding old secondary other tree land uses as a support, such as live fences and isolated trees. In addition to canopy cover, reduction in local management inputs via, for example, silvopastoral systems has already aided biodiversity conservation to some extent while increasing dung beetle function (Alvarado et al. 2019). In our study, we found the highest values of species richness ( 0 D), Shannon diversity ( 1 D), number of individuals, and biomass in ranches which had low cattle density, with no use of agrochemicals, and embedded in a landscape with more than 35 patches of old secondary forest which in some cases only cover 5% of total 1 km 2 buffer area (Fig. 4). However, reduced or no agrochemical use may provide little benefit if it is surrounded by a landscape of high input intensive farming (e.g., tree plantations; Table 1).

Conclusions
We have shown that local livestock management practices and landscape context shape the dung beetle community in cattle pastures in the northernmost moist forest ecoregion in Veracruz, Mexico. Macrocyclic lactones use drastically reduced dung beetle species richness and number of individuals, and the presence of old secondary forest mitigated such negative effects to some extent. We highlight that in order to effectively enhance dung beetle diversity, livestock producers need to consider the landscape context surrounding cattle pastures in these tropical landscapes and modify within field management strategies. An alternative could be the creation of semi natural habitats or low intensity field management (e.g., silvopastoral systems), which provide shade and reduce the need for application of agrochemicals, providing benefits for biodiversity and provision of ecosystem services. Therefore, we urge stakeholders to use our findings to implement practices that enhance dung beetle diversity in cattle ranches in tropical landscapes.