/* ================================================================
   INVOICES MODULE — concepts page · scoped styles
   Two variations live inside this same stylesheet. Selectors are
   prefixed with `.inv-` to avoid bleeding into the rest of the app.
   ================================================================ */

/* The design canvas paints its own warm bg. Inside each artboard we
   reset to the app surface so the in-frame shell looks native. */
.inv-art {
  background: var(--sd-bg-app);
  font-family: var(--sd-font);
  font-size: var(--sd-body-size);
  color: var(--sd-ink-900);
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
}

/* App shell inside an artboard mirrors purchase.html .app layout but
   never tries to fill the viewport — it's bounded by the artboard. */
.inv-art .app {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 78px 1fr;
}

/* ============================================================
   PAGE HEAD — shared between variations
   ============================================================ */
.inv-pagehead {
  padding: 16px 22px 0 22px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.inv-pagehead__title {
  font-size: 22px;
  font-weight: 600;
  color: var(--sd-ink-900);
  letter-spacing: -.01em;
  margin: 0;
}
.inv-pagehead__sub {
  font-size: 12.5px;
  color: var(--sd-ink-500);
  margin-top: 3px;
}
.inv-pagehead__sub strong { color: var(--sd-ink-900); font-weight: 500; }
.inv-pagehead__actions { display: flex; gap: 8px; align-items: center; }

/* ============================================================
   STAT-BAND TABS — clickable cards that act as the primary
   filter chips. Each card carries a count + meta. The active
   one is highlighted in primary blue.
   ============================================================ */
.inv-statband {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  background: #fff;
  border: 1px solid var(--sd-line-300);
  border-radius: var(--sd-radius-lg);
  box-shadow: var(--sd-shadow-sm);
  overflow: hidden;
  margin: 0 22px 14px 22px;
}
.inv-statband__cell {
  padding: 14px 18px;
  border-right: 1px solid var(--sd-line-100);
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  background: #fff;
  cursor: pointer;
  transition: background 150ms ease;
}
.inv-statband__cell:last-child { border-right: 0; }
.inv-statband__cell:hover { background: var(--sd-bg-soft); }
.inv-statband__cell.is-active {
  background: var(--sd-blue-050);
}
.inv-statband__cell.is-active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 3px;
  background: var(--sd-blue-600);
}
.inv-statband__caps {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--sd-ink-400);
  font-weight: 500;
}
.inv-statband__cell.is-active .inv-statband__caps { color: var(--sd-blue-700); }
.inv-statband__num {
  font-size: 26px;
  font-weight: 600;
  color: var(--sd-ink-900);
  letter-spacing: -.01em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.inv-statband__num--urgent { color: var(--sd-amber-text); }
.inv-statband__num--red    { color: var(--sd-red-600); }
.inv-statband__num--ok     { color: var(--sd-green-600); }
.inv-statband__cell.is-active .inv-statband__num { color: var(--sd-blue-700); }
.inv-statband__meta {
  font-size: 11.5px;
  color: var(--sd-ink-500);
  font-weight: 400;
}
.inv-statband__meta strong { color: var(--sd-ink-900); font-weight: 500; }
.inv-statband__cell.is-active .inv-statband__meta strong { color: var(--sd-blue-700); }
.inv-statband__breakdown {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--sd-ink-500);
}
.inv-statband__breakdown-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 3px;
}
.inv-statband__breakdown-dot.warn { background: var(--sd-amber-500); }
.inv-statband__breakdown-dot.err  { background: var(--sd-red-600); }
.inv-statband__breakdown-dot.ok   { background: var(--sd-green-600); }

/* (Legacy cell variants kept to avoid orphan styles; new tabs prefer is-active.) */
.inv-statband__cell--urgent {
  background: linear-gradient(to right, #FEF6E7 0%, #fff 60%);
}
.inv-statband__cell--ok {
  background: linear-gradient(to right, #EAF6EE 0%, #fff 60%);
}

/* ============================================================
   SHARED TOOLBAR — sits below the page head. Holds the mode
   toggle (Queue ⇄ Cockpit), date range, tabs and filters. This
   is the single place the operator changes the view's scope.
   ============================================================ */
.inv-toolbar {
  margin: 0 22px 12px 22px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 12px;
  background: #fff;
  border: 1px solid var(--sd-line-300);
  border-radius: var(--sd-radius-lg);
  box-shadow: var(--sd-shadow-sm);
}
.inv-toolbar__sep {
  width: 1px;
  height: 24px;
  background: var(--sd-line-200);
}
.inv-toolbar__spacer { flex: 1; }

/* Mode toggle — the hybrid switch. Big enough to be discoverable
   without dominating the toolbar. */
.inv-viewmode {
  display: inline-flex;
  background: var(--sd-bg-soft);
  border: 1px solid var(--sd-line-300);
  border-radius: var(--sd-radius-sm);
  padding: 2px;
  gap: 0;
}
.inv-viewmode__btn {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 6px 11px;
  border-radius: 3px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--sd-ink-500);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1;
}
.inv-viewmode__btn svg { width: 13px; height: 13px; }
.inv-viewmode__btn:not(.is-active):hover { color: var(--sd-ink-900); }
.inv-viewmode__btn.is-active {
  background: #fff;
  color: var(--sd-ink-900);
  box-shadow: var(--sd-shadow-sm), 0 0 0 1px var(--sd-line-200);
}
.inv-viewmode__btn.is-active svg { color: var(--sd-blue-600); }
.inv-viewmode__label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--sd-ink-400);
  font-weight: 600;
  margin-right: 4px;
}

/* Date range chip — opens a popover with presets in a real build. */
.inv-daterange {
  appearance: none;
  background: #fff;
  border: 1px solid var(--sd-line-300);
  border-radius: var(--sd-radius-sm);
  padding: 6px 12px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--sd-ink-900);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  line-height: 1;
  height: 32px;
}
.inv-daterange:hover { background: var(--sd-bg-soft); }
.inv-daterange svg { width: 13px; height: 13px; color: var(--sd-ink-500); }
.inv-daterange__caret { color: var(--sd-ink-400); margin-left: 4px; }
.inv-daterange__caret svg { width: 11px; height: 11px; }
.inv-daterange__preset {
  font-size: 10.5px;
  font-weight: 500;
  background: var(--sd-bg-soft);
  color: var(--sd-ink-700);
  padding: 1px 7px;
  border-radius: 3px;
  margin-left: 4px;
  border: 1px solid var(--sd-line-200);
}

