@font-face{font-family:CardexSans;src:url('fonts/IRANSansXFaNum-Regular.woff2') format('woff2');font-weight:400;font-display:block}
@font-face{font-family:CardexSans;src:url('fonts/IRANSansXFaNum-Bold.woff2') format('woff2');font-weight:600 900;font-display:block}

/* ---------- A4 vehicle cardex sheet ---------- */
.cx-sheet{--cx-ink:#111;--cx-line:#222;--cx-soft:#555;position:relative;box-sizing:border-box;width:210mm;height:297mm;padding:7mm 8mm 6mm;background:#fff;color:var(--cx-ink);font-family:CardexSans,Tahoma,sans-serif;font-size:8.6pt;line-height:1.55;direction:rtl;text-align:right;overflow:hidden;display:flex;flex-direction:column;gap:1.8mm}
.cx-sheet *{box-sizing:border-box}
.cx-sheet b{font-weight:800;color:#000}
.cx-sheet h1,.cx-sheet h2,.cx-sheet p{margin:0}
.cx-f{display:flex;align-items:baseline;gap:1.6mm;min-width:0}
.cx-f>span{color:#222;white-space:nowrap;flex-shrink:0;font-size:8pt}
.cx-f>b{font-size:9.4pt;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cx-f>b[dir=ltr]{text-align:right;unicode-bidi:isolate}

/* header */
.cx-head{display:grid;grid-template-columns:52mm 1fr 62mm;align-items:start;gap:3mm}
.cx-brand{display:flex;flex-direction:column;align-items:center;gap:1mm;padding-top:1mm}
.cx-logo{max-width:46mm;max-height:17mm;object-fit:contain;display:block}
.cx-logo-empty{width:40mm;height:15mm;border:1px dashed #999;display:grid;place-items:center;color:#999;font-size:9pt;letter-spacing:2px}
.cx-brand-name{font-weight:800;font-size:9.5pt;text-align:center;border-top:1px solid #333;padding-top:.6mm;min-width:30mm}
.cx-title{text-align:center;padding-top:4mm}
.cx-title h1{font-size:15pt;font-weight:900}
.cx-number{margin-top:1.5mm;font-size:8.6pt;color:#222}
.cx-number b{font-size:10pt}
.cx-meta{display:flex;flex-direction:column;gap:1.2mm}
.cx-meta-row{display:flex;gap:2mm;padding-right:2mm}
.cx-meta-row b{font-size:10pt}
.cx-box{border:1.2px solid var(--cx-line);padding:1.3mm 2.4mm;display:flex;gap:2mm;align-items:baseline}
.cx-box b{font-size:10pt}

/* seller */
.cx-seller{display:grid;grid-template-columns:1fr 62mm;gap:3mm;align-items:end}
.cx-seller-info{display:flex;flex-direction:column;gap:.4mm}
.cx-seller-info .cx-f>b{white-space:normal}
.cx-seller-side{display:flex;flex-direction:column;gap:1.2mm}
.cx-web{font-weight:700;font-size:9pt;text-align:left}
.cx-eco{justify-content:flex-start}

/* letter */
.cx-letter{display:flex;flex-direction:column;gap:.6mm}
.cx-recipient{font-size:9pt}
.cx-letter p{font-size:7.9pt;line-height:1.7;color:#111}
.cx-signer{display:grid;grid-template-columns:1.4fr 1.4fr 1fr;gap:3mm}

/* panels */
.cx-panel{display:grid;grid-template-columns:40mm 1fr;border:1.2px solid var(--cx-line)}
.cx-side{border-left:1.2px solid var(--cx-line);padding:1.6mm 2.2mm;display:flex;flex-direction:column;gap:1.6mm}
.cx-side h2{font-size:9.6pt;font-weight:900;border-bottom:1.2px solid var(--cx-line);margin:-1.6mm -2.2mm 0;padding:1.4mm 2.2mm}
.cx-body{padding:1.6mm 2.6mm;min-width:0}
.cx-grid3{display:grid;grid-template-columns:1.25fr 1fr 1.35fr;gap:.9mm 4mm;align-content:start}
.cx-grid2{display:grid;grid-template-columns:1fr 1fr;gap:1.2mm 8mm;align-content:start}
.cx-span2{grid-column:span 2}
.cx-span3{grid-column:1/-1}
.cx-vin{border-top:1px solid #bbb;padding-top:.8mm;margin-top:.4mm}
.cx-vin>b{font-size:10.5pt;letter-spacing:.4px}
.cx-plate-label{font-size:7.6pt;color:#333}
.cx-plate{display:flex;align-items:stretch;border:1.3px solid #111;border-radius:1.4mm;overflow:hidden;height:8.5mm;font-weight:800;font-size:10.5pt;direction:ltr}
.cx-plate-main{flex:1;display:flex;align-items:center;justify-content:space-around;padding:0 1mm;gap:1mm}
.cx-plate i,.cx-plate small{font-style:normal}
.cx-plate-region{width:10mm;border-left:1.3px solid #111;display:flex;flex-direction:column;align-items:center;justify-content:center;line-height:1.05}
.cx-plate-region small{font-size:6pt;font-weight:600}
.cx-install{margin-top:auto}

/* barcodes */
.cx-barcodes{display:grid;grid-template-columns:1fr 1.45fr 1fr;gap:6mm;padding:0 1mm}
.cx-bc{display:flex;flex-direction:column;align-items:center;gap:.6mm;min-width:0}
.cx-bc-title{font-weight:800;font-size:8.4pt}
.cx-bc-img{width:100%;height:11mm}
.cx-bc-img svg{width:100%;height:100%;display:block}
.cx-bc-text{font-family:CardexSans,monospace;font-size:8pt;letter-spacing:2.2px;line-height:1.1;min-height:3mm}

/* fees */
.cx-fees{display:grid;grid-template-columns:repeat(4,1fr);border:1.2px solid var(--cx-line)}
.cx-fee{padding:1.4mm 2.2mm;display:flex;flex-direction:column;gap:.6mm;border-left:1.2px solid var(--cx-line);min-width:0}
.cx-fee:last-child{border-left:0}
.cx-fee .cx-f>span{font-size:7.6pt}
.cx-fee .cx-f>b{font-size:8.8pt}

/* invoice */
.cx-money{display:flex;align-items:baseline;gap:1.6mm;min-width:0}
.cx-money>span{white-space:nowrap;font-size:8pt;color:#222}
.cx-money>b{flex:1;text-align:center;font-size:9.4pt;white-space:nowrap}
.cx-money>em{font-style:normal;font-size:7.6pt;color:#333}
.cx-total{border-top:1px solid #999;padding-top:.6mm}
.cx-total>b{font-size:10.2pt}

/* description & signatures */
.cx-desc .cx-body p{font-size:8.6pt;line-height:1.7;min-height:8mm;white-space:pre-line}
.cx-signs{display:grid;grid-template-columns:1.3fr 1fr 1fr;border:1.2px solid var(--cx-line);flex:1;min-height:17mm}
.cx-sign{padding:1.6mm 2.4mm;border-left:1.2px solid var(--cx-line);display:flex;flex-direction:column;gap:3.4mm}
.cx-sign:last-child{border-left:0}
.cx-sign b{font-size:8.6pt;font-weight:700}
.cx-sign span{font-size:8pt}

/* footer */
.cx-foot{display:flex;justify-content:space-between;align-items:center;gap:4mm;border-top:1px solid #999;padding-top:1.2mm;font-size:6.8pt;color:#444}
.cx-foot-text{display:flex;flex-direction:column;line-height:1.5}
.cx-foot-bc{width:34mm;height:6.5mm}
.cx-foot-bc svg{width:100%;height:100%;display:block}

/* watermark (sample / unpaid preview) */
.cx-watermark{position:absolute;inset:0;z-index:5;overflow:hidden;pointer-events:auto;user-select:none;-webkit-user-select:none;background:repeating-linear-gradient(-45deg,rgba(200,20,40,.035) 0 6mm,rgba(255,255,255,0) 6mm 12mm)}
.cx-watermark-grid{position:absolute;inset:-40%;display:grid;grid-template-columns:repeat(6,1fr);gap:14mm 6mm;transform:rotate(-32deg);align-content:center;justify-items:center}
.cx-watermark-grid span{font-family:CardexSans,sans-serif;font-weight:900;font-size:15pt;color:rgba(190,20,40,.20);white-space:nowrap}
.cx-watermark-stamp{position:absolute;top:44%;left:50%;transform:translate(-50%,-50%) rotate(-32deg);font-family:CardexSans,sans-serif;font-weight:900;font-size:46pt;color:rgba(190,20,40,.16);border:5px solid rgba(190,20,40,.16);padding:2mm 10mm;border-radius:6mm;white-space:nowrap}
.cx-mode-sample,.cx-mode-preview{user-select:none;-webkit-user-select:none}
.cx-mode-sample .cx-bc-img,.cx-mode-preview .cx-bc-img,.cx-mode-sample .cx-foot-bc,.cx-mode-preview .cx-foot-bc{filter:blur(1.4px)}

/* on-screen frame that scales the A4 sheet to the available width */
.cx-frame{position:relative;width:100%;max-width:210mm;margin:0 auto}
.cx-frame-inner{transform-origin:top right}
.cx-frame.is-scaled .cx-frame-inner{position:absolute;top:0;right:0}
.cx-frame .cx-sheet{box-shadow:0 10px 40px rgba(16,32,60,.14);border-radius:2px}
.cx-protected{-webkit-touch-callout:none;user-select:none;-webkit-user-select:none}
@media print{
    .cx-protected,.cx-protected *{display:none!important}
    .cx-print-block{display:block!important}
}
