/* ══════════════════════════════════════════════════════════
   TB3 Technologies — print.css (loaded with media="print")

   Every rule is scoped to body.printing-doc, which js/admin.js
   toggles around window.print() for the Documents tab. A normal
   visitor printing the page is completely unaffected.

   The overrides on #admin-overlay/#admin-dash are load-bearing:
   position:fixed + overflow:hidden ancestors clip printing to a
   single page in Chrome.
══════════════════════════════════════════════════════════ */

@page { size: A4; margin: 16mm; }

/* Only the admin overlay subtree participates in printing */
body.printing-doc > :not(#admin-overlay) { display: none !important; }

body.printing-doc #admin-overlay {
  display: block !important;
  position: static !important;
  background: #fff !important;
  padding: 0 !important;
  overflow: visible !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
body.printing-doc #admin-dash {
  display: block !important;
  overflow: visible !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  max-width: none !important;
}
body.printing-doc #admin-login { display: none !important; }

/* Hide the admin chrome; only the document sheet remains */
body.printing-doc .adm-header,
body.printing-doc .adm-tabs,
body.printing-doc .adm-note,
body.printing-doc .adm-section-title,
body.printing-doc #doc-list,
body.printing-doc #doc-new-btn,
body.printing-doc .adm-form-btns,
body.printing-doc #doc-editor > .adm-grid,
body.printing-doc .doc-screen-only { display: none !important; }

body.printing-doc .adm-body { padding: 0 !important; }
body.printing-doc .adm-tab-pane { display: none !important; }
body.printing-doc #tab-docs { display: block !important; }
body.printing-doc #doc-editor {
  display: block !important;
  border: none !important;
  background: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* Ink-friendly A4 sheet */
body.printing-doc .doc-paper {
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  color: #000 !important;
}
body.printing-doc .doc-sec { break-inside: avoid; }
body.printing-doc .doc-sec h3 { color: #000 !important; }
body.printing-doc .doc-brand { border-bottom-color: #000 !important; }
body.printing-doc .doc-brand-ar { color: #000 !important; }
body.printing-doc .doc-h-title { color: #000 !important; }
body.printing-doc .doc-h-sub { color: #333 !important; }
body.printing-doc .doc-edit {
  border: none !important;
  background: none !important;
  padding: 0 !important;
  color: #000 !important;
  min-height: 0 !important;
}
body.printing-doc .doc-edit:empty::before { content: none !important; }
/* Sections left blank don't print at all (supported in all modern engines) */
body.printing-doc .doc-sec:has(> .doc-edit:empty) { display: none !important; }
body.printing-doc .doc-paper.no-items .doc-pricing { display: none !important; }
body.printing-doc .doc-items input {
  border: none !important;
  background: none !important;
  color: #000 !important;
  box-shadow: none !important;
}
body.printing-doc .doc-items th { color: #333 !important; border-bottom-color: #000 !important; }
body.printing-doc .doc-items td { border-bottom-color: #ccc !important; color: #000 !important; }
body.printing-doc .doc-items tfoot td { color: #000 !important; }
body.printing-doc .doc-foot { color: #333 !important; border-top-color: #000 !important; }
