
/* Quotation Template V2 */
body{font-family:"Cairo",Tahoma,Arial,sans-serif;}
body .print-page-frame{display:none!important;}
body .page-shell{padding:12px;}
body .page.a4{width:210mm;min-height:297mm;padding:14mm 12mm 10mm;background:#fff;box-shadow:none;border-radius:0;}
body .page-content{min-height:calc(297mm - 24mm);display:flex;flex-direction:column;}
body .print-body{padding-top:0;}

.quotation-print-header{margin-bottom:12px;border-bottom:2px solid #dbe4ec;padding-bottom:10px;}
.qph-topbar{height:6px;background:linear-gradient(90deg,#16324a 0%,#2b5f8f 100%);border-radius:999px;margin-bottom:12px;}
.qph-main{display:grid;grid-template-columns:1.1fr .9fr;gap:16px;align-items:start;}
.qph-brand-head{display:flex;gap:12px;align-items:flex-start;}
.qph-logo{width:64px;height:64px;border:1px solid #d7e2ec;border-radius:50%;display:flex;align-items:center;justify-content:center;padding:4px;flex:0 0 64px;}
.qph-logo img{max-width:100%;max-height:100%;object-fit:contain;border-radius:50%;}
.qph-company-name{font-size:22px;font-weight:800;color:#10273a;line-height:1.2;}
.qph-company-sub,.qph-company-meta{font-size:11px;color:#5a6d7f;line-height:1.8;}
.qph-doc-block{text-align:left;border:1px solid #dbe4ec;border-radius:14px;padding:12px 14px;background:#fbfcfe;}
.qph-doc-title{font-size:28px;font-weight:800;color:#10273a;line-height:1.2;}
.qph-doc-title-en{font-size:12px;font-weight:700;color:#5d7185;text-transform:uppercase;letter-spacing:.14em;margin-top:3px;}
.qph-doc-meta{margin-top:10px;display:grid;gap:6px;}
.qph-meta-row{display:flex;justify-content:space-between;gap:12px;font-size:12px;border-bottom:1px solid #ecf1f5;padding-bottom:4px;}
.qph-meta-row:last-child{border-bottom:none;padding-bottom:0;}
.qph-meta-row span{color:#6a7d8f;font-weight:700;}
.qph-meta-row strong{color:#10273a;font-weight:800;direction:ltr;}

.quotation-expired-banner{margin-bottom:10px;border:1px solid #f0c88a;background:#fff8ec;color:#8b5a00;padding:10px 12px;border-radius:10px;font-size:12px;font-weight:700;}
.quotation-client-strip{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-bottom:12px;}
.quotation-client-card,.quotation-info-card,.quotation-total-box,.quotation-terms-block{border:1px solid #dbe4ec;border-radius:12px;background:#fff;}
.quotation-client-card,.quotation-info-card{padding:12px 14px;}
.quotation-section-label,.quotation-subtitle{font-size:12px;font-weight:800;color:#1c4363;letter-spacing:.02em;margin-bottom:8px;}
.quotation-client-name{font-size:18px;font-weight:800;color:#10273a;margin-bottom:5px;}
.quotation-client-meta{display:flex;flex-wrap:wrap;gap:8px 14px;font-size:11px;color:#5d7185;}
.quotation-info-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 16px;}
.quotation-info-grid span{display:block;font-size:10px;color:#6a7d8f;margin-bottom:3px;}
.quotation-info-grid strong{display:block;font-size:13px;color:#10273a;font-weight:800;direction:ltr;}

.quotation-table-section{margin-bottom:12px;}
.quotation-table{width:100%;border-collapse:collapse;border:1px solid #dbe4ec;border-radius:12px;overflow:hidden;}
.quotation-table thead{display:table-header-group;}
.quotation-table thead th{background:#16324a;color:#fff;font-size:12px;font-weight:800;padding:10px 8px;border-left:1px solid rgba(255,255,255,.08);}
.quotation-table td{padding:10px 8px;border-bottom:1px solid #e8eef4;font-size:12px;vertical-align:top;line-height:1.6;}
.quotation-table tbody tr:nth-child(even) td{background:#fafcfe;}
.quotation-table tbody tr:last-child td{border-bottom:none;}
.quotation-table .col-no{width:42px;}
.quotation-table .col-qty{width:80px;}
.quotation-table .col-price,.quotation-table .col-total{width:120px;}
.quotation-item-name{font-size:13px;font-weight:800;color:#10273a;}
.quotation-item-note{font-size:10px;color:#66798a;margin-top:3px;}
.quotation-line-total{font-weight:800;color:#10273a;}

.quotation-summary-area{display:grid;grid-template-columns:1.15fr .85fr;gap:14px;margin-top:8px;}
.quotation-terms-block{padding:12px 14px;}
.quotation-terms-list{margin:0;padding:0 18px 0 0;list-style:none;}
.quotation-terms-list li{font-size:11px;color:#314354;line-height:1.9;margin-bottom:4px;position:relative;}
.quotation-terms-list li::before{content:"";position:absolute;right:-12px;top:.8em;width:5px;height:5px;border-radius:50%;background:#2b5f8f;}
.quotation-total-box{padding:12px 14px;align-self:start;}
.quotation-total-table{width:100%;border-collapse:collapse;}
.quotation-total-table td{padding:8px 0;border-bottom:1px solid #edf2f6;font-size:12px;}
.quotation-total-table td:last-child{text-align:left;font-weight:800;color:#10273a;direction:ltr;}
.quotation-total-table tr:last-child td{border-bottom:none;}
.quotation-total-table .is-grand td{padding-top:12px;font-size:18px;font-weight:800;color:#10273a;}
.quotation-total-table .is-grand td:first-child{font-size:14px;}

.quotation-print-footer{margin-top:auto;padding-top:16px;border-top:1px solid #dbe4ec;}
.qpf-signatures{display:grid;grid-template-columns:1fr 1fr;gap:24px;margin-bottom:12px;}
.qpf-sign-label{font-size:12px;font-weight:800;color:#10273a;margin-bottom:18px;}
.qpf-sign-line{border-bottom:1px solid #97aabb;height:1px;}
.qpf-company-line{border-top:1px solid #edf2f6;padding-top:10px;display:flex;flex-wrap:wrap;gap:8px 14px;justify-content:center;font-size:10px;color:#66798a;}
.qpf-company-name{font-weight:800;color:#10273a;}
.qpf-bottom-note{display:flex;justify-content:space-between;gap:12px;align-items:center;font-size:9.5px;color:#7b8e9f;margin-top:10px;}

@media print{
  @page{size:A4 portrait;margin:0;}
  body .page-shell{padding:0;}
  body .page.a4{width:auto;min-height:auto;padding:0;}
  body .page-content{min-height:calc(297mm - 20mm);}
  .quotation-client-card,.quotation-info-card,.quotation-total-box,.quotation-terms-block,.qph-doc-block{break-inside:avoid;page-break-inside:avoid;}
  .quotation-summary-area,.quotation-print-footer{break-inside:avoid;page-break-inside:avoid;}
}
@media screen and (max-width:900px){
  .qph-main,.quotation-client-strip,.quotation-summary-area,.qpf-signatures,.quotation-info-grid{grid-template-columns:1fr;}
}


@media print{
  .quotation-table-section,.quotation-table,.quotation-summary-area,.quotation-total-box,.quotation-terms-block{overflow:visible!important;}
  .quotation-table tr{break-inside:avoid;page-break-inside:avoid;}
  .quotation-table td:last-child,.quotation-total-table td:last-child,.quotation-info-grid strong,.qpf-bottom-note{font-variant-numeric:tabular-nums;unicode-bidi:plaintext;}
}

/* Final quotation A4 document lock */
@media print{
  body:not(.report-print-mode) .quotation-client-strip,
  body:not(.report-print-mode) .quotation-summary-area{display:grid!important;grid-template-columns:1.15fr .85fr!important;}
  body:not(.report-print-mode) .quotation-info-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;}
  body:not(.report-print-mode) .qpf-signatures{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;}
}

/* Quotation: keep every configurable section independent so changing section order never breaks layout. */
.quotation-block-shell{margin:8px 0 12px;break-inside:avoid;page-break-inside:avoid;}
.quotation-block-shell--totals{display:flex;justify-content:flex-start;}
.quotation-block-shell--terms{display:block;}
.quotation-total-box--solo{width:min(100%,86mm);}
@media print{
  .quotation-block-shell{break-inside:avoid;page-break-inside:avoid;}
  .quotation-block-shell--totals{display:flex!important;justify-content:flex-start!important;}
  .quotation-total-box--solo{width:86mm!important;}
}

/* Quotation multipage A4 safe area: matches the global document print engine. */
@media print{
  @page{size:A4 portrait;margin:7mm 0 8mm;}
  body .page-shell{width:210mm!important;max-width:210mm!important;margin:0!important;padding:0!important;overflow:visible!important;}
  body .page.a4{width:210mm!important;max-width:210mm!important;min-height:282mm!important;margin:0!important;padding:0!important;border:none!important;box-shadow:none!important;overflow:visible!important;}
  body .page-content{width:210mm!important;min-height:282mm!important;padding:0 8mm!important;box-sizing:border-box!important;overflow:visible!important;}
  .quotation-table thead{display:table-header-group!important;}
  .quotation-table tr{break-inside:avoid!important;page-break-inside:avoid!important;}
}
