/* Trial balance (§6.9).
 *
 * Grid VERBATIM from the export's `rowStyle`, all nine tracks:
 *
 *   270px 108px 108px 104px 104px 112px 112px 104px 92px   = 1114px
 *   Acct  UnDr  UnCr  Prop  Appr  AdjDr AdjCr Prior Review
 *
 * Track widths, the 16px inline padding and the 10px/12px block padding are the
 * export's own numbers, not estimates. The cells carry NO padding of their own:
 * in the export the gap between two figures is the difference between the track
 * width and the number in it, so adding cell padding narrows every column by
 * that amount and the table stops matching the design.
 *
 * 1114px exceeds the content column well before the 1200px breakpoint, so it
 * scrolls inside its card rather than stretching the shell.
 */

.tb__head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 14px; }
.tb__head-ident { flex: 1; min-width: 0; }
.tb__title {
  font-family: var(--font-display);
  font-size: 20px; font-weight: 600; letter-spacing: -0.02em; margin: 0;
}
.tb__sub { font-size: 12.5px; color: var(--p-ink-2); margin: 3px 0 0; }
/* Provenance, not a heading: the moment the upstream half was read. Quieter
   than the period it sits under, because it qualifies that period rather than
   competing with it. */
.tb__asof { font-size: 11.5px; color: var(--p-ink-3); margin: 2px 0 0; }

.tb__export {
  display: inline-flex; align-items: center; gap: 7px; flex: none;
  background: var(--p-surface); border: 1px solid var(--p-line-2);
  border-radius: var(--radius-pill); padding: 9px 13px;
  font-family: inherit; font-size: 12.5px; font-weight: 500; color: var(--p-ink);
  cursor: pointer;
}

.tb__table { min-width: 1114px; }
.tb__thead, .tb__row {
  display: grid;
  grid-template-columns: 270px 108px 108px 104px 104px 112px 112px 104px 92px;
  align-items: center; width: 100%; text-align: start;
}
.tb__thead {
  padding: 10px 16px; background: var(--p-surface-2);
  border-bottom: 1px solid var(--p-line);
  font-size: 10px; font-weight: 600; letter-spacing: 0.5px;
  text-transform: uppercase; color: var(--p-ink-3);
}
/* The seven figure headings are end-aligned over their figures. Account and
   Review are NOT — both are start-aligned in the export, and right-aligning
   Review is what makes it collide with "Prior year" in the deployed build. */
.tb__thead > span:nth-child(n + 2):nth-child(-n + 8) { text-align: end; }

/* A row is a button now — it drills into the account's ledger. Reset the
   control back to a table row: the affordance is the hover and the focus ring,
   not a button's own chrome. */
.tb__row {
  padding: 10px 16px; border-bottom: 1px solid var(--p-line);
  background: transparent; border-inline: none; border-top: none;
  font: inherit; color: inherit; cursor: pointer;
}
.tb__row:hover { background: var(--p-surface-2); }
.tb__row:focus-visible {
  outline: 2px solid var(--p-brand); outline-offset: -2px;
}

