/* report-actions-bar — screen layout
   Right-aligned flex bar that sits above the report heading.
   Modest bottom margin keeps it from collapsing into the heading. */
.report-actions-bar {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 12px;
}

/* Bold the totals row(s) on both screen and print.
   Scoped to .report-print-region tfoot so only the CSR and forensic
   tables that consume <report-actions> get the bolding — zero blast
   on any other <tfoot> elsewhere in the app. */
.report-print-region tfoot {
    font-weight: bold;
}

/* Print scoping — opt-in via body.has-report-actions
   These rules ONLY engage on pages that consume <report-actions>.
   The directive adds / removes the body class in $onInit / $onDestroy.
   All other pages print exactly as they do today — zero blast radius. */
/* Print: independent of the legacy site.css #printSection mechanism.
   site.css:223 ships an UNCONDITIONAL @media print block that does
   `body * { display: none; visibility: hidden }` on every printable
   page in the app and revives ONLY id="printSection". To stay
   independent of that id (and avoid its off-target screen effects)
   we override site.css's hide directly for our .report-print-region
   class with !important (beats site.css's normal-weight rule
   regardless of specificity). :has() lets us revive the wrapper
   chain too — without that, the region is inside a display:none
   ancestor and won't render no matter what we set on the region. */
@media print {
    body.has-report-actions *:has(.report-print-region),
    body.has-report-actions .report-print-region,
    body.has-report-actions .report-print-region * {
        display: revert !important;
        visibility: visible !important;
    }

    /* The action bar lives inside the print region — the revival above
       would show it. Explicitly hide it for print. */
    body.has-report-actions .report-print-region report-actions,
    body.has-report-actions .report-print-region .report-actions-bar {
        display: none !important;
    }

    /* Avoid splitting table rows across print pages */
    body.has-report-actions .report-print-region tr {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    /* Repeat <thead> on every printed page */
    body.has-report-actions .report-print-region thead {
        display: table-header-group !important;
    }
}

/* Tighten the printed-page margins. Browser default is ~2.54 cm on every
   side which wastes real estate. NOTE: most browsers' print dialog has a
   "Margins" dropdown that OVERRIDES @page unless the user sets it to None
   / Minimum / Custom — "Default" wins and ignores us. With a permissive
   dropdown setting, this rule reclaims the gutter. */
@page {
    margin: 0.5cm;
}
