/* Smart Fin Reports 5.4.9.19 — Light Reference Typography Only
   Built directly from the approved 5.4.9.16 Unified Tool Blueprint.

   Approved visual references:
   - Receivables / Collections / ECL: type family, size hierarchy, reading rhythm,
     field text, compact KPI sizes, table sizes and numeric rhythm.
   - Administrative Expense Analyzer: semantic colored heading language only;
     colors and surfaces remain owned by that tool.
   - Financial Stress & Continuity Lab: top platform tabs remain governed by the
     5.4.9.16 Blueprint and are intentionally outside this typography layer.

   User preference: calm, light typography. Cairo must not be rendered with the
   heavy 800/900 weights used by older Tajawal/mono components. Main titles may
   use 700; normal section headings use 600; body copy uses 400.

   HARD SCOPE: typography properties only. No card geometry, backgrounds,
   borders, shadows, padding, margins, gaps, widths, heights, display, grid,
   positioning or workflow structure are changed here. */

#sfr-platform-root{
  --sfr-ref-font-ar:"Cairo","Tajawal",Tahoma,Arial,sans-serif;
  --sfr-ref-font-num:"Inter","Cairo",Arial,sans-serif;

  --sfr-ref-body:16px;
  --sfr-ref-body-leading:1.65;
  --sfr-ref-page-title:28px;
  --sfr-ref-stage-title:clamp(22px,2.15vw,30px);
  --sfr-ref-section-title:19px;
  --sfr-ref-panel-title:17px;
  --sfr-ref-subtitle:16px;
  --sfr-ref-description:14px;
  --sfr-ref-panel-kicker:12.5px;
  --sfr-ref-support:12.75px;
  --sfr-ref-label:14px;
  --sfr-ref-control:15px;
  --sfr-ref-button:13.5px;
  --sfr-ref-table:13.5px;
  --sfr-ref-table-head:13px;
  --sfr-ref-kpi-title:11px;
  --sfr-ref-kpi-value:18px;
  --sfr-ref-kpi-meta:11px;
  --sfr-ref-forecast-value:19px;

  --sfr-ref-weight-body:400;
  --sfr-ref-weight-support:400;
  --sfr-ref-weight-control:400;
  --sfr-ref-weight-label:500;
  --sfr-ref-weight-button:600;
  --sfr-ref-weight-title:700;
  --sfr-ref-weight-heading:600;
  --sfr-ref-weight-number:700;
}

/* 1. Shared family and calm reading rhythm. */
#sfr-platform-root [data-sfr-module-root]{
  font-family:var(--sfr-ref-font-ar)!important;
  font-size:var(--sfr-ref-body)!important;
  line-height:var(--sfr-ref-body-leading)!important;
  font-weight:var(--sfr-ref-weight-body)!important;
  text-rendering:optimizeLegibility;
  -webkit-font-smoothing:antialiased;
}
#sfr-platform-root [data-sfr-module-root] :is(button,input,select,textarea,option){
  font-family:var(--sfr-ref-font-ar)!important;
}
#sfr-platform-root [data-sfr-module-root] :is(input,select,textarea){
  font-size:var(--sfr-ref-control)!important;
  line-height:1.45!important;
  font-weight:var(--sfr-ref-weight-control)!important;
}
#sfr-platform-root [data-sfr-module-root] :is(button,[role="button"],summary){
  font-size:var(--sfr-ref-button)!important;
  line-height:1.35!important;
  font-weight:var(--sfr-ref-weight-button)!important;
}
#sfr-platform-root [data-sfr-module-root] :is(strong,b){
  font-weight:var(--sfr-ref-weight-button)!important;
}

