/* apm_received_dates_modal_html — the received-dates modal's own rules.
 *
 * SCOPED ON THE OVERLAY ID, NEVER ON THE ROOT CLASS. pxShowOverlay moves
 * #apm-received-dates-overlay into #px-modal-portal, so this form's root,
 * .apm-received-dates-root, stops being an ancestor of everything styled here
 * the moment the dialog opens. A :where(.apm-received-dates-root) scope would
 * therefore stop matching exactly when the rules are needed.
 * :where() contributes zero specificity, so every .apm-received-* rule keeps
 * its own weight, including .apm-received-table td:nth-child(2).
 *
 * .apm-received-search .px-input is written BARE rather than scoped:
 * at (0,2,0) it is safe from the dependency's
 * runtime-injected `.px-input { width: 100% }` whatever that sheet grows next,
 * and .apm-received-search is this form's private class, so a bare rule leaks
 * nowhere.
 *
 * No rule for .apm-received-dates-root: it is an invisible wrapper around a
 * position: fixed overlay and the chart-slot mount div.
 *
 * No designer gate: nothing in this form is hidden until JavaScript runs. On
 * the canvas the form renders OPEN, because the dependency's .px-modal-overlay
 * rule is injected from Python at runtime and the designer runs no Python.
 * That is expected, not a fault to fix.
 */

#apm-received-dates-overlay .px-modal {
  width: 94%;
  max-width: 1180px;
}

#apm-received-dates-overlay .px-modal-body {
  max-height: min(74vh, 760px);
  overflow: auto;
}

:where(#apm-received-dates-overlay) .apm-received-note {
  margin: 0 0 14px;
  color: var(--px-text-muted);
  font-family: var(--px-font);
  font-size: 12px;
  line-height: 1.45;
}

:where(#apm-received-dates-overlay) .apm-received-search {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.apm-received-search .px-input {
  flex: 1;
  min-width: 200px;
}

:where(#apm-received-dates-overlay) .apm-received-search-clear {
  border: 0;
  border-radius: var(--px-radius-sm);
  padding: 4px 8px;
  background: none;
  color: var(--px-text-muted);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

:where(#apm-received-dates-overlay) .apm-received-search-clear:hover,
:where(#apm-received-dates-overlay) .apm-received-search-clear:focus-visible {
  color: var(--accent);
}

:where(#apm-received-dates-overlay) .apm-received-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

:where(#apm-received-dates-overlay) .apm-received-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--px-font);
  font-size: 13px;
}

:where(#apm-received-dates-overlay) .apm-received-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 10px 12px;
  border-bottom: 1px solid var(--px-border);
  background: var(--px-bg-elevated);
  color: var(--px-text-muted);
  font-family: var(--px-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

:where(#apm-received-dates-overlay) .apm-received-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--px-border);
  color: var(--px-text-primary);
  vertical-align: top;
}

:where(#apm-received-dates-overlay) .apm-received-table td:nth-child(2),
:where(#apm-received-dates-overlay) .apm-received-table td:nth-child(3),
:where(#apm-received-dates-overlay) .apm-received-table td:nth-child(4) {
  font-family: var(--px-mono);
  font-variant-numeric: tabular-nums;
}

:where(#apm-received-dates-overlay) .apm-received-table tr:hover td {
  background: var(--accent-subtle);
}

:where(#apm-received-dates-overlay) .apm-received-date-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  min-width: 220px;
}

:where(#apm-received-dates-overlay) .apm-received-date-value {
  color: var(--px-text-secondary);
  font-family: var(--px-mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

:where(#apm-received-dates-overlay) .apm-received-no-date {
  color: var(--px-text-muted);
  font-size: 12px;
}

:where(#apm-received-dates-overlay) .apm-received-empty,
:where(#apm-received-dates-overlay) .apm-received-loading,
:where(#apm-received-dates-overlay) .apm-received-no-match {
  padding: 40px;
  color: var(--px-text-muted);
  font-family: var(--px-font);
  font-size: 14px;
  text-align: center;
}

:where(#apm-received-dates-overlay) .apm-received-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

@media (max-width: 720px) {
  #apm-received-dates-overlay .px-modal { width: 98%; }
  #apm-received-dates-overlay .px-modal-body { padding: 12px; }
}
