@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
  --ink: #0d1117;
  --mid: #4a5568;
  --light: #9aa5b4;
  --rule: #e2e8f0;
  --accent: #1a365d;
  --gold: #b7860b;
  --bg: #f8f7f4;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body.quotation-print-body,
body.quotation-sample-body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 10pt;
  line-height: 1.6;
}

/* A4 screen preview */
.page {
  width: 210mm;
  max-width: 100%;
  min-height: 297mm;
  margin: 0 auto;
  background: #fff;
  padding: 18mm 18mm 14mm 18mm;
  position: relative;
  box-sizing: border-box;
}

/* Off-screen host for html2pdf clone only (does not affect screen / print) */
.pdf-export-host {
  position: fixed;
  left: 0;
  top: 0;
  width: 786px;
  margin: 0;
  padding: 0;
  background: #fff;
  z-index: 100000;
  overflow: visible;
  pointer-events: none;
}

.pdf-export-host .page {
  width: 100% !important;
  max-width: 100% !important;
  min-height: auto !important;
  margin: 0 !important;
  /* Slightly less right padding than screen to avoid ~2–3mm clip on PDF download */
  padding: 15mm 14mm 12mm 15mm !important;
  box-sizing: border-box !important;
  box-shadow: none !important;
}

.header {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  border-bottom: 2.5px solid var(--accent);
  padding-bottom: 10mm;
  margin-bottom: 8mm;
}

.brand { display: flex; flex-direction: column; gap: 4px; }

.brand-name {
  font-family: 'DM Serif Display', serif;
  font-size: 26pt;
  color: var(--accent);
  letter-spacing: -0.5px;
  line-height: 1;
}

.brand-sub {
  font-size: 7.5pt;
  color: var(--light);
  letter-spacing: 3px;
  text-transform: uppercase;
  font-weight: 500;
}

.doc-label { text-align: right; }

.doc-label .title {
  font-family: 'DM Serif Display', serif;
  font-size: 22pt;
  color: var(--accent);
  letter-spacing: 6px;
  text-transform: uppercase;
}

.doc-label .meta {
  font-size: 7.5pt;
  color: var(--light);
  margin-top: 4px;
  letter-spacing: 0.5px;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1.5px solid var(--rule);
  margin-bottom: 8mm;
}

.info-label {
  background: #f1f3f6;
  padding: 5px 10px;
  font-size: 7.5pt;
  font-weight: 600;
  color: var(--mid);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--rule);
  border-right: 1px solid var(--rule);
}

.info-value {
  padding: 5px 10px;
  font-size: 8.5pt;
  color: var(--ink);
  border-bottom: 1px solid var(--rule);
}

.scope-box {
  border-left: 3px solid var(--gold);
  background: #fffdf5;
  padding: 7px 12px;
  margin-bottom: 8mm;
  font-size: 8.5pt;
  color: var(--mid);
  line-height: 1.7;
}

.scope-box strong {
  font-size: 7.5pt;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gold);
  display: block;
  margin-bottom: 3px;
}

.section-title {
  font-size: 7.5pt;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--light);
  margin-bottom: 4px;
}

table { width: 100%; border-collapse: collapse; margin-bottom: 0; }

