.flatpickr-calendar.fp-open-above {
    top: auto !important;
    bottom: calc(100% + 2px) !important;
}

/* ── Flatpickr drill-down overlay (month / year grid views) ── */
.fp-drilldown-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ffffff;
    z-index: 20;
    padding: 4px;
    box-sizing: border-box;
    border-radius: 4px;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 12px;
}
/* Grid open: hide the day view and keep the overlay in flow so the calendar takes the grid's height */
.flatpickr-calendar.fp-drill-open > :not(.fp-drilldown-overlay) {
    display: none !important;
}
.flatpickr-calendar.fp-drill-open > .fp-drilldown-overlay {
    position: relative;
}
.fp-drill-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 30px;
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: bold;
    color: #333333;
}
.fp-drill-prev,
.fp-drill-next {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    cursor: pointer;
    border-radius: 4px;
    color: #333333;
    flex-shrink: 0;
}
.fp-drill-prev::before {
    font-family: 'Glyphicons Halflings' !important;
    content: "\e091" !important;
    font-size: 12px !important;
    font-style: normal !important;
    font-weight: normal !important;
    line-height: 1 !important;
    -webkit-font-smoothing: antialiased !important;
}
.fp-drill-next::before {
    font-family: 'Glyphicons Halflings' !important;
    content: "\e092" !important;
    font-size: 12px !important;
    font-style: normal !important;
    font-weight: normal !important;
    line-height: 1 !important;
    -webkit-font-smoothing: antialiased !important;
}
.fp-drill-prev:hover,
.fp-drill-next:hover {
    background: #eeeeee !important;
}
.fp-drill-title {
    cursor: pointer;
    font-weight: bold;
    font-size: 12px;
    color: #333333;
    flex: 1;
    text-align: center;
}
.fp-drill-title:hover {
    text-decoration: underline;
}
.fp-drill-year-title {
    cursor: default !important;
    text-decoration: none !important;
}
.fp-drill-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2px;
    width: 100%;
}
.fp-drill-month,
.fp-drill-year {
    display: block;
    text-align: center;
    padding: 8px 2px;
    font-size: 12px;
    cursor: pointer;
    border-radius: 4px;
    color: #333333;
    line-height: 1.2;
}
.fp-drill-month:hover:not(.fp-drill-selected):not(.fp-drill-today),
.fp-drill-year:hover:not(.fp-drill-selected):not(.fp-drill-today):not(.fp-drill-outside) {
    background: #eeeeee !important;
}
.fp-drill-selected {
    background: linear-gradient(to bottom, #0088cc 0%, #0044cc 100%) !important;
    color: #ffffff !important;
    text-shadow: 0 -1px 0 rgba(0,0,0,.25) !important;
}
.fp-drill-outside {
    color: #999999 !important;
}
.fp-drill-outside:hover:not(.fp-drill-selected):not(.fp-drill-today) {
    background: #eeeeee !important;
}
.fp-drill-today {
    background: linear-gradient(to bottom, #0088cc 0%, #0044cc 100%) !important;
    color: #ffffff !important;
    text-shadow: 0 -1px 0 rgba(0,0,0,.25) !important;
}
.fp-drill-disabled {
    color: #cccccc !important;
    cursor: default !important;
    pointer-events: none;
}