/* Quick search input matched to the toolbar height */
.inv-toolbar__search {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--sd-line-300);
  border-radius: var(--sd-radius-sm);
  padding: 0 10px;
  height: 32px;
  min-width: 220px;
}
.inv-toolbar__search svg { width: 13px; height: 13px; color: var(--sd-ink-400); }
.inv-toolbar__search input {
  flex: 1; border: 0; outline: none; background: transparent;
  font-size: 12.5px; color: var(--sd-ink-900); font-family: inherit;
  min-width: 0;
}
.inv-toolbar__search input::placeholder { color: var(--sd-ink-300); }

/* Date-range popover preview — only shown on hover/focus in a real build;
   here we render the "open" state on Artboard A so the affordance reads.
   Anchored under the standard .list-toolbar__date pill. */
.inv-drpop {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 5;
  background: #fff;
  border: 1px solid var(--sd-line-300);
  border-radius: var(--sd-radius-md);
  box-shadow: 0 12px 24px rgba(15,23,38,.18);
  min-width: 240px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.inv-drpop__head {
  padding: 6px 10px 8px 10px;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 600;
  color: var(--sd-ink-400);
  border-bottom: 1px solid var(--sd-line-100);
  margin-bottom: 4px;
}
.inv-drpop__item {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 7px 10px;
  border-radius: var(--sd-radius-sm);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--sd-ink-800);
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.inv-drpop__item:hover { background: var(--sd-bg-soft); }
.inv-drpop__item.is-active {
  background: var(--sd-blue-100);
  color: var(--sd-blue-700);
}
.inv-drpop__item .inv-drpop__count {
  font-size: 11px;
  color: var(--sd-ink-400);
  font-variant-numeric: tabular-nums;
}
.inv-drpop__item.is-active .inv-drpop__count { color: var(--sd-blue-700); }
.inv-drpop__sep {
  height: 1px;
  background: var(--sd-line-100);
  margin: 4px 6px;
}
.inv-drpop__custom {
  padding: 8px 10px;
  border-top: 1px solid var(--sd-line-100);
  margin-top: 4px;
}
.inv-drpop__custom-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.inv-drpop__custom-row label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--sd-ink-400);
  font-weight: 600;
}
.inv-drpop__custom-row input {
  border: 1px solid var(--sd-line-300);
  border-radius: var(--sd-radius-sm);
  padding: 4px 7px;
  font-family: var(--sd-mono);
  font-size: 11px;
  color: var(--sd-ink-900);
  outline: none;
}

/* Pagination footer — sits below the queue (A) and below the cockpit list (B) */
.inv-pagination {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 22px;
  font-size: 12px;
  color: var(--sd-ink-500);
}
.inv-pagination__meta { font-variant-numeric: tabular-nums; }
.inv-pagination__meta strong { color: var(--sd-ink-900); font-weight: 600; }
.inv-pagination__spacer { flex: 1; }
.inv-pagination__pagesize {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.inv-pagination__pagesize select {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--sd-line-300);
  border-radius: var(--sd-radius-sm);
  padding: 4px 22px 4px 8px;
  font-family: inherit;
  font-size: 12px;
  color: var(--sd-ink-900);
  background: #fff url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237D7D7D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'/%3e%3c/svg%3e") no-repeat right 6px center / 10px;
  cursor: pointer;
}
.inv-pagination__nav {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.inv-pagination__pgbtn {
  appearance: none;
  background: #fff;
  border: 1px solid var(--sd-line-300);
  border-radius: var(--sd-radius-sm);
  width: 28px; height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--sd-ink-700);
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}
.inv-pagination__pgbtn:hover { background: var(--sd-bg-soft); color: var(--sd-ink-900); }
.inv-pagination__pgbtn:disabled {
  color: var(--sd-line-300);
  cursor: not-allowed;
  background: var(--sd-bg-softer);
}
.inv-pagination__pgbtn svg { width: 12px; height: 12px; }
.inv-pagination__page {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--sd-ink-700);
  padding: 0 6px;
}
.inv-pagination__page strong { color: var(--sd-ink-900); font-weight: 600; }

/* ============================================================
   AG-GRID RICH MODE
   Extends the existing .ag-shell / .ag-tbl shell with rich cell
   content: two-line stacks, pills, meters, action button groups.
   This is what makes the grid feel "designed" rather than spreadsheet.
   ============================================================ */
.inv-art .ag-shell {
  margin: 0 22px;
  border-radius: var(--sd-radius-lg);
}

