/* ============================================================
   Tadfeen Trust — print / PDF stylesheet
   ------------------------------------------------------------
   The interface uses inline <svg> icons that carry a viewBox but
   no width/height attributes; their size comes from CSS. Chromium's
   print/"Save as PDF" layout drops that CSS sizing for attribute-less
   inline SVGs, so every icon balloons to the full page width and the
   export spills across dozens of pages. This sheet re-asserts a bounded
   icon size for print and lets the admin dashboards paginate cleanly.
   ============================================================ */

@media print {

  /* 1) No inline icon may ever balloon.  Any inline SVG without an
        explicit width attribute is an icon — cap it hard. Elements
        that declare their own size (charts, sized graphics) are left
        untouched via :not([width]). */
  svg:not([width]) {
    width: 18px !important;
    height: 18px !important;
    max-width: 18px !important;
    max-height: 18px !important;
    flex: 0 0 auto !important;
  }

  /* 2) Re-assert the designed sizes for the icons that have a fixed
        footprint on screen, so the print matches the on-screen layout. */
  .chs-ic svg,
  .cm-stat-ic svg,
  .stat-ic svg,
  .stat-ico svg { width: 20px !important; height: 20px !important; max-width: 20px !important; max-height: 20px !important; }

  .chub-cta svg,
  .btn svg,
  a.chub-cta svg { width: 16px !important; height: 16px !important; max-width: 16px !important; max-height: 16px !important; }

  /* keep the fixed icon wrappers at their box size */
  .chs-ic, .cm-stat-ic, .stat-ic, .stat-ico { width: 42px !important; height: 42px !important; flex: 0 0 42px !important; }

  /* 3) Clean, readable page: white ground, honour tile backgrounds. */
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  html, body { background: #fff !important; }

  /* 4) Chrome that is meaningless on paper (keep the role badge for context). */
  .topbar-search, .topbar-icons, .theme-toggle,
  .side-quote, .side-help, .sidebar-foot,
  .search-cmd { display: none !important; }

  /* Tabs: wrap so no tab is clipped off the right edge on paper. */
  .chtabs { flex-wrap: wrap !important; overflow: visible !important; }

  /* 5) Let the content column use the full page instead of sitting in a
        fixed-sidebar offset that leaves the sidebar stranded on page 1. */
  .app-shell, .app-main, .app-content { display: block !important; margin: 0 !important; }
  .app-sidebar { display: none !important; }
  .app-content { padding: 0 12px !important; }

  /* 6) Avoid awkward breaks inside cards and stat tiles. */
  .chub-stat, .cm-stat, .stat, .chub-cta, .chub-panel, .alp-card,
  .card, .panel { break-inside: avoid; page-break-inside: avoid; }
  .chub-stats, .cm-stats { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 12px !important; }
}
