/* Custom date picker (public/assets/js/date-picker.js). Loaded by every layout, so it only uses its own .sh-dp* classes.
   Colours fall back to dark ink when a layout has no --primary. */

/* ── a normal date field (input[type=date]) replaced in place ─────────────────────────────────────────────
   The real input keeps its box, border, background and validation look; only its text is hidden and a transparent
   button is laid over it that shows the date and opens the calendar. */
.sh-dp-auto{position:relative;display:inline-flex;max-width:100%;min-width:0}
.sh-dp-auto.block{display:flex}
.sh-dp-auto[hidden]{display:none!important}
/* the field fills its wrapper, so a wrapper that a flex row stretches (input groups) is not left with a short field inside */
.sh-dp-auto>.sh-dp-native{flex:1 1 auto}
.sh-dp-native{color:transparent!important;-webkit-text-fill-color:transparent!important;caret-color:transparent!important;text-shadow:none!important;pointer-events:none!important}
.sh-dp-native::-webkit-datetime-edit,.sh-dp-native::-webkit-datetime-edit-fields-wrapper,.sh-dp-native::-webkit-calendar-picker-indicator{opacity:0!important}
.sh-dp-over{position:absolute!important;left:0;top:0;right:0;bottom:0;z-index:1;display:flex!important;align-items:center;gap:8px;width:100%;height:100%;min-height:0;margin:0;border:0!important;background:transparent!important;box-shadow:none!important;transform:none!important;text-align:left;text-transform:none;cursor:pointer;box-sizing:border-box;overflow:hidden;-webkit-appearance:none;appearance:none}
.sh-dp-over:disabled{cursor:not-allowed}
.sh-dp-over:focus-visible{outline:2px solid var(--primary,#171717);outline-offset:1px}
.sh-dp-over .sh-dp-text{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sh-dp-over .sh-dp-text.empty{opacity:.55}
.sh-dp-over svg{flex:none;margin-left:auto;opacity:.6}

/* ── a date block written out as .sh-dp (range filters, FDA paperwork dates) ──────────────────────────── */
.sh-dp{display:inline-block;position:relative;max-width:100%}
.sh-dp-btn{display:inline-flex;align-items:center;gap:8px;min-height:38px;max-width:100%;padding:0 12px;border:1px solid #e5e7eb;border-radius:9px;background:#fff;color:#1f2937;font:inherit;font-size:13px;cursor:pointer;text-align:left}
.sh-dp-btn:hover{border-color:#cbd5e1}
.sh-dp-btn:disabled{cursor:not-allowed;opacity:.6}
.sh-dp-btn:focus-visible,.sh-dp-btn[aria-expanded="true"]{outline:none;border-color:var(--primary,#171717);box-shadow:0 0 0 3px rgba(255,103,176,.16)}
.sh-dp-btn svg{flex:none;color:#6b7280}
.sh-dp-btn .sh-dp-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sh-dp-btn .sh-dp-text.empty{color:#6b7280}
.sh-dp-single .sh-dp-btn{min-width:200px;width:100%}

/* ── the calendar ────────────────────────────────────────────────────────────────────────────────────── */
.sh-dp-pop{position:fixed;z-index:2147483000;display:flex;background:#fff;border:1px solid #e5e7eb;border-radius:14px;box-shadow:0 18px 48px rgba(15,23,42,.18);color:#171717;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;font-size:13px;line-height:1.35;max-width:calc(100vw - 16px);text-align:left}
.sh-dp-pop *{box-sizing:border-box}
.sh-dp-pop[hidden]{display:none}
.sh-dp-side{width:158px;flex:none;padding:12px 8px;border-right:1px solid #eef0f2;display:flex;flex-direction:column;gap:2px;overflow:auto;max-height:min(520px,calc(100vh - 40px))}
.sh-dp-side h4{margin:8px 8px 4px;font-size:10.5px;font-weight:750;letter-spacing:.55px;text-transform:uppercase;color:#6b7280}
.sh-dp-side h4:first-child{margin-top:0}
.sh-dp-preset{border:0;background:transparent;font:inherit;font-size:13px;text-align:left;color:#1f2937;padding:6px 10px;border-radius:8px;cursor:pointer}
.sh-dp-preset:hover{background:#f3f4f6}
.sh-dp-preset[aria-pressed="true"]{background:#171717;color:#fff;font-weight:650}
.sh-dp-main{padding:12px 14px;min-width:0}
.sh-dp-head{display:flex;align-items:center;gap:6px;margin-bottom:8px}
.sh-dp-head select{height:32px;border:1px solid #e5e7eb;border-radius:8px;background:#fff;font:inherit;font-size:13px;padding:0 8px;color:#1f2937;width:auto;min-width:0}
.sh-dp-nav{width:32px;height:32px;border:1px solid #e5e7eb;border-radius:8px;background:#fff;color:#374151;font-size:18px;line-height:1;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;padding:0}
.sh-dp-nav:hover{background:#f3f4f6}
.sh-dp-nav:disabled{opacity:.35;cursor:not-allowed}
.sh-dp-head .sp{flex:1}
.sh-dp-months{display:flex;gap:22px}
.sh-dp-month{width:252px}
.sh-dp-cap{font-weight:750;font-size:13px;text-align:center;margin:2px 0 6px}
.sh-dp-grid{display:grid;grid-template-columns:repeat(7,36px);justify-content:center}
.sh-dp-wd{height:26px;display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:700;color:#6b7280}
.sh-dp-day{width:36px;height:34px;margin:1px 0;border:0;background:transparent;font:inherit;font-size:13px;color:#1f2937;cursor:pointer;position:relative;padding:0;border-radius:0}
.sh-dp-day:hover:not(:disabled):not(.end):not(.start){background:#f3f4f6;border-radius:8px}
.sh-dp-day:focus-visible{outline:2px solid #171717;outline-offset:-2px;border-radius:8px;z-index:1}
.sh-dp-day:disabled{color:#c4c8ce;cursor:not-allowed}
.sh-dp-day.today::after{content:"";position:absolute;left:50%;bottom:3px;width:4px;height:4px;margin-left:-2px;border-radius:50%;background:currentColor}
.sh-dp-day.in{background:#f3f4f6;background:color-mix(in srgb,var(--primary,#171717) 16%,#fff)}
.sh-dp-day.start,.sh-dp-day.end{background:#171717;color:#fff;font-weight:700}
.sh-dp-day.start{border-radius:8px 0 0 8px}.sh-dp-day.end{border-radius:0 8px 8px 0}
.sh-dp-day.start.end{border-radius:8px}
.sh-dp-day.start.pending{border-radius:8px}
.sh-dp-blank{height:36px}
.sh-dp-foot{display:flex;align-items:center;gap:8px;margin-top:10px;padding-top:10px;border-top:1px solid #eef0f2;flex-wrap:wrap}
.sh-dp-sum{flex:1;min-width:140px;font-size:12px;color:#4b5563}
.sh-dp-act{border:1px solid #e5e7eb;background:#fff;color:#1f2937;border-radius:9px;padding:8px 14px;font:inherit;font-size:13px;font-weight:650;cursor:pointer}
.sh-dp-act:hover{border-color:#cbd5e1;background:#f9fafb}
.sh-dp-act.go{background:#171717;border-color:#171717;color:#fff}.sh-dp-act.go:hover{background:#000}
.sh-dp-act:disabled{opacity:.45;cursor:not-allowed}

@media(max-width:700px){
    /* on a phone the calendar is a sheet at the bottom of the screen, so Apply is never below the fold */
    .sh-dp-pop{position:fixed!important;left:8px!important;right:8px;top:auto!important;bottom:8px;width:auto;max-width:none;flex-direction:column;max-height:calc(100vh - 16px);overflow:auto}
    .sh-dp-side{width:auto;flex-direction:row;flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;gap:6px;border-right:0;border-bottom:1px solid #eef0f2;max-height:none;padding:10px}
    .sh-dp-side h4{display:none}
    .sh-dp-preset{flex:none;white-space:nowrap;border:1px solid #e5e7eb;padding:7px 12px}
    .sh-dp-month+.sh-dp-month{display:none}
    .sh-dp-month{width:100%}
    .sh-dp-grid{grid-template-columns:repeat(7,1fr)}
    .sh-dp-day{width:100%;height:40px}
    .sh-dp-act{padding:10px 16px}
}
