/* ===========================================================================
   CustomOps — Print styles (work orders, invoices, estimates, asset labels)
   =========================================================================== */
@media print {
  @page { margin: 0.5in; size: letter; }

  html, body { background: #fff !important; overflow: visible !important; height: auto !important; }
  body { color: #111 !important; }

  .rail, .topbar, .subbar, #toasts, .scrim, .palette-scrim,
  .no-print, .drawer-foot, .modal-foot, .btn, .icon-btn { display: none !important; }

  #app { display: block !important; height: auto !important; }
  .main, .view { display: block !important; height: auto !important; overflow: visible !important; }
  .view-pad { padding: 0 !important; max-width: none !important; }

  .drawer, .modal {
    position: static !important; width: auto !important; max-height: none !important;
    border: none !important; box-shadow: none !important; animation: none !important;
    display: block !important;
  }
  .drawer-body, .modal-body { overflow: visible !important; padding: 0 !important; }

  /* Print target isolation: add .print-only-root to the element to print */
  body.printing > *:not(#print-stage) { display: none !important; }
  #print-stage { display: block !important; }

  .doc { box-shadow: none !important; border: none !important; border-radius: 0 !important; }
  .doc .doc-inner { padding: 0 !important; }

  .card { border-color: #d5dae2 !important; box-shadow: none !important; break-inside: avoid; }
  table.tbl thead th { background: #f1f3f7 !important; color: #444 !important; }
  tr, .tag-label, .postcard { break-inside: avoid; }

  .label-sheet {
    display: grid !important; grid-template-columns: repeat(3, 1fr); gap: 0.12in;
  }
  .tag-label { width: auto !important; break-inside: avoid; }

  a[href]::after { content: none !important; }
}

/* Off-screen stage used to render a single element for printing */
#print-stage { display: none; }
.label-sheet { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
