/* juribooks-sharp-type-v4.css — sharp-type layer v4.
   Loaded LAST of all stylesheets (immediately after
   juribooks-odoo-sharp-type-v3.1.css, itself the last link before this one).
   Presentation only. No .js file, no ledger/billing/VAT/WHT/payroll/trust/
   budget/cash-flow/storage/auth/export/numbering/posting logic is touched.

   ============================================================================
   WHAT THIS FILE DOES, IN ONE LINE PER SECTION
   1. Redefines --fsans/--fmono/--fnum at plain :root (Inter Tight installed
      INSIDE --fsans, not hard-coded anywhere) — Settings > Appearance > Sans
      and every existing var(--font-*) selector keeps working, unrewritten.
   2. Reverses the existing mono-money rules: amounts become --fnum (Inter
      Tight) with tabular lining figures, not IBM Plex Mono.
   3. Confirms — makes NO change to — the existing, already-correct identifier
      hook (.mono and friends), which stays on --font-numeric (IBM Plex Mono).
   4. Row density: 36px desktop / 44px at max-width:760px, via padding-block +
      line-height only, never a fixed td height.
   5. Body/heading sharpening: antialiasing, tabular lining numerals,
      tightened tracking, a heading scale, no color changed anywhere in this
      file (so contrast is unaffected by this pass — verify separately if a
      future pass touches color).

   ============================================================================
   GREP FINDINGS THIS FILE IS BUILT ON (real class names/attributes found,
   not guessed — commands run against this repo before writing a line below)

   IDENTIFIER HOOK (point 3) — already correct, confirmed via
   `grep -rn "class=\"mono" lib/*.js index.html` (36 files) and reading
   lib/juribooks-typography-v3.css lines 93-94/101:
     .coa-code, .jrn-no, .inv-no, .pv-ref, .tax-ref, .mono,
     input.mono, .inp.mono, select.mono, td.mono, span.mono
   already route to --font-numeric (hard-coded 'IBM Plex Mono' stack in that
   file, which this file does not touch). Confirmed by reading actual
   rendered call sites that this hook wraps: journal/PV refs
   (journal-entry.js, receivables-payables.js, bank-loans.js, investments.js,
   rent-schedule.js, prepay-accrual.js), GL account codes (general-ledger.js
   .coa-code span), dates (jobs-clients.js, revenue-import.js, reports.js —
   esc(r.iso)), TIN (payroll.js .mono on r.tin; vat-statutory.js and wht.js
   TIN schedule columns already render <td class="mono">), RSA/PFA and IRN
   numbers (payroll.js, nrs-ubl-export.js), job IDs (jobs-clients.js),
   2FA/TOTP secrets and bank sort codes (settings-subcards.js). Nothing in
   this section needed a rule added — it is additive by construction already:
   an element is mono only because it carries one of the classes above.
   NOT reclassified as identifiers despite living in a related area: RC
   number / FRC number settings inputs (#pfRc, #pfFrc in
   settings-company-profile.js) carry no class hook at all — they are plain
   <input id="..."> with no .mono, and adding one would mean editing a .js
   file, which is out of bounds for this pass. Left as inherited Inter Tight;
   flagged here rather than silently left unstated.

   MONEY REVERSAL (point 2) — the mono-money sources found and reversed,
   confirmed by reading each file directly:
     lib/juribooks-typography-scope-v2.css  section 4 (lines ~70-116) and the
       #feeNote block (line ~133)
     lib/juribooks-typography-v3.css        section 3 (lines ~72-101) and the
       #view-batch/#view-post block (lines ~164-168) and #feeNote (line 174)
     lib/juribooks-skin-v2.css              line 64 (.kpi .v,.dkpi .v weight
       600!important/letter-spacing -.02em!important — beaten below)
   Deliberately EXCLUDED from the reversal despite appearing in those files'
   selector lists, after checking real usage rather than assuming:
     - bare, unscoped .num — grep across lib/*.js showed this class sits on
       ~50+ plain numeric <input> fields with no connection to money at all
       (loan principal/rate/tenure, budget quantity/rate/months, fixed-asset
       cost/rate, investment principal/tenure/rate, invoice FX rate/VAT
       rate/WHT rate) and on the topbar's #statAcc "Accounts" count chip
       (.stat-chip .v.num) and the "Active PV ref" chip — an IDENTIFIER, not
       money. Reversing bare .num with !important would have silently
       flipped all of those. .num is still reversed everywhere it appears
       scoped to an actual money context: td.num, every *-tbl td.num
       combination, #view-batch/#view-post .num (journal/PV amount line,
       confirmed money via journal-entry.js's fmt(tt.d) span),
       [data-typography-scope="report"] .num, and #feeNote .num.
     - .mono / input.mono / .jtbl's own reference inputs — these are the
       identifier hook from point 3, not money; left exactly as-is.
   .amt and .money (bare, unscoped) ARE reversed: grep confirmed every real
   .amt usage (metrics-dashboard.js, nrs-panel.js, practice-groups.js,
   comparative-analysis.js's index.html cells) is a genuine currency or
   count-with-percent figure, and .money has zero real usage in the app
   today (defined in the source rules but never applied by any class= call
   site) — reversed anyway for completeness/parity with the rules being
   replaced, at zero behavioural risk since nothing currently uses it.

   TABLE CLASSES (point 4) — the exact 9 named in the brief, confirmed
   against real <table class="..."> call sites (grep across lib/*.js):
     .tb-tbl .stmt .coa-tbl .jtbl .drill-tbl .recent-tbl .far-tbl .ppe-tbl
     .vat-tbl
   GL/AR/AP (general-ledger.js, receivables-payables.js) both render
   <table class="tb-tbl">, already in the list above — no new class needed.
   Found but deliberately OUT OF SCOPE (not named in the brief, and touching
   them risks the executive dashboard's separately-hardened skin, which
   sharp-type-v3.1's own convention treats as its own concern): .cmp-tbl,
   .lines-tbl, .exec-recent-table, .exec-stmt.

   EXISTING !important THIS FILE MUST BEAT (found by reading each file, not
   assumed — this is why some rules below carry !important and others do
   not):
     - lib/juribooks-typography-scope-v2.css: report-scope amount cells and
       .dkpi/.kpi .v (both !important blocks, documented there).
     - lib/juribooks-skin-v2.css line 64: .kpi .v,.dkpi .v font-weight
       600!important, letter-spacing -.02em!important.
     - lib/juribooks-skin-v2.css lines 69-71: .stmt/.tb-tbl/.recent-tbl/
       .drill-tbl td/th padding, 7-8px 11px, all !important.
     - index.html's own inline <style> (loads BEFORE every lib/*.css link,
       so lib/juribooks-skin-v2.css already beats it today, but this file
       must beat it too since we load later still): two competing
       `:is(.view) :is(.stmt,.tb-tbl,.coa-tbl,.ppe-tbl,.vat-tbl,.drill-tbl,
       .far-tbl) :is(td,th){padding:...!important}` blocks (9px 13px, then
       7px 11px later in the same file — the later one already wins there),
       plus a bare `.jtbl td{padding:0;height:36px}` — NOT !important, but a
       fixed height, which is exactly the anti-pattern this brief says to
       avoid reintroducing; overridden below to height:auto.
     - lib/juribooks-typography-v3.css: one of its documented "!important
       #1 of 3" on `.view .tb-tbl thead th` (and siblings) at font-size
       var(--t-xs) (11px) !important — beaten below for the 10.5px header
       requirement. Its print-media !important (#3 of 3) is left alone —
       print is out of scope for this pass, see the note at the end of this
       file.
   ============================================================================ */