.ag-tbl--rich {
  font-size: 12.5px;
}
.ag-tbl--rich thead th {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--sd-ink-500);
  padding: 10px 12px;
  white-space: nowrap;
  background: var(--sd-bg-soft);
  border-bottom: 1px solid var(--sd-line-300);
  position: sticky;
  top: 0;
  z-index: 1;
}
.ag-tbl--rich thead th .ag-th-content {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.ag-tbl--rich thead th .ag-th-content svg {
  width: 10px; height: 10px;
  color: var(--sd-ink-400);
}
.ag-tbl--rich thead th.num { text-align: right; }
.ag-tbl--rich thead th.num .ag-th-content { justify-content: flex-end; }

.ag-tbl--rich tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--sd-line-100);
  vertical-align: middle;
  background: #fff;
  position: relative;
  white-space: nowrap;
}
.ag-tbl--rich tbody tr { cursor: default; }
.ag-tbl--rich tbody tr:hover td { background: var(--sd-blue-050); }
.ag-tbl--rich tbody tr.is-selected td { background: #F4F8FC; }
.ag-tbl--rich tbody tr.is-selected:hover td { background: #E8F0F9; }

/* Urgency indicator — a 3px bar painted onto the first td */
.ag-tbl--rich tbody tr[data-urgency="urgent"] td:first-of-type {
  box-shadow: inset 3px 0 0 0 var(--sd-amber-500);
}
.ag-tbl--rich tbody tr[data-urgency="blocked"] td:first-of-type {
  box-shadow: inset 3px 0 0 0 var(--sd-red-600);
}
.ag-tbl--rich tbody tr[data-urgency="clean"] td:first-of-type {
  box-shadow: inset 3px 0 0 0 var(--sd-green-600);
}
.ag-tbl--rich tbody tr[data-urgency="done"] td {
  background: var(--sd-bg-softer);
  color: var(--sd-ink-500);
}
.ag-tbl--rich tbody tr[data-urgency="done"]:hover td { background: var(--sd-bg-softer); }

/* Cell content helpers */
.cell-stack {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.cell-mono {
  font-family: var(--sd-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--sd-ink-900);
  letter-spacing: -.005em;
}
.cell-strong {
  font-size: 13px;
  font-weight: 500;
  color: var(--sd-ink-900);
}
.cell-meta {
  font-size: 11px;
  color: var(--sd-ink-500);
  font-weight: 400;
}
.cell-meta--mono { font-family: var(--sd-mono); }
.cell-meta--warn { color: var(--sd-amber-text); font-weight: 500; }
.cell-meta--err  { color: var(--sd-red-600);  font-weight: 500; }
.cell-link {
  font-family: var(--sd-mono);
  font-size: 11.5px;
  color: var(--sd-blue-700);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.cell-num {
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: 600;
  color: var(--sd-ink-900);
}
.cell-num--big { font-size: 13.5px; }

/* In-cell action group — compact buttons that fit the row height */
.cell-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.cell-btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: var(--sd-radius-sm);
  padding: 5px 10px;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  line-height: 1;
  height: 26px;
}
.cell-btn svg { width: 11px; height: 11px; }
.cell-btn--primary {
  background: var(--sd-green-600);
  border-color: var(--sd-green-600);
  color: #fff;
}
.cell-btn--primary:hover { background: #2E7E50; border-color: #2E7E50; }
.cell-btn--resolve {
  background: var(--sd-red-100);
  border-color: #E1A6B3;
  color: #A8273F;
}
.cell-btn--resolve:hover { background: #f5d3da; }
.cell-btn--accept-tol {
  background: var(--sd-amber-100);
  border-color: #EBC07B;
  color: var(--sd-amber-text);
}
.cell-btn--accept-tol:hover { background: #fde2b3; }
.cell-btn--ghost-icon {
  background: transparent;
  border-color: var(--sd-line-300);
  color: var(--sd-ink-500);
  width: 26px; padding: 0;
  justify-content: center;
}
.cell-btn--ghost-icon:hover {
  background: var(--sd-bg-soft);
  color: var(--sd-ink-900);
}
.cell-btn[disabled] {
  opacity: .5;
  cursor: not-allowed;
}

/* Inline cell pill — smaller than the standalone pill, fits a single row */
.cell-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--sd-radius-pill);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.3;
  border: 1px solid transparent;
  white-space: nowrap;
}
.cell-pill__dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.cell-pill--ok      { background: var(--sd-green-100); color: #1F6A3F; border-color: #c4dfcf; }
.cell-pill--warn    { background: var(--sd-amber-100); color: var(--sd-amber-text); border-color: #EBC07B; }
.cell-pill--err     { background: var(--sd-red-100); color: #A8273F; border-color: #E1A6B3; }
.cell-pill--neutral { background: var(--sd-line-100); color: var(--sd-ink-700); border-color: var(--sd-line-300); }
.cell-pill--cool    { background: #EAF1F5; color: #225d83; border-color: #B7CEDF; }
.cell-pill svg { width: 10px; height: 10px; }

/* Column header — checkbox in the check column */
.ag-tbl--rich .check {
  width: 36px;
  padding-right: 0;
}
.ag-tbl--rich .check input { accent-color: var(--sd-blue-600); cursor: pointer; }

/* Match meter inside ag cell — slightly tighter */
.ag-tbl--rich .inv-meter { gap: 5px; }
.ag-tbl--rich .inv-meter__label { font-size: 10.5px; }

/* Cool ring — keep colour but slightly tighten for grid context */
.ag-tbl--rich .inv-cool { font-size: 10.5px; }

/* "Drag here to set row groups" — already styled in v12.css; we just
   tone down the height a touch in our scoped context for breathing room. */
.inv-art .ag-grouper { font-size: 11.5px; padding: 8px 14px; }

/* Side labels (Columns / Filters vertical strip) */
.inv-art .ag-side__label { font-size: 11px; }

/* ag-footer that holds pagination + count.
   In the queue we replace ag-footer with our richer inv-pagination,
   so re-style ag-footer to match. */
.inv-art .ag-footer {
  padding: 8px 16px;
  font-size: 12px;
}

/* Cockpit's left pane uses a compact ag-table variant.
   No grouper, no ag-side, smaller row height. */
.ag-tbl--compact thead th {
  padding: 8px 12px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--sd-ink-500);
  background: var(--sd-bg-softer);
  border-bottom: 1px solid var(--sd-line-200);
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  white-space: nowrap;
}
.ag-tbl--compact tbody td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--sd-line-100);
  vertical-align: middle;
  background: #fff;
  font-size: 12px;
}
.ag-tbl--compact tbody tr { cursor: pointer; }
.ag-tbl--compact tbody tr:hover td { background: var(--sd-blue-050); }
.ag-tbl--compact tbody tr.is-active td {
  background: #F4F8FC;
}
.ag-tbl--compact tbody tr.is-active td:first-of-type {
  box-shadow: inset 3px 0 0 0 var(--sd-blue-600);
}
.ag-tbl--compact tbody tr[data-urgency="urgent"] td:first-of-type {
  box-shadow: inset 3px 0 0 0 var(--sd-amber-500);
}
.ag-tbl--compact tbody tr[data-urgency="blocked"] td:first-of-type {
  box-shadow: inset 3px 0 0 0 var(--sd-red-600);
}
.ag-tbl--compact .ag-group-row td {
  background: var(--sd-bg-softer);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--sd-ink-500);
  padding: 6px 12px;
  cursor: default;
}
.ag-tbl--compact .ag-group-row:hover td { background: var(--sd-bg-softer); }
.ag-tbl--compact .ag-group-row .group-count {
  float: right;
  color: var(--sd-ink-400);
  font-family: var(--sd-mono);
}

/* Wrap the cockpit left-pane ag-shell to remove margins */
.inv-cockpit .ag-shell {
  margin: 0;
  border-radius: var(--sd-radius-lg);
  height: 100%;
}
.inv-cockpit .ag-shell .ag-scroll { max-height: none; }

/* ============================================================
   SMART SUGGESTION BANNER + INLINE EXCEPTION CAPTURE
   These sit between the 3-way match summary and the lines table
   in the cockpit preview, turning the "Capture exception" button
   from a navigation into an inline 2-keystroke flow.
   ============================================================ */
.inv-suggest {
  margin: 14px 18px 0 18px;
  background: linear-gradient(to right, var(--sd-blue-050) 0%, #fff 90%);
  border: 1px solid var(--sd-blue-100);
  border-left: 3px solid var(--sd-blue-600);
  border-radius: var(--sd-radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.inv-suggest__icon {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--sd-blue-600);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.inv-suggest__icon svg { width: 14px; height: 14px; }
.inv-suggest__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.inv-suggest__label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--sd-blue-700);
}
.inv-suggest__text {
  font-size: 13px;
  color: var(--sd-ink-900);
  font-weight: 500;
  line-height: 1.4;
}
.inv-suggest__text strong { font-weight: 600; }
.inv-suggest__text .num { font-variant-numeric: tabular-nums; font-family: var(--sd-mono); font-weight: 600; }
.inv-suggest__cta {
  appearance: none;
  background: var(--sd-blue-600);
  border: 1px solid var(--sd-blue-600);
  color: #fff;
  padding: 8px 14px;
  border-radius: var(--sd-radius-sm);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  line-height: 1;
}
.inv-suggest__cta:hover { background: var(--sd-blue-700); border-color: var(--sd-blue-700); }
.inv-suggest__cta svg { width: 12px; height: 12px; }
.inv-suggest__cta kbd {
  font-family: var(--sd-mono);
  font-size: 10px;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.32);
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 4px;
  letter-spacing: 0;
}

/* ─── Inline exception capture ─── */
.inv-except {
  margin: 12px 18px 0 18px;
  background: #fff;
  border: 1px solid var(--sd-line-300);
  border-radius: var(--sd-radius-md);
  overflow: hidden;
}
.inv-except__head {
  background: var(--sd-bg-softer);
  padding: 8px 12px;
  border-bottom: 1px solid var(--sd-line-200);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.inv-except__caps {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--sd-amber-text);
}
.inv-except__lines {
  font-size: 11.5px;
  color: var(--sd-ink-500);
  font-family: var(--sd-mono);
}
.inv-except__lines strong {
  color: var(--sd-ink-800);
  font-weight: 600;
}
.inv-except__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 12px;
  align-items: center;
}
.inv-except__chip {
  appearance: none;
  background: #fff;
  border: 1px solid var(--sd-line-300);
  border-radius: var(--sd-radius-sm);
  padding: 6px 11px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--sd-ink-800);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1;
}
.inv-except__chip:hover { background: var(--sd-bg-soft); border-color: var(--sd-ink-300); }
.inv-except__chip.is-active {
  background: var(--sd-amber-100);
  border-color: #EBC07B;
  color: var(--sd-amber-text);
}
.inv-except__chip.is-active::after {
  content: '✓';
  font-size: 11px;
  font-weight: 700;
  color: var(--sd-amber-text);
  margin-left: 2px;
}
.inv-except__chip-kbd {
  font-family: var(--sd-mono);
  font-size: 10px;
  background: var(--sd-line-100);
  color: var(--sd-ink-500);
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 2px;
  font-weight: 600;
}
.inv-except__chip.is-active .inv-except__chip-kbd {
  background: rgba(179,113,26,.15);
  color: var(--sd-amber-text);
}
.inv-except__chip-other {
  color: var(--sd-ink-500);
  font-style: italic;
}

/* Evidence required strip */
.inv-except__evidence {
  background: var(--sd-bg-soft);
  border-top: 1px solid var(--sd-line-100);
  padding: 9px 12px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.inv-except__evidence-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 600;
  color: var(--sd-ink-500);
}
.inv-except__evidence-items {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.inv-except__ev {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--sd-ink-700);
  font-weight: 500;
}
.inv-except__ev-icon {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--sd-line-100);
  border: 1px solid var(--sd-line-300);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.inv-except__ev-icon svg { width: 11px; height: 11px; color: var(--sd-ink-500); }
.inv-except__ev.is-pending .inv-except__ev-icon {
  background: var(--sd-red-100);
  border-color: #E1A6B3;
}
.inv-except__ev.is-pending .inv-except__ev-icon svg { color: var(--sd-red-600); }
.inv-except__ev.is-pending {
  color: var(--sd-red-600);
}
.inv-except__ev.is-done .inv-except__ev-icon {
  background: var(--sd-green-100);
  border-color: #c4dfcf;
}
.inv-except__ev.is-done .inv-except__ev-icon svg { color: var(--sd-green-600); }
.inv-except__ev-count {
  font-family: var(--sd-mono);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  color: var(--sd-ink-500);
}
.inv-except__ev.is-pending .inv-except__ev-count { color: var(--sd-red-600); font-weight: 600; }
.inv-except__add {
  appearance: none;
  background: var(--sd-blue-050);
  border: 1px dashed var(--sd-blue-100);
  color: var(--sd-blue-700);
  padding: 4px 10px;
  border-radius: var(--sd-radius-sm);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.inv-except__add:hover { background: var(--sd-blue-100); border-style: solid; }
.inv-except__add svg { width: 11px; height: 11px; }

/* ag-grouper drop zone — when an active grouping is applied, the
   placeholder "Drag here to set row groups" copy is replaced with a
   "Grouped by:" label + a removable chip for each grouped column. */
.ag-grouper__label {
  font-size: 11px;
  font-weight: 500;
  color: var(--sd-ink-500);
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-right: 4px;
}
.ag-grouper__chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fff;
  border: 1px solid var(--sd-line-300);
  border-radius: var(--sd-radius-sm);
  padding: 3px 4px 3px 9px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--sd-ink-800);
  font-family: var(--sd-font);
}
.ag-grouper__chip-icon { color: var(--sd-blue-600); display: inline-flex; }
.ag-grouper__chip-icon svg { width: 11px; height: 11px; }
.ag-grouper__chip-close {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 0;
  width: 16px;
  height: 16px;
  border-radius: var(--sd-radius-xs);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--sd-ink-400);
  font-size: 14px;
  line-height: 1;
}
.ag-grouper__chip-close:hover {
  background: var(--sd-line-100);
  color: var(--sd-ink-800);
}

