/* Tianxinhui CRM V2.5.4 - final quotation and commercial invoice refinements. */

/* The visual theme belongs to the export action, not to a saved business template. */
.quote-preview-toolbar,.invoice-preview-toolbar{min-height:66px;align-items:center}
.document-export-actions{display:flex;align-items:center;gap:9px}
.document-theme-select{width:184px;height:42px;padding:0 34px 0 13px;color:#1b2b45;background:#fff;border:1px solid #d5dfec;border-radius:9px;outline:none;font-size:14px;font-weight:700;line-height:42px}
.document-theme-select:focus{border-color:#4a7fe4;box-shadow:0 0 0 3px rgba(37,99,235,.12)}
.document-export-actions .btn{height:42px;padding:0 16px;border-radius:9px;font-size:14px;white-space:nowrap}

/* Ten independent document palettes. */
.document-page{--doc:#174f7d;--accent:#b8873d;--soft:#f3f7fb;position:relative;width:210mm;height:297mm;min-height:297mm;max-height:297mm;padding:6.5mm 9mm 8mm;overflow:hidden;font-family:"Times New Roman",Times,serif;color:#18334d}
.document-theme-navy{--doc:#174f7d;--accent:#b8873d;--soft:#f3f7fb}
.document-theme-tech{--doc:#183c69;--accent:#3b82c4;--soft:#edf4fb}
.document-theme-green{--doc:#15594c;--accent:#ba8b3b;--soft:#eff8f4}
.document-theme-wine{--doc:#762b43;--accent:#bc8a42;--soft:#fbf2f4}
.document-theme-mono{--doc:#25292e;--accent:#71767d;--soft:#f5f5f5}
.document-theme-champagne{--doc:#43372c;--accent:#c4a05b;--soft:#fbf7ee}
.document-theme-graphite{--doc:#353b42;--accent:#7d8791;--soft:#f2f4f6}
.document-theme-ocean{--doc:#0f5362;--accent:#dc9d45;--soft:#edf8f9}
.document-theme-royal{--doc:#38346f;--accent:#c89542;--soft:#f4f2fa}
.document-theme-sky{--doc:#286b94;--accent:#69a9c9;--soft:#eff7fb}

/* Apply theme variables to every visual part of both documents. */
.document-page .doc-continuation,.quote-page .qa3-header,.invoice-page .ci-header{border-bottom-color:var(--doc)}
.document-page .doc-continuation-brand strong,.document-page .doc-continuation>div:last-child strong,.document-page .document-annex-summary strong,.quote-page .qa3-brand strong,.quote-page .qa3-document-title h1,.quote-page .qa3-overview strong,.quote-page .qa3-parties h2,.quote-page .qa3-section-heading h2,.quote-page .qa3-product h3,.quote-page .qa3-endnote span,.invoice-page .ci-company strong,.invoice-page .ci-title h1,.invoice-page .ci-meta strong,.invoice-page .ci-parties h2,.invoice-page .ci-section-title h2{color:var(--doc)}
.document-page .doc-continuation>div:last-child span,.document-page .document-annex-summary span,.quote-page .qa3-document-title>span,.quote-page .qa3-footer span,.invoice-page .ci-title>span,.invoice-page .ci-signature section span{color:var(--accent)}
.document-page .document-annex-summary{background:var(--soft);border-left-color:var(--doc)}
.quote-page .qa3-logo,.quote-page .qa3-party-label,.quote-page .qa3-products th,.quote-page .qa3-commercial>aside,.invoice-page .ci-logo,.invoice-page .ci-party-label,.invoice-page .ci-goods th,.invoice-page .ci-financial>aside{background:var(--doc)}
.quote-page .qa3-party-label.buyer,.quote-page .qa3-section-heading>div>span,.invoice-page .ci-party-label.buyer,.invoice-page .ci-section-title>span{background:var(--accent)}
.quote-page .qa3-overview,.quote-page .qa3-products tbody tr:nth-child(even),.quote-page .qa3-commercial>article,.invoice-page .ci-meta,.invoice-page .ci-goods tbody tr:nth-child(even),.invoice-page .ci-financial>article{background:var(--soft)}
.quote-page .qa3-bank{border-left-color:var(--doc)}

/* Three standard products stay on one A4 page without hiding text. */
.document-single-page.quote-page .qa3-parties article,.document-single-page.invoice-page .ci-parties article{min-height:35mm}
.document-single-page.quote-page .qa3-products td,.document-single-page.invoice-page .ci-goods td{height:21mm}
.document-single-page.quote-page .qa3-commercial{min-height:27mm}
.document-single-page.quote-page .qa3-bank{min-height:33mm}
.document-page p,.document-page dd,.document-page td,.document-page strong,.document-page small{max-width:100%;white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere}

/* Product headers, images and names are centered and never cross cell borders. */
.quote-page .qa3-products th,.invoice-page .ci-goods th{height:9mm;padding:0 1.4mm;text-align:center!important;vertical-align:middle;line-height:1.15;white-space:normal;word-break:keep-all}
.quote-page .qa3-products td,.invoice-page .ci-goods td{text-align:center;vertical-align:middle}
.quote-page .qa3-spec{text-align:left!important}
.quote-page .qa3-product{align-items:center;text-align:center}
.quote-page .qa3-product img,.quote-page .qa3-image-placeholder,.invoice-page .ci-product-image img,.invoice-page .ci-product-image>span{display:grid;place-items:center;margin:auto;object-fit:contain;object-position:center}
.invoice-page .ci-goods td:nth-child(3){text-align:center}

/* The 40 mm transparent PNG stamp floats above the original signature layout. */
.quote-page .qa3-footer{position:relative;display:grid;grid-template-columns:1fr 1fr;min-height:25mm;overflow:visible}
.quote-page .qa3-stamp{position:absolute;left:40%;top:50%;width:40mm;height:40mm;transform:translate(-50%,-50%);display:grid;place-items:center;z-index:30;pointer-events:none}
.quote-page .qa3-stamp img,.quote-page .qa3-stamp>span{display:grid;width:40mm;height:40mm;max-width:40mm;max-height:40mm;place-items:center;margin:0;object-fit:contain;object-position:center;background:transparent}
.invoice-page .ci-declaration{position:relative;grid-template-columns:minmax(0,1fr) 58mm;min-height:29mm;overflow:visible}
.invoice-page .ci-signature{position:relative;display:flex;align-items:center;justify-content:flex-end;min-width:0;height:100%;padding:3mm;border-left:1px solid #e1e7ec;overflow:visible}
.invoice-page .ci-signature img,.invoice-page .ci-signature>div{position:absolute;right:1mm;left:auto;top:72%;display:grid;width:40mm;height:40mm;max-width:40mm;max-height:40mm;place-items:center;margin:0;object-fit:contain;object-position:center;transform:translateY(-50%) rotate(-4deg);z-index:30;pointer-events:none;background:transparent}
.invoice-page .ci-signature section{position:relative;z-index:2;min-width:0;text-align:left}

/* Page notes are pinned inside the safe area, so no footer text is clipped. */
.quote-page .qa3-endnote,.invoice-page .ci-footer{position:absolute;left:9mm;right:9mm;bottom:2.5mm;min-height:4mm;height:auto;margin:0;padding-top:1.2mm;background:#fff;z-index:25;white-space:normal;overflow:visible;text-overflow:clip}
.invoice-page .ci-footer{display:grid;grid-template-columns:1fr auto auto;align-items:start;gap:4mm}

@page{size:A4 portrait;margin:0}
@media print{
  html,body{width:210mm!important;min-width:0!important;max-width:210mm!important;height:auto!important;margin:0!important;padding:0!important;overflow:visible!important;background:#fff!important}
  body>*{display:none!important}
  body>#appPage{display:block!important;position:static!important;width:210mm!important;min-width:0!important;max-width:210mm!important;margin:0!important;padding:0!important;background:#fff!important;transform:none!important;scale:1!important;zoom:1!important}
  #appPage>.sidebar,#appPage .topbar,#appPage .quote-editor,#appPage .quote-preview-toolbar,#appPage .invoice-editor,#appPage .invoice-preview-toolbar{display:none!important}
  #appPage>.main,#appPage .content,#view-tool-quote>.quote-workspace,#view-tool-quote .quote-preview-shell,#view-tool-invoice>.invoice-workspace,#view-tool-invoice .invoice-preview-shell{display:block!important;position:static!important;grid-template-columns:none!important;grid-column:auto!important;width:210mm!important;min-width:0!important;max-width:210mm!important;height:auto!important;margin:0!important;padding:0!important;overflow:visible!important;transform:none!important;scale:1!important;zoom:1!important}
  #appPage .content>.view{display:none!important}
  body.printing-quote #appPage #view-tool-quote,body.printing-invoice #appPage #view-tool-invoice{display:block!important;position:static!important;width:210mm!important;min-width:0!important;max-width:210mm!important;margin:0!important;padding:0!important}
  body.printing-quote #appPage #view-tool-invoice,body.printing-invoice #appPage #view-tool-quote{display:none!important}
  #quotePrintArea.document-pages,#invoicePrintArea.document-pages{display:block!important;position:static!important;width:210mm!important;min-width:0!important;max-width:210mm!important;margin:0!important;padding:0!important;overflow:visible!important;visibility:visible!important;transform:none!important;scale:1!important;zoom:1!important}
  #quotePrintArea.document-pages *,#invoicePrintArea.document-pages *{visibility:visible!important}
  .document-page{display:block!important;position:relative!important;inset:auto!important;width:210mm!important;min-width:210mm!important;max-width:210mm!important;height:297mm!important;min-height:297mm!important;max-height:297mm!important;margin:0!important;padding:6.5mm 9mm 8mm!important;border:0!important;box-shadow:none!important;overflow:hidden!important;transform:none!important;scale:1!important;zoom:1!important;box-sizing:border-box!important;break-after:page!important;page-break-after:always!important;print-color-adjust:exact!important;-webkit-print-color-adjust:exact!important}
  .document-page:last-child{break-after:auto!important;page-break-after:auto!important}
  .document-page tr,.document-page .qa3-parties,.document-page .qa3-commercial,.document-page .qa3-bank,.document-page .qa3-footer,.document-page .ci-parties,.document-page .ci-financial,.document-page .ci-declaration{break-inside:avoid!important;page-break-inside:avoid!important}
}
