/* ============================================================================
   BEC ARABIA — REPORTING DESIGN SYSTEM  (SSOT)
   ============================================================================
   ONE stylesheet for every reporting dashboard (Sales, Warehouse, Maintenance,
   Accounting, Purchasing, HR, CEO). All classes use the single `rpt-` prefix.

   Linked globally from Components/App.razor — NOT Blazor-scoped — so all report
   pages share one identical look. Per-page `.razor.css` files were removed; if a
   page ever needs a true one-off, add a scoped `.razor.css` for that override
   ONLY (never re-declare the system here).

   Layers below:  Tokens · Page · Header · KPIs · Cards · Columns · Tables
                  · Bar chart · Stacked bar · Line chart · Callouts · Badges
                  · Helpers · Responsive · Print
   ============================================================================ */

/* ── LAYER 1 · DESIGN TOKENS ───────────────────────────────────────────────
   Scoped to the report root so they never leak into the rest of the portal. */
.rpt-doc,
.rpt-loading-gate {
  /* Greyscale ramp */
  --black:  #000000;
  --dark:   #1a1a1a;
  --mid:    #555555;
  --light:  #999999;
  --faint:  #cccccc;
  --stroke: #e2e2e2;
  --surface:#f6f6f6;
  --white:  #ffffff;

  /* Accent + status */
  --accent:      #0071e3;
  --accent-soft: #eef5ff;
  --critical:    #7a0012;
  --critical-bg: #fff5f7;
  --success:     #166534;
  --success-bg:  #eef8f1;
  --pending:     #92400e;
  --pending-bg:  #fff7e8;

  /* Type scale — Major-Third (×1.25). KPI ▸ Card gap restored so the two
     no longer read as the same size (was 1.56 vs 1.45 = only 7% apart). */
  --fs-display: 3.45rem;  /* 55px — cover hero            */
  --fs-title:   1.95rem;  /* 31px — page title            */
  --fs-kpi:     1.56rem;  /* 25px — KPI headline value    */
  --fs-card:    1.25rem;  /* 20px — card value            */
  --fs-body:    0.92rem;  /* 15px — body                  */
  --fs-meta:    0.75rem;  /* 12px — captions / callouts   */
  --fs-table:   0.69rem;  /* 11px — dense table cell      */
  --fs-eyebrow: 0.625rem; /* 10px — chapter / labels      */

  /* Spacing — 4px base */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px;
  --block-gap: 22px;   /* uniform vertical rhythm between visuals */

  /* Page geometry */
  --page-pad:  34px 46px 28px;
  --cover-pad: 56px 62px;

  font-family: "Inter", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.rpt-doc {
  background: var(--white);
  color: var(--dark);
  padding: 0;
  font-size: var(--fs-body);
  -webkit-font-smoothing: antialiased;
}

/* ── Loading gate ── */
.rpt-loading-gate {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
}
.rpt-loading-spinner {
  width: 42px;
  height: 42px;
  border: 3px solid var(--stroke);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: rpt-spin 0.85s linear infinite;
}
@keyframes rpt-spin { to { transform: rotate(360deg); } }
.rpt-loading-title { font-size: 24px; font-weight: 700; color: var(--black); letter-spacing: -0.4px; }
.rpt-loading-text  { font-size: 15px; color: var(--light); }

/* ── LAYER 2 · PAGE CONTAINER ──────────────────────────────────────────────
   Each report is a stack of full-viewport "slides" (cover → content → end). */
.rpt-page {
  width: 100%;
  max-width: 1680px;       /* tame ultra-wide monitors so charts, tables & KPIs stay aligned */
  margin: 0 auto;
  padding: var(--page-pad);
  background: var(--white);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  overflow: visible;
}
/* Screen: sections flow to their CONTENT with a steady rhythm — no forced full-viewport
   "slides" (which over-scroll and create uneven gaps via space-between). The slide-per-page
   feel is preserved for the PDF/print path in the @media print layer below. */
.rpt-page:not(.rpt-page--cover):not(.rpt-page--end) {
  justify-content: flex-start;   /* blocks self-space via their own margin-bottom (no doubled gap) */
}
/* ONE hairline separates consecutive content chapters (the first, right after the cover,
   gets none). Adjacent-sibling (+) so rules never stack into a double line. */
.rpt-page:not(.rpt-page--cover):not(.rpt-page--end) + .rpt-page:not(.rpt-page--end) {
  border-top: 1px solid var(--stroke);
}

/* Cover & closing stay tall and centred — they're the title moments. */
.rpt-page--cover,
.rpt-page--end { min-height: 88vh; justify-content: center; align-items: center; padding: var(--cover-pad); }
.rpt-page--end .rpt-cover__content {
  min-height: 72vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

/* ── Cover / end content ── */
.rpt-cover__content { width: min(980px, 100%); text-align: left; }
.rpt-cover__eyebrow {
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--dark);
  margin-bottom: 22px;
}
.rpt-cover__title {
  font-size: var(--fs-display);
  line-height: 0.96;
  font-weight: 900;
  letter-spacing: -2.4px;
  color: var(--black);
  margin-bottom: 24px;
  max-width: 960px;
}
.rpt-cover__divider { width: 56px; height: 3px; background: var(--black); margin-bottom: 28px; }
.rpt-cover__sub {
  font-size: 17px;
  font-weight: 300;
  line-height: 1.55;
  color: var(--dark);
  max-width: 1000px;
  margin-bottom: 24px;
}
.rpt-cover__period { font-size: var(--fs-meta); font-weight: 600; color: var(--mid); letter-spacing: 0.5px; }
.rpt-cover__footer {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 11px;
  color: var(--dark);
  margin-top: auto;
  padding-top: 26px;
  border-top: 1px solid var(--black);
}
.rpt-badge-live { font-weight: 700; letter-spacing: 0.5px; color: var(--black); }

/* ── LAYER 3 · PAGE HEADER ── */
.rpt-page__header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.rpt-chapter   { font-size: var(--fs-eyebrow); font-weight: 700; text-transform: uppercase; letter-spacing: 3.5px; color: var(--light); }
.rpt-page-num  { font-size: 11px; font-weight: 600; color: var(--faint); letter-spacing: 1px; }
.rpt-page__title {
  font-size: var(--fs-title);
  font-weight: 800;
  color: var(--black);
  letter-spacing: -0.9px;
  line-height: 1.05;
  margin-bottom: 10px;
}
.rpt-rule { display: none; }

/* ── LAYER 4 · BIG NUMBERS (KPI strip) ── */
.rpt-big-numbers {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 2px solid var(--black);
  border-bottom: 1px solid var(--stroke);
  margin-bottom: 16px;
}
.rpt-big-numbers--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rpt-big-numbers--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.rpt-big-numbers--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.rpt-big-numbers--6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.rpt-big-numbers--8 { grid-template-columns: repeat(8, minmax(0, 1fr)); }

.rpt-big-num { padding: 14px 10px 12px; border-right: 1px solid var(--stroke); text-align: center; position: relative; }
.rpt-big-num:last-child { border-right: none; }
.rpt-big-num__val {
  font-size: var(--fs-kpi);
  font-weight: 800;
  letter-spacing: -0.6px;
  color: var(--black);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  margin-bottom: 4px;
}
.rpt-big-num__lbl {
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  color: var(--mid);
  text-transform: uppercase;
  letter-spacing: 0.65px;
  margin-top: 4px;
}
.rpt-big-num__sub { font-size: 9px; color: var(--light); margin-top: 2px; }
.rpt-big-num--accent .rpt-big-num__val { color: var(--accent); }
.rpt-big-num--warn   .rpt-big-num__val { color: var(--critical); }
/* Two stacked KPI strips read as ONE block: the second drops its heavy 2px top rule and
   tucks under the first (whose 1px bottom border is the single internal divider) — no
   ladder of doubled black lines. */
.rpt-big-numbers + .rpt-big-numbers { border-top: none; margin-top: -16px; }

/* ── LAYER 5 · CARDS ── */
.rpt-card-grid { display: grid; gap: var(--sp-4); margin-bottom: var(--sp-4); }
.rpt-card-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rpt-card-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rpt-card-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.rpt-card {
  border: 1px solid var(--stroke);
  background: var(--surface);
  padding: 14px 12px;
  position: relative;
  transition: box-shadow 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.rpt-card:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(0, 0, 0, 0.07); border-color: var(--faint); }
.rpt-card__num   { font-size: var(--fs-card); font-weight: 800; letter-spacing: -0.4px; font-variant-numeric: tabular-nums; margin-bottom: 4px; }
.rpt-card__title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.7px; color: var(--dark); margin-bottom: 4px; }
.rpt-card__desc  { font-size: 11px; color: var(--light); line-height: 1.4; }