thead tr { background: var(--accent); color: #fff; }

thead th {
  padding: 7px 10px;
  font-size: 7.5pt;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-align: left;
}

thead th:last-child { text-align: right; }

tbody tr { border-bottom: 1px solid var(--rule); }
tbody tr:nth-child(even) { background: #f8f9fb; }

tbody td {
  padding: 8px 10px;
  font-size: 8.5pt;
  vertical-align: top;
}

.td-no {
  width: 28px;
  color: var(--light);
  font-weight: 600;
  text-align: center;
}

.td-desc { font-weight: 600; color: var(--ink); }

.td-scope {
  font-size: 7.5pt;
  color: var(--mid);
  width: 42%;
}

.td-amount {
  text-align: right;
  font-weight: 600;
  font-size: 9pt;
  white-space: nowrap;
  width: 18%;
}

.total-row { background: var(--accent) !important; border: none !important; }

.total-row td {
  color: #fff !important;
  padding: 10px 10px !important;
  font-size: 9.5pt !important;
  font-weight: 600 !important;
}

.total-row .total-label {
  text-align: right;
  letter-spacing: 2px;
  font-size: 8pt !important;
  text-transform: uppercase;
}

  .total-row .total-amount {
    text-align: right;
    font-size: 12pt !important;
    font-family: 'DM Serif Display', serif;
    letter-spacing: 1px;
  }

.subtotal-row {
  background: #eef2f7 !important;
}

.subtotal-row td {
  font-weight: 600 !important;
  color: var(--accent) !important;
}

.options-wrap {
  margin-bottom: 6mm;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.option-block {
  border: 1px solid var(--rule);
  padding: 6px 10px;
  background: #fafbfc;
  page-break-inside: avoid;
}

.option-block-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}

.option-id {
  font-size: 7pt;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--gold);
  text-transform: uppercase;
}

.option-block-amount {
  font-weight: 700;
  font-size: 9pt;
  color: var(--accent);
}

.option-block-title {
  font-size: 8.5pt;
  font-weight: 600;
  color: var(--ink);
}

.option-block-sub {
  font-size: 7pt;
  color: var(--mid);
  margin-bottom: 3px;
}

.option-feature-list {
  margin: 0;
  padding-left: 12px;
  font-size: 7pt;
  color: var(--mid);
  line-height: 1.45;
}

.summary-table,
.grand-total-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 4mm;
}

.summary-table td {
  padding: 5px 10px;
  font-size: 8.5pt;
  border-bottom: 1px solid var(--rule);
}

.summary-label { color: var(--mid); }
.summary-amount { text-align: right; font-weight: 600; }

.grand-total-table .total-row td {
  padding: 10px !important;
}

.grand-total-table .total-label {
  text-align: right;
  width: 75%;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6mm;
  margin-top: 7mm;
}

.box {
  border: 1.5px solid var(--rule);
  padding: 8px 12px;
}

.box-title {
  font-size: 7.5pt;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  border-bottom: 1.5px solid var(--rule);
  padding-bottom: 5px;
  margin-bottom: 7px;
}

.box-row {
  display: flex;
  justify-content: space-between;
  font-size: 8pt;
  padding: 2px 0;
  border-bottom: 1px dotted var(--rule);
}

.box-row:last-child { border-bottom: none; }
.box-row .lbl { color: var(--mid); }
.box-row .val { font-weight: 600; }

.note-list { list-style: none; padding: 0; }

.note-list li {
  font-size: 7.5pt;
  color: var(--mid);
  padding: 2.5px 0;
  padding-left: 10px;
  position: relative;
  line-height: 1.5;
  border-bottom: 1px dotted var(--rule);
}

.note-list li:last-child { border-bottom: none; }

.note-list li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--gold);
  font-size: 7pt;
}

.footer {
  margin-top: 10mm;
  border-top: 1.5px solid var(--rule);
  padding-top: 6mm;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.footer-left {
  font-size: 7.5pt;
  color: var(--light);
  line-height: 1.8;
}

.footer-right { text-align: right; }

.sig-label {
  font-size: 7pt;
  color: var(--light);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.sig-name {
  font-family: 'DM Serif Display', serif;
  font-size: 16pt;
  color: var(--accent);
}

.confidential-badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 6.5pt;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 2px 7px;
  margin-top: 6px;
}

.quotation-toolbar {
  max-width: 210mm;
  margin: 16px auto 12px;
  padding: 0 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: center;
}

.quotation-btn-primary,
.quotation-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
}

.quotation-btn-primary {
  background: var(--accent);
  color: #fff;
}

.quotation-btn-secondary {
  background: #fff;
  color: var(--accent);
  border: 2px solid var(--accent);
}

.sample-banner {
  max-width: 210mm;
  margin: 12px auto;
  padding: 12px 16px;
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 8px;
  font-size: 13px;
  text-align: center;
}

.sample-banner a { color: var(--accent); font-weight: 600; }

.quotation-amount-masked {
  letter-spacing: 0.1em;
  font-variant-numeric: tabular-nums;
}

@media print {
  .no-print, .quotation-toolbar, .sample-banner { display: none !important; }
  body { background: #fff; }
  .page { margin: 0; padding: 14mm 16mm; box-shadow: none; }
}
