/* 직접 작성 견적서 양식 (frontend/quote-templates.js)
   품목 표 칸 규칙 (모든 양식 공통)
   - 고정: 수량 8%, 단가 13.5%, 공급가액(금액) 13.5% (단가와 금액은 같은 너비, 천만원대까지 한 줄)
   - 나머지(품명, 규격, 비고)는 견적서마다 가장 긴 글자에 맞춰 나눠 갖는다 (quote-templates.js planCols)
     최소: 품명 22%, 규격 8%, 비고 8% / 남으면 품명에, 모자라면 긴 칸부터 양보
   - 그래도 길면 품명, 규격은 두 줄로, 비고는 두 줄 없이 글자를 줄인다
   - 금액은 오른쪽, 수량은 가운데 정렬 */

.qt-page { width: 210mm; height: 297mm; padding: 45px 42px; box-sizing: border-box; background: #fff; color: #111; font-family: 'Nanum Gothic', sans-serif;
  position: relative; overflow: hidden; display: flex; flex-direction: column; font-size: 10.5pt; line-height: 1.3; }
.qt-page *, .qt-page *::before, .qt-page *::after { box-sizing: border-box; }
.qt-pages .qt-page { margin: 0 auto 18px; box-shadow: 0 4px 24px rgba(0,0,0,.12); }
.qt-render-host { position: fixed; left: -12000px; top: 0; width: 210mm; }
.qt-fit { display: block; overflow: hidden; white-space: nowrap; }
.qt-pageno { position: absolute; bottom: 5mm; right: 11mm; font-size: 8pt; color: #6b7280; }

/* ── 테두리형 ── */
.qt-frame .fr { border: 2px solid #111; display: flex; flex-direction: column; }
.qt-frame .fr-head { position: relative; height: 80px; display: flex; align-items: center; justify-content: center; border-bottom: 2px solid #111; }
.qt-frame .fr-no { position: absolute; left: 5mm; bottom: 4.5mm; width: 54mm; display: flex; align-items: baseline; gap: 3mm; border-bottom: 1px solid #111; padding: 0 1mm 1mm; font-size: 10pt; }
.qt-frame .fr-no-v { flex: 1; }
.qt-frame .fr-title { font-size: 25pt; font-weight: 800; letter-spacing: 9mm; margin-right: -9mm; }
.qt-frame .fr-info { display: flex; height: 182px; border-bottom: 2px solid #111; }
.qt-frame .fr-left { width: 41%; padding: 5mm 4mm 3.5mm 5mm; display: flex; flex-direction: column; }
.qt-frame .fr-date { font-size: 11pt; word-spacing: 1.5mm; }
.qt-frame .fr-date b { font-weight: 400; }
.qt-frame .fr-to { margin-top: 7mm; display: flex; align-items: flex-end; gap: 2mm; border-bottom: 1.2px solid #111; padding: 0 1mm 1.5mm; }
.qt-frame .fr-to-v { flex: 1; text-align: center; font-size: 12.5pt; font-weight: 800; }
.qt-frame .fr-to > span:last-child { font-size: 11pt; flex: none; }
.qt-frame .fr-fields { margin-top: 2.5mm; font-size: 8.6pt; line-height: 1.55; }
.qt-frame .fr-fields > div { display: flex; gap: 2mm; }
.qt-frame .fr-fields > div > span:first-child { flex: none; width: 15mm; color: #374151; }
.qt-frame .fr-fields .qt-fit { flex: 1; }
.qt-frame .fr-gap { flex: 1; }
.qt-frame .fr-lead { margin-top: auto; font-size: 10.5pt; }
.qt-frame .fr-sup { flex: 1; height: 100%; align-self: stretch; border-collapse: collapse; table-layout: fixed; border-left: 2px solid #111; }
.qt-frame .fr-sup col.c-v { width: 9mm; }
.qt-frame .fr-sup col.c-th { width: 25mm; }
.qt-frame .fr-sup col.c-th2 { width: 11mm; }
.qt-frame .fr-sup col.c-v2 { width: 33mm; }
.qt-frame .fr-sup th, .qt-frame .fr-sup td { border: 1px solid #111; font-weight: 400; text-align: center; padding: 0 1.5mm; font-size: 10.5pt; }
.qt-frame .fr-sup tr:first-child > * { border-top: 0; }
.qt-frame .fr-sup tr:last-child > * { border-bottom: 0; }
.qt-frame .fr-sup tr > *:last-child { border-right: 0; }
.qt-frame .fr-sup th { letter-spacing: .3mm; }
.qt-frame .fr-sup th.v { line-height: 1.05; border-bottom: 0; }
.qt-frame .fr-sup tr { height: 36px; }
.qt-frame .fr-sup th.n { padding: 0; letter-spacing: 0; }
.qt-frame .fr-sup td.ceo { position: relative; }
.qt-frame .fr-sup td.ceo .qt-fit { padding-right: 8mm; }
.qt-frame .fr-sup td.ceo .in { position: absolute; right: 1.5mm; top: 50%; transform: translateY(-50%); }
.qt-frame .fr-stamp { position: absolute; right: -1mm; top: 50%; transform: translateY(-50%); opacity: .92; pointer-events: none; }
.qt-frame .fr-amt { display: flex; align-items: center; height: 56px; border-bottom: 2px solid #111; padding: 0 4mm 0 5mm; font-size: 10.5pt; }
.qt-frame .fr-amt .l { flex: none; width: 52mm; }
.qt-frame .fr-amt .k { flex: 1; text-align: center; font-size: 12pt; }
.qt-frame .fr-amt .r { flex: none; width: 52mm; text-align: right; white-space: nowrap; }
.qt-frame .fr-amt .r b { font-size: 12pt; margin: 0 2mm 0 6mm; }
.qt-frame .fr-items { width: 100%; border-collapse: collapse; table-layout: fixed; line-height: 1.2; }
.qt-frame .fr-items col.c1 { width: 40%; } .qt-frame .fr-items col.c2 { width: 11%; } .qt-frame .fr-items col.c3 { width: 8%; }
.qt-frame .fr-items col.c4 { width: 13.5%; } .qt-frame .fr-items col.c5 { width: 13.5%; } .qt-frame .fr-items col.c6 { width: 14%; }
.qt-frame .fr-items th { height: 36px; font-weight: 400; font-size: 11pt; border-bottom: 2px solid #111; border-right: 1px solid #111; white-space: nowrap; }
.qt-frame .fr-items td { height: 34px; border-bottom: 1px solid #111; border-right: 1px solid #111; padding: 0 1.5mm; text-align: center; font-size: 10.5pt; }
.qt-frame .fr-items th:nth-child(4), .qt-frame .fr-items td:nth-child(4) { border-right: 2px solid #111; }
.qt-frame .fr-items th:nth-child(5), .qt-frame .fr-items td:nth-child(5) { border-right: 2px solid #111; }
.qt-frame .fr-items th:last-child, .qt-frame .fr-items td:last-child { border-right: 0; }
.qt-frame .fr-items td.n { text-align: right; padding-right: 2.5mm; }
.qt-frame .fr-items tbody tr:last-child td { border-bottom: 0; }
.qt-frame .fr-items tr.fr-sec td { text-align: left; padding-left: 3mm; font-weight: 700; border-right: 0; }
.qt-frame .fr-items tr.fr-subt td { background: #f3f4f6; font-weight: 700; }
.qt-frame .fr-items tfoot td { height: 38px; font-size: 11pt; border-bottom: 1px solid #111; }
.qt-frame .fr-items tfoot tr:first-child td { border-top: 2px solid #111; }
.qt-frame .fr-items tfoot tr.last td { border-bottom: 0; font-weight: 700; }

.qt-frame .fr-notes { margin-top: 3.5mm; font-size: 10pt; line-height: 1.6; }

@media print {
  body.printing .qt-pages .qt-page { box-shadow: none; margin: 0; break-after: page; }
  body.printing .qt-pages .qt-page:last-child { break-after: auto; }
}