.rpt-card--dark { background: var(--dark); border-color: var(--dark); color: var(--white); }
.rpt-card--dark .rpt-card__num,
.rpt-card--dark .rpt-card__title,
.rpt-card--dark .rpt-card__desc { color: var(--white); }
.rpt-card--warn { border-color: var(--critical); background: var(--critical-bg); }
.rpt-card--warn .rpt-card__num { color: var(--critical); }

/* ── LAYER 6 · COLUMN LAYOUTS ── */
.rpt-two-col   { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); margin-bottom: var(--sp-3); }
.rpt-three-col { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-4); margin-bottom: var(--sp-3); }
.rpt-col       { display: flex; flex-direction: column; }
.rpt-col__head { font-size: var(--fs-eyebrow); font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--mid); margin-bottom: 8px; }
.rpt-col__sub  { font-size: var(--fs-eyebrow); color: var(--light); margin: -2px 0 8px; }
.rpt-section-lbl { font-size: var(--fs-eyebrow); font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--light); margin: var(--sp-3) 0 var(--sp-2); }
.rpt-section-gap { height: var(--sp-5); }

/* ── LAYER 7 · TABLES ──
   Canonical look from the design SSOT: 2px black header underline, no fill. */
.rpt-table { width: 100%; border-collapse: collapse; font-size: var(--fs-table); color: var(--dark); }
.rpt-table th {
  text-align: left;
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  color: var(--mid);
  padding: 8px 10px;
  border-bottom: 2px solid var(--black);
}
.rpt-table td { padding: 8px 10px; border-bottom: 1px solid var(--stroke); font-variant-numeric: tabular-nums; }
.rpt-table tr:last-child td { border-bottom: none; }
.rpt-table--compact th { padding: 6px 8px; }
.rpt-table--compact td { padding: 6px 8px; }
.rpt-table--striped tbody tr:nth-child(even) td { background: var(--surface); }

