/* Styled date picker (client item 18) — see static/js/datepicker.js.
   Uses the ui.css design tokens so the calendar matches the rest of the app. */

.edp {
    position: relative;
    display: block;
}

.edp .edp-input {
    width: 100%;
    padding-right: 38px;   /* room for the calendar button */
}

.edp-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted, #64748b);
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}

.edp-toggle:hover,
.edp.is-open .edp-toggle {
    background: var(--primary-soft, #e0edff);
    color: var(--primary-strong, #2563eb);
}

.edp-toggle svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.edp-pop {
    position: absolute;
    z-index: 1080;
    top: calc(100% + 6px);
    left: 0;
    width: 288px;
    padding: 12px;
    background: var(--surface, #fff);
    border: 1px solid var(--border-strong, rgba(15, 23, 42, .10));
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, .14);
    user-select: none;
}

/* Flip to the right edge when the field sits near the viewport edge. */
.edp-pop.is-right { left: auto; right: 0; }

.edp-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.edp-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text, #0f172a);
    text-transform: capitalize;
}

.edp-nav {
    width: 28px;
    height: 28px;
    border: 1px solid var(--border, rgba(15, 23, 42, .06));
    border-radius: 8px;
    background: var(--surface-muted, #f8fafc);
    color: var(--text-muted, #64748b);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}

.edp-nav:hover {
    background: var(--primary-soft, #e0edff);
    color: var(--primary-strong, #2563eb);
}

.edp-dow,
.edp-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.edp-dow {
    margin-bottom: 4px;
}

.edp-dow span {
    text-align: center;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--text-soft, #94a3b8);
    padding: 4px 0;
}

.edp-day {
    height: 34px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--text, #0f172a);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background .12s ease, color .12s ease;
}

.edp-day:hover:not(:disabled) {
    background: var(--surface-hover, #f1f5f9);
}

.edp-day.is-muted {
    color: var(--text-soft, #94a3b8);
}

.edp-day.is-today {
    box-shadow: inset 0 0 0 1px var(--primary, #3b82f6);
    color: var(--primary-strong, #2563eb);
    font-weight: 700;
}

.edp-day.is-selected,
.edp-day.is-selected:hover {
    background: var(--primary-strong, #2563eb);
    color: #fff;
    font-weight: 700;
    box-shadow: none;
}

.edp-day:disabled {
    opacity: .35;
    cursor: not-allowed;
}

.edp-foot {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border, rgba(15, 23, 42, .06));
}

.edp-link {
    border: 0;
    background: transparent;
    padding: 4px 6px;
    border-radius: 6px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--primary-strong, #2563eb);
    cursor: pointer;
}

.edp-link:hover {
    background: var(--primary-soft, #e0edff);
}

/* Inside the dashboard filter drawer the popup must escape the scroll area. */
.filter-field .edp-pop {
    z-index: 1200;
}

@media (max-width: 480px) {
    .edp-pop { width: 260px; }
    .edp-day { height: 32px; }
}
