/* Styling for the custom date picker (flatpickr), to match the app.
   Loaded after ~/lib/flatpickr/flatpickr.min.css. */

input[data-date-picker-display="true"] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 1rem 1rem;
  padding-right: 2rem;
  cursor: pointer;
}

input[data-date-picker-display="true"]:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

/* A replaced native date control is compact (about 125px in Chrome/Edge), but
   flatpickr's altInput is a plain text input and would otherwise take the
   browser default width (~200px) and reflow the flex row around it. Fields that
   size themselves (w-full, w-40, ...) never get this marker. */
input[data-date-picker-autowidth="true"] {
  width: 9rem;
  flex: 0 0 auto;
}

.flatpickr-calendar {
  font-family: inherit;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
}

.flatpickr-calendar:before,
.flatpickr-calendar:after {
  display: none;
}

.flatpickr-months .flatpickr-month,
.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
  color: #0f172a;
  fill: #0f172a;
}

.flatpickr-months .flatpickr-month {
  font-weight: 600;
}

.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month input.cur-year {
  font-weight: 600;
  color: #0f172a;
}

.flatpickr-months .flatpickr-prev-month:hover,
.flatpickr-months .flatpickr-next-month:hover {
  color: #1d4ed8;
}

.flatpickr-months .flatpickr-prev-month:hover svg,
.flatpickr-months .flatpickr-next-month:hover svg {
  fill: #1d4ed8;
}

span.flatpickr-weekday {
  color: #94a3b8;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
}

.flatpickr-day {
  border-radius: 0.5rem;
  color: #0f172a;
}

.flatpickr-day:hover,
.flatpickr-day:focus {
  background: #f1f5f9;
  border-color: #f1f5f9;
}

.flatpickr-day.today {
  border-color: #93c5fd;
  color: #1d4ed8;
  font-weight: 600;
}

.flatpickr-day.today:hover,
.flatpickr-day.today:focus {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.flatpickr-day.selected,
.flatpickr-day.selected:hover,
.flatpickr-day.selected:focus {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #ffffff;
  font-weight: 600;
}

.flatpickr-day.flatpickr-disabled,
.flatpickr-day.flatpickr-disabled:hover {
  background: transparent;
  border-color: transparent;
  color: #e2e8f0;
}

.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
  color: #cbd5e1;
}

.flatpickr-day.prevMonthDay.selected,
.flatpickr-day.nextMonthDay.selected {
  color: #ffffff;
}
