/* HARPS financial display — alignment, tabular figures, negative colour.
   Does not restyle ADS modal, drawer, or button chrome. */

html[data-theme="ads"] .harps-num--neg,
html[data-theme="ads"] .dash-kpi-value.harps-num--neg,
html[data-theme="ads"] .dash-kpi-value--red,
html[data-theme="ads"] .gl-table tbody td.harps-num--neg,
html[data-theme="ads"] .gl-table tfoot td.harps-num--neg,
html[data-theme="ads"] .ap-table td.harps-num--neg,
html[data-theme="ads"] .ov-li-table td.harps-num--neg,
.harps-num--neg {
  color: #993b44;
}

html[data-theme="ads"] .ap-table--rich td,
html[data-theme="ads"] .gl-table tbody td,
html[data-theme="ads"] .fs-table td,
html[data-theme="ads"] .ov-li-table td,
html[data-theme="ads"] .line-items-cell,
html[data-theme="ads"] .td-text,
html[data-theme="ads"] .inv-cell-text {
  font-family: "Open Sans", var(--font-family), sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  color: var(--ads-gray-600, #1e2528);
}

html[data-theme="ads"] table thead th.ap-th-num,
html[data-theme="ads"] table thead th.gl-num,
html[data-theme="ads"] table thead th.ov-num,
html[data-theme="ads"] .ap-table--rich th.ap-th-num,
html[data-theme="ads"] .ap-table--rich td.ap-cell-num,
html[data-theme="ads"] .gl-table th.gl-num,
html[data-theme="ads"] .gl-table td.gl-num,
html[data-theme="ads"] .ov-li-table th.ov-num,
html[data-theme="ads"] .ov-li-table td.ov-num,
.ap-table--rich th.ap-th-num,
.ap-table--rich td.ap-cell-num,
.gl-table th.gl-num,
.gl-table td.gl-num,
.ov-li-table th.ov-num,
.ov-li-table td.ov-num,
.line-items-header-cell--numeric,
.line-items-cell--numeric,
.col-value .th-cell,
.col-value.td-stack-cell,
.inv-th.inv-col-amount,
.inv-cell.inv-col-amount {
  text-align: right;
  font-variant-numeric: tabular-nums !important;
  font-feature-settings: "tnum" 1;
}

/* Order / invoice detail cards: same label|value grid as Order Information.
   Values stay left-aligned after the label column; numbers may use tabular
   figures. Do not right-align — that butted left-column values into the
   right-column labels. */
.order-info-grid,
.revenue-billing-grid {
  column-gap: 32px;
}

.order-info-value,
.revenue-billing-value {
  width: auto;
  max-width: none;
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
  font-variant-numeric: tabular-nums !important;
  font-feature-settings: "tnum" 1;
}

.order-info-label,
.revenue-billing-label {
  width: 200px;
  flex-shrink: 0;
}

.detail-field-value {
  text-align: left;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.ap-table--rich th.ap-th-num .sort-label,
.gl-table th.gl-num .sort-label,
.ov-li-table th.ov-num span {
  justify-content: flex-end;
  text-align: right;
}

.ap-table td.ap-cell-muted,
.ap-table td.ap-cell-notes.ap-cell-muted {
  color: var(--ads-gray-600, var(--gray-95, #1e2528));
}

.td-stack-secondary:empty,
.td-stack-secondary[hidden] {
  display: none;
}

html[data-theme="ads"] .dash-kpi-value.harps-num--neg,
html[data-theme="ads"] .dash-kpi-value--red,
.dash-kpi-value.harps-num--neg,
.dash-kpi-value--red {
  color: #993b44;
}

html[data-theme="wireframe"] .harps-num--neg,
html[data-theme="wireframe"] .dash-kpi-value.harps-num--neg,
html[data-theme="wireframe"] .dash-kpi-value--red {
  color: #4a4a4a;
}

/* ── Prompt 46: leftover HARPS chrome → ADS tokens ─────────────────────
   ads-theme.css is not edited. These selectors are HARPS-owned classes
   that ads-theme never mapped: table-row actions, detail cards, Order
   Review drawer. Layout (padding, min-height, placement) stays. */

html[data-theme="ads"] .line-items-action-btn {
  border-radius: var(--radius-button, 6px);
  border-width: 1px;
  font-weight: 600;
  font-family: var(--font-family, "Open Sans", sans-serif);
  gap: var(--ads-btn-gap, 4px);
}

html[data-theme="ads"] .line-items-action-btn--promoted:hover:not(:disabled),
html[data-theme="ads"] .line-items-action-btn--promoted:focus-visible:not(:disabled) {
  color: var(--white, #fff);
  background: var(--ads-brand-hover, #3b3fba);
  border-color: var(--ads-brand-hover, #3b3fba);
}

html[data-theme="ads"] .line-items-action-btn--promoted:active:not(:disabled) {
  color: var(--white, #fff);
  background: var(--ads-brand-active, #363aab);
  border-color: var(--ads-brand-active, #363aab);
}

html[data-theme="ads"] .line-items-action-btn--standard:hover:not(:disabled),
html[data-theme="ads"] .line-items-action-btn--standard:focus-visible:not(:disabled),
html[data-theme="ads"] .line-items-action-btn--demoted:hover:not(:disabled),
html[data-theme="ads"] .line-items-action-btn--demoted:focus-visible:not(:disabled),
html[data-theme="ads"] .line-items-action-btn--review:hover:not(:disabled) {
  color: var(--ads-brand, #4045c2);
  background: var(--ads-indigo-50, #e2e3f2);
  border-color: var(--ads-brand, #4045c2);
}

html[data-theme="ads"] .line-items-action-btn--standard:active:not(:disabled),
html[data-theme="ads"] .line-items-action-btn--demoted:active:not(:disabled),
html[data-theme="ads"] .line-items-action-btn--review:active:not(:disabled) {
  color: var(--ads-brand-active, #363aab);
  background: var(--ads-indigo-50, #e2e3f2);
  border-color: var(--ads-brand-active, #363aab);
}

html[data-theme="ads"] .order-info-card,
html[data-theme="ads"] .revenue-billing-card,
html[data-theme="ads"] .detail-card {
  border-radius: var(--radius-card, 12px);
  border-color: var(--ads-card-border, rgba(15, 18, 20, 0.10));
}

html[data-theme="ads"] .or-surface {
  border-radius: var(--radius-card, 12px);
  border-color: var(--ads-card-border, rgba(15, 18, 20, 0.10));
}

html[data-theme="ads"] .or-drawer {
  background: var(--ads-card-bg, #fff);
  border-left-color: var(--ads-card-border, rgba(15, 18, 20, 0.10));
}

html[data-theme="ads"] .or-drawer-head {
  border-bottom-color: var(--ads-card-border, rgba(15, 18, 20, 0.10));
}

html[data-theme="ads"] .or-compare div {
  border-radius: var(--radius-field, 8px);
  border-color: var(--ads-card-border, rgba(15, 18, 20, 0.10));
}

/* Left-panel composite title: wrap between words, never mid-token.
   Outranks `.edl-truncate { white-space: nowrap }` so the title can wrap. */
.detail-order-title,
.detail-order-title.edl-truncate {
  word-break: normal;
  overflow-wrap: break-word;
  white-space: normal;
}
