/* datetime_picker component */

.datetime-picker { position: relative; display: block; }
.datetime-picker--disabled { opacity: 0.6; pointer-events: none; }

/* Bootstrap input-group integration: a direct-child picker fills the group like a .form-control,
   so adjacent .input-group-text addons (e.g. "Od" / "Do") stay inline instead of wrapping. */
.input-group > .datetime-picker { flex: 1 1 auto; width: 1%; min-width: 0; }
.input-group > .datetime-picker:not(:first-child) > .dtp-input { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.input-group > .datetime-picker:not(:last-child) > .dtp-input { border-top-right-radius: 0; border-bottom-right-radius: 0; }

.dtp-input { cursor: pointer; background-color: #fff; }

/* Popup panel */
.dtp-popup {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1050;
    margin: 0.125rem 0 0;
    padding: 0.45rem;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    width: max-content;
}
.dtp-popup[hidden] { display: none; }
.dtp-popup.dtp-popup--up { top: auto; bottom: 100%; margin: 0 0 0.125rem; }
.dtp-body { display: flex; align-items: stretch; gap: 0.5rem; }

/* Calendar */
.dtp-cal { width: 228px; }
.dtp-cal-head {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 0.4rem; font-weight: 600; font-size: 0.875rem;
}
.dtp-nav {
    border: 0; background: transparent; cursor: pointer;
    color: #6c757d; padding: 0 0.4rem; font-size: 1.1rem; line-height: 1; border-radius: 0.25rem;
}
.dtp-nav:hover { background: #e9ecef; color: #212529; }
.dtp-cal-title { text-transform: capitalize; }

.dtp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; text-align: center; }
.dtp-dow { color: #adb5bd; font-size: 0.7rem; font-weight: 600; padding: 0.2rem 0; }
.dtp-day {
    border: 0; background: transparent; cursor: pointer;
    padding: 0.22rem 0; border-radius: 0.3rem; font-size: 0.8rem; color: #212529;
}
.dtp-day:hover:not(.dtp-disabled) { background: #e9ecef; }
.dtp-day.dtp-other { color: #c3c9d0; }
.dtp-day.dtp-today { border: 1px solid #0d6efd; }
.dtp-day.dtp-sel,
.dtp-day.dtp-start,
.dtp-day.dtp-end { background: #0d6efd; color: #fff; }
.dtp-day.dtp-start { border-radius: 0.3rem 0 0 0.3rem; }
.dtp-day.dtp-end { border-radius: 0 0.3rem 0.3rem 0; }
.dtp-day.dtp-mid { background: #cfe2ff; border-radius: 0; }
.dtp-day.dtp-disabled { color: #dee2e6; cursor: not-allowed; }

/* Month grid (month variant) */
.dtp-month-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.3rem; }
.dtp-month-cell {
    border: 1px solid #e9ecef; background: #fff; cursor: pointer;
    padding: 0.5rem 0; border-radius: 0.3rem; font-size: 0.8rem; text-transform: capitalize;
}
.dtp-month-cell:hover:not(.dtp-disabled) { background: #e9ecef; }
.dtp-month-cell.dtp-sel { background: #0d6efd; color: #fff; border-color: #0d6efd; }
.dtp-month-cell.dtp-disabled { color: #dee2e6; cursor: not-allowed; }

/* "Cały rok" button (month variant, allow_year) */
.dtp-year-all {
    display: block; width: 100%; margin-top: 0.4rem;
    border: 1px solid #e9ecef; background: #fff; cursor: pointer;
    padding: 0.45rem 0; border-radius: 0.3rem; font-size: 0.8rem;
}
.dtp-year-all:hover:not(.dtp-disabled) { background: #e9ecef; }
.dtp-year-all.dtp-sel { background: #0d6efd; color: #fff; border-color: #0d6efd; }
.dtp-year-all.dtp-disabled { color: #dee2e6; cursor: not-allowed; }

/* Time — Chrome-style vertical scroll columns */
.dtp-time { display: flex; flex-direction: column; gap: 0.4rem; }
.dtp-cal + .dtp-time { border-left: 1px solid #eee; padding-left: 0.5rem; }
.dtp-time--range { gap: 0.5rem; }
.dtp-time-group { display: flex; flex-direction: column; }
.dtp-time-label { font-size: 0.65rem; text-transform: uppercase; color: #adb5bd; letter-spacing: 0.04em; font-weight: 600; margin-bottom: 0.15rem; }
.dtp-cols { display: flex; align-items: stretch; gap: 0.15rem; }
.dtp-cols.dtp-disabled { opacity: 0.45; pointer-events: none; }
.dtp-col { display: flex; flex-direction: column; }
.dtp-col-head { font-size: 0.62rem; text-transform: uppercase; color: #adb5bd; font-weight: 600; text-align: center; margin-bottom: 0.2rem; letter-spacing: 0.02em; }
.dtp-scroll { height: 168px; width: 2.4rem; overflow-y: auto; scroll-snap-type: y mandatory; scrollbar-width: none; -ms-overflow-style: none; }
.dtp-scroll::-webkit-scrollbar { width: 0; height: 0; display: none; }
.dtp-scroll:focus { outline: 2px solid rgba(13, 110, 253, 0.35); outline-offset: -2px; border-radius: 0.3rem; }
.dtp-tick { scroll-snap-align: center; display: block; width: 100%; border: 0; background: transparent; cursor: pointer; padding: 0.28rem 0; font-size: 0.82rem; border-radius: 0.3rem; color: #212529; font-variant-numeric: tabular-nums; }
.dtp-tick:hover { background: #e9ecef; }
.dtp-tick.dtp-sel { background: #0d6efd; color: #fff; font-weight: 600; }
.dtp-colon { align-self: center; font-weight: 700; color: #adb5bd; padding: 0 0.05rem; }

/* Beside a calendar: stretch the time columns to match the calendar's height */
.dtp-cal + .dtp-time .dtp-time-group,
.dtp-cal + .dtp-time .dtp-cols { flex: 1 1 auto; }
.dtp-cal + .dtp-time .dtp-time-group,
.dtp-cal + .dtp-time .dtp-cols,
.dtp-cal + .dtp-time .dtp-col,
.dtp-cal + .dtp-time .dtp-scroll { min-height: 0; }
.dtp-cal + .dtp-time .dtp-scroll { height: auto; flex: 1 1 0; }

/* Footer */
.dtp-footer { display: flex; gap: 0.4rem; border-top: 1px solid #eee; margin-top: 0.45rem; padding-top: 0.45rem; }
.dtp-btn { border: 1px solid #ced4da; background: #fff; cursor: pointer; border-radius: 0.3rem; padding: 0.25rem 0.6rem; font-size: 0.78rem; }
.dtp-btn:hover { background: #e9ecef; }
.dtp-done { margin-left: auto; border-color: #0d6efd; color: #0d6efd; }
.dtp-done:hover { background: #0d6efd; color: #fff; }