.tb__account { display: flex; align-items: center; gap: 9px; min-width: 0; }
.tb__code { font-size: 11px; color: var(--p-ink-3); width: 36px; flex: none; }
.tb__name {
  font-size: 12.5px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* No cell padding — see the header. The export's gap is the track width. */
.tb__num { text-align: end; font-size: 12px; }
.tb__num--proposed { color: var(--p-audit); }
.tb__num--approved { color: var(--p-ok); }
.tb__num--adjusted { font-weight: 500; }
.tb__num--prior { color: var(--p-ink-2); }

/* Review is the export's ninth track: start-aligned, and a chip rather than a
   bare word so a state is never carried by colour alone. */
.tb__review { display: flex; align-items: center; }
.tb__review-absent { font-size: 12px; color: var(--p-ink-3); }

/* ---- Totals. The row the whole screen exists to produce. ---- */
.tb__row--totals {
  padding: 12px 16px; background: var(--p-surface-2);
  border-top: 1px solid var(--p-line-2); border-bottom: none;
  cursor: default;
}
.tb__row--totals:hover { background: var(--p-surface-2); }
.tb__totals-label { font-size: 12.5px; font-weight: 700; }
.tb__row--totals .tb__num { font-size: 12.5px; font-weight: 700; }
/* The comparative total is context, not a figure being signed off. */
.tb__row--totals .tb__num--prior { font-weight: 400; color: var(--p-ink-2); }
/* The verdict sits in the export's ninth cell, start-aligned like Review. */
.tb__verdict-cell { display: flex; align-items: center; }
/* The adjustment columns are context, not the figure being signed off, so they
   stay at the row's weight rather than shouting alongside it. */
.tb__row--totals .tb__num--proposed,
.tb__row--totals .tb__num--approved { font-weight: 500; }

/* ---- The verdict. Its own line, so the amount cannot be clipped. ---- */
.tb__verdict {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 12px 0 0; font-size: 12.5px; line-height: 1.5;
}
.tb__verdict--ok { color: var(--p-ink-2); }
.tb__verdict--risk { color: var(--p-ink); }

/* ---- Notes: discrepancies to act on, and columns this route cannot fill. ---- */
.tb__notes { list-style: none; margin: 10px 0 0; padding: 0; }
.tb__note {
  font-size: 12px; line-height: 1.5; padding-inline-start: 12px;
  border-inline-start: 2px solid var(--p-line-2); margin-bottom: 6px;
}
.tb__note--risk { border-inline-start-color: var(--p-risk); color: var(--p-ink); }
.tb__note--warn { border-inline-start-color: var(--p-warn); color: var(--p-ink-2); }
/* A stated absence is not a warning — nothing is wrong, the column simply is
   not computed. Toned down so it cannot be mistaken for a discrepancy. */
.tb__note--quiet { color: var(--p-ink-3); }

/* ---- The account ledger drawer ---------------------------------------- */

.drawer--ledger .drawer__title { display: flex; align-items: baseline; gap: 9px; }
.algr__title-code { font-size: 12px; color: var(--p-ink-3); flex: none; }

.algr__content { min-height: 80px; }

.algr__table { width: 100%; }
.algr__head-row, .algr__row {
  display: grid;
  grid-template-columns: 82px 1fr 96px 104px 104px;
  align-items: baseline; gap: 8px; width: 100%; text-align: start;
}
.algr__head-row {
  padding-bottom: 8px; border-bottom: 1px solid var(--p-line);
  font-size: 10px; font-weight: 600; letter-spacing: 0.5px;
  text-transform: uppercase; color: var(--p-ink-3);
}
.algr__head-row > span:nth-child(n + 4) { text-align: end; }

.algr__row { padding: 9px 0; border-bottom: 1px solid var(--p-line); }
.algr__date { font-size: 11.5px; color: var(--p-ink-2); }
.algr__desc { font-size: 12.5px; min-width: 0; }
/* Most lines have none — measured 10 of 76 on a live account. An absence, not
   an empty cell that would read as a line with nothing to say for itself. */
.algr__desc--absent { color: var(--p-ink-3); font-style: italic; }
.algr__journal {
  display: block; font-size: 10.5px; color: var(--p-ink-3); margin-top: 1px;
}
.algr__branch { font-size: 11.5px; color: var(--p-ink-2); }
.algr__num { text-align: end; font-size: 12px; }

.algr__row--total {
  border-bottom: none; border-top: 1px solid var(--p-line-2);
  padding-top: 10px; font-weight: 700;
}
.algr__total-label { font-size: 12px; font-weight: 700; }

.algr__empty { font-size: 12.5px; color: var(--p-ink-2); margin: 0; }
.algr__notes { list-style: none; margin: 12px 0 0; padding: 0; }
