/* doc.css — the printed quotation. Colours follow the original Satyam proforma. */
.qdoc {
  --d-orange: #C8570F; --d-blue: #2E75B6; --d-navy: #1F3864; --d-light: #EEF2FA;
  --d-peach: #FCE4D0; --d-label: #DCE6F1; --d-grid: #8C95A1; --d-red: #B22222; --d-valid: #F79646;
  font-family: "Plex", "Segoe UI", Arial, sans-serif;
  font-size: var(--fs, 9pt);
  line-height: 1.3;
  color: #111;
  background: #fff;
  font-variant-numeric: tabular-nums;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.qdoc * { box-sizing: border-box; }
.qdoc table { border-collapse: collapse; width: 100%; }
.qdoc th, .qdoc td { border: 0.6pt solid var(--d-grid); padding: 0.28em 0.45em; vertical-align: middle; }
.qdoc .a-left { text-align: left; } .qdoc .a-right { text-align: right; } .qdoc .a-center { text-align: center; }

.d-head { display: flex; align-items: center; justify-content: center; gap: 1.2em; text-align: center; margin-bottom: 0.9em; }
.d-logo { max-height: 5.2em; max-width: 12em; object-fit: contain; }
.d-co-name { font-size: 1.95em; font-weight: 600; letter-spacing: 0.02em; line-height: 1.15; }
.d-co-tag { font-style: italic; }
.d-co-line { font-size: 0.92em; font-weight: 500; }

.d-frame { border: 0.8pt solid #333; }
.d-title { background: var(--d-orange); color: #fff; text-align: center; font-weight: 600; font-size: 1.45em; padding: 0.2em; }
.d-band { background: var(--d-blue); color: #fff; font-weight: 600; padding: 0.25em 0.5em; font-size: 1.05em; }
.d-band-2 { background: #4A86C2; }
.d-parties { display: grid; grid-template-columns: 1fr 1fr; }
.d-bill { border-right: 0.6pt solid var(--d-grid); }
.d-lines { padding: 0.35em 0.5em; background: var(--d-light); }
.d-lines > div { padding: 0.08em 0; }
.d-strong { font-weight: 600; font-size: 1.08em; }
.d-kv th, .d-kv td { border-width: 0 0 0.6pt 0; }
.d-kv th { width: 36%; background: var(--d-label); font-weight: 600; text-align: left; }
.d-kv td { background: var(--d-light); }
.d-kv tr:last-child th, .d-kv tr:last-child td { border-bottom: 0; }

.d-items { margin-top: -0.6pt; }
.d-items thead th { background: var(--d-navy); color: #fff; font-weight: 600; text-align: center; }
.d-items thead { display: table-header-group; }
.d-items tr { break-inside: avoid; page-break-inside: avoid; }
.d-group td { background: var(--d-peach); font-weight: 600; text-align: center; }
.d-sub td { background: #F5F7FB; font-weight: 600; }
.d-items td { word-break: break-word; }
.d-items td.k-hsn, .d-items td.k-amount, .d-items td.k-rate { white-space: nowrap; word-break: normal; }

.d-bottom { display: grid; grid-template-columns: 1fr minmax(16em, 42%); border-top: 0; break-inside: avoid; page-break-inside: avoid; }
.d-left { background: var(--d-light); border: 0.6pt solid var(--d-grid); border-top: 0; border-right: 0; padding: 0.35em 0.5em; }
.d-count { margin-bottom: 0.4em; }
.d-export { font-weight: 600; margin-bottom: 0.4em; }
.d-notes { margin: 0; padding-left: 1.4em; color: var(--d-red); font-weight: 600; }
.d-totals { background: var(--d-light); }
.d-totals th, .d-totals td { border-top: 0; }
.d-totals th { font-weight: 400; text-align: left; }
.d-totals td { text-align: right; white-space: nowrap; }
.d-grand th, .d-grand td { background: var(--d-navy); color: #fff; font-weight: 600; font-size: 1.3em; }

.d-words { border-left: 0.6pt solid var(--d-grid); border-right: 0.6pt solid var(--d-grid); padding: 0.35em 0.5em; break-inside: avoid; }
.d-words > div { padding: 0.1em 0; }
.d-words-tax { font-style: italic; }
.d-summary { break-inside: avoid; page-break-inside: avoid; }
.d-summary th, .d-summary td { text-align: right; }
.d-summary th:first-child, .d-summary td:first-child { text-align: left; }
.d-summary thead th { background: var(--d-label); font-weight: 600; }
.d-summary tfoot th { background: #F5F7FB; }

.d-pay { display: grid; grid-template-columns: 1fr 1fr; break-inside: avoid; page-break-inside: avoid; }
.d-pay > section { border-right: 0.6pt solid var(--d-grid); background: var(--d-light); }
.d-pay > section:last-child { border-right: 0; }
.d-banks { padding: 0.35em 0.5em; display: grid; gap: 0.5em; }
.d-bank { display: flex; justify-content: space-between; gap: 0.8em; align-items: center; }
.d-bank + .d-bank { border-top: 0.6pt dashed var(--d-grid); padding-top: 0.5em; }
.d-qr { text-align: center; font-size: 0.8em; flex: none; }
.d-qr svg { width: 6.4em; height: 6.4em; display: block; }
.d-terms { margin: 0; padding: 0.35em 0.5em 0.35em 1.9em; }

.d-sign { display: grid; grid-template-columns: 1fr 1fr; border-top: 0.6pt solid var(--d-grid); break-inside: avoid; page-break-inside: avoid; }
.d-note { padding: 0.5em; font-style: italic; color: #555; background: #F2F2F2; border-right: 0.6pt solid var(--d-grid); display: flex; align-items: center; }
.d-sig { padding: 0.5em; text-align: center; background: #F2F2F2; color: var(--d-navy); }
.d-sig-label { font-weight: 600; font-size: 1.1em; }
.d-sig img { max-height: 4.2em; max-width: 14em; display: block; margin: 0.3em auto; }
.d-sig-space { height: 3.4em; }
.d-sig-name { color: #333; border-top: 0.6pt solid #999; display: inline-block; min-width: 14em; padding-top: 0.15em; }
.d-valid { background: var(--d-valid); color: var(--d-red); text-align: center; font-weight: 600; font-size: 1.15em; padding: 0.3em; border-top: 0.6pt solid var(--d-grid); }
.qdoc .muted { color: #666; }

/* ---------- On-screen preview sheet ---------- */
.sheet-wrap { overflow: hidden; background: #D6DBE2; border-radius: 8px; padding: 12px; }
.sheet { background: #fff; box-shadow: 0 2px 10px rgba(23,38,61,.25); transform-origin: top left; }

/* ---------- Print mode ---------- */
#print-root { display: none; }
@media print {
  body.is-printing > *:not(#print-root) { display: none !important; }
  body.is-printing { background: #fff !important; }
  body.is-printing #print-root { display: block; }
  body.is-printing .main { margin: 0; padding: 0; }
}