/* ============================================================
   1. FONT FAMILIES — plain :root, no theme/data-attribute scoping, so
   every existing var(--fsans)/var(--fmono) consumer and all ~85 var(--font-*)
   selectors that alias to them (juribooks-typography-scope-v2.css) inherit
   automatically. Settings > Appearance > "Sans" still means this stack.

   FOUND, NOT ASSUMED: applyAppr() (appearance.js, untouched) does not read
   --fsans through the cascade — it resolves the current typeface choice
   and writes the LITERAL stack directly as an inline style on <html>
   (confirmed live: document.documentElement.style.getPropertyValue('--fsans')
   returns 'IBM Plex Sans',system-ui,-apple-system,sans-serif with no
   !important). An inline style beats any non-!important stylesheet rule
   regardless of load order, so a plain :root{--fsans:...} here would be
   silently shadowed. --fsans (and --fserif, which the same mechanism also
   inlines) therefore needs !important to win; --fmono is NOT one of the
   properties applyAppr() inlines (confirmed by reading the same live
   style attribute — no --fmono entry in it), so it needs none. */
:root{
  --fsans:'Inter Tight','IBM Plex Sans',system-ui,-apple-system,'Segoe UI',sans-serif !important;
  --fmono:'IBM Plex Mono',ui-monospace,SFMono-Regular,monospace;
  --fnum: var(--fsans);
}