/* 2. Inter is reserved for actual figures, percentages, dates and codes. */
#sfr-platform-root [data-sfr-module-root] :is(
  input[type="number"],input[type="date"],input[type="time"],
  input[inputmode="numeric"],input[inputmode="decimal"],output,
  .num,.sfr-num,[data-number],[data-value],[data-amount],[data-total],
  [data-percent],[data-percentage],[data-score],[data-balance]
){
  font-family:var(--sfr-ref-font-num)!important;
  font-variant-numeric:tabular-nums lining-nums!important;
  font-feature-settings:"tnum" 1,"lnum" 1!important;
  letter-spacing:-.012em;
}
#sfr-platform-root [data-sfr-module-root] :is(
  output,.num,.sfr-num,[data-number],[data-value],[data-amount],[data-total],
  [data-percent],[data-percentage],[data-score],[data-balance]
){
  font-weight:var(--sfr-ref-weight-number)!important;
}

/* 3. Approved title hierarchy with no extra-heavy Cairo. */
#sfr-platform-root [data-sfr-module-root] :is(h1,h2,h3,h4){
  font-family:var(--sfr-ref-font-ar)!important;
  letter-spacing:0!important;
}
#sfr-platform-root [data-sfr-module-root] h1{font-weight:var(--sfr-ref-weight-title)!important}
#sfr-platform-root [data-sfr-module-root] h2,
#sfr-platform-root [data-sfr-module-root] h3,
#sfr-platform-root [data-sfr-module-root] h4{font-weight:var(--sfr-ref-weight-heading)!important}

#sfr-platform-root [data-sfr-module-root] .sfr-blueprint-data-header :is(h1,h2),
#sfr-platform-root [data-sfr-module-root] .sfr-compact-data-header :is(h1,h2){
  font-size:var(--sfr-ref-stage-title)!important;
  font-weight:var(--sfr-ref-weight-title)!important;
  line-height:1.35!important;
}
#sfr-platform-root [data-sfr-module-root] :is([class*="page-head"],[class*="view-head"]):not(.sfr-blueprint-data-header):not(.sfr-compact-data-header) > div:first-child > :is(h1,h2),
#sfr-platform-root [data-sfr-module-root] :is([class*="page-head"],[class*="view-head"]):not(.sfr-blueprint-data-header):not(.sfr-compact-data-header) > :is(h1,h2){
  font-size:var(--sfr-ref-page-title)!important;
  font-weight:var(--sfr-ref-weight-title)!important;
  line-height:1.35!important;
}
#sfr-platform-root [data-sfr-module-root] :is(
  [class*="section-head"],[class*="analysis-head"],[class*="report-toolbar"]
) :is(h2,h3){
  font-size:var(--sfr-ref-section-title)!important;
  font-weight:var(--sfr-ref-weight-heading)!important;
  line-height:1.48!important;
}
#sfr-platform-root [data-sfr-module-root] [class*="panel"] > header :is(h2,h3),
#sfr-platform-root [data-sfr-module-root] [class*="card-head"] :is(h2,h3,h4){
  font-size:var(--sfr-ref-panel-title)!important;
  font-weight:var(--sfr-ref-weight-heading)!important;
  line-height:1.45!important;
}
#sfr-platform-root [data-sfr-module-root] :is(h4,[class*="subtitle"],[class*="sub-title"]){
  font-size:var(--sfr-ref-subtitle)!important;
  font-weight:var(--sfr-ref-weight-heading)!important;
  line-height:1.5!important;
}

/* 4. Descriptions and semantic eyebrows. Colors stay local. */
#sfr-platform-root [data-sfr-module-root] :is(
  [class*="page-head"],[class*="view-head"],[class*="section-head"],
  [class*="analysis-head"],[class*="toolbar-copy"]
) > p,
#sfr-platform-root [data-sfr-module-root] :is(
  [class*="page-head"],[class*="view-head"],[class*="section-head"],
  [class*="analysis-head"],[class*="toolbar-copy"]
) > div:first-child > p{
  font-family:var(--sfr-ref-font-ar)!important;
  font-size:var(--sfr-ref-description)!important;
  line-height:1.72!important;
  font-weight:var(--sfr-ref-weight-support)!important;
  letter-spacing:0!important;
}
#sfr-platform-root [data-sfr-module-root] [class*="panel"] > header :is(span,small),
#sfr-platform-root [data-sfr-module-root] :is([class*="eyebrow"],[class*="kicker"]),
#sfr-platform-root [data-sfr-module-root] .sfr-blueprint-data-header > .sfr-compact-data-copy > span:first-child,
#sfr-platform-root [data-sfr-module-root] .sfr-blueprint-data-header > div:first-child > span:first-child{
  font-family:var(--sfr-ref-font-ar)!important;
  font-size:var(--sfr-ref-panel-kicker)!important;
  line-height:1.45!important;
  font-weight:var(--sfr-ref-weight-heading)!important;
  letter-spacing:0!important;
  text-transform:none!important;
}
#sfr-platform-root [data-sfr-module-root] :is(
  [class*="table-note"],[class*="method-note"],[class*="grid-help"],
  [class*="policy-note"],[class*="helper"],[class*="support-copy"]
){
  font-family:var(--sfr-ref-font-ar)!important;
  font-size:var(--sfr-ref-support)!important;
  line-height:1.62!important;
  font-weight:var(--sfr-ref-weight-support)!important;
}

