/* ============================================================================
   Print: the workshop sheet. Only what a shop needs on paper — the parts table
   with sizes, the job estimate and the hardware list. Everything interactive
   disappears. A4 portrait, 10mm margins, black on white.
   ==========================================================================*/
@page { size: A4 portrait; margin: 10mm; }

@media print {
  :root { --bg: #fff; --txt: #111; --dim: #444; --dim2: #666; --line: #bbb; --line2: #999; }
  html, body { background: #fff !important; color: #111 !important; }
  .topbar, .statbar, .pane-bar, .pane, .ftr,
  .toast, .modal, .cmdk, .dlmenu, .usagerow, .catrow, .presets,
  #btnExport, #btnWizard { display: none !important; }

  /*
   * کارت برآورد داخل #panel است. قبلاً کل پنل مخفی می‌شد و قانون
   * «.jobcard را چاپ کن» بی‌اثر بود؛ حالا پنل باز می‌ماند ولی همهٔ فرزندانش
   * جز همان بخشِ کارت حذف می‌شوند.
   */
  #panel, .panel { display: block !important; border: 0 !important; background: none !important;
    padding: 0 !important; box-shadow: none !important; }
  #panel > * { display: none !important; }
  #panel > details:has(#jobCard) { display: block !important; }
  #panel > details:has(#jobCard) > summary { display: none !important; }
  #panel > details:has(#jobCard) > .secbody > *:not(.jobcard):not(#jobCard) { display: none !important; }
  #panel > details:has(#jobCard) > .secbody { display: block !important; padding: 0 !important; }

  main.wrap { display: block !important; padding: 0 !important; }
  .stage { display: block !important; }
  .partsbar { display: block !important; background: none !important; border: 0 !important; }

  .partsbar .ptitle { font-size: 12pt; font-weight: 700; margin-bottom: 4mm; }
  .ptable table { width: 100% !important; border-collapse: collapse !important; font-size: 9pt; }
  .ptable th, .ptable td { border: 0.3mm solid #999 !important; padding: 1.2mm 2mm !important; color: #111 !important; }
  .ptable thead th { background: #eee !important; }
  .ptable tr[data-part] { break-inside: avoid; }

  /* the job card is the quote sheet: print it above the table */
  .jobcard { display: table !important; width: 100% !important; margin-bottom: 4mm !important; }
  .jobcard > div { display: table-cell !important; border: 0 !important; padding: 0 4mm 0 0 !important; }
  .jobcard i { color: #555 !important; }
  .jobcard b { font-size: 11pt !important; }

  a[href]::after { content: ''; }
  .hidden { display: none !important; }
}
