/* ========================================= */
/* SECTION: Shared Form Control Behavior     */
/* ========================================= */
/* Loaded by every layout branch (TAO Main and Payroll) so number fields and */
/* date pickers look and behave the same across the whole app. */

/* Hide up/down spinner arrows on number fields app-wide. Typing remains available. */
input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Date fields: typed mm/dd/yyyy plus a calendar icon that opens a month grid. */
.lh-date-field {
  position: relative;
  display: block;
  width: 100%;
}

.lh-date-field .lh-date-input {
  padding-right: 2.35rem;
}

.lh-date-picker-toggle {
  position: absolute;
  top: 50%;
  right: 0.35rem;
  transform: translateY(-50%);
  width: 1.75rem;
  height: 1.75rem;
  border: 0;
  border-radius: 0.35rem;
  background: transparent;
  color: var(--text-muted, #6b7280);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  cursor: pointer;
}

.lh-date-picker-toggle:hover,
.lh-date-picker-toggle[aria-expanded="true"] {
  color: var(--primary, #1f5e8c);
  background: var(--primary-soft, rgba(31, 94, 140, 0.12));
}

.lh-date-picker {
  position: absolute;
  z-index: 1080;
  width: 17.5rem;
  padding: 0.75rem;
  border: 1px solid var(--border, #d6dde3);
  border-radius: 0.5rem;
  background: var(--surface, #fff);
  color: var(--text, #1a1a1a);
  box-shadow: 0 0.5rem 1.25rem rgba(15, 23, 42, 0.16);
}

.lh-date-picker[hidden] {
  display: none !important;
}

.lh-date-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
}

.lh-date-picker-title {
  display: flex;
  gap: 0.35rem;
  flex: 1;
  min-width: 0;
}

.lh-date-picker-month,
.lh-date-picker-year {
  border: 1px solid var(--border, #d6dde3);
  border-radius: 0.35rem;
  background: var(--surface, #fff);
  color: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.2rem 0.35rem;
  max-width: 100%;
}

.lh-date-picker-month {
  flex: 1.4;
  min-width: 0;
}

.lh-date-picker-year {
  flex: 1;
  min-width: 4.25rem;
}

.lh-date-picker-nav {
  width: 1.85rem;
  height: 1.85rem;
  border: 0;
  border-radius: 0.35rem;
  background: transparent;
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}

.lh-date-picker-nav:hover {
  background: var(--surface-muted, #f1f4f6);
}

.lh-date-picker-weekdays,
.lh-date-picker-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.15rem;
}

.lh-date-picker-weekdays {
  margin-bottom: 0.25rem;
}

.lh-date-picker-weekdays span {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted, #6b7280);
  padding: 0.2rem 0;
}

.lh-date-picker-day,
.lh-date-picker-empty {
  aspect-ratio: 1;
  width: 100%;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.lh-date-picker-day {
  cursor: pointer;
}

.lh-date-picker-day:hover:not(:disabled) {
  background: var(--primary-soft, rgba(31, 94, 140, 0.12));
}

.lh-date-picker-day.is-today {
  box-shadow: inset 0 0 0 1px var(--primary, #1f5e8c);
}

.lh-date-picker-day.is-selected {
  background: var(--primary, #1f5e8c);
  color: #fff;
}

.lh-date-picker-day.is-disabled,
.lh-date-picker-day:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.lh-date-picker-footer {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.65rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--border, #d6dde3);
}

.lh-date-picker-action {
  border: 0;
  background: transparent;
  color: var(--primary, #1f5e8c);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.15rem 0.25rem;
  cursor: pointer;
}

.lh-date-picker-action:hover {
  text-decoration: underline;
}