/* 5. Field typography. */
#sfr-platform-root [data-sfr-module-root] :is(
  label > span,
  [class*="form-grid"] label > span,
  [class*="field"] > label,
  [class*="field-label"]
){
  font-family:var(--sfr-ref-font-ar)!important;
  font-size:var(--sfr-ref-label)!important;
  line-height:1.48!important;
  font-weight:var(--sfr-ref-weight-label)!important;
  letter-spacing:0!important;
}
#sfr-platform-root [data-sfr-module-root] :is(
  label > small,
  [class*="form-grid"] label > small,
  [class*="field"] > small,
  [class*="input"] > small
){
  font-family:var(--sfr-ref-font-ar)!important;
  font-size:var(--sfr-ref-support)!important;
  line-height:1.58!important;
  font-weight:var(--sfr-ref-weight-support)!important;
}

/* 6. Compact KPI typography; card geometry remains untouched. */
#sfr-platform-root [data-sfr-module-root] :is(
  [class*="-kpi-grid"],[class$="-kpis"],[class*="-kpi-strip"],
  [class*="-analysis-summary"]
) > article > span:first-child{
  font-family:var(--sfr-ref-font-ar)!important;
  font-size:var(--sfr-ref-kpi-title)!important;
  line-height:1.45!important;
  font-weight:var(--sfr-ref-weight-heading)!important;
  letter-spacing:0!important;
}
#sfr-platform-root [data-sfr-module-root] :is(
  [class*="-kpi-grid"],[class$="-kpis"],[class*="-kpi-strip"],
  [class*="-analysis-summary"]
) > article > strong{
  font-family:var(--sfr-ref-font-num)!important;
  font-size:var(--sfr-ref-kpi-value)!important;
  line-height:1.3!important;
  font-weight:var(--sfr-ref-weight-number)!important;
  font-variant-numeric:tabular-nums lining-nums!important;
  letter-spacing:-.012em!important;
}
#sfr-platform-root [data-sfr-module-root] :is(
  [class*="-kpi-grid"],[class$="-kpis"],[class*="-kpi-strip"],
  [class*="-analysis-summary"]
) > article > small{
  font-family:var(--sfr-ref-font-ar)!important;
  font-size:var(--sfr-ref-kpi-meta)!important;
  line-height:1.5!important;
  font-weight:var(--sfr-ref-weight-support)!important;
}
#sfr-platform-root [data-sfr-module-root] [class*="forecast-cards"] > article > strong{
  font-family:var(--sfr-ref-font-num)!important;
  font-size:var(--sfr-ref-forecast-value)!important;
  line-height:1.2!important;
  font-weight:var(--sfr-ref-weight-number)!important;
  font-variant-numeric:tabular-nums lining-nums!important;
  letter-spacing:-.012em!important;
}

