/* om_pending_stock_table_html — the Pending Stock table's own rules, kept
 * here because the server strips a template's <style> block.
 *
 * The form root is the .om-pending-section div itself, so its rule stays
 * BARE: the root is that rule's subject and a :where(.om-pending-section)
 * wrapper in front of it would never match. It is a plain block child of the
 * shell's pending mount point, so it takes no `position: relative` and no
 * `flex: 1 0 auto` — the shell owns the section container.
 *
 * Every other rule is scoped :where(.om-pending-section), which adds no
 * specificity and so cannot change which rule wins, EXCEPT the three that need
 * .om-pending-section as a REAL ancestor class and the one compound that
 * replaces an inline style. Each is called out where it sits.
 *
 * This sheet has no designer gate: nothing here hides content until JavaScript
 * runs, so the canvas shows the header, the ten column titles and an empty
 * body, which is what the running screen shows before its first render.
 */

.om-pending-section {
  background: var(--px-bg-card);
  border: 1px solid var(--px-border);
  border-radius: var(--px-radius);
  box-shadow: var(--px-shadow);
  overflow: hidden;
}

/* Clearer row dividers in light mode (default); keep dark mode subtle.
   Colour-only override so the .px-grid-row:last-child border-none still wins.

   NOT :where()-scoped. This rule is (0,2,0) and beats theme/assets/theme.css's
   .px-grid-row (0,1,0) on specificity; wrapped as :where(.om-pending-section)
   .px-grid-row it would drop to (0,1,0), tie, and lose to the theme, which is
   a head link loaded before this one. */
.om-pending-section .px-grid-row {
  border-bottom-color: var(--px-border-strong);
}

/* [data-theme] sits on <html>, an ancestor of this root, so the attribute stays
   FIRST and the class stays real, for the same reason as above. */
[data-theme="dark"] .om-pending-section .px-grid-row {
  border-bottom-color: var(--px-border);
}

:where(.om-pending-section) .om-td-narrow {
  font-size: 11px;
  color: var(--px-text-secondary);
}

:where(.om-pending-section) .om-td-instructions {
  font-size: 11px;
  color: var(--px-text-secondary);
  white-space: normal;
  line-height: 1.3;
}

:where(.om-pending-section) .om-td-dropdown {
  padding: 2px;
}

:where(.om-pending-section) .om-dropdown {
  font-family: var(--px-font);
  font-size: 11px;
  padding: 4px 6px;
  border: 1px solid var(--px-border);
  border-radius: var(--px-radius-sm);
  background: var(--px-input-bg);
  color: var(--px-text-primary);
  width: 100%;
  cursor: pointer;
}

:where(.om-pending-section) .om-dropdown:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 2px var(--accent-subtle);
}

/* Both tables write the same merged .om-td-actions declarations: a column
   that wraps and ends-aligns. The two extra declarations are inert on a
   pending cell, because theme.css gives .px-grid-row align-items: center. */
:where(.om-pending-section) .om-td-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Cancel + Partial Assign sit together as a compact pair (natural width,
   tight gap) so they fit inside the actions column without overflow. */
:where(.om-pending-section) .om-action-secondary {
  display: flex;
  gap: 4px;
}

:where(.om-pending-section) .om-action-secondary > .om-btn {
  flex: 0 0 auto;
  min-width: 0;
}

/* Real ancestor class, not :where(). theme/assets/theme.css only READS
   --px-grid-cols off .px-grid-card, so there is no tie to lose here; the rule
   keeps the same shape as the two .px-grid-row rules above. */
.om-pending-section .px-grid-card {
  --px-grid-cols: 80px 70px 100px 90px minmax(0,1fr) minmax(0,1fr) 80px 100px minmax(0,1fr) 200px;
}

/* The card's old inline style="max-height:75vh;overflow-y:auto;", which a
   converted template may not carry. Written as a COMPOUND on the new private
   class rather than scoped: at (0,2,0) it beats theme/assets/theme.css's
   .px-grid-card (0,1,0), which declares overflow: hidden auto. An inline style
   beat everything, so a bare class here would be a real regression risk. */
.px-grid-card.om-pending-grid {
  max-height: 75vh;
  overflow-y: auto;
}

@media (max-width: 1400px) {
  .om-pending-section .px-grid-card {
    --px-grid-cols: 70px 60px 90px 80px minmax(0,1fr) minmax(0,1fr) 70px 90px minmax(0,1fr) 180px;
  }
}

@media (max-width: 1100px) {
  :where(.om-pending-section) .om-td-actions {
    justify-content: flex-start;
    padding-top: 8px;
    border-top: 1px solid var(--px-border);
  }
}

:where(.om-pending-section) .om-btn.px-btn-touch-xs {
  padding: 12px 10px;
  min-height: 44px;
  border-radius: 9999px;
  font-size: 0.8rem;
}