/* ============================================================
   2. MONEY — Inter Tight, tabular lining figures. Not monospace.
   html body prefix + !important on every rule in this section: the
   selectors below are reproduced verbatim from the three competing sources
   listed in the header comment, several of which are themselves
   !important, and this file must win over all of them regardless of which
   currently wins amongst each other.
   ============================================================ */
html body .amt,html body .money,
html body td.amt,html body td.money,html body td.r,html body th.r,html body td.num,
html body .tb-tbl td.r,html body .tb-tbl td.num,
html body .stmt td.r,html body .stmt td.num,
html body .coa-tbl td.r,html body .coa-tbl td.num,
html body .jtbl td.r,html body .jtbl td.num,
html body .ppe-tbl td.r,html body .vat-tbl td.r,
html body .drill-tbl td.r,html body .drill-tbl td.num,
html body .far-tbl td.r,html body .recent-tbl td.r,html body .recent-tbl td.num,
html body .jtbl input.amt,html body .jtbl td.r input,
html body #view-batch .num,html body #view-batch td.r,html body #view-batch td.num,
html body #view-post .num,html body #view-post td.r,html body #view-post td.num,
html body [data-typography-scope="report"] td.r,
html body [data-typography-scope="report"] td.num,
html body [data-typography-scope="report"] .num,
html body [data-typography-scope="report"] .amt,
html body [data-typography-scope="report"] .money,
html body #feeNote .amt,html body #feeNote .num,html body #feeNote td.r{
  font-family:var(--fnum) !important;
  font-variant-numeric:tabular-nums lining-nums !important;
  font-feature-settings:"tnum" 1,"lnum" 1 !important;
  font-weight:500;
  letter-spacing:0;
}
/* KPI / lead-tile monetary values — a separate, heavier weight. Includes
   the report-metric-tile pattern (.mx .v — WHT/VAT/bank-rec position tiles
   etc., confirmed via grep across lib/*.js: 20+ modules render this exact
   <div class="mx"><div class="v">figure</div></div> shape) alongside the
   dashboard KPI classes named in the brief. */
html body .dkpi .v,html body .kpi .v,html body .mx .v,
html body #view-home .kpi-grid > .dkpi[data-jb2-lead]:first-child .v{
  font-family:var(--fnum) !important;
  font-variant-numeric:tabular-nums lining-nums !important;
  font-feature-settings:"tnum" 1,"lnum" 1 !important;
  font-weight:700 !important;
  letter-spacing:-.03em !important;
}

/* ============================================================
   3. IDENTIFIERS — no rule needed. See the header comment: .mono and its
   siblings (.coa-code,.jrn-no,.inv-no,.pv-ref,.tax-ref,input.mono,.inp.mono,
   select.mono,td.mono,span.mono) already route to --font-numeric (IBM Plex
   Mono, defined in juribooks-typography-v3.css, untouched here) and are not
   part of the money reversal above. This section exists in the contract to
   record that it was checked, not skipped.
   ============================================================ */

/* ============================================================
   4. ROW DENSITY — padding-block + line-height only. Both values are
   fixed px (not proportional to font-size), so the row height holds at
   exactly 36px regardless of the --fbody/zoom value currently governing
   cell font-size elsewhere (index.html's own "Sage 50 chrome" block sets
   td/th font-size via calc(var(--fbody)*var(--zoom,1)) !important — this
   file does not touch font-size on these cells at all, only the box
   metrics around whatever size that resolves to).
   height:auto cancels the one fixed-height rule found (.jtbl td, index.html,
   height:36px) so padding/line-height are the only thing determining row
   height, per the brief's "never a fixed td height" instruction.
   Header row (thead th) gets the same padding rhythm as body rows, plus its
   own typography (10.5px/600/.09em/uppercase) — the two are independent so
   changing one never silently changes the other. */