/* Group header row in the rich ag-grid — spans the full table width,
   slightly tinted, with a twisty + summary stats inline. */
.ag-tbl--rich tbody tr.ag-group-row td {
  background: var(--sd-bg-soft);
  padding: 8px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--sd-line-200);
  border-top: 1px solid var(--sd-line-200);
}
.ag-tbl--rich tbody tr.ag-group-row:hover td { background: var(--sd-line-100); }
.ag-tbl--rich tbody tr.ag-group-row td:first-of-type {
  box-shadow: none !important;
}
.ag-group-content {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--sd-ink-800);
}
.ag-group-content__twist {
  color: var(--sd-ink-500);
  font-family: var(--sd-mono);
  width: 12px;
  flex-shrink: 0;
}
.ag-group-content__key {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--sd-ink-500);
}
.ag-group-content__value {
  font-size: 13px;
  font-weight: 600;
  color: var(--sd-ink-900);
}
.ag-group-content__sep {
  color: var(--sd-ink-300);
}
.ag-group-content__count {
  font-size: 11.5px;
  color: var(--sd-ink-500);
  font-variant-numeric: tabular-nums;
  font-family: var(--sd-mono);
}
.ag-group-content__total {
  margin-left: auto;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--sd-ink-900);
  font-variant-numeric: tabular-nums;
}
.ag-group-content__stats {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ag-group-content__stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--sd-ink-500);
}
.ag-group-content__stat-dot {
  width: 7px; height: 7px; border-radius: 50%;
}
.ag-group-content__stat-dot.ok    { background: var(--sd-green-600); }
.ag-group-content__stat-dot.warn  { background: var(--sd-amber-500); }
.ag-group-content__stat-dot.err   { background: var(--sd-red-600); }

