/* ─── Print styles for reports ─── */
@media print {
  /* Hide chrome */
  header, footer, nav, aside, button,
  .no-print, [data-sidebar], [role="banner"],
  [role="complementary"] {
    display: none !important;
  }
  .print-only { display: block !important; }
  .print-page-break { break-before: page; }

  /* Base */
  html, body {
    font-size: 11pt;
    color: #1a1a1a;
    background: #fff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Layout: remove sidebar offset, maximize width */
  body > div, main, [role="main"] {
    margin: 0 !important;
    padding: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
  }
  .container, .max-w-5xl, .max-w-6xl, .max-w-7xl {
    max-width: 100% !important;
    padding-left: 0.5cm !important;
    padding-right: 0.5cm !important;
    margin: 0 !important;
  }

  /* Remove decorative elements */
  .shadow-sm, .shadow-md, .shadow-lg, .shadow-xl, .shadow-2xl {
    box-shadow: none !important;
  }

  /* Keep rounded corners on cards for visual structure */
  .rounded-2xl { border-radius: 8px !important; }
  .rounded-xl { border-radius: 6px !important; }
  .rounded-lg { border-radius: 4px !important; }

  /* Gradient headers: solid dark background with preserved text */
  [style*="linear-gradient"] {
    background: #0d2b6b !important;
    color: #fff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Preserve trait bar colors and chart fills */
  [style*="backgroundColor"], [style*="background:"],
  .bg-blue-50, .bg-violet-50, .bg-emerald-50, .bg-amber-50,
  .bg-rose-50, .bg-slate-50, .bg-blue-100, .bg-amber-100 {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Recharts SVGs: force visible */
  .recharts-wrapper, .recharts-surface {
    width: 100% !important;
    overflow: visible !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  svg { overflow: visible !important; }

  /* Border styling */
  .border, [class*="border-"] {
    border-color: #ddd !important;
  }

  /* Page break control */
  h1, h2, h3 { break-after: avoid; }
  section, .rounded-2xl, .rounded-xl { break-inside: avoid; }
  [role="tabpanel"] > div { break-inside: avoid; }

  /* Tab list: show as a subtle header, not interactive buttons */
  [role="tablist"] {
    display: flex !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    padding: 4px !important;
    background: #f5f5f5 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  [role="tab"] {
    display: inline-flex !important;
    font-size: 9pt !important;
    padding: 2px 8px !important;
    color: #666 !important;
  }
  [role="tab"][data-state="active"] {
    font-weight: 700 !important;
    color: #000 !important;
    background: #fff !important;
    border-radius: 3px !important;
  }

  /* Glass-morphism sections: solid background for print */
  .backdrop-blur-sm, .backdrop-blur {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    background: #0d2b6b !important;
  }

  /* Links: show URL */
  a[href]::after { content: none; }
}