/* 7. Tables use the accepted ECL sizes with lighter hierarchy. */
#sfr-platform-root [data-sfr-module-root] table :is(th,td){
  font-family:var(--sfr-ref-font-ar)!important;
  font-size:var(--sfr-ref-table)!important;
  line-height:1.5!important;
}
#sfr-platform-root [data-sfr-module-root] table th{
  font-size:var(--sfr-ref-table-head)!important;
  font-weight:var(--sfr-ref-weight-heading)!important;
  letter-spacing:0!important;
}
#sfr-platform-root [data-sfr-module-root] table td{
  font-weight:var(--sfr-ref-weight-body)!important;
}
#sfr-platform-root [data-sfr-module-root] table :is(
  td[data-value],td[data-amount],td[data-total],td[data-percent],td[data-score],
  td > strong,td > b
){
  font-family:var(--sfr-ref-font-num)!important;
  font-weight:var(--sfr-ref-weight-button)!important;
  font-variant-numeric:tabular-nums lining-nums!important;
  letter-spacing:-.012em;
}
#sfr-platform-root [data-sfr-module-root] table input{
  font-size:14.5px!important;
  font-weight:var(--sfr-ref-weight-label)!important;
}

/* 8. Unified workflow copy is deliberately calmer than the historical 800 weights. */
#sfr-platform-root [data-sfr-module-root] .sfr-unified-workflow-progress > span,
#sfr-platform-root [data-sfr-module-root] .sfr-unified-workflow-progress > strong,
#sfr-platform-root [data-sfr-module-root] .sfr-unified-workflow-number,
#sfr-platform-root [data-sfr-module-root] .sfr-unified-workflow-copy > b{
  font-weight:var(--sfr-ref-weight-heading)!important;
}
#sfr-platform-root [data-sfr-module-root] .sfr-unified-workflow-copy > small{
  font-weight:var(--sfr-ref-weight-support)!important;
}
#sfr-platform-root [data-sfr-module-root] .sfr-unified-workflow-badge{
  font-weight:var(--sfr-ref-weight-label)!important;
}

/* 9. Reports preserve geometry and A4 hierarchy; only families and weight ceiling change. */
#sfr-platform-root [data-sfr-module-root] :is([class*="report-page"],[class*="report-paper"]){
  font-family:var(--sfr-ref-font-ar)!important;
  font-weight:var(--sfr-ref-weight-body)!important;
}
#sfr-platform-root [data-sfr-module-root] :is([class*="report-page"],[class*="report-paper"]) :is(h1,h2){
  font-weight:var(--sfr-ref-weight-title)!important;
}
#sfr-platform-root [data-sfr-module-root] :is([class*="report-page"],[class*="report-paper"]) :is(h3,h4){
  font-weight:var(--sfr-ref-weight-heading)!important;
}
#sfr-platform-root [data-sfr-module-root] :is([class*="report-page"],[class*="report-paper"]) :is(
  [data-value],[data-amount],[data-total],[data-percent],[data-score],output
){
  font-family:var(--sfr-ref-font-num)!important;
  font-weight:var(--sfr-ref-weight-number)!important;
  font-variant-numeric:tabular-nums lining-nums!important;
}

@media(max-width:680px){
  #sfr-platform-root{
    --sfr-ref-body:14.5px;
    --sfr-ref-page-title:23px;
    --sfr-ref-section-title:17px;
    --sfr-ref-panel-title:16px;
    --sfr-ref-description:13.5px;
    --sfr-ref-label:13px;
    --sfr-ref-control:14px;
    --sfr-ref-table:12.75px;
    --sfr-ref-table-head:12.5px;
  }
  #sfr-platform-root [data-sfr-module-root] .sfr-blueprint-data-header :is(h1,h2),
  #sfr-platform-root [data-sfr-module-root] .sfr-compact-data-header :is(h1,h2){
    font-size:22px!important;
  }
}

@media print{
  #sfr-platform-root [data-sfr-module-root],
  #sfr-platform-root [data-sfr-module-root] *{
    font-family:var(--sfr-ref-font-ar)!important;
  }
  #sfr-platform-root [data-sfr-module-root] :is(
    input[type="number"],input[type="date"],output,[data-number],[data-value],
    [data-amount],[data-total],[data-percent],[data-score]
  ){
    font-family:var(--sfr-ref-font-num)!important;
  }
}
