/* The site-wide date picker (wwwroot/js/crm-datepicker.js): Getfly-style calendar and «Thời gian» list.
   Navy is the site's brand navy (#16315f); the link blue matches «Hủy bỏ» in the reference. */

/* ---- the boxes on the page ------------------------------------------------------------------- */
.crm-date-alt,
.crm-date-text {
    padding-right: 34px !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b6577' stroke-width='2' stroke-linecap='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='3'/%3E%3Cpath d='M3 10h18M8 3v4M16 3v4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px 16px;
    cursor: pointer;
}
.crm-date-alt:disabled, .crm-date-alt[readonly] { cursor: default; }

.cdp-range { width: 100%; }
.cdp-ghost-caption { visibility: hidden; }

.cdp-range-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-width: 180px;
    max-width: 340px;          /* Getfly-sized: the list's longest label, not a whole merged column */
    height: 38px;
    padding: 0 10px 0 12px;
    border: 1px solid #cfd5de;
    border-radius: 8px;
    background: #fff;
    color: #1f2937;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    text-align: left;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
}
.cdp-range-btn.is-sm { height: 32px; font-size: 13px; }
.cdp-range-btn:hover { border-color: #9aa6b8; }
.cdp-range-btn:focus-visible { outline: none; border-color: #16315f; box-shadow: 0 0 0 3px rgba(22, 49, 95, .18); }
.cdp-range-btn.is-set { border-color: #16315f; color: #16315f; }
.cdp-range-btn svg { flex: none; width: 18px; height: 18px; color: #3a4250; }
.cdp-range-btn.is-set svg { color: #16315f; }
.cdp-range-btn .cdp-caret { width: 16px; height: 16px; margin-left: auto; color: #1f2937; }
.cdp-range-text { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* ---- the popup --------------------------------------------------------------------------------- */
.cdp-pop {
    position: fixed;
    z-index: 2100;              /* above Bootstrap modals (1055) and the sidebar */
    background: #fff;
    border: 1px solid #dfe3ea;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(16, 42, 78, .18);
    color: #1f2937;
    font-size: 14px;
    max-height: calc(100vh - 16px);
    overflow: auto;
}
.cdp-pop button { font-family: inherit; }
.cdp-single, .cdp-custom { width: 304px; max-width: calc(100vw - 16px); }
.cdp-list { width: 300px; max-width: calc(100vw - 16px); }

/* calendar */
.cdp-head { background: #eef1f5; padding: 6px 8px 0; }
.cdp-bar { display: flex; align-items: center; justify-content: space-between; }
.cdp-title { font-size: 15px; font-weight: 700; color: #111827; }
.cdp-pop .cdp-nav {
    width: 36px; height: 36px;
    padding: 0;
    border: 0; border-radius: 8px;
    background: transparent;
    color: #8a94a6;
    font-size: 24px; line-height: 1;
    cursor: pointer;
}
.cdp-pop .cdp-nav:hover { background: #e0e6ee; color: #16315f; }
.cdp-selects { display: flex; gap: 6px; padding: 4px 0 0; }
.cdp-select {
    flex: 1;
    height: 34px;
    padding: 0 26px 0 10px;
    border: 1px solid #cfd5de;
    border-radius: 6px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' stroke='%235b6577' stroke-width='2.4' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 8px center / 14px;
    color: #1f2937;
    font-size: 14px;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}
.cdp-select.cdp-year { flex: 0 0 92px; }
.cdp-select:focus { outline: none; border-color: #16315f; box-shadow: 0 0 0 2px rgba(22, 49, 95, .15); }
.cdp-dow {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    padding: 10px 0 8px;
    font-size: 13px;
    color: #374151;
    text-align: center;
}
.cdp-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px 0;
    padding: 8px;
}
.cdp-day {
    height: 36px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #1f2937;
    font-size: 14px;
    cursor: pointer;
}
.cdp-day:hover { background: #eaf0fb; }
.cdp-day:focus-visible { outline: 2px solid #16315f; outline-offset: -2px; }
.cdp-day.is-out { color: #9aa3af; }
.cdp-day.is-today { font-weight: 700; color: #16315f; }
.cdp-day.in-range { background: #e3eaf7; border-radius: 0; }
.cdp-day.is-sel { background: #16315f; color: #fff; font-weight: 600; }
.cdp-day.is-start:not(.is-end) { border-radius: 8px 0 0 8px; }
.cdp-day.is-end:not(.is-start) { border-radius: 0 8px 8px 0; }
.cdp-day:disabled { color: #c9ced6; background: transparent; cursor: not-allowed; }

/* footer, buttons */
.cdp-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px 12px;
    border-top: 1px solid #eef0f3;
}
.cdp-foot-end { justify-content: flex-end; }
.cdp-link {
    min-height: 40px;
    padding: 0 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #2457c5;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}
.cdp-link:hover { background: #f1f5fd; }
.cdp-apply,
.cdp-apply.btn {
    min-height: 42px;
    padding: 0 20px;
    border: 0;
    border-radius: 8px;
    background: #16315f;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.cdp-apply:hover, .cdp-apply.btn:hover { background: #102a4e; color: #fff; }
.cdp-time { display: flex; align-items: center; gap: 8px; margin: 0; color: #374151; }
.cdp-time input { width: 110px; height: 36px; padding: 0 8px; border: 1px solid #cfd5de; border-radius: 6px; }

/* the «Thời gian» list */
.cdp-opt {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 44px;
    padding: 10px 16px;
    border: 0;
    border-bottom: 1px solid #eef0f3;
    background: #fff;
    color: #1f2937;
    font-size: 14.5px;
    text-align: left;
    cursor: pointer;
}
.cdp-opt:hover { background: #f5f7fb; }
.cdp-opt:focus-visible { outline: none; background: #eef3fc; }
.cdp-radio {
    flex: none;
    width: 18px; height: 18px;
    border: 1.5px solid #c3c9d3;
    border-radius: 50%;
    background: #fff;
}
.cdp-opt.is-on .cdp-radio { border-color: #16315f; background: #16315f; box-shadow: inset 0 0 0 3.5px #fff; }
.cdp-opt.is-on { font-weight: 600; color: #16315f; }
.cdp-list .cdp-foot { border-top: 0; padding-top: 6px; }

/* the custom range */
.cdp-inputs { display: flex; align-items: center; gap: 8px; padding: 12px 12px 4px; }
.cdp-in { flex: 1; min-width: 0; height: 42px; padding: 0 10px; border: 1px solid #cfd5de; border-radius: 8px; background: #fff; color: #1f2937; font-size: 14px; }
.cdp-in:focus { outline: none; }
.cdp-in.is-active { border-color: #16315f; box-shadow: 0 0 0 2px rgba(22, 49, 95, .15); }
.cdp-arrow { flex: none; color: #374151; font-size: 18px; }
.cdp-custom .cdp-foot { border-top: 0; }

@media (max-width: 400px) {
    .cdp-day { height: 40px; }
    .cdp-range-btn { min-width: 0; }
}
