/* ===== OmboxDatePicker ===== */
.ombox-datepicker-wrap {
    position: relative;
    display: block;
}
.ombox-dp-input {
    width: 100%;
    box-sizing: border-box;
    min-height: var(--widget-control-min-height, 38px);
    height: var(--widget-control-min-height, 38px);
    font-size: var(--widget-font-size, 14px);
    line-height: var(--widget-line-height, 1.571);
    border-radius: var(--widget-control-radius, var(--radius-md, 8px));
    cursor: pointer;
    background-color: #fff !important;
}
.ombox-dp-input[readonly]:focus {
    border-color: var(--color-primary, #0087f7);
    box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--color-primary, #0087f7) 18%, transparent);
}
.ombox-dp-input:disabled {
    color: var(--color-text-muted, #697586);
    background-color: var(--color-surface-muted, #e9ecef) !important;
    cursor: not-allowed;
    opacity: 1;
}
.ombox-dp-input.is-invalid,
.ombox-dp-input[aria-invalid="true"],
.ombox-dp-input:invalid {
    border-color: var(--color-border, #dee2e6);
    box-shadow: none;
}
.ombox-dp-input.is-invalid:focus,
.ombox-dp-input[aria-invalid="true"]:focus,
.ombox-dp-input:invalid:focus {
    border-color: var(--color-primary, #0087f7);
    box-shadow: none;
}
/* ---- popup ---- */
.ombox-dp-popup {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 1055;
    min-width: 252px;
    background: #fff;
    border: 1px solid var(--color-border, #dee2e6);
    border-radius: 10px;
    box-shadow: 0 8px 28px rgba(20, 32, 50, .13);
    padding: 10px;
    user-select: none;
}
.ombox-dp-popup.is-positioned {
    position: fixed;
    inset: auto;
    margin: 0;
    min-width: 0;
    box-sizing: border-box;
    overflow: auto;
    overscroll-behavior: contain;
}
.ombox-dp-popup[hidden] { display: none; }

/* ---- calendar navigation ---- */
.ombox-dp-cal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.ombox-dp-cal-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary, #202733);
}
.ombox-dp-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid var(--color-border, #dee2e6);
    border-radius: 6px;
    background: #fff;
    color: var(--text-primary, #202733);
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}
.ombox-dp-nav-btn:hover {
    border-color: #0087f7;
    color: #0087f7;
    background: #f0f8ff;
}

/* ---- day grid ---- */
.ombox-dp-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}
.ombox-dp-day-hdr {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 26px;
    color: var(--text-muted, #697586);
    font-size: var(--widget-small-font-size, 12px);
    font-weight: 600;
    line-height: var(--widget-small-line-height, 1.5);
}
.ombox-dp-day {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    border-radius: 6px;
    border: 0;
    background: transparent;
    color: var(--text-primary, #202733);
    font-size: var(--widget-font-size, 14px);
    line-height: var(--widget-line-height, 1.571);
    cursor: pointer;
    padding: 0;
    width: 100%;
    transition: background .12s, color .12s;
}
.ombox-dp-day:hover:not(.is-disabled):not(.ombox-dp-day-empty) {
    background: #eef6ff;
    color: #0087f7;
}
.ombox-dp-day-empty {
    pointer-events: none;
}
.ombox-dp-day.is-today {
    font-weight: 700;
    color: #0087f7;
}
.ombox-dp-day.is-selected {
    background: #0087f7 !important;
    color: #fff !important;
    font-weight: 600;
}
.ombox-dp-day.is-disabled {
    color: #c0c8d4;
    cursor: not-allowed;
}

/* ---- month picker ---- */
.ombox-dp-month-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}
.ombox-dp-month {
    align-items: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--text-primary, #202733);
    cursor: pointer;
    display: flex;
    font-size: var(--widget-font-size, 14px);
    height: 34px;
    justify-content: center;
    padding: 0 8px;
}
.ombox-dp-month:hover:not(.is-disabled) {
    background: #eef6ff;
    border-color: #cfe5ff;
    color: #0087f7;
}
.ombox-dp-month.is-selected {
    background: #0087f7;
    border-color: #0087f7;
    color: #fff;
    font-weight: 600;
}
.ombox-dp-month.is-disabled {
    color: #c0c8d4;
    cursor: not-allowed;
}

/* ---- time picker ---- */
.ombox-dp-time {
    border-top: 1px solid var(--color-border, #dee2e6);
    margin-top: 8px;
    padding-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
}
.ombox-dp-time-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}
.ombox-dp-time-sep {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary, #202733);
    margin: 0 4px;
    padding-bottom: 2px;
}
.ombox-dp-time-val {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: var(--widget-control-min-height, 38px);
    border: 1px solid var(--color-border, #dee2e6);
    border-radius: var(--widget-control-radius, 8px);
    font-size: 16px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary, #202733);
    background: #f9fafc;
}
.ombox-dp-time-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 26px;
    border: 1px solid var(--color-border, #dee2e6);
    border-radius: 5px;
    background: #fff;
    color: var(--text-muted, #697586);
    font-size: var(--widget-small-font-size, 12px);
    line-height: var(--widget-small-line-height, 1.5);
    cursor: pointer;
    padding: 0;
    transition: border-color .12s, color .12s, background .12s;
}
.ombox-dp-time-btn:hover {
    border-color: #0087f7;
    color: #0087f7;
    background: #f0f8ff;
}
.ombox-dp-time-confirm {
    margin-left: 10px;
    align-self: center;
    padding: 5px 12px;
    border: 0;
    border-radius: 6px;
    background: #0087f7;
    color: #fff;
    font-size: var(--widget-font-size, 14px);
    font-weight: 600;
    cursor: pointer;
    height: 32px;
}
.ombox-dp-time-confirm:hover {
    background: #006fcf;
}

.ombox-dp-time-grid {
    border-top: 1px solid var(--color-border, #dee2e6);
    margin-top: 8px;
    padding-top: 10px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
}

.ombox-dp-time-column {
    min-width: 0;
}

.ombox-dp-time-column > strong {
    display: block;
    margin-bottom: 6px;
    color: var(--text-secondary, #667085);
    font-size: 12px;
    font-weight: 650;
}

.ombox-dp-time-options {
    display: grid;
    grid-template-columns: repeat(6, minmax(30px, 1fr));
    gap: 4px;
}


.ombox-dp-time-option {
    min-width: 0;
    min-height: 32px;
    padding: 4px 3px;
    border: 1px solid var(--color-border, #dee2e6);
    border-radius: 5px;
    background: var(--color-white, #fff);
    color: var(--text-primary, #202733);
    font-variant-numeric: tabular-nums;
    cursor: pointer;
}

.ombox-dp-time-option:hover,
.ombox-dp-time-option:focus-visible,
.ombox-dp-time-option.is-selected {
    border-color: var(--color-primary, #0087f7);
    background: var(--color-primary-light, #f0f8ff);
    color: var(--color-primary, #0087f7);
    outline: 0;
}

.ombox-dp-time-option:disabled {
    color: var(--color-text-muted, #98a2b3);
    background: var(--color-surface-muted, #f8fafc);
    cursor: not-allowed;
    opacity: .65;
}

@media (max-width: 1024px), (pointer: coarse) {
    .ombox-dp-time-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .ombox-dp-time-options {
        grid-template-columns: repeat(6, minmax(40px, 1fr));
        gap: 6px;
    }


    .ombox-dp-time-option {
        min-height: 44px;
        padding: 8px 4px;
    }

    .ombox-dp-time-grid .ombox-dp-time-confirm {
        width: 100%;
        margin-left: 0;
        min-height: 44px;
    }
}

/* ---- eye-protection ---- */
body.eye-protection .ombox-dp-input {
    background: var(--bg-card, #fbfefb) !important;
}
body.eye-protection .ombox-dp-popup {
    background: var(--bg-card, #fbfefb);
    border-color: var(--border-color, #cfe3d2);
}
body.eye-protection .ombox-dp-cal-title,
body.eye-protection .ombox-dp-day {
    color: var(--text-primary, #24422f);
}
body.eye-protection .ombox-dp-day:hover:not(.is-disabled):not(.ombox-dp-day-empty) {
    background: #edf7ee;
    color: var(--primary-color, #4f9d69);
}
body.eye-protection .ombox-dp-day.is-today {
    color: var(--primary-color, #4f9d69);
}
body.eye-protection .ombox-dp-day.is-selected {
    background: var(--primary-color, #4f9d69) !important;
    color: #fff !important;
}
body.eye-protection .ombox-dp-month {
    color: var(--text-primary, #24422f);
}
body.eye-protection .ombox-dp-month:hover:not(.is-disabled) {
    background: #edf7ee;
    border-color: var(--border-color, #cfe3d2);
    color: var(--primary-color, #4f9d69);
}
body.eye-protection .ombox-dp-month.is-selected {
    background: var(--primary-color, #4f9d69);
    border-color: var(--primary-color, #4f9d69);
    color: #fff;
}
body.eye-protection .ombox-dp-time-val {
    background: var(--bg-gray, #edf7ee);
    border-color: var(--border-color, #cfe3d2);
    color: var(--text-primary, #24422f);
}
body.eye-protection .ombox-dp-time-btn,
body.eye-protection .ombox-dp-nav-btn {
    background: var(--bg-card, #fbfefb);
    border-color: var(--border-color, #cfe3d2);
    color: var(--text-secondary, #52695a);
}
body.eye-protection .ombox-dp-time-confirm {
    background: var(--primary-color, #4f9d69);
}

/* Weekend identity remains red, including adjusted working weekends (marked 班).
   Selected dates keep white text; disabled dates retain a subdued treatment. */
.ombox-dp-popup .ombox-dp-day-hdr.is-weekend,
.ombox-dp-popup .ombox-dp-day:is(.is-weekend, .is-holiday):not(.is-selected):not(.is-disabled),
body.eye-protection .ombox-dp-popup .ombox-dp-day:is(.is-weekend, .is-holiday):not(.is-selected):not(.is-disabled) {
    color: #c62828;
}
.ombox-dp-popup .ombox-dp-day.is-disabled { color: #a0a5ad; }
.ombox-dp-day { position: relative; }
.ombox-dp-day-note {
    position: absolute;
    top: 0;
    right: 1px;
    font-size: 9px;
    line-height: 1;
    font-weight: 400;
}

.ombox-dp-title-button {
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    padding: 6px 8px;
    min-height: 36px;
    cursor: pointer;
}
.ombox-dp-title-button:hover { background: var(--bg-gray, #f0f4f8); }
.ombox-dp-year-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}
.ombox-dp-year-grid .ombox-dp-month { min-height: 44px; }
.ombox-dp-month:disabled { opacity: .45; cursor: not-allowed; }