.rpt-row--total td,
.rpt-row-total td { border-top: 2px solid var(--black); font-weight: 700; color: var(--black); }
.rpt-row--warn { background: rgba(122, 0, 18, 0.04); }

/* Right-align helpers — must out-specify `.rpt-table th { text-align:left }` so numeric
   HEADERS line up with their right-aligned cells (not just the cells). */
.rpt-num { text-align: right; }
.rpt-table th.rpt-num, .rpt-table td.rpt-num,
.rpt-table th.right,   .rpt-table td.right { text-align: right; }
.rpt-table th.center, .rpt-table td.center, .rpt-table .center { text-align: center; }

/* ── LAYER 8 · HORIZONTAL BAR CHART ──
   Canonical ranked-bar (HR + CEO). label │ track │ value. */
.rpt-bar-section { width: 100%; margin: 0 0 12px; }
.rpt-bar-section--wide { width: 100%; }
.rpt-bar-list { display: grid; gap: 7px; }
.rpt-bar-row {
  display: grid;
  grid-template-columns: minmax(150px, 230px) 1fr minmax(150px, auto);
  gap: 12px;
  align-items: center;
}
.rpt-bar-row__label { font-size: 11px; color: var(--mid); white-space: normal; line-height: 1.25; }
.rpt-bar-row__track { height: 16px; background: var(--surface); border-radius: 4px; overflow: hidden; }
.rpt-bar-row__fill {
  height: 100%;
  min-width: 2px;
  border-radius: 4px;
  background: var(--dark);
  transition: width 0.4s ease;
}
.rpt-bar-row__fill--warn { background: var(--critical); }
.rpt-bar-row__value { font-size: 11px; font-weight: 700; text-align: right; color: var(--dark); font-variant-numeric: tabular-nums; }

/* ── LAYER 9 · STACKED BAR + LEGEND (HR salary composition) ── */
.rpt-stacked-chart { margin-bottom: 16px; }
.rpt-stacked-row { display: grid; grid-template-columns: 90px 1fr 100px; gap: 8px; align-items: center; margin-bottom: 6px; }
.rpt-stacked-row__label { font-size: 11px; color: var(--mid); }
.rpt-stacked-row__bar { display: flex; height: 18px; border-radius: 4px; overflow: hidden; background: var(--surface); }
.rpt-stacked-row__total { font-size: 11px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.rpt-stacked-seg { height: 100%; min-width: 1px; transition: width 0.4s ease; }
.rpt-stacked-seg--basic     { background: var(--black); }
.rpt-stacked-seg--housing   { background: var(--mid); }
.rpt-stacked-seg--transport { background: var(--light); }
.rpt-stacked-seg--additions { background: var(--accent); }

.rpt-legend { display: flex; gap: 16px; margin-top: 10px; flex-wrap: wrap; }
.rpt-legend__item { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--mid); }
.rpt-legend__dot { width: 10px; height: 10px; border-radius: 2px; }
.rpt-legend__dot--basic     { background: var(--black); }
.rpt-legend__dot--housing   { background: var(--mid); }
.rpt-legend__dot--transport { background: var(--light); }
.rpt-legend__dot--additions { background: var(--accent); }

