/* Futkar — Professional Quotation (Print & PDF)
   Doc component styles stay on-screen for live preview.
   Global html/body remaps are print-only so they do not shrink the whole page. */
*, *::before, *::after { box-sizing: border-box; }

@media print {
  html, body {
    margin: 0;
    padding: 0;
    background: #fff;
    color: #1e293b;
    font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 10pt;
    line-height: 1.5;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

@page { size: A4; margin: 14mm 16mm; }

.quote-doc {
  max-width: 100%;
  margin: 0 auto;
}

/* ── Header ── */
.quote-doc-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.25rem;
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid #cbd5e1;
}

.quote-doc-brand {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  flex: 1 1 0;
  min-width: 0;
  max-width: calc(100% - 13.5rem);
  overflow: hidden;
}

.quote-doc-logo {
  flex-shrink: 0;
  width: 3rem;
  height: 3rem;
  border-radius: 0.375rem;
  background: #f1f5f9;
  color: #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.125rem;
  border: 1px solid #e2e8f0;
}

.quote-doc-logo-img {
  flex-shrink: 0;
  max-width: 4.5rem;
  max-height: 3.25rem;
  width: auto;
  height: auto;
  object-fit: contain;
}

.quote-doc-brand-text {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.quote-doc-biz-name {
  font-size: 1.125rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 0.3rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.quote-doc-contact-line {
  margin: 0.1rem 0;
  font-size: 9pt;
  color: #64748b;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.quote-doc-sep { color: #cbd5e1; }

.quote-doc-empty { color: #94a3b8; }

.quote-doc-doc-panel {
  flex: 0 0 auto;
  width: 12.5rem;
  max-width: 42%;
}

.quote-doc-doc-card {
  border: 1px solid #cbd5e1;
  border-radius: 0.25rem;
  overflow: hidden;
  width: 100%;
}

.quote-doc-doc-card-head {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  padding: 0.45rem 0.875rem;
  font-size: 7.5pt;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #475569;
  text-align: center;
}

.quote-doc-meta-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 9pt;
}

.quote-doc-meta-table th {
  text-align: left;
  font-weight: 500;
  color: #64748b;
  padding: 0.4rem 0.75rem;
  white-space: nowrap;
  width: 46%;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: top;
}

.quote-doc-meta-table td {
  text-align: right;
  font-weight: 600;
  color: #0f172a;
  padding: 0.4rem 0.75rem;
  border-bottom: 1px solid #f1f5f9;
  font-variant-numeric: tabular-nums;
  vertical-align: top;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.quote-doc-meta-table tr:last-child th,
.quote-doc-meta-table tr:last-child td {
  border-bottom: none;
}

/* ── Parties (customer / payment terms) ── */
.quote-doc-parties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid #e2e8f0;
}

.quote-doc-parties--single {
  grid-template-columns: 1fr;
  max-width: 50%;
}

.quote-doc-party-label {
  font-size: 7.5pt;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  margin: 0 0 0.4rem;
}

.quote-doc-party-name {
  margin: 0 0 0.2rem;
  font-size: 10.5pt;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.35;
}

.quote-doc-party-line,
.quote-doc-party-body {
  margin: 0.1rem 0;
  font-size: 9.5pt;
  color: #475569;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── Line items table ── */
.quote-doc-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.25rem;
  font-size: 9.5pt;
  table-layout: fixed;
}

.quote-doc-table thead th {
  background: #f8fafc;
  color: #475569;
  font-weight: 600;
  text-align: left;
  padding: 0.5rem 0.65rem;
  font-size: 7.5pt;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-top: 1px solid #cbd5e1;
  border-bottom: 1px solid #cbd5e1;
}

.quote-doc-table thead th:first-child { width: 52%; }
.quote-doc-table thead th:nth-child(2) { width: 10%; }
.quote-doc-table thead th:nth-child(3) { width: 18%; }
.quote-doc-table thead th:last-child { width: 20%; }

.quote-doc-table tbody td {
  padding: 0.6rem 0.65rem;
  border-bottom: 1px solid #e2e8f0;
  color: #334155;
  vertical-align: top;
}

.quote-doc-table tbody tr:last-child td { border-bottom: 1px solid #cbd5e1; }

.quote-doc-desc-cell {
  text-align: left !important;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.55;
  color: #1e293b;
}

.quote-doc-table td:nth-child(2),
.quote-doc-table td:nth-child(3),
.quote-doc-table td:nth-child(4),
.quote-doc-table th:nth-child(2),
.quote-doc-table th:nth-child(3),
.quote-doc-table th:nth-child(4) {
  text-align: right;
  white-space: nowrap;
}

/* ── Totals ── */
.quote-doc-bottom {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.quote-doc-bottom:has(.quote-doc-margin-box) {
  justify-content: space-between;
}

.quote-doc-margin-box {
  flex: 1;
  max-width: 14rem;
  border: 1px dashed #cbd5e1;
  border-radius: 0.375rem;
  padding: 0.75rem;
  font-size: 8.5pt;
  color: #64748b;
  background: #f8fafc;
}

.quote-doc-total {
  width: 100%;
  max-width: 16rem;
  border-collapse: collapse;
  font-size: 9.5pt;
}

.quote-doc-total td {
  padding: 0.3rem 0;
  color: #64748b;
  border: none;
}

.quote-doc-total td:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: #334155;
}

.quote-doc-total tr.quote-doc-total-final td {
  padding-top: 0.55rem;
  border-top: 2px solid #0f172a;
  font-weight: 700;
  font-size: 11pt;
  color: #0f172a;
}

.quote-doc-total tr.quote-doc-total-final td:last-child {
  color: #0f172a;
  font-weight: 700;
}

/* ── Footer ── */
.quote-doc-footer {
  border-top: 1px solid #e2e8f0;
  padding-top: 1rem;
}

.quote-doc-section-title {
  font-size: 7.5pt;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  margin: 0 0 0.5rem;
}

.quote-doc-payment-block {
  border: 1px solid #e2e8f0;
  border-radius: 0.375rem;
  padding: 0.75rem 0.875rem;
  margin-bottom: 1rem;
  background: #fafafa;
}

.quote-doc-payment-rows {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.quote-doc-payment-row {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 0.65rem;
  align-items: start;
  font-size: 9pt;
  color: #334155;
}

.quote-doc-payment-row--block {
  grid-template-columns: 1fr;
  gap: 0.3rem;
}

.quote-doc-payment-label {
  font-size: 7.5pt;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
}

.quote-doc-payment-instructions {
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.quote-doc-pay-link {
  color: #1e293b;
  text-decoration: underline;
  font-weight: 500;
  word-break: break-all;
}

.quote-doc-prose {
  margin: 0 0 0.875rem;
  padding: 0;
}

.quote-doc-prose-body {
  font-size: 9.5pt;
  color: #475569;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.quote-doc-terms .quote-doc-section-title,
.quote-doc-notes .quote-doc-section-title {
  margin-bottom: 0.35rem;
}

.quote-doc-signature {
  display: flex;
  justify-content: flex-end;
  margin-top: 2rem;
  padding-top: 0.5rem;
}

.quote-doc-signature-block {
  text-align: center;
  min-width: 9rem;
}

.quote-doc-signature-line {
  border-top: 1px solid #334155;
  margin-bottom: 0.4rem;
  padding-top: 0.2rem;
}

.quote-doc-signature-block p {
  margin: 0;
  font-size: 9pt;
  color: #334155;
}

@media print {
  body { padding: 0; }
  .quote-doc-header { break-inside: avoid; }
  .quote-doc-table thead { display: table-header-group; }
}