/* When rows belong to a group, they're indented from the left to indicate
   they sit under the parent group row. The standard ag-grid pattern. */
.ag-tbl--rich tbody tr.ag-group-child td:first-of-type {
  padding-left: 28px;
}

/* ============================================================
   VIEW TABS — across both variations
   ============================================================ */
.inv-viewtabs {
  display: inline-flex;
  background: var(--sd-bg-soft);
  border: 1px solid var(--sd-line-200);
  border-radius: var(--sd-radius-sm);
  padding: 3px;
  gap: 2px;
}
.inv-viewtabs__btn {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 6px 12px;
  border-radius: 3px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--sd-ink-700);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1;
}
.inv-viewtabs__btn:not(.is-active):hover { background: #fff; color: var(--sd-ink-900); }
.inv-viewtabs__btn.is-active {
  background: #fff;
  color: var(--sd-ink-900);
  box-shadow: var(--sd-shadow-sm);
}
.inv-viewtabs__count {
  background: var(--sd-line-200);
  color: var(--sd-ink-700);
  padding: 1px 6px;
  border-radius: var(--sd-radius-pill);
  font-size: 10.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  min-width: 18px;
  text-align: center;
}
.inv-viewtabs__btn.is-active .inv-viewtabs__count {
  background: var(--sd-blue-100);
  color: var(--sd-blue-700);
}
.inv-viewtabs__btn--alert .inv-viewtabs__count {
  background: var(--sd-amber-100);
  color: var(--sd-amber-text);
}
.inv-viewtabs__btn--alert.is-active .inv-viewtabs__count {
  background: #F6A82C; color: #fff;
}

/* ============================================================
   FILTER STRIP — chips that sit above the queue
   ============================================================ */
.inv-filters {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 0 22px 12px 22px;
}
.inv-filters .inv-fchip {
  appearance: none;
  background: #fff;
  border: 1px solid var(--sd-line-300);
  border-radius: var(--sd-radius-pill);
  padding: 4px 11px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--sd-ink-700);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  line-height: 1.4;
}
.inv-filters .inv-fchip:hover { background: var(--sd-bg-soft); }
.inv-filters .inv-fchip svg { width: 11px; height: 11px; color: var(--sd-ink-400); }
.inv-filters .inv-fchip.is-active {
  background: var(--sd-blue-100);
  border-color: var(--sd-blue-600);
  color: var(--sd-blue-700);
}
.inv-filters .inv-fchip__count {
  background: var(--sd-line-200);
  color: var(--sd-ink-700);
  padding: 0 6px;
  border-radius: var(--sd-radius-pill);
  font-size: 10px;
  font-weight: 600;
}
.inv-filters .inv-fchip.is-active .inv-fchip__count { background: var(--sd-blue-600); color: #fff; }
.inv-filters .inv-fchip-sep {
  width: 1px; height: 16px; background: var(--sd-line-200); margin: 0 4px;
}

/* ============================================================
   VARIATION A — RECEIVE QUEUE
   Action cards stacked vertically. Each card has all the data
   needed to make the GRN call in one place.
   ============================================================ */
.inv-queue {
  padding: 0 22px 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.inv-row {
  background: #fff;
  border: 1px solid var(--sd-line-300);
  border-radius: var(--sd-radius-lg);
  box-shadow: var(--sd-shadow-sm);
  display: grid;
  grid-template-columns: 36px 1.4fr 1fr 1fr 1fr 1.1fr auto;
  gap: 0;
  align-items: stretch;
  overflow: hidden;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
  cursor: pointer;
}
.inv-row:hover {
  border-color: var(--sd-line-300);
  box-shadow: 0 4px 12px rgba(15,23,38,.06);
}
.inv-row--urgent { border-left: 3px solid var(--sd-amber-500); }
.inv-row--blocked { border-left: 3px solid var(--sd-red-600); }
.inv-row--clean { border-left: 3px solid var(--sd-green-600); }
.inv-row--done { opacity: .7; background: var(--sd-bg-softer); cursor: default; }

.inv-row__check {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 0;
  border-right: 1px solid var(--sd-line-100);
}
.inv-row__check input { accent-color: var(--sd-blue-600); cursor: pointer; }

.inv-row__cell {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  border-right: 1px solid var(--sd-line-100);
  justify-content: center;
}
.inv-row__cell:last-of-type { border-right: 0; }
.inv-row__caps {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--sd-ink-400);
  font-weight: 500;
}
.inv-row__primary {
  font-family: var(--sd-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--sd-ink-900);
  letter-spacing: -.005em;
}
.inv-row__secondary {
  font-size: 12px;
  color: var(--sd-ink-700);
  font-weight: 500;
}
.inv-row__ternary {
  font-size: 11px;
  color: var(--sd-ink-500);
  font-family: var(--sd-mono);
}
.inv-row__num {
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  font-weight: 600;
  color: var(--sd-ink-900);
}

/* Pills */
.inv-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: var(--sd-radius-pill);
  font-size: 11px;
  font-weight: 500;
  font-family: inherit;
  width: fit-content;
  white-space: nowrap;
}
.inv-pill svg { width: 11px; height: 11px; }
.inv-pill__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.inv-pill--ok { background: var(--sd-green-100); color: #1F6A3F; border: 1px solid #c4dfcf; }
.inv-pill--warn { background: var(--sd-amber-100); color: var(--sd-amber-text); border: 1px solid #EBC07B; }
.inv-pill--err { background: var(--sd-red-100); color: #A8273F; border: 1px solid #E1A6B3; }
.inv-pill--neutral { background: var(--sd-line-100); color: var(--sd-ink-700); border: 1px solid var(--sd-line-300); }
.inv-pill--cool { background: #EAF1F5; color: #225d83; border: 1px solid #B7CEDF; }

/* Match meter — visual at-a-glance 3-way match indicator */
.inv-meter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.inv-meter__rail {
  display: inline-flex;
  gap: 2px;
  align-items: center;
}
.inv-meter__seg {
  width: 14px; height: 6px;
  border-radius: 2px;
  background: var(--sd-line-200);
}
.inv-meter__seg.on--ok { background: var(--sd-green-600); }
.inv-meter__seg.on--warn { background: var(--sd-amber-500); }
.inv-meter__seg.on--err { background: var(--sd-red-600); }
.inv-meter__label {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--sd-ink-700);
}

/* Action column */
.inv-row__actions {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: center;
  align-items: stretch;
  background: var(--sd-bg-softer);
  border-left: 1px solid var(--sd-line-200);
  min-width: 200px;
}
.inv-act {
  appearance: none;
  border: 1px solid transparent;
  border-radius: var(--sd-radius-sm);
  padding: 7px 12px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  line-height: 1;
}
.inv-act svg { width: 12px; height: 12px; }
.inv-act--primary {
  background: var(--sd-green-600);
  border-color: var(--sd-green-600);
  color: #fff;
}
.inv-act--primary:hover { background: #2E7E50; border-color: #2E7E50; }
.inv-act--exception {
  background: #fff;
  border-color: var(--sd-line-300);
  color: var(--sd-ink-700);
}
.inv-act--exception:hover { background: var(--sd-bg-soft); color: var(--sd-ink-900); }
.inv-act--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--sd-ink-500);
  font-size: 11.5px;
  padding: 4px 8px;
}
.inv-act--ghost:hover { color: var(--sd-ink-900); background: var(--sd-line-100); }

/* Cool-off countdown — a tiny inline timer ring with text */
.inv-cool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--sd-amber-text);
  font-weight: 500;
}
.inv-cool__ring {
  width: 14px; height: 14px;
  position: relative;
}
.inv-cool__ring svg { width: 14px; height: 14px; transform: rotate(-90deg); }
.inv-cool__ring circle.track { stroke: #EBC07B; stroke-width: 2; fill: transparent; }
.inv-cool__ring circle.fill { stroke: var(--sd-amber-500); stroke-width: 2; fill: transparent; stroke-linecap: round; }

/* Done-row affordance */
.inv-row--done .inv-row__actions { background: transparent; border-left: 0; }
.inv-row--done .inv-act { display: none; }
.inv-row--done .inv-row__actions::after {
  content: 'Done';
  font-size: 11px; color: var(--sd-ink-400); font-weight: 500;
  text-transform: uppercase; letter-spacing: .07em;
  display: flex; align-items: center; justify-content: flex-end;
  width: 100%;
}

/* Sticky bulk-action bar — appears when rows are selected */
.inv-bulkbar {
  position: sticky;
  bottom: 0;
  background: #0F1726;
  color: #fff;
  border-radius: var(--sd-radius-lg);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 12px 28px rgba(15,23,38,.25);
  margin: 12px 22px 0 22px;
}
.inv-bulkbar__count { font-weight: 600; font-size: 13px; }
.inv-bulkbar__count strong { color: #fff; }
.inv-bulkbar__spacer { flex: 1; }
.inv-bulkbar__btn {
  appearance: none;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.18);
  color: #fff;
  padding: 6px 12px;
  border-radius: var(--sd-radius-sm);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.inv-bulkbar__btn:hover { background: rgba(255,255,255,.18); }
.inv-bulkbar__btn--primary {
  background: var(--sd-green-600);
  border-color: var(--sd-green-600);
}
.inv-bulkbar__btn--primary:hover { background: #2E7E50; border-color: #2E7E50; }
.inv-bulkbar__btn svg { width: 13px; height: 13px; }

/* ============================================================
   VARIATION B — RECEIVE COCKPIT
   Split-pane triage. Left = compact list, right = preview pane.
   ============================================================ */
.inv-cockpit {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 14px;
  padding: 0 22px 22px 22px;
  flex: 1;
  min-height: 0;
}

.inv-cklist {
  background: #fff;
  border: 1px solid var(--sd-line-300);
  border-radius: var(--sd-radius-lg);
  box-shadow: var(--sd-shadow-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}
.inv-cklist__head {
  padding: 10px 12px;
  border-bottom: 1px solid var(--sd-line-200);
  background: var(--sd-bg-softer);
  display: flex;
  align-items: center;
  gap: 8px;
}
.inv-cklist__search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid var(--sd-line-300);
  border-radius: var(--sd-radius-sm);
  padding: 0 8px;
  height: 28px;
}
.inv-cklist__search svg { width: 12px; height: 12px; color: var(--sd-ink-400); }
.inv-cklist__search input {
  flex: 1; border: 0; outline: none;
  background: transparent; font-size: 12px; font-family: inherit;
  min-width: 0;
}
.inv-cklist__sort {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 4px 8px;
  border-radius: var(--sd-radius-sm);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--sd-ink-500);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.inv-cklist__sort:hover { background: var(--sd-line-100); color: var(--sd-ink-900); }
.inv-cklist__sort svg { width: 10px; height: 10px; }

.inv-cklist__items {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.inv-cklist__divider {
  padding: 6px 14px;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--sd-ink-400);
  background: var(--sd-bg-softer);
  border-bottom: 1px solid var(--sd-line-100);
  border-top: 1px solid var(--sd-line-100);
  display: flex;
  align-items: center;
  gap: 8px;
}
.inv-cklist__divider strong { color: var(--sd-ink-700); font-weight: 600; }
.inv-ckitem {
  padding: 10px 14px;
  border-bottom: 1px solid var(--sd-line-100);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 8px;
  cursor: pointer;
  position: relative;
}
.inv-ckitem:last-child { border-bottom: 0; }
.inv-ckitem:hover { background: var(--sd-blue-050); }
.inv-ckitem.is-active {
  background: #F4F8FC;
  border-left: 3px solid var(--sd-blue-600);
  padding-left: 11px;
}
.inv-ckitem.is-active::before { display: none; }
.inv-ckitem__line1 {
  font-family: var(--sd-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--sd-ink-900);
  letter-spacing: -.005em;
  grid-column: 1;
}
.inv-ckitem__total {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--sd-ink-900);
  font-variant-numeric: tabular-nums;
  grid-column: 2;
  text-align: right;
}
.inv-ckitem__line2 {
  font-size: 11.5px;
  color: var(--sd-ink-500);
  grid-column: 1;
}
.inv-ckitem__line2 strong { color: var(--sd-ink-700); font-weight: 500; }
.inv-ckitem__pill {
  grid-column: 2;
  text-align: right;
  display: flex;
  justify-content: flex-end;
}
.inv-ckitem__meta {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 10.5px;
  color: var(--sd-ink-500);
  margin-top: 2px;
}
.inv-ckitem__meta .sep { color: var(--sd-ink-300); }
.inv-ckitem__kbd {
  position: absolute;
  top: 50%; right: 12px;
  transform: translateY(-50%);
  display: none;
  font-family: var(--sd-mono);
  font-size: 9.5px;
  background: rgba(7,98,173,.12);
  color: var(--sd-blue-700);
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 600;
}
.inv-ckitem.is-active .inv-ckitem__kbd { display: inline-block; }
.inv-ckitem.is-active .inv-ckitem__pill { display: none; }

.inv-cklist__foot {
  padding: 8px 12px;
  border-top: 1px solid var(--sd-line-200);
  background: var(--sd-bg-softer);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--sd-ink-500);
}
.inv-cklist__foot kbd {
  font-family: var(--sd-mono);
  font-size: 10px;
  background: #fff;
  border: 1px solid var(--sd-line-300);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--sd-ink-700);
  font-weight: 500;
}

