/* Correção de camadas e overflow para DatePickerRange */

/* 1) O popup do calendário sempre acima de navbar, gráficos, modais etc. */
.DateRangePicker_picker,
.SingleDatePicker_picker,
.DateRangePicker_picker__vertical,
.DateRangePicker_picker__horizontal {
    z-index: 2000 !important;  /* Bem acima de Bootstrap modal (1050) */
    position: absolute !important;
}

/* 2) Liberar o overflow do sidebar/painel de filtros para não cortar o calendário */
.sidebar,
.filters-card,
.filter-card,
.card-body,
[class*="Col"] [class*="card"],  /* Cards dentro de colunas */
.DateRangePicker,
.DateRangePickerInput,
div[style*="overflow"] {
    overflow: visible !important;
}

/* 3) Garantir que o container do sidebar permita overflow */
[style*="backgroundColor: var(--section-bg)"],  /* Sidebar pelo estilo inline */
[style*="minHeight: calc(100vh - 64px)"] {
    overflow: visible !important;
    position: relative;
    z-index: 10;
}

/* 4) Ajuste específico para o calendário vertical */
.DateRangePicker_picker__vertical {
    top: calc(100% + 8px) !important;
    left: 0 !important;
    right: auto !important;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    padding: 10px;
}

/* 5) Container principal dos filtros - permitir overflow */
.container-fluid,
.row,
.col,
.col-md-2,
.col-lg-2 {
    overflow: visible !important;
}

/* 6) Garantir que o DateRangePicker seja relative para posicionar o popup corretamente */
.DateRangePicker {
    position: relative !important;
    display: inline-block;
    width: 100%;
}

/* 7) Se ainda estiver cortando, forçar o body do card a permitir overflow */
.dbc_Card,
.dash-card,
.card {
    overflow: visible !important;
}

/* 8) Para garantir que funcione com o portal também (caso queira voltar) */
.DateRangePicker_fullScreenPortal {
    background: rgba(0, 0, 0, 0.3) !important;  /* Fundo levemente escurecido mas não opaco */
    z-index: 1999 !important;
}

/* 9) Ajuste para não ficar colado na navbar */
.DateRangePicker_picker__portal {
    top: 80px !important;
    position: fixed !important;
}

/* 10) Fallback genérico para qualquer container que possa estar cortando */
*:has(> .DateRangePicker) {
    overflow: visible !important;
}

/* Debug: Adicionar borda vermelha temporária para identificar elementos com overflow hidden */
/* Descomente as linhas abaixo para debug */
/*
[style*="overflow: hidden"],
[style*="overflow: auto"],
[style*="overflow: scroll"] {
    border: 2px solid red !important;
}
*/