html body .view .tb-tbl td,html body .view .tb-tbl th,
html body .view .stmt td,html body .view .stmt th,
html body .view .coa-tbl td,html body .view .coa-tbl th,
html body .view .jtbl td,html body .view .jtbl th,
html body .view .drill-tbl td,html body .view .drill-tbl th,
html body .view .recent-tbl td,html body .view .recent-tbl th,
html body .view .far-tbl td,html body .view .far-tbl th,
html body .view .ppe-tbl td,html body .view .ppe-tbl th,
html body .view .vat-tbl td,html body .view .vat-tbl th,
html body .tb-tbl td,html body .tb-tbl th,
html body .stmt td,html body .stmt th,
html body .coa-tbl td,html body .coa-tbl th,
html body .jtbl td,html body .jtbl th,
html body .drill-tbl td,html body .drill-tbl th,
html body .recent-tbl td,html body .recent-tbl th,
html body .far-tbl td,html body .far-tbl th,
html body .ppe-tbl td,html body .ppe-tbl th,
html body .vat-tbl td,html body .vat-tbl th{
  padding-block:9px !important;
  line-height:18px !important;
  height:auto !important;
  vertical-align:middle;
}
html body .view .tb-tbl thead th,html body .view .stmt thead th,
html body .view .coa-tbl thead th,html body .view .jtbl thead th,
html body .view .drill-tbl thead th,html body .view .recent-tbl thead th,
html body .view .far-tbl thead th,html body .view .ppe-tbl thead th,
html body .view .vat-tbl thead th,
html body .tb-tbl thead th,html body .stmt thead th,html body .coa-tbl thead th,
html body .jtbl thead th,html body .drill-tbl thead th,html body .recent-tbl thead th,
html body .far-tbl thead th,html body .ppe-tbl thead th,html body .vat-tbl thead th,
html body #drillBox .tb-tbl thead th{
  font-size:var(--type-th-size-v4, 11px) !important;   /* token: a theme sets it without out-ranking this rule */
  font-weight:600 !important;
  letter-spacing:.09em !important;
  text-transform:uppercase !important;
}
@media (max-width:760px){
  html body .view .tb-tbl td,html body .view .tb-tbl th,
  html body .view .stmt td,html body .view .stmt th,
  html body .view .coa-tbl td,html body .view .coa-tbl th,
  html body .view .jtbl td,html body .view .jtbl th,
  html body .view .drill-tbl td,html body .view .drill-tbl th,
  html body .view .recent-tbl td,html body .view .recent-tbl th,
  html body .view .far-tbl td,html body .view .far-tbl th,
  html body .view .ppe-tbl td,html body .view .ppe-tbl th,
  html body .view .vat-tbl td,html body .view .vat-tbl th,
  html body .tb-tbl td,html body .tb-tbl th,
  html body .stmt td,html body .stmt th,
  html body .coa-tbl td,html body .coa-tbl th,
  html body .jtbl td,html body .jtbl th,
  html body .drill-tbl td,html body .drill-tbl th,
  html body .recent-tbl td,html body .recent-tbl th,
  html body .far-tbl td,html body .far-tbl th,
  html body .ppe-tbl td,html body .ppe-tbl th,
  html body .vat-tbl td,html body .vat-tbl th{
    padding-block:13px !important;
    line-height:18px !important;
    height:auto !important;
  }
  /* The existing 16px input-font floor (juribooks-odoo-sharp-type-v3.1.css
     section 6, also max-width:760px) is untouched — this file adds no
     input font-size rule of its own, so that floor still governs. */
}

/* ============================================================
   5. SHARPENING
   ============================================================ */
body{
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  text-rendering:optimizeLegibility;
  letter-spacing:-.006em;
  font-variant-numeric:tabular-nums lining-nums;
  font-feature-settings:"tnum" 1,"lnum" 1;
}
h1,h2,h3{
  font-weight:700;
  letter-spacing:-.022em;
}
h4,h5{
  font-weight:600;
  letter-spacing:-.014em;
}
/* <h5>/<h6> have zero real call sites today (grep: only h1/h2/h3/h4 are
   ever used across lib/*.js and index.html) — defined anyway so the
   contract holds if either is used later; not fixing an observed defect. */
h6{
  font-size:var(--text-xs);
  font-weight:600;
  letter-spacing:.09em;
  text-transform:uppercase;
}
/* No prose below 12px; 10px reserved for uppercase tracked eyebrow labels
   only. Scoped to narrative/paragraph text specifically (p, li, the report
   sub-heading line) — deliberately NOT table cells: this app's tables are a
   dense, compact accounting grid by design (v3.css's own stated "compact
   enterprise scale", 10-13px throughout), and "prose" does not describe a
   ledger cell. Forcing every td up to 12px would be a real, unrequested
   density regression in exactly the tables section 4 above just tuned. */
p,li,.stmt-sub{
  font-size:max(12px,1em);
}
