.nx-datetime {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  width: 100%;
}
.nx-datetime-input {
  min-width: 0;
  padding-right: 10px !important;
  border-radius: 10px 0 0 10px !important;
  font-variant-numeric: tabular-nums;
}
.nx-datetime-trigger {
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 46px;
  padding: 0;
  border: 1px solid #cbd5e1;
  border-left: 0;
  border-radius: 0 10px 10px 0;
  color: #334155;
  background: #f8fafc;
  cursor: pointer;
}
.nx-datetime-trigger:hover { color: #1d4ed8; background: #eff6ff; }
.nx-datetime-trigger:focus-visible {
  position: relative;
  z-index: 2;
  outline: 3px solid rgba(37, 99, 235, .16);
  outline-offset: 1px;
}
.nx-datetime-trigger svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nx-datetime.is-open .nx-datetime-input,
.nx-datetime.is-open .nx-datetime-trigger {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .08);
}
.nx-datetime.is-disabled .nx-datetime-trigger,
.nx-datetime.is-readonly .nx-datetime-trigger {
  color: #94a3b8;
  background: #f1f5f9;
  cursor: not-allowed;
}
.nx-datetime-input.is-invalid {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, .09) !important;
}

.nx-datetime-popover {
  position: fixed;
  z-index: 790;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  border-radius: 16px;
  color: #0f172a;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .25);
  font-family: inherit;
}
.nx-datetime-popover[hidden] { display: none !important; }
.nx-datetime-head {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}
.nx-datetime-nav {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 10px;
  color: #334155;
  background: transparent;
  font-size: 27px;
  line-height: 1;
  cursor: pointer;
}
.nx-datetime-nav:hover { color: #1d4ed8; background: #dbeafe; }
.nx-datetime-period { display: grid; grid-template-columns: minmax(0, 1fr) 92px; gap: 8px; }
.nx-datetime-period select {
  width: 100%;
  min-height: 38px;
  padding: 6px 28px 6px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  color: #0f172a;
  background: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
}
.nx-datetime-weekdays,
.nx-datetime-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.nx-datetime-weekdays {
  padding: 9px 12px 4px;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}
.nx-datetime-grid { gap: 3px; padding: 3px 12px 12px; }
.nx-datetime-day {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  min-height: 38px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  color: #1e293b;
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}
.nx-datetime-day:hover { color: #1d4ed8; background: #dbeafe; }
.nx-datetime-day.is-outside { color: #94a3b8; }
.nx-datetime-day.is-today span {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
.nx-datetime-day.is-selected {
  color: #fff;
  background: #2563eb;
  box-shadow: 0 5px 12px rgba(37, 99, 235, .25);
}
.nx-datetime-day:focus-visible { outline: 3px solid rgba(37, 99, 235, .18); outline-offset: 1px; }
.nx-datetime-day:disabled,
.nx-datetime-day.is-disabled,
.nx-datetime-day:disabled:hover,
.nx-datetime-day.is-disabled:hover {
  color: #cbd5e1;
  background: transparent;
  box-shadow: none;
  text-decoration: none;
  cursor: not-allowed;
}

.nx-datetime-time {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}
.nx-datetime-clock { align-self: center; color: #64748b; font-size: 21px; }
.nx-datetime-time label {
  display: grid;
  gap: 3px;
  color: #64748b;
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.nx-datetime-time select {
  min-width: 74px;
  min-height: 40px;
  padding: 7px 25px 7px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  color: #0f172a;
  background: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}
.nx-datetime-time b { align-self: center; padding-bottom: 6px; font-size: 20px; }

.nx-datetime-actions {
  display: grid;
  grid-template-columns: auto auto 1fr auto auto;
  align-items: center;
  gap: 7px;
  padding: 11px 12px 12px;
}
.nx-datetime-link,
.nx-datetime-button {
  min-height: 38px;
  padding: 7px 11px;
  border-radius: 9px;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}
.nx-datetime-link { border: 0; color: #1d4ed8; background: transparent; }
.nx-datetime-link:hover { background: #eff6ff; }
.nx-datetime-button { border: 1px solid #cbd5e1; color: #334155; background: #fff; }
.nx-datetime-button:hover { background: #f8fafc; }
.nx-datetime-apply { border-color: #2563eb; color: #fff; background: #2563eb; }
.nx-datetime-apply:hover { background: #1d4ed8; }

/* Report filters reuse the same accessible popup without irrelevant time UI. */
.nx-datetime.is-date-only { min-width: 150px; }
.nx-datetime-popover.is-date-only .nx-datetime-time,
.nx-datetime-popover.is-date-only [data-dt-apply] { display: none !important; }
.nx-datetime-popover.is-date-only .nx-datetime-actions {
  grid-template-columns: auto auto 1fr auto;
  border-top: 1px solid #e2e8f0;
}
.br-report-date .nx-datetime { min-width: 150px; }
.br-report-date .nx-datetime-input {
  height: 40px;
  min-height: 40px;
  padding: 0 9px !important;
  border-color: var(--br-line, #d8e0ea);
  font-size: 13px;
}
.br-report-date .nx-datetime-trigger { min-width: 40px; min-height: 40px; height: 40px; }

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (max-width: 520px) {
  .nx-datetime-popover { max-height: calc(100vh - 16px); overflow: auto; border-radius: 14px; }
  .nx-datetime-day { min-height: 36px; }
  .nx-datetime-actions { grid-template-columns: auto auto 1fr auto; }
  .nx-datetime-cancel { display: none; }
  .nx-datetime-popover.is-date-only .nx-datetime-actions { grid-template-columns: auto auto 1fr; }
  .br-report-date .nx-datetime { min-width: 0; }
}
