/* A4 행정 공문서 인쇄 규격 스타일 — 원본 서식 재현 */
:root {
  --doc-font: 'HCR Batang', '함초롬바탕', 'Batang', '바탕', serif;
  --doc-ink: #111;
}

.doc-page {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 210mm;
  min-height: 290mm;     /* A4(297)보다 짧게 → 한 장을 채우되 넘침 방지 */
  box-sizing: border-box;
  padding: 18mm 20mm 14mm;
  background: #fff;
  color: var(--doc-ink);
  font-family: var(--doc-font);
  font-size: 15pt;
  line-height: 1.7;
}
/* 산출내역서·완료내역서: 항목이 많으면 다음 장으로 흐르도록 */
.doc-page.flow { min-height: 290mm; }
@media print { .doc-page { break-inside: avoid; } .doc-page.flow { break-inside: auto; } }

.doc-title {
  text-align: center;
  font-size: 27pt;
  font-weight: 700;
  letter-spacing: 0.12em;
  margin: 3mm 0 9mm;
}
.doc-title.boxed { align-self: center; padding: 3mm 9mm; border: 2px solid #000; font-size: 26pt; margin: 4mm 0 14mm; }
.doc-title.sm { font-size: 22pt; letter-spacing: .08em; margin: 0 0 7mm; }

/* (인) 위 직인 도장 */
.ins { position: relative; display: inline-block; }
.seal-ins { position: absolute; left: 50%; top: 44%; width: 22.7mm; height: 22.7mm; transform: translate(-50%, -50%); pointer-events: none; }

/* 감독관 경유 박스 (작게) */
.supervisor-box { position: absolute; top: 38mm; right: 20mm; border-collapse: collapse; font-size: 9.5pt; line-height: 1.3; }
.supervisor-box th, .supervisor-box td { border: 1px solid #000; padding: 0.8mm 2mm; text-align: center; white-space: nowrap; }
.supervisor-box th:not([colspan]) { width: 12mm; }
.supervisor-box td { width: 26mm; }

.fields { margin: 0 0 8mm; }
.fields.tight { margin-bottom: 4mm; }
.fl { margin: 1mm 0; }
.fl.sub { padding-left: 8mm; }

.body-text { margin: 5mm 0; }
.body-text.indent { text-indent: 1em; }
.body-text.attach { margin: 4mm 0; }
.body-text.center { text-align: center; }
.body-text.prove { margin: 22mm 0 12mm; }
.body-text.red { color: #d00; font-style: italic; }
.body-text.sm2 { font-size: 9pt; line-height: 1.6; margin: 4mm 0; text-indent: 1em; }

/* 하단 서명 + 수신처 (사업자번호가 귀하 위에) */
.doc-foot { display: flex; flex-direction: column; margin-top: auto; }
.doc-foot .sig { align-self: flex-end; }
.doc-foot .contractor { align-self: center; }
.doc-foot .recipient { align-self: flex-start; margin-top: 12mm; }
.sig { line-height: 2.1; padding-right: 8mm; }
.sig-line { white-space: nowrap; }
.recipient { font-weight: 700; font-size: 16pt; }
.contractor { text-align: center; font-size: 16pt; letter-spacing: .04em; }

/* 표 공통 */
.tbl { border-collapse: collapse; width: 100%; font-size: 13pt; }
.tbl th, .tbl td { border: 1px solid #000; padding: 2mm; text-align: center; vertical-align: middle; }

/* 공정예정표 */
.gantt { margin-top: 4mm; }
.gantt th { font-weight: 700; height: 9mm; }
.gantt .pn-h { width: 34mm; }
.gantt .note-h { width: 26mm; }
.gantt .pn, .gantt .pnote, .gantt .pperiod { height: 14mm; }
.gantt .pperiod { font-size: 12pt; }
.gantt .gc { width: 20mm; }
.gantt .mk { font-size: 11pt; }

/* 재직증명서 */
.jaejik-page { }
.jaejik { width: 84%; margin: 0 auto; font-size: 15pt; }
.jaejik th.jl { font-weight: 700; width: 26mm; background: #fff; white-space: nowrap; } /* 재직기간 1줄 */
.jaejik th.jl2 { width: 29mm; } /* 생년월일·직위 라벨칸 20% 확대 */
.jaejik th.jl.green { background: #e2efda; }
.jaejik td { height: 12mm; }
.jaejik-foot { text-align: center; margin-top: 24mm; line-height: 2.5; }
.jaejik-foot .jf-org { }
.jf-name-wrap { position: relative; display: inline-block; letter-spacing: .18em; padding-right: 2mm; }
.seal-jaejik { position: absolute; left: 100%; margin-left: 6mm; top: 50%; transform: translateY(-50%); width: 25.2mm; height: 25.2mm; }
.jaejik-date { margin: 14mm 0; }

/* 산출내역서 */
.sanchul { font-size: 12pt; margin-top: 2mm; }
.sanchul .hd th { font-weight: 700; height: 8mm; }
.sanchul td, .sanchul th { height: 6.6mm; }
.sanchul .c-name { width: 34%; }
.sanchul .c-qty { width: 9%; }
.sanchul .c-unit { width: 9%; }
.sanchul .c-price { width: 16%; }
.sanchul .c-amt { width: 20%; }
.sanchul td.c-price, .sanchul td.c-amt { text-align: right; padding-right: 2mm; } /* 데이터만 오른쪽, 헤더(구분)는 가운데 */
.sanchul .c-note { width: 12%; }
.sanchul td.c-note { font-size: 64%; } /* 데이터 비고만 축소(추가 20%↓), 헤더 텍스트는 동일 크기 */
.sanchul .item .c-name { color: #1442a0; }
.sanchul .sum .sum-l { font-weight: 700; }
.sanchul .sum.total .c-amt { font-weight: 700; }

/* 보안각서 */
.boan { margin-top: 4mm; font-size: 13pt; }
.boan .hd th { font-weight: 700; height: 8mm; }
.boan td { height: 12mm; }
.boan .b-name { width: 20mm; }
.boan .b-title { width: 26mm; }
.boan .b-sign { width: 34mm; }
.boan td.al { text-align: center; }
.boan .sign-img { height: 15.7mm; }

/* 사용인감계 */
.ingam-boxes { display: flex; gap: 22mm; justify-content: center; margin: 12mm 0; }
.ingam-box { width: 54mm; border: 1px solid #000; }
.ib-h { border-bottom: 1px solid #000; text-align: center; font-weight: 700; padding: 2.5mm; font-size: 15pt; letter-spacing: .1em; }
.ib-body { height: 44mm; display: flex; align-items: center; justify-content: center; }
.ib-seal { }
.ib-seal-use { width: 22.7mm; height: 22.7mm; }      /* 이름 옆 (인) 직인과 동일 크기 */
.ib-seal-corp { max-width: 24mm; max-height: 24mm; } /* 법인인감 */
.ingam-text { margin: 8mm 0 16mm; }
.ingam-foot { margin-left: 42mm; line-height: 2.3; }

/* 바로계약 통합서약서 */
.seoyak { padding: 14mm 13mm; font-size: 9.5pt; line-height: 1.5; }
.seoyak-head { font-size: 9.5pt; margin-bottom: 3mm; }
.seoyak-head .sh { background: #f1f1f1; font-weight: 700; white-space: nowrap; }
.seoyak-head td, .seoyak-head th { padding: 1.5mm; }
.seoyak-body { font-size: 9pt; }
.seoyak-body .hd th { background: #f1f1f1; font-weight: 700; }
.seoyak-body td, .seoyak-body th { padding: 1.6mm 2mm; }
.s-no { width: 8mm; text-align: center; font-weight: 700; }
.s-gu { width: 26mm; font-weight: 700; text-align: center; line-height: 1.35; }
.s-ct, .s-ct2 { text-align: left; }
.s-se { width: 30mm; text-align: center; white-space: nowrap; }
.v-chk { font-weight: 900; }
.baeje { margin-top: 4mm; border: 1px solid #000; padding: 3mm 4mm; }
.baeje-h { text-align: center; font-weight: 700; margin-bottom: 2mm; font-size: 10pt; }
.baeje-list { margin: 0; padding-left: 6mm; font-size: 8.5pt; line-height: 1.7; }
.seoyak-sign { text-align: center; margin-top: 12mm; font-size: 12pt; letter-spacing: .04em; }

/* 사진대지 */
.sajin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4mm; margin-top: 4mm; }
.sajin-cell { height: 68mm; border: 1px solid #000; display: flex; align-items: center; justify-content: center; overflow: hidden; background: #fafafa; }
.sajin-cell img { max-width: 100%; max-height: 100%; object-fit: contain; }
.sajin-empty { grid-column: 1 / -1; text-align: center; color: #888; padding: 30mm 0; }

/* 청구서 */
.cheonggu-sub { text-align: center; font-size: 15pt; margin: -6mm 0 12mm; }
.cheonggu-fields .fl { margin: 2.5mm 0; }
.ipgeum { width: 90%; margin: 3mm auto 0; font-size: 13pt; }
.ipgeum .hd th { font-weight: 700; background: #f4f4f4; }
.ipgeum td { height: 11mm; }
.red-txt, .red-txt td, .red-txt .v { color: #d00; }
.cheonggu-date { margin: 16mm 0 10mm; letter-spacing: .1em; }
.cheonggu-sign { display: flex; flex-direction: column; align-items: center; line-height: 2.1; }
.cheonggu-sign .sig-line { text-align: left; white-space: nowrap; }

/* 완납증명서 등 첨부 이미지 페이지 */
.cert-page { padding: 10mm; align-items: center; justify-content: center; }
.cert-img { max-width: 100%; max-height: 277mm; object-fit: contain; }

/* 인쇄 */
@media print {
  @page { size: A4; margin: 0; }
  html, body { margin: 0; padding: 0; background: #fff; }
  .doc-page { box-shadow: none !important; margin: 0 !important; page-break-after: always; }
  .doc-page:last-child { page-break-after: auto; }
}
