/* ===== Custom DateTime Picker (flatpickr-style) ===== */
.cdp-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 99999;
    background: #fff;
    border-radius: 5px;
    box-shadow: 1px 0 0 #e6e6e6, -1px 0 0 #e6e6e6, 0 1px 0 #e6e6e6, 0 -1px 0 #e6e6e6, 0 3px 13px rgba(0, 0, 0, .08);
    user-select: none;
    font-size: 14px;
    overflow: hidden;
    width: 315px;
}

.cdp-popup.open {
    display: block;
    animation: cdpFadeIn .1s ease;
}

@keyframes cdpFadeIn {
    from {
        opacity: 0;
        transform: translateY(2px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

/* Nav header — white, minimal */
.cdp-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 15px 10px;
}

.cdp-nav-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 3px 8px;
    border-radius: 3px;
    color: #484848;
    font-size: 1.1rem;
    line-height: 1;
    transition: background .1s;
}

.cdp-nav-btn:hover {
    background: #f0f0f0;
}

.cdp-nav-title {
    font-size: 1.05rem;
    font-weight: 500;
    color: #484848;
    display: flex;
    gap: 6px;
    align-items: center;
}

.cdp-nav-month {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.cdp-nav-year {
    font-size: 1.05rem;
    font-weight: 400;
    color: #484848;
}

/* Weekday headers */
.cdp-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    padding: 8px 10px 0;
}

.cdp-weekday {
    text-align: center;
    font-size: .75rem;
    color: rgba(72, 72, 72, .54);
    padding: 2px 0;
    font-weight: 400;
}

/* Day grid */
.cdp-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    padding: 0 10px 10px;
}

.cdp-day {
    text-align: center;
    font-size: .9rem;
    border: none;
    background: none;
    cursor: pointer;
    width: 38px;
    height: 38px;
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #3d3d3d;
    transition: background .1s;
    box-sizing: border-box;
}

.cdp-day:hover:not([disabled]):not(.cdp-other) {
    background: #e2e2e2;
}

.cdp-day.cdp-today:not(.cdp-selected) {
    border: 1px solid var(--primary-color, #3e6b5f);
    color: var(--primary-color, #3e6b5f);
}

.cdp-day.cdp-selected {
    background: var(--primary-color, #3e6b5f) !important;
    color: #fff !important;
    border-color: transparent !important;
}

.cdp-day.cdp-disabled {
    color: #ccc !important;
    cursor: not-allowed;
    text-decoration: none;
    pointer-events: none;
}

.cdp-day.cdp-other {
    color: rgba(72, 72, 72, .3);
    pointer-events: none;
    cursor: default;
}

/* Time spinner bar */
.cdp-time-bar {
    border-top: 1px solid #e6e6e6;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    box-sizing: border-box;
    padding: 0;
}

.cdp-spin {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    flex: 1;
    position: relative;
    cursor: pointer;
}

.cdp-spin:hover {
    background: #f0f0f0;
}

.cdp-spin-val {
    font-size: 1.1rem;
    font-weight: 400;
    color: #3d3d3d;
    text-align: center;
    width: 100%;
}

.cdp-spin:hover .cdp-spin-val {
    font-weight: 600;
}

.cdp-spin-arrows {
    display: flex;
    flex-direction: column;
    border-left: 1px solid #e6e6e6;
    height: 100%;
    width: 24px;
    position: absolute;
    right: 0;
    top: 0;
    background: #f9f9f9;
}

.cdp-spin-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    font-size: .6rem;
    height: 50%;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.cdp-spin-btn:hover {
    background: #e0e0e0;
}

.cdp-spin-btn:first-child {
    border-bottom: 1px solid #e6e6e6;
}

.cdp-time-colon {
    font-size: 1.1rem;
    font-weight: 600;
    color: #3d3d3d;
    padding: 0;
    align-self: center;
}

/* Footer */
.cdp-footer {
    border-top: 1px solid #e6e6e6;
    padding: 6px 10px;
    display: flex;
    justify-content: flex-end;
}

.cdp-btn-clear {
    padding: 4px 12px;
    border-radius: 3px;
    border: 1px solid #e6e6e6;
    background: #fff;
    color: #7d7d7d;
    cursor: pointer;
    font-size: .8rem;
    transition: all .1s;
}

.cdp-btn-clear:hover {
    background: #f0f0f0;
    color: #484848;
}