/* ── LAYER 10 · SVG LINE CHART (CEO trends) ── */
.rpt-chart-shell { width: 100%; flex: 1; min-height: 140px; max-height: 160px; margin: 8px 0 10px; }
.rpt-svg { width: 100%; height: 100%; display: block; min-height: 140px; max-height: 160px; }
.rpt-line-area        { fill: rgba(0, 113, 227, 0.14); }
.rpt-line-area--alt   { fill: rgba(0, 0, 0, 0.08); }
.rpt-line-stroke      { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.rpt-line-stroke--alt { stroke: var(--black); }
.rpt-chart-axis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; margin-top: 4px; }
.rpt-chart-axis span { font-size: 9px; color: var(--light); text-align: center; white-space: nowrap; }

/* ── LAYER 11 · CALLOUTS + NOTES ── */
.rpt-callout { border: 1px solid var(--stroke); border-left: 3px solid var(--dark); background: var(--surface); border-radius: 4px; padding: 12px 16px; margin: 10px 0; }
.rpt-callout--info { border-color: var(--accent); border-left-color: var(--accent); background: var(--accent-soft); }
.rpt-callout__text { font-size: var(--fs-meta); color: var(--mid); line-height: 1.5; }
.rpt-note-list { display: flex; flex-direction: column; gap: 8px; }
.rpt-note-item { padding: 10px 12px; border: 1px solid var(--stroke); border-left: 3px solid var(--accent); background: var(--white); color: var(--dark); font-size: 12px; line-height: 1.45; }

