/* Shared date field + calendar. Loaded by every customer page that has dates. */

.smp-date-control,
.recon-date-control,
.cb-date-control {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  overflow: visible;
  cursor: text;
}

.smp-date-control > input[data-date="1"],
.recon-date-control > input[data-date="1"],
.cb-date-control > input[data-date="1"] {
  box-sizing: border-box;
  width: 100%;
  min-width: 11.5rem;
  min-height: 44px;
  padding-right: 3.2rem;
  font-size: inherit;
  overflow: visible;
  text-overflow: clip;
}

.smp-date-open,
.recon-date-open,
.cb-date-open {
  position: absolute;
  top: 50%;
  right: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 1px solid #c8d9d0;
  border-radius: 8px;
  background: #eef5f0;
  color: #165536;
  transform: translateY(-50%);
  cursor: pointer;
}

.smp-date-open:hover,
.smp-date-open:focus-visible,
.recon-date-open:hover,
.recon-date-open:focus-visible,
.cb-date-open:hover,
.cb-date-open:focus-visible {
  background: #dff0e6;
  outline: 2px solid #165536;
  outline-offset: 1px;
}

.smp-date-open svg,
.recon-date-open svg,
.cb-date-open svg {
  width: 18px;
  height: 18px;
}

.smp-date-invalid,
.recon-date-invalid {
  flex: 1 0 100%;
  margin: 0.25rem 0 0;
  color: #8a3b12;
  font-size: 0.9rem;
}

html.recon-date-picker-open,
html.recon-date-picker-open body {
  overflow: hidden;
  overscroll-behavior: none;
}

.recon-date-popover {
  position: fixed;
  z-index: 80;
  box-sizing: border-box;
  max-width: calc(100vw - 16px);
  padding: 10px;
  border: 1px solid #eadfce;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(23, 33, 29, 0.16);
}

.recon-date-popover:focus {
  outline: none;
}

.recon-date-popover__nav {
  display: grid;
  grid-template-columns: 36px minmax(0, 1.2fr) minmax(0, 0.9fr) 36px;
  gap: 6px;
  align-items: center;
  margin-bottom: 8px;
}

.recon-date-nav,
.recon-date-popover__actions button {
  min-height: 36px;
  border: 1px solid #eadfce;
  border-radius: 8px;
  background: #f7f3ea;
  color: inherit;
  font: inherit;
}

.recon-date-nav-field select {
  width: 100%;
  min-height: 36px;
  border: 1px solid #eadfce;
  border-radius: 8px;
  background: #fff;
  font: inherit;
}

.recon-date-popover__weekdays,
.recon-date-popover__grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
  text-align: center;
}

.recon-date-popover__weekdays {
  margin-bottom: 4px;
  color: #64716b;
  font-size: 0.8rem;
}

.recon-date-day {
  min-height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  touch-action: manipulation;
}

.recon-date-day.is-outside {
  color: #b3bbb6;
}

.recon-date-day.is-today {
  box-shadow: inset 0 0 0 1px #165536;
}

.recon-date-day.is-selected {
  background: #165536;
  color: #fff;
}

.recon-date-day.is-disabled {
  color: #c5cdc8;
  pointer-events: none;
}

.recon-date-popover__actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}

@media (max-width: 720px) {
  .recon-date-popover {
    max-height: calc(100dvh - 16px);
    overflow: auto;
  }

  .recon-date-popover__nav {
    grid-template-columns: 40px minmax(0, 1.1fr) minmax(0, 0.9fr) 40px;
  }
}

@media print {
  .smp-date-open,
  .recon-date-open,
  .cb-date-open,
  .recon-date-popover {
    display: none !important;
  }
}
