/*
 * GigMint print stylesheet (Phase 5b, E4). Linked with media="print" by components/gm/head-icons.blade.php,
 * so it is only ever applied when printing (or "Save as PDF") an order, contract, invoice or any other page.
 * Goal: the record itself on white paper — no app chrome, no buttons or forms, nothing cut across pages.
 */

@page { margin: 16mm 14mm; }

html, body, body.gm, .gm, .gm .gm-shell, .gm .gm-main {
  background: #fff !important;
  color: #1C1612 !important;
}
body.gm, body.gm-impersonating { padding-top: 0 !important; }

/* ---------- Chrome that makes no sense on paper ---------- */
.gm-skip, .gma-skip,
.gm-sidebar, .gm-mobilebar, .gm-tabbar, .gm-shell__scrim,
.gm .gm-topbar__actions,
.gm-header, .gm-footer,
.gm-toasts, .gm-toast, .gmc-dialog,
.gm-impbar, .gm-verifybar,
.gm-welcome-back,
.gma-sidebar, .gma-scrim,
[data-gm-toasts], [wire\:loading], [data-gm-no-print],
iframe, video, audio,
.gm button, .gm .gm-btn, .gm input, .gm select, .gm textarea,
.gm .gm-op-sticky, .gm .gm-op-notice__actions, .gm .gm-op-notice__close, .gm .gm-op-meta__link, .gm .gm-op-help,
.gm .gm-ct-actions, .gm .gm-ct-banner__actions, .gm .gm-ct-notice__close, .gm .gm-ct-help-card, .gm .gm-ct-form,
.gm .gm-ct-file-input, .gm .gm-ct-head__msg {
  display: none !important;
}

/* ---------- Layout: one full-width column ---------- */
.gm .gm-shell { display: block !important; min-height: 0 !important; }
.gm .gm-main { padding: 0 !important; margin: 0 !important; width: auto !important; max-width: none !important; }
.gm .gm-main__inner { max-width: none !important; gap: 16px !important; }
.gm .gm-topbar { min-height: 0 !important; display: block !important; }
.gm .gm-op-cols, .gm .gm-ct-body, .gm .gm-ct { display: block !important; }
.gm .gm-op-side, .gm .gm-ct-aside { width: auto !important; position: static !important; margin-top: 16px; }

/* A small header line naming the source on every printout. */
.gm .gm-main::before {
  content: "GigMint \00B7  gigmint.ai";
  display: block;
  margin: 0 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid #E8E0D8;
  font: 600 10pt/1.4 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #776A60;
}

/* ---------- Cards and type ---------- */
.gm { font-size: 10.5pt !important; line-height: 1.45 !important; }
.gm h1 { font-size: 18pt !important; }
.gm h2 { font-size: 13pt !important; }
.gm h1, .gm h2, .gm h3 { break-after: avoid; page-break-after: avoid; }
.gm .gm-card, .gm .gm-op-card, .gm .gm-ct-ms, .gm .gm-mb-inv, .gm table, .gm tr, .gm figure {
  break-inside: avoid;
  page-break-inside: avoid;
}
.gm .gm-card, .gm .gm-op-card {
  box-shadow: none !important;
  border: 1px solid #D9CEC4 !important;
  background: #fff !important;
}
.gm a { color: #1C1612 !important; text-decoration: none !important; }
.gm .gm-table { width: 100% !important; border-collapse: collapse; }
.gm .gm-table th, .gm .gm-table td { border-bottom: 1px solid #E8E0D8 !important; }
.gm .gm-table-wrap { overflow: visible !important; }

/* Keep status colour (chips, escrow track) — it carries meaning. */
.gm .gm-chip, .gm .gm-escrow, .gm .gm-escrow *, .gm .gm-badge {
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

/* Long conversations: print the record, not the whole chat history scroll box. */
.gm .gm-op-convo__body, .gm [data-gm-scroll] { max-height: none !important; overflow: visible !important; }