/* Reference badge + [?] verification popup on each report figure */
.rpt-reftip { position: relative; display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; vertical-align: middle; font-weight: 400; }
.rpt-reftip__id { font-size: 10px; font-weight: 700; letter-spacing: 0.3px; color: var(--mid); background: var(--surface); border: 1px solid var(--stroke); border-radius: 3px; padding: 1px 5px; }
.rpt-reftip__q { display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; border-radius: 50%; background: var(--dark); color: #fff; font-size: 10px; font-weight: 700; cursor: help; user-select: none; }
.rpt-reftip__pop { position: absolute; top: 130%; left: 0; z-index: 60; width: 370px; max-width: 82vw; background: var(--white, #fff); border: 1px solid var(--stroke); border-left: 3px solid var(--dark); border-radius: 6px; box-shadow: 0 8px 26px rgba(0,0,0,0.16); padding: 13px 15px; display: none; flex-direction: column; gap: 3px; text-align: left; white-space: normal; text-transform: none; letter-spacing: normal; font-weight: 400; font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; }
.rpt-reftip:hover .rpt-reftip__pop, .rpt-reftip__q:focus + .rpt-reftip__pop { display: flex; }
.rpt-reftip__title { font-size: 12.5px; font-weight: 700; color: var(--dark); margin-bottom: 3px; text-transform: none; letter-spacing: normal; }
.rpt-reftip__lbl { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: var(--mid); margin-top: 4px; }
.rpt-reftip__txt { font-size: 12.5px; line-height: 1.55; color: var(--dark); text-transform: none; letter-spacing: normal; font-weight: 400; }
.rpt-reftip__formula { font-family: 'Consolas', 'SF Mono', 'Menlo', monospace; font-size: 11.5px; line-height: 1.6; white-space: pre-line; background: var(--surface); border: 1px solid var(--stroke); border-radius: 4px; padding: 7px 10px; margin-top: 1px; color: var(--dark); text-transform: none; letter-spacing: normal; }

/* CEO / ops action note shown under a table or chart (Issue → cause → fix → action) */
.rpt-action-note { margin: 10px 0 4px; padding: 12px 14px; border: 1px solid var(--stroke); border-left: 3px solid var(--dark); background: var(--surface); border-radius: 4px; display: flex; flex-direction: column; gap: 7px; }
.rpt-action-note__row { display: grid; grid-template-columns: 168px 1fr; gap: 12px; align-items: baseline; }
.rpt-action-note__label { font-size: 10px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase; color: var(--mid); }
.rpt-action-note__label--issue { color: var(--danger, #c0152f); }
.rpt-action-note__label--action { color: var(--dark); }
.rpt-action-note__text { font-size: 12px; line-height: 1.5; color: var(--dark); }
@media (max-width: 760px) { .rpt-action-note__row { grid-template-columns: 1fr; gap: 2px; } }

/* ── LAYER 12 · BADGES (status + severity) ── */
.rpt-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 9px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase; }
.rpt-badge--ready    { background: var(--success-bg); color: var(--success); }
.rpt-badge--partial  { background: var(--pending-bg); color: var(--pending); }
.rpt-badge--medium   { background: var(--accent-soft); color: var(--accent); }
.rpt-badge--low      { background: var(--surface); color: var(--mid); }
.rpt-badge--empty,
.rpt-badge--critical,
.rpt-badge--high     { background: var(--critical-bg); color: var(--critical); }

/* ── LAYER 13 · EMPTY STATES + INLINE HELPERS ── */
.rpt-empty { color: var(--light); font-size: 12px; font-style: italic; padding: 8px 0; }
.rpt-empty-card { border: 1px solid var(--stroke); background: var(--white); padding: 16px 12px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; margin-bottom: 8px; }
.rpt-empty-card__icon { width: 34px; height: 34px; border-radius: 999px; border: 1px solid var(--stroke); display: inline-flex; align-items: center; justify-content: center; color: var(--light); font-size: 11px; font-weight: 700; }
.rpt-empty-card__title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: var(--dark); }
.rpt-empty-card__sub { font-size: 11px; color: var(--mid); max-width: 320px; line-height: 1.4; }

.rpt-report-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--stroke); font-size: 10px; color: var(--light); flex-wrap: wrap; }

/* ── Methodology / honest-data notes ── */
.rpt-notes { margin: 6px 0 0; padding-left: 18px; list-style: disc; }
.rpt-notes li { font-size: 11.5px; line-height: 1.55; color: var(--mid); margin-bottom: 7px; }
.rpt-notes li strong { color: var(--dark); font-weight: 700; }

.rpt-doc .bold,
.rpt-bold     { font-weight: 700; }
.rpt-positive { color: var(--accent); font-weight: 700; }
.rpt-warn     { color: var(--critical); font-weight: 700; }

/* ── LAYER 14 · RESPONSIVE — three breakpoints: 1280 · 1024 · 760 ── */
@media (max-width: 1280px) {
  .rpt-big-numbers--6,
  .rpt-big-numbers--8 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .rpt-cover__title { font-size: 2.6rem; letter-spacing: -1.4px; }
}
@media (max-width: 1024px) {
  .rpt-big-numbers--4,
  .rpt-big-numbers--5,
  .rpt-big-numbers--6,
  .rpt-big-numbers--8 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rpt-card-grid--3,
  .rpt-card-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rpt-three-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rpt-two-col   { grid-template-columns: 1fr; }
  .rpt-bar-row   { grid-template-columns: minmax(130px, 200px) 1fr minmax(120px, auto); }
}
@media (max-width: 760px) {
  .rpt-page { min-height: auto; padding: 20px 16px; }
  .rpt-big-numbers--3,
  .rpt-big-numbers--4,
  .rpt-big-numbers--5,
  .rpt-big-numbers--6,
  .rpt-big-numbers--8 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rpt-card-grid--2,
  .rpt-card-grid--3,
  .rpt-card-grid--4 { grid-template-columns: 1fr; }
  .rpt-three-col { grid-template-columns: 1fr; }
  .rpt-big-num { border-right: none; border-bottom: 1px solid var(--stroke); }
  .rpt-big-num:last-child { border-bottom: none; }
  .rpt-cover__title { font-size: 2.1rem; }
  .rpt-bar-row { grid-template-columns: minmax(110px, 1fr) 1.3fr minmax(96px, auto); }
  .rpt-bar-row__label, .rpt-bar-row__value { font-size: 10px; }
}

/* ── LAYER 15 · PRINT — A4 landscape, one report page per sheet ── */
@media print {
  .rpt-doc { padding: 0; background: var(--white); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rpt-page { min-height: auto; box-shadow: none; break-after: page; page-break-after: always; page-break-inside: avoid; }
  .rpt-page--last { break-after: auto; page-break-after: auto; }
  .rpt-card:hover { transform: none; box-shadow: none; }
  @page { size: A4 landscape; margin: 12mm; }
}

/* ── LAYER 16 · BLOCKS · CHART KIT · 2-UP GRID · SCROLL TABLES · KPI DELTAS ──
   Every visual = one .rpt-block (small title + sub + body) with a uniform gap.
   Charts are always full-width blocks; only text tables may sit 2-up. */
.rpt-block { margin-bottom: var(--block-gap); }
.rpt-block:last-child { margin-bottom: 0; }
.rpt-block__title { font-size: 14px; font-weight: 700; color: var(--black); letter-spacing: -0.2px; line-height: 1.25; margin-bottom: 3px; }
.rpt-block__sub { font-size: 11.5px; color: var(--light); line-height: 1.45; margin-bottom: 12px; }

/* Chart fills the content width at a wide ~4.3:1 aspect (viewBox 1280×300) so it matches the
   full-width tables/KPIs instead of letterboxing into a small centred block. */
.rpt-chart { width: 100%; height: auto; display: block; }

/* ── Download-Excel action (fixed, top-right; hidden on print/export) ── */
.rpt-export-fab {
  position: fixed; top: 84px; right: 30px; z-index: 50;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; font-family: inherit; font-size: 13px; font-weight: 700; letter-spacing: 0.2px;
  color: var(--white); background: var(--black); border: none; border-radius: 999px;
  cursor: pointer; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
  transition: background-color 0.15s ease, transform 0.15s ease;
}
.rpt-export-fab:hover { background: var(--success); transform: translateY(-1px); }
.rpt-export-fab:disabled { opacity: 0.7; cursor: default; transform: none; }
.rpt-export-fab__spin {
  width: 13px; height: 13px; border: 2px solid rgba(255, 255, 255, 0.4); border-top-color: #fff;
  border-radius: 50%; display: inline-block; animation: rpt-spin 0.8s linear infinite;
}
@media (max-width: 760px) { .rpt-export-fab { top: auto; bottom: 18px; right: 18px; } }
@media print { .rpt-export-fab { display: none !important; } }

.rpt-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); margin-bottom: var(--block-gap); }

