/* Shared custom controls — select + date picker */

.ui-date-picker {
  position: relative;
  width: 100%;
}

.ui-date-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--border-strong, #aebdb7);
  border-radius: var(--radius-sm, 10px);
  background: linear-gradient(180deg, #ffffff 0%, #fafbf8 100%);
  color: var(--ink, #17292b);
  font: inherit;
  font-weight: 720;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-control, 0 1px 2px rgba(20, 48, 48, 0.05));
  transition:
    border-color 160ms cubic-bezier(0.2, 0.75, 0.25, 1),
    box-shadow 160ms cubic-bezier(0.2, 0.75, 0.25, 1);
}

.ui-date-trigger:hover:not(:disabled) {
  border-color: #8fa6a0;
  background: #ffffff;
}

.ui-date-trigger:focus-visible,
.ui-date-picker.is-open .ui-date-trigger {
  border-color: var(--brand, #2f7773);
  outline: 0;
  box-shadow: 0 0 0 4px rgba(52, 127, 123, 0.14), 0 8px 24px rgba(26, 83, 80, 0.08);
}

.ui-date-trigger:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.ui-date-trigger.is-empty .ui-date-value {
  color: var(--ink-muted, #74827f);
  font-weight: 650;
}

.ui-date-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ui-date-icon {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--ink-secondary, #526465);
  border-radius: 3px;
  position: relative;
}

.ui-date-icon::before {
  position: absolute;
  top: -4px;
  left: 2px;
  right: 2px;
  height: 4px;
  border: 1.5px solid var(--ink-secondary, #526465);
  border-bottom: 0;
  border-radius: 2px 2px 0 0;
  content: "";
}

.ui-date-panel {
  box-sizing: border-box;
  padding: 12px;
  border: 1px solid var(--border, #d8e1dc);
  border-radius: var(--radius-md, 13px);
  background: #fffefb;
  box-shadow: 0 18px 48px rgba(27, 63, 62, 0.16);
}

.ui-date-panel.is-floating {
  position: fixed;
  z-index: 10050;
  width: 300px;
  max-width: calc(100vw - 24px);
}

.ui-date-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.ui-date-panel-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink, #17292b);
}

.ui-date-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border, #d8e1dc);
  border-radius: 8px;
  background: #fff;
  color: var(--ink-secondary, #526465);
  font: inherit;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.ui-date-nav:hover {
  border-color: var(--brand, #2f7773);
  color: var(--brand-deep, #153f43);
  background: var(--brand-soft, #e4f0ec);
}

.ui-date-weekdays,
.ui-date-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.ui-date-weekdays {
  margin-bottom: 6px;
}

.ui-date-weekdays span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  font-size: 11px;
  font-weight: 800;
  color: var(--ink-muted, #74827f);
  text-align: center;
}

.ui-date-day {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 36px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink, #17292b);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}

.ui-date-day:hover {
  background: var(--brand-soft, #e4f0ec);
  color: var(--brand-deep, #153f43);
}

.ui-date-day.is-outside {
  color: var(--ink-muted, #74827f);
  opacity: 0.55;
}

.ui-date-day.is-today {
  box-shadow: inset 0 0 0 1px rgba(47, 119, 115, 0.35);
}

.ui-date-day.is-selected {
  background: var(--brand, #2f7773);
  color: #fff;
}

.ui-date-day.is-selected:hover {
  background: var(--brand-strong, #205f60);
  color: #fff;
}

.ui-date-panel-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border, #d8e1dc);
}

.ui-date-foot-button {
  min-height: 36px;
  border: 0;
  background: transparent;
  color: var(--brand-deep, #153f43);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  padding: 4px 8px;
  touch-action: manipulation;
}

.ui-date-foot-button:hover {
  color: var(--brand, #2f7773);
}

@media (max-width: 720px) {
  .ui-date-trigger {
    min-height: 48px;
  }

  .ui-date-panel.is-floating {
    width: min(300px, calc(100vw - 24px));
  }

  .ui-date-day {
    min-height: 42px;
    font-size: 14px;
  }

  .ui-date-nav {
    width: 40px;
    height: 40px;
  }

  .ui-date-foot-button {
    min-height: 40px;
    font-size: 13px;
  }
}