/* Preview pane */
.inv-ckpreview {
  background: #fff;
  border: 1px solid var(--sd-line-300);
  border-radius: var(--sd-radius-lg);
  box-shadow: var(--sd-shadow-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}
.inv-ckp__head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--sd-line-200);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.inv-ckp__title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.inv-ckp__inv {
  font-family: var(--sd-mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--sd-ink-900);
  letter-spacing: -.005em;
}
.inv-ckp__sub {
  font-size: 12px;
  color: var(--sd-ink-500);
  margin-top: 4px;
}
.inv-ckp__sub strong { color: var(--sd-ink-900); font-weight: 500; }
.inv-ckp__head-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}
.inv-ckp__iconbtn {
  appearance: none;
  background: transparent;
  border: 1px solid var(--sd-line-300);
  width: 30px; height: 30px;
  border-radius: var(--sd-radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--sd-ink-500);
  cursor: pointer;
  padding: 0;
}
.inv-ckp__iconbtn:hover { background: var(--sd-bg-soft); color: var(--sd-ink-900); }
.inv-ckp__iconbtn svg { width: 13px; height: 13px; }

/* Cool-off banner — at top of preview when invoice has a counting cool-off */
.inv-ckp__coolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 18px;
  background: linear-gradient(to right, #FEF6E7, #FDFCF7 70%);
  border-bottom: 1px solid #EBC07B;
  font-size: 12px;
  color: var(--sd-amber-text);
  font-weight: 500;
}
.inv-ckp__coolbar svg { width: 13px; height: 13px; flex-shrink: 0; }
.inv-ckp__coolbar strong { color: #7A4E12; font-weight: 600; }
.inv-ckp__coolbar .sep { margin: 0 4px; color: #C29554; }
.inv-ckp__coolbar .inv-ckp__coolprog {
  flex: 1;
  height: 4px;
  background: rgba(246,168,44,.25);
  border-radius: 999px;
  overflow: hidden;
  max-width: 240px;
}
.inv-ckp__coolprog-fill {
  height: 100%;
  background: var(--sd-amber-500);
  border-radius: 999px;
}

/* PO context strip — three little party cards under the header */
.inv-ckp__context {
  padding: 12px 18px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  border-bottom: 1px solid var(--sd-line-100);
  background: var(--sd-bg-softer);
}
.inv-ckp__ctxcell { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.inv-ckp__ctxcaps {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--sd-ink-400);
  font-weight: 500;
}
.inv-ckp__ctxval {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--sd-ink-900);
}
.inv-ckp__ctxsub {
  font-size: 11px;
  color: var(--sd-ink-500);
  font-family: var(--sd-mono);
}

/* 3-way match summary widget */
.inv-3way {
  padding: 14px 18px;
  border-bottom: 1px solid var(--sd-line-100);
}
.inv-3way__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.inv-3way__title {
  font-size: 11px;
  font-weight: 600;
  color: var(--sd-ink-500);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.inv-3way__verdict {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--sd-radius-pill);
  font-size: 11.5px;
  font-weight: 600;
  background: var(--sd-green-100);
  color: #1F6A3F;
  border: 1px solid #c4dfcf;
}
.inv-3way__verdict svg { width: 12px; height: 12px; }
.inv-3way__verdict--warn { background: var(--sd-amber-100); color: var(--sd-amber-text); border-color: #EBC07B; }
.inv-3way__verdict--err { background: var(--sd-red-100); color: #A8273F; border-color: #E1A6B3; }
.inv-3way__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid var(--sd-line-200);
  border-radius: var(--sd-radius-sm);
  overflow: hidden;
}
.inv-3way__col {
  padding: 10px 12px;
  border-right: 1px solid var(--sd-line-100);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.inv-3way__col:last-child { border-right: 0; }
.inv-3way__collabel {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--sd-ink-400);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.inv-3way__collabel .inv-3way__dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--sd-green-600);
}
.inv-3way__col--warn .inv-3way__dot { background: var(--sd-amber-500); }
.inv-3way__col--err .inv-3way__dot { background: var(--sd-red-600); }
.inv-3way__colmeta {
  font-size: 11px;
  color: var(--sd-ink-500);
  font-family: var(--sd-mono);
}
.inv-3way__colval {
  font-size: 14px;
  font-weight: 600;
  color: var(--sd-ink-900);
  font-variant-numeric: tabular-nums;
}
.inv-3way__coldelta {
  font-size: 11px;
  font-weight: 500;
  margin-top: 2px;
}
.inv-3way__coldelta--ok { color: var(--sd-green-600); }
.inv-3way__coldelta--warn { color: var(--sd-amber-text); }
.inv-3way__coldelta--err { color: #A8273F; }

/* Mini line items table */
.inv-ckp__lines {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}
.inv-linestbl {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}
.inv-linestbl thead th {
  background: var(--sd-bg-softer);
  border-bottom: 1px solid var(--sd-line-200);
  padding: 8px 12px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--sd-ink-500);
  text-align: left;
  position: sticky;
  top: 0;
}
.inv-linestbl thead th.num { text-align: right; }
.inv-linestbl tbody td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--sd-line-100);
  vertical-align: middle;
}
.inv-linestbl tbody td.num { text-align: right; font-variant-numeric: tabular-nums; }
.inv-linestbl tbody tr.has-diff { background: #FDF6E7; }
.inv-linestbl .part-chip {
  font-family: var(--sd-mono);
  font-size: 11px;
  font-weight: 500;
  background: var(--sd-bg-soft);
  border: 1px solid var(--sd-line-200);
  padding: 1px 6px;
  border-radius: 3px;
  color: var(--sd-ink-800);
}
.inv-linestbl .diff-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--sd-amber-text);
  margin-left: 6px;
}