.rpt-scroll { max-height: 320px; overflow-y: auto; }
.rpt-scroll .rpt-table thead th { position: sticky; top: 0; background: var(--white); z-index: 1; }
.rpt-table-note { font-size: 10px; color: var(--light); margin-top: 6px; }

.rpt-big-num__delta { font-size: 11px; color: var(--mid); margin-top: 3px; font-variant-numeric: tabular-nums; }

@media (max-width: 1024px) {
  .rpt-grid-2 { grid-template-columns: 1fr; }
}
@media print {
  .rpt-scroll { max-height: none; overflow: visible; }
}

/* ── LAYER 17 · HOVER EXPLAINERS — plain-English tooltip on any KPI (data-tip) ── */
.rpt-big-num[data-tip] { cursor: help; }
/* native-title hover explainers on cells and chart SVG points */
.rpt-table td[title], .rpt-chart [title] { cursor: help; }
/* headers are click-to-sort (pointer) AND carry a hover explainer (dotted underline) */
.rpt-table thead th { cursor: pointer; user-select: none; }
.rpt-table th[title] { text-decoration: underline dotted rgba(0,0,0,0.28); text-underline-offset: 3px; }
.rpt-sort-mark { color: var(--accent); font-size: 0.82em; font-weight: 700; }

/* per-table filter box (inserted above long tables) + reused by inline pickers */
.rpt-table-search {
  width: 220px; max-width: 100%; padding: 7px 11px; border: 1px solid var(--stroke);
  border-radius: 8px; font-size: 12px; font-family: inherit; color: var(--dark); background: var(--white);
}
.rpt-table-search:focus { outline: none; border-color: var(--accent); }
.rpt-table-filter { display: block; margin: 0 0 var(--sp-2); }
.rpt-big-num[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% - 4px);
  transform: translateX(-50%);
  width: 220px;
  background: #111;
  color: #fff;
  text-align: left;
  text-transform: none;
  letter-spacing: normal;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.45;
  padding: 8px 10px;
  border-radius: 6px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 30;
}
.rpt-big-num[data-tip]:hover::after { opacity: 1; }

.rpt-note-list--2col { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 1024px) { .rpt-note-list--2col { grid-template-columns: 1fr; } }
@media print { .rpt-big-num[data-tip]::after { display: none; } }
