/* ==========================================================================
   공식 안전작업 문서 양식 (CHECKUP · SE-FMS)
   CHK-SF-01 작업신청서 / CHK-SF-02 작업허가서
   CHK-SF-03 일일작업신청서 / CHK-SF-04 일일작업허가서
   --------------------------------------------------------------------------
   중요: 인쇄는 $htmlToPaper 가 새 창에 element.innerHTML 만 복사하고
   main.js 의 styles 배열에 등록된 CSS 만 불러옵니다.
   따라서 이 양식의 스타일은 Vue scoped style 이 아니라 반드시 이 파일에
   있어야 화면과 인쇄물이 동일하게 보입니다.
   (public/index.html 에서도 같은 파일을 link 합니다)
   ========================================================================== */

.ofm {
	--ofm-line: #111111;
	--ofm-rule: #666666;
	--ofm-label-bg: #f2f2f2;
	--ofm-muted: #555555;

	width: 210mm;
	min-height: 297mm;
	margin: 0 auto;
	padding: 14mm 13mm;
	box-sizing: border-box;
	background: #ffffff;
	color: #111111;
	font-family: 'Malgun Gothic', '맑은 고딕', 'Apple SD Gothic Neo',
		AppleGothic, 'Noto Sans KR', sans-serif;
	font-size: 10.5px;
	line-height: 1.5;
	-webkit-print-color-adjust: exact;
	print-color-adjust: exact;
}

/* 화면에서만 종이처럼 보이도록 */
@media screen {
	.ofm {
		box-shadow: 0 2px 16px rgba(0, 0, 0, 0.14);
		margin-top: 12px;
		margin-bottom: 24px;
	}
}

/* ── 머리말 ─────────────────────────────────────────────── */
.ofm-head {
	position: relative;
	/* QR 영역만큼 좌우 여백을 확보해 제목이 QR 과 겹치지 않게 합니다 */
	padding: 0 84px;
}

.ofm-qr {
	position: absolute;
	top: 0;
	right: 0;
	width: 76px;
	text-align: center;
}

.ofm-qr img {
	display: block;
	width: 76px;
	height: 76px;
	border: 1px solid var(--ofm-line);
}

.ofm-qr-cap {
	margin: 2px 0 0;
	font-size: 8px;
	letter-spacing: 0.06em;
	color: var(--ofm-muted);
}

.ofm-eyebrow {
	margin: 0 0 10px;
	text-align: center;
	font-size: 9.5px;
	letter-spacing: 0.04em;
	color: var(--ofm-muted);
}

.ofm-title {
	margin: 0;
	text-align: center;
	font-size: 24px;
	font-weight: 700;
	letter-spacing: 0.24em;
	/* 자간 때문에 오른쪽으로 밀리는 현상 보정 */
	text-indent: 0.24em;
	line-height: 1.25;
}

.ofm-subtitle {
	margin: 6px 0 12px;
	text-align: center;
	font-size: 9.5px;
	color: var(--ofm-muted);
	letter-spacing: 0.02em;
}

/* ── 공통 표 ────────────────────────────────────────────── */
.ofm-table {
	width: 100%;
	border-collapse: collapse;
	table-layout: fixed;
	margin: 0;
}

.ofm-table th,
.ofm-table td {
	border: 1px solid var(--ofm-line);
	padding: 4px 6px;
	vertical-align: middle;
	font-size: 10.5px;
	line-height: 1.45;
	word-break: break-all;
	overflow-wrap: break-word;
}

.ofm-table th {
	background: var(--ofm-label-bg);
	font-weight: 700;
	text-align: center;
	white-space: nowrap;
}

.ofm-table td {
	text-align: left;
}

.ofm-table td.is-center {
	text-align: center;
}

/* 문서번호 / 접수번호 / 신청일 */
.ofm-meta {
	margin-bottom: 12px;
}

.ofm-meta th {
	width: 62px;
}

/* ── 섹션 ───────────────────────────────────────────────── */
.ofm-section {
	margin-top: 11px;
	/* 인쇄 시 섹션이 페이지 경계에서 잘리지 않도록 */
	page-break-inside: avoid;
	break-inside: avoid;
}

.ofm-section-title {
	margin: 0 0 4px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: -0.01em;
}

.ofm-section-note {
	margin: 4px 0 0;
	font-size: 9px;
	color: var(--ofm-muted);
	line-height: 1.5;
}

/* ── 체크박스 ───────────────────────────────────────────── */
.ofm-checks {
	display: block;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ofm-check {
	display: inline-block;
	margin: 1px 14px 1px 0;
	white-space: nowrap;
	font-size: 10.5px;
}

.ofm-check::before {
	content: '□';
	margin-right: 4px;
	font-size: 11.5px;
}

.ofm-check.is-on {
	font-weight: 700;
}

.ofm-check.is-on::before {
	content: '■';
}

/* 손으로 적는 빈 칸 */
.ofm-blank {
	display: inline-block;
	min-width: 60px;
	border-bottom: 1px solid var(--ofm-rule);
}

.ofm-blank-lines {
	min-height: 34px;
}

/* ── 작업자 명단 ────────────────────────────────────────── */
.ofm-workers th {
	white-space: normal;
}

.ofm-workers td {
	height: 20px;
	text-align: center;
}

.ofm-workers td.is-left {
	text-align: left;
}

/* 일일작업허가서 작업자 명단 — 9개 열이라 A4 폭에 맞춰 밀도를 높입니다 */
.ofm-workers--dense th,
.ofm-workers--dense td {
	padding: 3px 3px;
	font-size: 9.5px;
	letter-spacing: -0.02em;
	word-break: keep-all;
}

.ofm-workers--dense td {
	height: 18px;
}

/* ── 서약문 · 서명란 ────────────────────────────────────── */
.ofm-declaration {
	margin: 14px 0 6px;
	text-align: center;
	font-size: 10.5px;
	line-height: 1.6;
}

.ofm-sign td {
	height: 26px;
	text-align: center;
}

/* ── 꼬리말 ─────────────────────────────────────────────── */
.ofm-footer {
	margin-top: 12px;
	padding-top: 6px;
	border-top: 1px solid var(--ofm-rule);
	font-size: 8.5px;
	line-height: 1.5;
	color: var(--ofm-muted);
	text-align: center;
}

.ofm-page-no {
	margin-top: 2px;
	text-align: center;
	font-size: 8.5px;
	color: var(--ofm-muted);
}

/* ── 인쇄 ───────────────────────────────────────────────── */
@page {
	size: A4 portrait;
	margin: 10mm;
}

@media print {
	.ofm {
		width: auto;
		min-height: 0;
		margin: 0;
		padding: 0;
		box-shadow: none;
		font-size: 9.6pt;
	}

	.ofm-title {
		font-size: 20pt;
	}

	.ofm-head {
		padding: 0 22mm;
	}

	.ofm-qr,
	.ofm-qr img {
		width: 20mm;
	}

	.ofm-qr img {
		height: 20mm;
	}

	.ofm-table th,
	.ofm-table td {
		font-size: 9.2pt;
		padding: 3px 5px;
	}

	.ofm-workers--dense th,
	.ofm-workers--dense td {
		font-size: 7.8pt;
		padding: 2px 3px;
	}

	.ofm-eyebrow,
	.ofm-subtitle {
		font-size: 8.4pt;
	}

	.ofm-footer,
	.ofm-page-no {
		font-size: 7.6pt;
	}

	/* 인쇄물에 남으면 안 되는 화면 전용 요소 */
	.ofm-screen-only {
		display: none !important;
	}
}
