/* Customer Credits follows the exported Stitch liability-register composition.
   All workspace rules are scoped to this route; the portaled drawer is scoped
   by its explicit owner class below. */
.tv-stitch-customer-credits .customer-credit-workbench {
  --credit-navy: var(--tv-text, #122c46);
  --credit-blue: var(--tv-brand, #0a67b2);
  --credit-muted: var(--tv-text-muted, #4d6178);
  --credit-line: var(--tv-border, #c7d4e2);
  --credit-wash: var(--tv-surface-muted, #f3f7fb);
  display: grid;
  gap: 16px;
  min-width: 0;
  max-width: 1680px;
  margin-inline: auto;
  color: var(--credit-navy);
}
.tv-stitch-customer-credits .customer-credit-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border: 1px solid var(--credit-line);
  border-radius: 12px;
  background: #fff;
}
.tv-stitch-customer-credits .customer-credit-context-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}
.tv-stitch-customer-credits .customer-credit-context-copy .context-label {
  color: var(--credit-blue);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .11em;
}
.tv-stitch-customer-credits .customer-credit-context-copy .context-muted {
  color: var(--credit-muted);
  font-size: 13px;
  line-height: 1.45;
}
.tv-stitch-customer-credits .customer-credit-context-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.tv-stitch-customer-credits .customer-credit-context-actions .btn {
  min-height: 40px;
  white-space: nowrap;
}
.tv-stitch-customer-credits .customer-credit-currency-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 450px), 1fr));
  gap: 12px;
  min-width: 0;
}
.tv-stitch-customer-credits .customer-credit-currency-card {
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--credit-line);
  border-radius: 12px;
  background: #fff;
}
.tv-stitch-customer-credits .customer-credit-currency-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--credit-line);
}
.tv-stitch-customer-credits .customer-credit-currency-heading strong {
  color: var(--credit-navy);
  font-size: 13px;
  letter-spacing: .04em;
}
.tv-stitch-customer-credits .customer-credit-currency-heading span {
  color: var(--credit-muted);
  font-size: 11px;
}
.tv-stitch-customer-credits .customer-credit-currency-values {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding-top: 10px;
}
.tv-stitch-customer-credits .customer-credit-currency-values .customer-credit-info {
  display: grid;
  align-content: start;
  gap: 5px;
  min-width: 0;
  border: 0;
}
.tv-stitch-customer-credits .customer-credit-currency-values .customer-credit-info > span {
  color: var(--credit-muted);
  font-size: 10px;
  line-height: 1.3;
}
.tv-stitch-customer-credits .customer-credit-currency-values .customer-credit-info > strong {
  color: var(--credit-navy);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.tv-stitch-customer-credits .customer-credit-trust {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--credit-line);
  border-radius: 12px;
  background: #fff;
}
.tv-stitch-customer-credits .customer-credit-trust .customer-credit-info {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 14px 16px;
  border-right: 1px solid var(--credit-line);
}
.tv-stitch-customer-credits .customer-credit-trust .customer-credit-info:last-child { border-right: 0; }
.tv-stitch-customer-credits .customer-credit-trust .customer-credit-info > span {
  color: var(--credit-muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.tv-stitch-customer-credits .customer-credit-trust .customer-credit-info > strong {
  color: var(--credit-navy);
  font-size: 21px;
  font-variant-numeric: tabular-nums;
}
.tv-stitch-customer-credits .customer-credit-filters {
  display: grid;
  grid-template-columns: minmax(240px, 2fr) repeat(2, minmax(145px, 1fr)) auto auto;
  align-items: end;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--credit-line);
  border-radius: 12px;
  background: var(--credit-wash);
}
.tv-stitch-customer-credits .customer-credit-filters .field {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--credit-muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.tv-stitch-customer-credits .customer-credit-filters :is(input, select) {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  border: 1px solid var(--credit-line);
  border-radius: 7px;
  background: #fff;
  color: var(--credit-navy);
  font-size: 13px;
  letter-spacing: normal;
  text-transform: none;
}
.tv-stitch-customer-credits .customer-credit-filters .btn { min-height: 40px; white-space: nowrap; }
.tv-stitch-customer-credits .customer-credit-register {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--credit-line);
  border-radius: 12px;
  background: #fff;
}
.tv-stitch-customer-credits .customer-credit-table-scroll {
  max-width: 100%;
  overflow: auto;
  overscroll-behavior-inline: contain;
  scrollbar-gutter: stable;
}
.tv-stitch-customer-credits .customer-credit-table-scroll:focus-visible {
  outline: 3px solid var(--tv-brief-focus, #0a67b2);
  outline-offset: -3px;
}
.tv-stitch-customer-credits .customer-credit-table-scroll table { min-width: 1120px; }
.tv-stitch-customer-credits .customer-credit-table-scroll :is(th, td) {
  padding: 11px 12px;
  border-bottom: 1px solid var(--credit-line);
  vertical-align: middle;
}
.tv-stitch-customer-credits .customer-credit-table-scroll th {
  background: var(--credit-wash);
  color: var(--credit-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .055em;
  text-transform: uppercase;
}
.tv-stitch-customer-credits .customer-credit-table-scroll td {
  color: var(--credit-navy);
  font-size: 12px;
  line-height: 1.4;
}
.tv-stitch-customer-credits .customer-credit-table-scroll td:nth-last-child(-n+3) {
  font-variant-numeric: tabular-nums;
}
.tv-stitch-customer-credits :is(button, input, select, a):focus-visible {
  outline: 3px solid var(--tv-brief-focus, #0a67b2);
  outline-offset: 2px;
}
.customer-credit-drawer .customer-credit-detail {
  display: grid;
  gap: 14px;
  padding: 16px;
  background: var(--tv-surface-muted, #f3f7fb);
}
.customer-credit-drawer .customer-credit-panel {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--credit-line);
  border-radius: 10px;
  background: #fff;
}
.customer-credit-drawer .customer-credit-command {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--credit-line);
  border-radius: 10px;
  background: #fff;
}
.customer-credit-drawer .customer-credit-info {
  overflow-wrap: anywhere;
}
.customer-credit-drawer .customer-credit-info strong {
  font-variant-numeric: tabular-nums;
}
@media (max-width: 980px) {
  .tv-stitch-customer-credits .customer-credit-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .tv-stitch-customer-credits .customer-credit-filters .field:first-child { grid-column: 1 / -1; }
  .tv-stitch-customer-credits .customer-credit-currency-values { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .tv-stitch-customer-credits .customer-credit-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .tv-stitch-customer-credits .customer-credit-context-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
  .tv-stitch-customer-credits .customer-credit-context-actions .btn { width: 100%; }
  .tv-stitch-customer-credits .customer-credit-trust { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tv-stitch-customer-credits .customer-credit-trust .customer-credit-info:nth-child(2) { border-right: 0; }
  .tv-stitch-customer-credits .customer-credit-trust .customer-credit-info:nth-child(-n+2) { border-bottom: 1px solid var(--credit-line); }
  .tv-stitch-customer-credits .customer-credit-filters { grid-template-columns: 1fr; }
  .tv-stitch-customer-credits .customer-credit-filters .field:first-child { grid-column: auto; }
  .tv-stitch-customer-credits .customer-credit-filters > .btn { width: 100%; }
}
