/* Reusable Date Picker / DatePicker component */

.dp-wrap {
    position: relative;
    display: inline-block;
}

/* Trigger button (the "input") */
.dp-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
    color: #6b7280;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.12s, background 0.12s, color 0.12s, box-shadow 0.12s;
    white-space: nowrap;
    line-height: 1.2;
}
.dp-trigger > i { font-size: 12px; opacity: 0.75; }
.dp-trigger:hover:not([disabled]) { border-color: #16a34a; color: #166534; background: #f0fdf4; }
.dp-trigger.has-val { border-color: #16a34a; background: #f0fdf4; color: #166534; }
.dp-trigger.open {
    border-color: #16a34a;
    background: #f0fdf4;
    color: #166534;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.18);
}
.dp-trigger[disabled] { opacity: 0.6; cursor: not-allowed; }

/* Form-style trigger: matches "form-input" / "doctor-form-input" / "mgmt-form-input" classes */
.dp-trigger.form-input,
.dp-trigger.doctor-form-input,
.dp-trigger.mgmt-form-input,
.dp-trigger.hrc-field-input,
.dp-trigger.hrc-date-input,
.dp-trigger.db-pay-input {
    width: 100%;
    justify-content: flex-start;
    background: #fff;
    padding: 8px 10px;
    border-color: #d1d5db;
    border-radius: 6px;
    min-height: 36px;
}
.dp-trigger.form-input:not(.has-val) > .dp-trigger-label,
.dp-trigger.doctor-form-input:not(.has-val) > .dp-trigger-label,
.dp-trigger.mgmt-form-input:not(.has-val) > .dp-trigger-label,
.dp-trigger.hrc-field-input:not(.has-val) > .dp-trigger-label,
.dp-trigger.hrc-date-input:not(.has-val) > .dp-trigger-label,
.dp-trigger.db-pay-input:not(.has-val) > .dp-trigger-label { color: #9ca3af; }

/* Make the wrap fill its container when used as a form input */
.dp-wrap:has(.dp-trigger.form-input),
.dp-wrap:has(.dp-trigger.doctor-form-input),
.dp-wrap:has(.dp-trigger.mgmt-form-input),
.dp-wrap:has(.dp-trigger.hrc-field-input),
.dp-wrap:has(.dp-trigger.hrc-date-input),
.dp-wrap:has(.dp-trigger.db-pay-input) { display: block; width: 100%; }

/* _spHighlight() adds .is-invalid to the hidden input, so reflect it onto the visible trigger via :has(). */
.dp-wrap:has(input.is-invalid) .dp-trigger {
    border-color: #ef4444;
    background: #fef2f2;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

/* Panel (calendar dropdown) */
.dp-panel {
    position: fixed;
    width: 260px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
    z-index: 9999;
    padding: 12px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s linear 0.15s;
}
.dp-panel.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

/* Month nav header */
.dp-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.dp-month-label { font-size: 13px; font-weight: 700; color: #111827; }
.dp-nav {
    width: 26px; height: 26px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #f9fafb;
    color: #6b7280;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.12s;
}
.dp-nav:hover { border-color: #16a34a; color: #16a34a; background: #f0fdf4; }

/* Day grid */
.dp-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}
.dp-wd-row { margin-bottom: 4px; }
.dp-wd {
    text-align: center;
    font-size: 10px;
    font-weight: 600;
    color: #9ca3af;
    padding: 2px 0;
}
.dp-day {
    height: 32px;
    border: none;
    border-radius: 6px;
    background: transparent;
    font-size: 12px;
    color: #374151;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.1s, color 0.1s;
}
.dp-day:hover { background: #f0fdf4; color: #16a34a; }
.dp-day.today { border: 1.5px solid #16a34a; color: #16a34a; font-weight: 600; }
.dp-day.active { background: #16a34a; color: #fff; font-weight: 700; border: none; }
.dp-day--other { color: #d1d5db; }
.dp-day--other:hover { background: #f3f4f6; color: #9ca3af; }

/* Month / year drill-down. `button.` so the year view's plain <span> label gets no pointer or hover.
   `.dp-grid--my` must stay AFTER `.dp-grid`: same div, and `.dp-grid` hardcodes 7 columns. */
button.dp-month-label {
    border: none;
    background: transparent;
    font-family: inherit;
    padding: 3px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
}
button.dp-month-label:hover { background: #f0fdf4; color: #16a34a; }

.dp-grid--my {
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}
.dp-my-cell {
    height: 38px;
    border: none;
    border-radius: 6px;
    background: transparent;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: background 0.1s, color 0.1s;
}
.dp-my-cell:hover { background: #f0fdf4; color: #16a34a; }
.dp-my-cell.active { background: #16a34a; color: #fff; font-weight: 700; }

/* Footer: Clear / Today */
.dp-footer {
    display: flex;
    gap: 6px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #f3f4f6;
}
.dp-foot-btn {
    flex: 1;
    padding: 7px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
    background: #fff;
    cursor: pointer;
    transition: all 0.12s;
}
.dp-foot-clear { color: #6b7280; }
.dp-foot-clear:hover { border-color: #ef4444; color: #ef4444; background: #fef2f2; }
.dp-foot-today { color: #16a34a; border-color: #16a34a; background: #f0fdf4; }
.dp-foot-today:hover { background: #16a34a; color: #fff; }
