/* ============================================================================
   finevo · Reports — Kanonische Tabellen-Typografie
   ============================================================================
   Verbindlich für alle Report-Pages (BWA, SuSa, GuV, Bilanz, EÜR,
   Anlage EÜR, Beilage E1a, OPO, Anlagespiegel, Party, Tax, BankAccount).

   Quelle: User-Direktive 2026-05-14, Belege-Tabelle als Referenz.

   Scope: *.report-table — alle Report-Tabellen tragen diese Klasse
   ODER wir scopten via page-spezifische Card-Klasse.
   Da die Report-Tables custom <table>-Tags sind (nicht FluentDataGrid),
   greifen wir direkt über die Tabellen-Klassen.

   Kanonische Werte:
     Header  → JetBrains Mono 10.5px / 0.16em / uppercase / brand-ink-3
     Body    → Source Serif 4  13px            / brand-ink-2
     Code    → JetBrains Mono 11.5px           / brand-ink-3   (Konten-Nr)
     Betrag  → JetBrains Mono 13px             / brand-ink-2
   ========================================================================= */

/* ── Issue 2: FluentSelect / FluentSearch transparent in .platform-body ── */
.platform-body fluent-select::part(control),
.platform-body fluent-search::part(control),
.platform-body fluent-text-field::part(control) {
    background: transparent !important;
    border-color: var(--brand-rule, #D6D1C2) !important;
}

/* ── Kanonischer Header: 10.5px / 0.16em / uppercase ──────────────────── */
.bwa-table       thead th,
.susa-table      thead th,
.guv-table       thead th,
.bilanz-table    thead th,
.euer-anlage-table thead th,
.euer-table      thead th,
.e1a-table       thead th,
.opo-table       thead th,
.as-table        thead th,
.pt-table        thead th,
.dar-table       thead th {
    /* JetBrains Mono ist in fonts.css nur als weight 500 geladen — bei
       font-weight: 400 erzwingt das fast jede Render-Engine das verfuegbare
       500-Weight, was zu schwerer wirkt als gewollt. Fallback ui-monospace
       (System-Mono mit echtem 400) liefert das gewuenschte schmale Look. */
    font-family: ui-monospace, 'JetBrains Mono', monospace !important;
    font-size: 9.5px !important;
    font-weight: 400 !important;
    letter-spacing: 0.14em !important;
    text-transform: uppercase !important;
    color: var(--brand-ink-3, #5C5D67) !important;
}

/* ── Kanonischer Body: Source Serif 4 / 13px / brand-ink-2 ────────────── */
.bwa-table,
.susa-table,
.guv-table,
.bilanz-table,
.euer-anlage-table,
.euer-table,
.e1a-table,
.opo-table,
.as-table,
.pt-table,
.dar-table {
    font-family: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif !important;
    font-size: 13px !important;
    color: var(--brand-ink-2, #2A2A30) !important;
}

/* ── Betrag-Mono: 13px / brand-ink-2 (nicht 12px oder 11.5px) ────────── */
.bwa-table   td.t-amount,
.bwa-table   td.t-abw,
.guv-table   td.t-amount,
.bilanz-table td.t-amount,
.euer-anlage-table .t-amount,
.euer-table  .euer-amount,
.e1a-table   .t-amount,
.susa-table  .susa-amount,
.susa-table  .susa-group-subtotal td.susa-amount,
.opo-table   .opo-amount,
.as-table    td.t-amount,
.pt-table    td.t-amount,
.dar-table   td.t-amount,
.dar-table   .dar-mono {
    font-family: 'JetBrains Mono', ui-monospace, monospace !important;
    font-size: 13px !important;
    font-variant-numeric: tabular-nums;
}

/* ── Anlagespiegel body-size fix (war 12.5px) ──────────────────────────── */
.as-table {
    font-size: 13px !important;
}

/* ── Rechts-Bündigkeit aller Betrag-Spalten-Header ─────────────────────── */
.bwa-table      thead th.t-amount,
.bwa-table      thead th.t-abw,
.bwa-table      thead th.t-pct,
.susa-table     thead th.susa-th-amount,
.guv-table      thead th.t-amount,
.bilanz-table   thead th.t-amount,
.euer-anlage-table thead th.t-amount,
.euer-table     thead th.euer-th-amount,
.e1a-table      thead th.t-amount,
.opo-table      thead th.opo-th-amount,
.as-table       thead th.t-amount,
.pt-table       thead th.t-amount,
.pt-table       thead th.t-num,
.dar-table      thead th.t-amount {
    text-align: right !important;
}

/* ── Gruppen- / Subtotal- / Total-Zeilen: Instrument Serif ────────────────
   Pattern aus Categories-Baum: Eltern-Knoten (L1/L0) in Instrument Serif,
   Leaves in Inter Tight. Fuer Tabellen-Reports: berechnete Zwischensummen
   (Rohertrag, Vorlaeufiges Ergebnis), Gruppen-Header (Klasse 1/2/3/4),
   Total-Banner (Gesamtsumme/Bilanzsumme), Section-Titel (Aktiva/Passiva).

   Instrument Serif ist eine schmal-geschnittene Display-Schrift. Bei
   kleinen Groessen + Zero/Minus-Letter-Spacing wirkt sie gedraengt —
   daher: minimum 15px fuer Subtotals, 17px fuer Gruppen-Header, plus
   0.005em positives Tracking damit die Buchstaben atmen koennen. */
.bwa-table     tr.bwa-subtotal-row td,
.bwa-table     tr.bwa-total-row td,
.susa-table    .susa-group-header td,
.susa-table    .susa-group-subtotal td,
.susa-table    .susa-grand-total td,
.guv-table     tr.guv-subtotal-row td,
.guv-result-row .guv-result-label,
.guv-result-row .guv-result-amount,
.bwa-result-banner .bwa-result-label,
.bwa-result-banner .bwa-result-amount,
.bwa-result-banner .bwa-result-ytd,
.euer-gewinn-row .euer-gewinn-label,
.euer-gewinn-row .euer-gewinn-amount,
.e1a-gewinn-row .e1a-gewinn-label,
.e1a-gewinn-row .e1a-gewinn-amount,
.bilanz-side-title,
.bilanz-table  tfoot .t-summe-label,
.bilanz-table  tfoot .t-summe,
.euer-section-title,
.euer-anlage-section-title,
.euer-aveuer-title,
.euer-anlage-table .euer-anlage-subtotal td,
.euer-table    .euer-section-header td,
.euer-table    .euer-subtotal td,
.e1a-section-title,
.e1a-table     .e1a-subtotal td,
.e1a-table     .e1a-section-header td,
.as-table      .as-group-header td,
.as-table      .as-subtotal-row td,
.as-table      .as-total-row td,
.opo-table     tfoot td,
.pt-total-row  td,
.tax-section-title,
.bank-section-title,
.dar-section-title,
.dar-summary-amount {
    font-family: 'Instrument Serif', Georgia, serif !important;
    font-size: 15px !important;
    letter-spacing: 0.005em !important;
    font-weight: 400 !important;
}
/* Gruppen-Header und Section-Titel sind eine Stufe groesser (17px). */
.susa-table .susa-group-header td,
.susa-table .susa-grand-total td,
.as-table   .as-group-header td,
.as-table   .as-total-row td,
.euer-table .euer-section-header td,
.e1a-table  .e1a-section-header td,
.bilanz-side-title,
.bilanz-table tfoot .t-summe-label,
.euer-section-title,
.euer-anlage-section-title,
.euer-aveuer-title,
.e1a-section-title,
.tax-section-title,
.bank-section-title,
.dar-section-title {
    font-size: 17px !important;
}
/* Globale pt-total-row Hintergrund-Definition — damit auch Tabellen, die
   keine eigene pt-total-row-Page-CSS haben (z.B. OPO), den dunklen
   Total-Streifen bekommen. */
.pt-total-row {
    background: var(--brand-ink-soft, #2D3340) !important;
}
.pt-total-row td {
    color: var(--brand-bone, #F2EEE5) !important;
    background: var(--brand-ink-soft, #2D3340) !important;
    padding: 8px 10px !important;
    border-top: 2px solid var(--brand-ink-soft, #2D3340) !important;
}
/* Dunkle Total-Zeilen in Party/Tax/Bank-Tabellen: t-emphasis (schwarz)
   und t-num (grau, 11px) ueberschreiben sonst die brand-bone-Farbe der
   Total-Zeile und werden auf dunklem Grund schwer lesbar. Explizit reset. */
.pt-total-row td.t-emphasis,
.pt-total-row td.t-amount,
.pt-total-row td.t-num {
    color: var(--brand-bone, #F2EEE5) !important;
    font-size: 13px !important;
}

/* Auswertungs-Tabellen (Party/Tax/Bank/Loan): t-name + t-emphasis hatten
   font-weight 500/600. Soll normal-weight sein wie der Rest der Body-Zellen
   (Konvention: Body = 400, Emphasis nur via Farbe bzw. Hintergrund). */
.pt-table tbody td.t-name,
.dar-table tbody td.t-name {
    font-weight: 400 !important;
}
.pt-table tbody td.t-emphasis {
    font-weight: 400 !important;
}
/* Beträge UND Position-Nummern in Subtotal/Total-Zeilen bleiben Mono —
   Schriftart-Cascade ueberschreibt vorherigen Mono-Selektor, daher
   explizit reasserten. Nur Bezeichnungs-Zelle (Label) bekommt Serif. */
.susa-table    .susa-group-subtotal td.susa-amount,
.susa-table    .susa-grand-total    td.susa-amount,
.bwa-table     tr.bwa-subtotal-row  td.t-pos,
.bwa-table     tr.bwa-subtotal-row  td.t-amount,
.bwa-table     tr.bwa-subtotal-row  td.t-abw,
.bwa-table     tr.bwa-subtotal-row  td.t-pct,
.bwa-table     tr.bwa-total-row     td.t-pos,
.bwa-table     tr.bwa-total-row     td.t-amount,
.guv-table     tr.guv-subtotal-row  td.t-pos,
.guv-table     tr.guv-subtotal-row  td.t-amount,
.bilanz-table  tfoot                td.t-amount,
.as-table      .as-subtotal-row     td.t-amount,
.as-table      .as-total-row        td.t-amount,
.opo-table     tfoot                td.opo-amount,
.pt-total-row  td.t-amount {
    font-family: 'JetBrains Mono', ui-monospace, monospace !important;
    font-size: 13px !important;
    letter-spacing: 0 !important;
}

/* Ergebnis-Banner-Amounts auf allen Result-Bannern (GuV/BWA/EÜR/E1a):
   Mono 13px (gleiche Groesse wie restliche Mono-Zellen — User-Direktive).
   Label bleibt Instrument Serif (von oben). */
.guv-result-row .guv-result-amount,
.bwa-result-banner .bwa-result-amount,
.euer-gewinn-row .euer-gewinn-amount,
.e1a-gewinn-row .e1a-gewinn-amount {
    font-family: 'JetBrains Mono', ui-monospace, monospace !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    letter-spacing: 0 !important;
}
.bwa-result-banner .bwa-result-ytd {
    font-family: 'JetBrains Mono', ui-monospace, monospace !important;
    font-size: 11px !important;
    letter-spacing: 0 !important;
    color: var(--brand-ink-3, #5C5D67) !important;
}
