/* Shared business-row geometry. Batch selection and archive tables stay independent. */
table:is(.order-unified-table, .order-table-unified) {
  width: 100%;
  min-width: 1550px;
  table-layout: fixed;
  font-variant-numeric: tabular-nums;
}
table:is(.order-unified-table, .order-table-unified) :is(th, td) {
  box-sizing: border-box;
  min-width: 0;
  padding-inline: 8px;
  text-align: center;
  vertical-align: middle;
}
table:is(.order-unified-table, .order-table-unified) th {
  white-space: nowrap;
}
table:is(.order-unified-table, .order-table-unified) tbody > tr {
  transform: none;
  transition: background-color 180ms ease, box-shadow 180ms ease;
}
table:is(.order-unified-table, .order-table-unified) tbody > tr:is(:hover, :active) {
  transform: none;
}
table.order-unified-table th[data-order-column="completed"],
table.pdd-sources-table.order-unified-table th:nth-child(1) { width: 6%; }
table.order-unified-table th[data-order-column="orderNo"],
table.pdd-sources-table.order-unified-table th:nth-child(2) { width: 16%; }
table.order-unified-table th[data-order-column="people"],
table.pdd-sources-table.order-unified-table th:nth-child(3) { width: 9%; }
table.order-unified-table th[data-order-column="total"],
table.pdd-sources-table.order-unified-table th:nth-child(4) { width: 8%; }
table.order-unified-table th[data-order-column="pages"],
table.pdd-sources-table.order-unified-table th:nth-child(5) { width: 5%; }
table.order-unified-table th[data-order-column="shippedAt"],
table.pdd-sources-table.order-unified-table th:nth-child(6),
table.order-unified-table th[data-order-column="confirmedAt"],
table.pdd-sources-table.order-unified-table th:nth-child(7) { width: 10%; }
table.order-unified-table th[data-order-column="method"],
table.pdd-sources-table.order-unified-table th:nth-child(8) { width: 5%; }
table.order-unified-table th[data-order-column="source"],
table.pdd-sources-table.order-unified-table th:nth-child(9) { width: 6%; }
table.order-unified-table th[data-order-column="note"],
table.pdd-sources-table.order-unified-table th:nth-child(10) { width: 12%; }
table.order-unified-table th[data-order-column="refundAmount"],
table.pdd-sources-table.order-unified-table th:nth-child(11) { width: 6%; }
table.order-unified-table th[data-order-column="received"],
table.pdd-sources-table.order-unified-table th:nth-child(12) { width: 7%; }
table:is(.order-unified-table, .order-table-unified) :is(.en-order-number, .pdd-source-order-number, .order-number-text) {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
}
table:is(.order-unified-table, .order-table-unified) :is(td[data-order-column="method"], td[data-order-column="source"], .pdd-source-method-cell, .pdd-source-origin-cell) {
  white-space: nowrap;
}
table:is(.order-unified-table, .order-table-unified) :is(.en-order-people, .pdd-source-people, .order-people) > span {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  line-height: 1.65;
}
table:is(.order-unified-table, .order-table-unified) :is(.en-order-people, .pdd-source-people, .order-people) > span + span {
  color: var(--en-muted, var(--blue-700));
  font-size: 11px;
}
table:is(.order-unified-table, .order-table-unified) :is(.en-order-note-text, .pdd-source-note-cell > .pdd-source-field) {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
table.order-unified-table .pdd-source-note-cell > .pdd-source-field { margin: 0; }
table.order-unified-table .pdd-source-inline-number { width: 100%; min-width: 0; }
table.order-unified-table :is(.en-order-income-details, .pdd-source-income-actions) { gap: 4px; justify-content: center; }
table.order-unified-table :is(.en-order-income-details, .pdd-source-income-actions) > :first-child { min-width: 0; margin-inline: 0; padding-inline: 4px; }
table:is(.order-unified-table, .order-table-unified) :is(.en-order-details-button, .pdd-source-more, .home-order-more-button) {
  flex-shrink: 0;
  transform: none;
  transition: background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}
@media (prefers-reduced-motion: reduce) {
  table:is(.order-unified-table, .order-table-unified) tbody > tr,
  table:is(.order-unified-table, .order-table-unified) :is(.en-order-details-button, .pdd-source-more, .home-order-more-button) { transition: none; }
}

/* The same semantic colors follow an order through tables, filters and editors. */
:is(.order-status-trigger, .order-status-option, .pdd-source-completion, [data-pdd-status-option]) {
  --order-state-accent: #176db4;
}
:is(.order-status-trigger, .order-status-option)[data-order-state="unfinished"],
.pdd-source-completion.is-unfinished,
[data-pdd-status-option="unfinished"] { --order-state-accent: #b73e5a; }
:is(.order-status-trigger, .order-status-option)[data-order-state="completed"],
.pdd-source-completion.is-completed,
[data-pdd-status-option="completed"] { --order-state-accent: #187454; }
:is(.order-status-trigger, .order-status-option)[data-order-state="partial"] { --order-state-accent: #956019; }
:is(.order-status-trigger, .order-status-option)[data-order-state="refunded"],
.pdd-source-completion.is-refunded,
[data-pdd-status-option="refunded"] { --order-state-accent: #7951a9; }
:is(.order-status-trigger, .order-status-option)[data-order-state="settled"] { --order-state-accent: #18767c; }
:is(.order-status-trigger, .order-status-option)[data-order-state="pending"] { --order-state-accent: #956019; }

:is(button.order-status-trigger, button.pdd-source-completion) {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  border: 1px solid color-mix(in srgb, var(--order-state-accent) 32%, transparent) !important;
  border-radius: 12px !important;
  color: var(--order-state-accent) !important;
  background: linear-gradient(160deg, color-mix(in srgb, var(--order-state-accent) 5%, #fff), color-mix(in srgb, var(--order-state-accent) 11%, #fff)) !important;
  box-shadow: 0 2px 7px color-mix(in srgb, var(--order-state-accent) 12%, transparent), 0 0 12px color-mix(in srgb, var(--order-state-accent) 9%, transparent), inset 0 1px 0 rgba(255,255,255,.9) !important;
  font-weight: 700;
  white-space: nowrap;
  transform: none !important;
  transition: box-shadow 220ms ease, border-color 220ms ease, background-color 220ms ease, color 220ms ease;
}
button.pdd-source-completion { min-height: 32px; padding: 6px 10px; }
:is(button.order-status-trigger, button.pdd-source-completion):is(:hover, [aria-expanded="true"]):not(:disabled) {
  border-color: color-mix(in srgb, var(--order-state-accent) 55%, transparent) !important;
  box-shadow: 0 3px 11px color-mix(in srgb, var(--order-state-accent) 20%, transparent), 0 0 17px color-mix(in srgb, var(--order-state-accent) 16%, transparent), inset 0 1px 0 rgba(255,255,255,.95) !important;
}
:is(button.order-status-trigger, button.pdd-source-completion):focus-visible {
  outline: 2px solid color-mix(in srgb, var(--order-state-accent) 70%, white);
  outline-offset: 3px;
}
:is(button.order-status-trigger, button.pdd-source-completion):disabled { box-shadow: inset 0 1px 0 rgba(255,255,255,.7) !important; }
#enterpriseSelectListbox .order-status-option,
#pddSourceStatusPopover [data-pdd-status-option] {
  border: 1px solid color-mix(in srgb, var(--order-state-accent) 20%, transparent);
  border-radius: 11px;
  color: var(--order-state-accent);
  background: color-mix(in srgb, var(--order-state-accent) 6%, rgba(255,255,255,.8));
}
#enterpriseSelectListbox .order-status-option:is(:hover, [data-active="true"], [aria-selected="true"]),
#pddSourceStatusPopover [data-pdd-status-option]:is(:hover, :focus-visible, [aria-checked="true"]) {
  color: var(--order-state-accent);
  border-color: color-mix(in srgb, var(--order-state-accent) 38%, transparent);
  background: color-mix(in srgb, var(--order-state-accent) 12%, #fff);
  box-shadow: 0 0 10px color-mix(in srgb, var(--order-state-accent) 12%, transparent);
}
@media (prefers-reduced-motion: reduce) {
  :is(button.order-status-trigger, button.pdd-source-completion) { transition: none; }
}

/* Headers use a plain chevron; only row status controls use colored pills. */
:is(table.order-unified-table, table.order-table-unified) thead :is(.en-select-trigger, .pdd-source-filter-trigger),
:is(table.order-unified-table, table.order-table-unified) thead :is(.en-select-trigger, .pdd-source-filter-trigger):is(:hover, :active, [aria-expanded="true"], :disabled) {
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--blue-700) !important;
}
:is(table.order-unified-table, table.order-table-unified) tbody .en-order-state-select {
  width: max-content;
  min-width: 0;
  max-width: 100%;
}
:is(table.order-unified-table, table.order-table-unified) tbody :is(button.order-status-trigger, button.pdd-source-completion) {
  justify-content: center;
  width: max-content;
  min-width: 0;
  max-width: 100%;
  padding-inline: 7px;
  gap: 3px;
}
:is(table.order-unified-table, table.order-table-unified) tbody :is(button.order-status-trigger, button.pdd-source-completion) > span {
  flex: 0 0 auto;
  min-width: 0;
}
:is(table.order-unified-table, table.order-table-unified) tbody :is(button.order-status-trigger, button.pdd-source-completion) > svg {
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  margin: 0;
}
