/* Date field (public/js/date-field.js): dd/mm/yyyy text box + calendar popup.
   Shared by the public /insight filter and the CMS dashboard. Only the popup
   and the calendar button are styled here — the text box inherits the class of
   the input it replaces, so each site keeps styling its own field. Colours can
   be themed with --df-accent / --df-accent-ink / --df-danger on any ancestor
   (or :root); the defaults are the SUR+ navy and gold. */

.datepick {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}

.datepick__text {
  width: 100%;
  min-width: 0;
  padding-right: 30px; /* room for the calendar button */
  font-variant-numeric: tabular-nums;
}

.datepick__text.is-invalid {
  color: var(--df-danger, #d92d20);
}

.datepick__btn {
  position: absolute;
  right: 0;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #667085;
  cursor: pointer;
}

.datepick__btn:hover {
  background: rgba(6, 37, 74, 0.06);
  color: var(--df-accent, #06254a);
}

.datepick__pop {
  position: fixed;
  z-index: 1000;
  width: 260px;
  padding: 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(6, 37, 74, 0.16);
  font: 400 13px/1.4 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #1e1e1e;
  user-select: none;
}

.datepick__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-weight: 600;
}

.datepick__head button {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--df-accent, #06254a);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.datepick__head button:hover {
  background: #f6f7fb;
}

.datepick__week,
.datepick__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
}

.datepick__week span {
  padding: 4px 0;
  font-size: 11px;
  font-weight: 600;
  color: #667085;
  text-transform: uppercase;
}

.datepick__day {
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font: inherit;
  color: #1e1e1e;
  cursor: pointer;
}

.datepick__day:hover {
  background: #f6f7fb;
}

.datepick__day.is-today {
  box-shadow: inset 0 0 0 1px var(--df-accent-ink, #d6a329);
}

.datepick__day.is-selected {
  background: var(--df-accent, #06254a);
  color: #fff;
}

.datepick__foot {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #e2e8f0;
}

.datepick__foot button {
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 600;
  color: var(--df-accent, #06254a);
  cursor: pointer;
}

.datepick__foot button:hover {
  text-decoration: underline;
}
