/* ── Registers (Ui::RegisterComponent), from the mock-ups' table.reg ──────────
   Tabs with counts, a filter bar on history tabs, 44px rows; under 560px the
   rows stack into labelled cards (td[data-l]). */
.register { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s4); min-width: 0; }
.reg-head { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s3); }
.reg-actions { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s2); }
/* Tabs wider than a phone scroll inside the head rather than widen the page. */
.reg-head .seg { overflow-x: auto; scrollbar-width: thin; }
.seg a { display: inline-flex; align-items: center; padding: 0 var(--s3); border-left: 1px solid var(--edge); color: var(--ink-3); font: 500 var(--t13) var(--body); white-space: nowrap; text-decoration: none; }
.seg a:first-child { border-left: 0; }
.seg a.on { background: var(--rail); color: var(--ink); }
.seg a:hover { color: var(--ink); }

.filters { display: flex; flex-wrap: wrap; align-items: end; gap: var(--s3); }
.fl { display: grid; gap: var(--s1); margin: 0; font-size: var(--t12); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.fl > input, .fl > select {
  height: var(--ctl); width: 150px; max-width: 100%; min-width: 0; padding: 0 var(--s3);
  background: var(--well); color: var(--ink); border: 1px solid var(--edge-2); border-radius: var(--r);
  font: var(--t14) var(--body); text-transform: none; letter-spacing: 0;
}
.filters .btn-shell { height: var(--ctl); text-decoration: none; }
/* A type-ahead filter (a party) reads as the bar's other fields. */
.fl .gate-cell-typeahead { min-width: 0; }
.fl .typeahead > input[type=text] {
  height: var(--ctl); width: 190px; max-width: 100%; min-width: 0; padding: 0 var(--s3);
  background: var(--well); color: var(--ink); border: 1px solid var(--edge-2); border-radius: var(--r);
  font: var(--t14) var(--body); text-transform: none; letter-spacing: 0;
}
.fl .typeahead-list { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--ink); }

.panel { background: var(--panel); border: 1px solid var(--edge); border-radius: var(--r); min-width: 0; }
.panel .pager { border-top: 1px solid var(--edge); }
.tbl { overflow-x: auto; }
table.reg { width: 100%; border-collapse: collapse; font-size: var(--t13); line-height: 1.35; }
table.reg th { font-size: var(--t12); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; text-align: left; background: var(--well); border-bottom: 1px solid var(--edge); white-space: nowrap; }
table.reg th, table.reg td { height: 44px; padding: 6px 12px; vertical-align: middle; }
table.reg td { border-bottom: 1px solid var(--edge); color: var(--ink-2); }
table.reg tbody tr:last-child td { border-bottom: 0; }
table.reg .num { text-align: right; font-family: var(--mono); }
table.reg td.empty { color: var(--ink-3); text-align: center; }
table.reg td.strong { color: var(--ink); font-weight: 500; }
/* The mock-ups' tr.row and td.lead share names with Bootstrap's grid row and
   lead paragraph: cancel those inside a register. */
table.reg tr.row { display: table-row; margin: 0; cursor: pointer; }
table.reg tr.row > * { width: auto; max-width: none; margin-top: 0; padding: 6px 12px; flex-shrink: 1; }
table.reg td.lead { font-size: inherit; font-weight: 500; }
table.reg tr.row:hover td { background: color-mix(in srgb, var(--rail) 60%, transparent); }

@media (max-width: 559.98px) {
  .fl { flex: 1 1 140px; }
  .fl > input, .fl > select { width: 100%; }
  table.stack thead { display: none; }
  table.stack, table.stack tbody, table.stack tfoot { display: block; }
  table.stack tr, table.reg.stack tr.row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2) var(--s3); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--edge); }
  table.stack tbody tr:last-child { border-bottom: 0; }
  table.stack td, table.stack th, table.reg.stack tr.row > * { display: block; height: auto; padding: 0; border: 0; text-align: left !important; background: transparent !important; }
  table.stack :is(td, th)[data-l]::before { content: attr(data-l); display: block; margin-bottom: 2px; font: 600 var(--t12) var(--body); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
  /* A stacked total row: its label heads the card, its sums labelled like the rows'. */
  table.stack tfoot th:not([data-l]) { grid-column: 1 / -1; }
  /* Stacked, a table never scrolls sideways; its wrapper must not add a second
     scroller inside a modal body that already scrolls. */
  .tbl:has(> table.stack) { overflow: visible; }
  table.stack td.empty { grid-column: 1 / -1; text-align: center !important; }
  table.stack td.lead, table.stack td.full { grid-column: 1 / -1; }
  table.stack td:empty { display: none; }
  table.stack tr.row:hover td { background: transparent; }
}

/* ── Detail header (Ui::DetailHeaderComponent): crumbs, code, two rows of facts ── */
.crumbs { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s2); font-size: var(--t13); color: var(--ink-3); margin-bottom: var(--s3); }
.crumbs a { color: var(--ink-3); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.crumbs [aria-current] { color: var(--ink-2); }
.head { background: var(--panel); border: 1px solid var(--edge); border-radius: var(--r); padding: var(--s4); margin-bottom: var(--s5); display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3) var(--s5); }
.head .code { font-family: var(--disp); font-weight: 700; font-size: var(--t24); line-height: 1.2; letter-spacing: .04em; color: var(--ink); overflow-wrap: anywhere; }
.head-facts { display: grid; gap: var(--s3); min-width: 0; }
.head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.facts { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); }
.fact { display: grid; gap: 2px; min-width: 0; }
.fact .k { font-size: var(--t12); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.fact .v { color: var(--ink); font-size: var(--t16); font-weight: 500; line-height: 1.35; overflow-wrap: anywhere; }
.fact .v.is-empty { color: var(--ink-3); }

/* Chips, the mock-ups' status marks. */
.chip { display: inline-flex; align-items: center; height: 22px; padding: 0 var(--s2); border-radius: var(--s1); font-size: var(--t12); line-height: 1; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; border: 1px solid transparent; vertical-align: middle; }
.chip.done { background: color-mix(in srgb, var(--green) 18%, transparent); color: var(--green-ink); border-color: color-mix(in srgb, var(--green) 40%, transparent); }
.chip.todo { background: color-mix(in srgb, var(--gold) 14%, transparent); color: var(--gold-ink); border-color: color-mix(in srgb, var(--gold) 45%, transparent); }
.chip.warn { background: color-mix(in srgb, var(--rust) 14%, transparent); color: var(--rust-ink); border-color: color-mix(in srgb, var(--rust) 45%, transparent); }
.chip.none { background: transparent; color: var(--ink-3); border-color: var(--edge-2); }

.register .note { margin-left: var(--s2); font-size: var(--t12); font-weight: 400; color: var(--ink-3); }
.muted { color: var(--ink-3); }

/* A detail page's panel head (the mock-ups' .panel-h) and the revisions panel
   (Ui::RevisionsComponent). */
.panel-h { display: flex; align-items: center; gap: var(--s2) var(--s3); flex-wrap: wrap; padding: var(--s3) var(--s4); border-bottom: 1px solid var(--edge); min-height: 52px; }
.panel-h h2 { margin: 0; font-size: var(--t16); font-weight: 600; color: var(--ink); }
.panel + .panel { margin-top: var(--s5); }
.rev-change .k { color: var(--ink-3); }