/* Preview footer with the dominant CTAs */
.inv-ckp__foot {
  padding: 14px 18px;
  border-top: 1px solid var(--sd-line-200);
  background: var(--sd-bg-softer);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.inv-ckp__foot-meta {
  font-size: 12px;
  color: var(--sd-ink-500);
}
.inv-ckp__foot-meta strong {
  color: var(--sd-ink-900); font-weight: 600;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.inv-ckp__foot-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}
.inv-ckp__btn {
  appearance: none;
  border: 1px solid transparent;
  padding: 9px 16px;
  border-radius: var(--sd-radius-sm);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.inv-ckp__btn svg { width: 13px; height: 13px; }
.inv-ckp__btn--primary {
  background: var(--sd-green-600);
  border-color: var(--sd-green-600);
  color: #fff;
  padding: 9px 18px;
  font-weight: 500;
}
.inv-ckp__btn--primary:hover { background: #2E7E50; border-color: #2E7E50; }
.inv-ckp__btn--ghost {
  background: #fff;
  border-color: var(--sd-line-300);
  color: var(--sd-ink-700);
}
.inv-ckp__btn--ghost:hover { background: var(--sd-bg-soft); color: var(--sd-ink-900); }
.inv-ckp__btn--danger {
  background: #fff;
  border-color: var(--sd-line-300);
  color: var(--sd-red-600);
}
.inv-ckp__btn--danger:hover { background: var(--sd-red-100); border-color: #E1A6B3; }
.inv-ckp__kbd-hint {
  font-size: 10.5px;
  color: var(--sd-ink-400);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.inv-ckp__kbd-hint kbd {
  font-family: var(--sd-mono);
  font-size: 10px;
  background: #fff;
  border: 1px solid var(--sd-line-300);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--sd-ink-700);
  font-weight: 500;
}

/* The cockpit page uses a tight top bar without the stat band so the
   list + preview own the visual weight. */
.inv-ckp-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px 8px 22px;
  gap: 16px;
  flex-wrap: wrap;
}
.inv-ckp-topbar .inv-pagehead__title { font-size: 18px; }
.inv-ckp-topbar .inv-pagehead__sub { font-size: 11.5px; }

/* ============================================================
   Variation eyebrow — small label inside the artboard so when
   the cards are zoomed-in you still remember which one you're
   looking at.
   ============================================================ */
.inv-eyebrow {
  position: absolute;
  top: 10px; left: 14px;
  z-index: 5;
  font-family: var(--sd-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: rgba(15,23,38,.85);
  color: #fff;
  padding: 3px 9px;
  border-radius: var(--sd-radius-pill);
  pointer-events: none;
}
.inv-eyebrow__dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--sd-amber-500);
  margin-right: 6px;
  vertical-align: middle;
}
.inv-eyebrow--b .inv-eyebrow__dot { background: var(--sd-teal-600); }

/* Hide the screen-picker prototype strip on this page; the canvas IS
   the picker for these two concepts. */
.inv-art .screen-picker { display: none !important; }
