/* ══════════════════════════════════════════
   print.css — أنماط الطباعة وتصدير PDF
   ══════════════════════════════════════════ */

@media print {

  /* ─── Page Setup ─── */
  @page { margin: 18mm 15mm; size: A4; }

  /* ─── Hide UI Chrome ─── */
  .topbar,
  .ap-widget,
  .btn-save,
  .btn-sec,
  .compare-bar,
  .kpi-tip,
  .leg,
  #toast,
  select { display: none !important; }

  /* ─── Show Print Header ─── */
  #print-header { display: block !important; }

  /* ─── Base ─── */
  body { background: white !important; color: #1a1f2e !important; font-size: 12px; }

  /* ─── App shell: remove fixed heights so all content prints ─── */
  #app { height: auto !important; display: block !important; }
  .content {
    height: auto !important;
    overflow: visible !important;
    padding: 0 !important;
    background: white !important;
  }

  /* ─── Pages: show only the active one ─── */
  .page { display: none !important; }
  .page.on { display: block !important; }

  /* ─── Cards & Metric Cards ─── */
  .card, .mc {
    box-shadow: none !important;
    border: 1px solid #d0d5e0 !important;
    break-inside: avoid;
  }

  /* ─── Grids: readable on A4 ─── */
  .g4 { grid-template-columns: repeat(2, 1fr) !important; }
  .g2 { grid-template-columns: 1fr 1fr !important; }
  .g21 { grid-template-columns: 2fr 1fr !important; }
  .g3 { grid-template-columns: repeat(3, 1fr) !important; }

  /* ─── Charts ─── */
  .ch { break-inside: avoid; }
  .ch-280 { height: 220px !important; }
  .ch-240 { height: 200px !important; }
  .ch-200 { height: 160px !important; }

  /* ─── Tables ─── */
  .tw { overflow: visible !important; }
  table { font-size: 11px; }
  thead { display: table-header-group; }
  tr { break-inside: avoid; }

  /* ─── Force color printing for colored elements ─── */
  .sec-header,
  .mc-accent,
  .pf, .ap-fill,
  .badge,
  .sec-header-title { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  /* ─── Section header: simpler in print ─── */
  .sec-header { margin-bottom: 14px; }

  /* ─── Page-head: hide action buttons row ─── */
  .pg-head { margin-bottom: 14px; }
}
