.insupay-admin .insupay-dash { list-style: disc; margin-left: 1.5em; }
.insupay-dashboard .insupay-dash-meta { margin: 0.4em 0 1.2em; color: #50575e; }
.insupay-dashboard .insupay-dash-card {
	background: #fff;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	padding: 14px 18px 16px;
	margin: 0 0 16px;
	max-width: 1100px;
}
.insupay-dashboard .insupay-dash-card h2 {
	margin: 0 0 10px;
	padding: 0;
	font-size: 1.15em;
}
.insupay-dashboard .insupay-dash-group {
	margin: 14px 0 6px;
	font-size: 13px;
	color: #1d2327;
	border-bottom: 1px solid #dcdcde;
	padding-bottom: 4px;
}
.insupay-dashboard .insupay-dash-flow {
	margin: 0 0 8px 1.2em;
	line-height: 1.55;
}
.insupay-dashboard .insupay-dash-grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 8px 14px;
}
.insupay-dashboard .insupay-dash-grid li {
	margin: 0;
	padding: 8px 10px;
	background: #f6f7f7;
	border-left: 3px solid #2271b1;
}
.insupay-dashboard .insupay-dash-grid .description {
	display: block;
	margin-top: 2px;
	color: #646970;
}
.insupay-dashboard .insupay-dash-badge {
	display: inline-block;
	margin-left: 4px;
	padding: 0 6px;
	font-size: 11px;
	background: #f0f0f1;
	border-radius: 3px;
	color: #646970;
	vertical-align: middle;
}
.insupay-dashboard .insupay-help-block {
	margin: 8px 0;
	padding: 8px 12px;
	background: #f6f7f7;
	border: 1px solid #dcdcde;
}
.insupay-dashboard .insupay-help-block > summary {
	cursor: pointer;
	font-weight: 600;
	padding: 4px 0;
}
.insupay-dashboard .insupay-help-pre {
	background: #1d2327;
	color: #f0f0f1;
	padding: 10px 12px;
	overflow-x: auto;
	font-size: 12px;
	line-height: 1.45;
	border-radius: 3px;
}
.insupay-dashboard .insupay-help-table {
	margin: 8px 0;
	max-width: 100%;
}
.insupay-dashboard .insupay-help-table th,
.insupay-dashboard .insupay-help-table td {
	font-size: 12px;
	padding: 6px 8px;
	vertical-align: top;
}
.insupay-page-tip {
	max-width: 1100px;
	margin: 10px 0 14px !important;
	padding: 10px 14px !important;
}
.insupay-page-tip .insupay-page-tip-title { margin: 0 0 6px; }
.insupay-page-tip p { margin: 0.35em 0; }
.insupay-admin .insupay-preview { background: #fff; border: 1px solid #ccd0d4; padding: 1rem; max-width: 980px; overflow-x: auto; }
.insupay-period-bar { margin: 1em 0; }
/*
 * 스크롤 필수 규칙
 * - .insupay-summary-scroll = 세로·가로 스크롤 컨테이너
 * - 세로 스크롤 → thead(1행) 고정
 * - 가로 스크롤 → 1열 고정 (기본 first-child, 또는 .insupay-sticky-col)
 * 새 표도 반드시 이 래퍼를 쓰고, table에 overflow를 직접 주지 말 것.
 */
.insupay-summary-scroll {
	overflow: auto;
	max-width: 100%;
	max-height: 70vh;
	border: 1px solid #c3c4c7;
	background: #fff;
}
.insupay-summary-scroll > table,
.insupay-summary-scroll table {
	border-collapse: separate;
	border-spacing: 0;
	margin: 0;
}
/* 세로 스크롤: 헤더(1행) 고정 — 모든 스크롤 표 공통 */
.insupay-summary-scroll thead th {
	position: sticky;
	top: 0;
	z-index: 2;
	background: #f0f0f1;
	box-shadow: 0 1px 0 #c3c4c7;
}
/* 가로 스크롤: 1열 고정 — 공통 */
.insupay-summary-scroll thead th:first-child,
.insupay-summary-scroll tbody td:first-child,
.insupay-summary-scroll tfoot td:first-child,
.insupay-summary-scroll th.insupay-sticky-col,
.insupay-summary-scroll td.insupay-sticky-col {
	position: sticky;
	left: 0;
	z-index: 1;
	background: #fff;
	box-shadow: 2px 0 0 #c3c4c7;
}
.insupay-summary-scroll thead th:first-child,
.insupay-summary-scroll thead th.insupay-sticky-col {
	z-index: 4;
	background: #f0f0f1;
}
.insupay-summary-scroll.striped > table > tbody > tr:nth-child(odd) > td:first-child,
.insupay-summary-scroll table.striped > tbody > tr:nth-child(odd) > td:first-child,
.insupay-summary-scroll table.striped > tbody > tr:nth-child(odd) > td.insupay-sticky-col {
	background: #f6f7f7;
}
.insupay-summary-scroll table.striped > tbody > tr:nth-child(even) > td:first-child,
.insupay-summary-scroll table.striped > tbody > tr:nth-child(even) > td.insupay-sticky-col {
	background: #fff;
}
/* 합계행 등 강조 행의 1열도 배경 유지 */
.insupay-summary-scroll tbody tr[style*="font-weight:600"] > td:first-child,
.insupay-summary-scroll tbody tr[style*="font-weight: 600"] > td:first-child {
	background: #f0f0f1;
	z-index: 2;
}

/* 총괄표: 이미 헤더·1열 고정 적용됨(.insupay-summary-table). 위 스크롤 공통규칙과 함께 동작 */
.insupay-summary-table { min-width: 2400px; }
.insupay-summary-table th,
.insupay-summary-table td { white-space: nowrap; font-size: 12px; padding: 4px 8px; }
.insupay-summary-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.insupay-summary-table tfoot td {
	position: sticky;
	bottom: 0;
	background: #fff8e5;
	font-weight: 700;
	border-top: 2px solid #dba617;
	z-index: 2;
}
.insupay-summary-table tfoot td:first-child,
.insupay-summary-table tfoot td.insupay-sticky-col {
	z-index: 3;
	background: #fff8e5;
}
.insupay-summary-table tfoot td.num { font-variant-numeric: tabular-nums; }

/* 거래처 담당자별 정산합계 상세 */
.insupay-agent-settle-breakdown th,
.insupay-agent-settle-breakdown td {
	white-space: nowrap;
	font-size: 12px;
}
.insupay-agent-settle-breakdown thead th {
	vertical-align: bottom;
}
.insupay-agent-settle-breakdown .insupay-agent-drill {
	padding: 0;
	font-weight: 600;
	text-decoration: underline;
	cursor: pointer;
}
.insupay-agent-settle-breakdown tr.is-active {
	background: #e7f3ff !important;
}
.insupay-agent-drill-panel h4 {
	font-size: 13px;
}

/* 지급월 근무상태: 기본 접힘, 펼치면 목록만 스크롤(화면 안 충분히 보이도록) */
.insupay-month-work-scroll {
	max-height: min(65vh, 780px);
	overflow: auto;
	border: 1px solid #dcdcde;
	background: #fff;
	max-width: min(100%, 980px);
	width: 100%;
}
.insupay-month-work-scroll > table {
	margin: 0;
	max-width: none !important;
	width: 100%;
}
.insupay-month-work-scroll thead th {
	position: sticky;
	top: 0;
	z-index: 1;
	background: #f0f0f1;
	box-shadow: 0 1px 0 #c3c4c7;
}

/* 총괄표 열 표시/숨김 */
.insupay-col-toggle-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 4px 12px;
	max-height: 220px;
	overflow: auto;
	padding: 4px 0 2px;
}
.insupay-col-toggle-item {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	font-size: 13px;
	line-height: 1.3;
}
.insupay-col-toggle-item input { margin: 0; }
.insupay-summary-total-note {
	margin: 8px 0 10px;
	padding: 8px 12px;
	background: #fff8e5;
	border-left: 4px solid #dba617;
}
.insupay-manual-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
/* 라바 장기명단: 헤더열 ↔ 입력열 정렬, 수정·삭제 한 줄 */
.insupay-roster-table th,
.insupay-roster-table td { vertical-align: middle; }
.insupay-roster-table td .button-small { vertical-align: middle; }
.insupay-roster-table td form { display: inline; }

/* ===== 명세표 시트 양식 (구글시트 색상) ===== */
.insupay-stmt-sheet {
	width: 100%;
	border-collapse: collapse;
	table-layout: fixed;
	font-size: 13px;
	color: #111;
}
.insupay-stmt-sheet col.c-sec { width: 7%; }
.insupay-stmt-sheet col.c1,
.insupay-stmt-sheet col.c2,
.insupay-stmt-sheet col.c3,
.insupay-stmt-sheet col.c4,
.insupay-stmt-sheet col.c5 { width: 18.6%; }
.insupay-stmt-sheet th,
.insupay-stmt-sheet td {
	border: 1px solid #222;
	padding: 6px 8px;
	vertical-align: middle;
}
.insupay-stmt-title {
	text-align: center;
	font-size: 20px;
	font-weight: 700;
	color: #1a56c4;
	border: none !important;
	padding: 8px 0 14px !important;
}
.insupay-stmt-meta-row {
	border: none !important;
	text-align: right;
	padding-bottom: 12px !important;
}
.insupay-meta-gap { display: inline-block; width: 2.5em; }
.insupay-sec { font-weight: 700; text-align: center; }
.insupay-label-row th { text-align: center; font-weight: 600; }
.insupay-value-row td.num,
.insupay-label-row th.num-on-label {
	text-align: right;
	font-variant-numeric: tabular-nums;
	font-weight: 500;
}
.insupay-gap td { border: none !important; height: 12px; padding: 0 !important; }

/* 섹션·헤더 바탕 */
.theme-green { background: #c6efce !important; }
.insupay-sec.theme-green { background: #a9e0b5 !important; }
.theme-orange { background: #fce4d6 !important; }
.insupay-sec.theme-orange { background: #f8cbad !important; }
.theme-blue { background: #bdd7ee !important; }
.insupay-sec.theme-blue { background: #9dc3e6 !important; }
.theme-subtotal { background: #bdd7ee !important; color: #1a56c4 !important; vertical-align: middle !important; }
.theme-subtotal-val { background: #deebf7 !important; color: #1a56c4; vertical-align: middle !important; }
.insupay-label-row th.theme-subtotal-val.num-on-label {
	text-align: right !important;
	font-variant-numeric: tabular-nums;
	font-weight: 700;
}
.theme-tax { background: #bdd7ee !important; color: #1a56c4 !important; }
.theme-tax-val { background: #fff !important; color: #1a56c4; font-weight: 700; border: 2px solid #5b9bd5 !important; }
.theme-bank { background: #ffe566 !important; font-weight: 700; }
.theme-bank-val { background: #ffe566 !important; font-weight: 700; border: 2px solid #111 !important; }
.theme-memo { background: #fff2cc !important; text-align: center !important; }
.theme-memo-body {
	background: #fffef5 !important;
	border: 1px solid #c3c4c7 !important;
	/* 기본 ~3줄 + 짧은 여유 (과대 빈칸 방지) */
	min-height: 4.8em;
	height: auto;
	padding: 6px 8px !important;
	text-align: left !important;
	vertical-align: top !important;
	white-space: pre-wrap;
	word-break: break-word;
	line-height: 1.4;
}
.theme-gap {
	border: none !important;
	background: transparent !important;
	width: 1.2em;
}
.no-left { border-left: none !important; }
.insupay-value-row td.neg { color: #c00000 !important; font-weight: 600; }
.num-on-label { text-align: right !important; color: #1a56c4 !important; }

/*
 * 명세표 미리보기 인쇄 (관리자).
 * page-break-inside:avoid 를 큰 표에 쓰면 1장이 비고 2장으로 밀림 → 금지.
 * fixed 로 첫 장 상단부터 출력.
 */
@media print {
	@page {
		size: A4;
		margin: 14mm 12mm; /* 상·하 동일 여백 (하단 실종 방지) */
	}
	html, body {
		margin: 0 !important;
		padding: 0 !important;
		background: #fff !important;
		width: 100% !important;
		height: auto !important;
		overflow: visible !important;
	}
	#wpadminbar,
	#adminmenumain,
	#adminmenuback,
	#adminmenuwrap,
	#wpfooter,
	#screen-meta,
	#screen-meta-links,
	#wpbody-content > .notice,
	.notice,
	.insupay-no-print {
		display: none !important;
	}
	#wpwrap,
	#wpcontent,
	#wpbody,
	#wpbody-content,
	.wrap,
	.insupay-admin {
		margin: 0 !important;
		padding: 0 !important;
		border: none !important;
		float: none !important;
		position: static !important;
		width: 100% !important;
		max-width: none !important;
		min-height: 0 !important;
		height: auto !important;
		background: #fff !important;
		box-shadow: none !important;
	}
	#wpcontent,
	#wpfooter {
		margin-left: 0 !important;
		padding-left: 0 !important;
	}
	.insupay-print-area {
		display: block !important;
		position: static !important;
		left: auto !important;
		top: auto !important;
		right: auto !important;
		width: 100% !important;
		max-width: none !important;
		margin: 0 !important;
		box-sizing: border-box !important;
		border: none !important;
		padding: 0 !important; /* 여백은 @page 상하 14mm */
		background: #fff !important;
		overflow: visible !important;
		z-index: auto !important;
	}
	.insupay-stmt-sheet {
		width: 100% !important;
		font-size: 12.5px !important;
		page-break-inside: auto;
		page-break-before: avoid;
		break-inside: auto;
		break-before: avoid;
	}
	.insupay-stmt-sheet th,
	.insupay-stmt-sheet td {
		padding: 5px 7px !important;
	}
	.insupay-stmt-title {
		font-size: 18px !important;
		padding: 4px 0 8px !important;
	}
	.insupay-stmt-meta-row {
		padding-bottom: 8px !important;
	}
	.insupay-gap td {
		height: 8px !important;
	}
	.theme-memo-body {
		min-height: 4.8em !important;
		height: auto !important;
		max-height: none !important;
		overflow: visible !important;
		padding: 5px 7px !important;
		font-size: 12px !important;
		line-height: 1.4 !important;
	}
}

/* 분석: 취급 탭 + 라바정산 비교표 */
.insupay-analysis-tabs .insupay-analysis-tab-soon {
	display: inline-block;
	margin-left: 4px;
	padding: 0 5px;
	font-size: 10px;
	font-weight: 500;
	background: #f0f0f1;
	color: #646970;
	border-radius: 3px;
	vertical-align: middle;
}
.insupay-analysis-tab-panel {
	background: #fff;
	border: 1px solid #c3c4c7;
	border-top: none;
	padding: 14px 16px 18px;
}
.insupay-analysis-scroll {
	max-height: 75vh;
}
.insupay-analysis-table {
	min-width: 1200px;
}
.insupay-analysis-table th,
.insupay-analysis-table td {
	white-space: nowrap;
	font-size: 12px;
	padding: 4px 6px;
}
.insupay-analysis-table td.num {
	text-align: right;
	font-variant-numeric: tabular-nums;
}
.insupay-analysis-table thead tr:nth-child(1) th {
	top: 0;
}
.insupay-analysis-table thead tr:nth-child(2) th {
	top: 28px;
	z-index: 3;
	font-weight: 500;
	font-size: 11px;
}
.insupay-analysis-table th.insupay-analysis-month {
	text-align: center;
	border-left: 2px solid #c3c4c7;
	background: #e7f0f8;
}
.insupay-analysis-table th.insupay-analysis-sub {
	border-left: 1px solid #dcdcde;
}
.insupay-analysis-table th.insupay-analysis-sub:nth-child(5n+1),
.insupay-analysis-table tbody td:nth-child(5n+2),
.insupay-analysis-table tfoot td:nth-child(5n+2) {
	border-left: 2px solid #c3c4c7;
}
.insupay-analysis-actual {
	background: #fff8e5;
}
.insupay-analysis-input {
	width: 110px;
	text-align: right;
	padding: 2px 4px;
}
.insupay-diff-nonzero {
	color: #b32d2e;
	font-weight: 600;
}
.insupay-analysis-table tfoot td {
	position: sticky;
	bottom: 0;
	background: #fff8e5;
	font-weight: 700;
	border-top: 2px solid #dba617;
	z-index: 2;
}
.insupay-analysis-table tfoot td.insupay-sticky-col {
	z-index: 3;
	background: #fff8e5;
}

/* ===== 거래처 마감양식 (샘플 시트 · A4 연속인쇄) ===== */
.insupay-closing-print {
	max-width: 920px;
	margin: 8px 0 24px;
	background: #fff;
	padding: 12px 14px;
	border: 1px solid #c3c4c7;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.insupay-closing-sheet {
	width: 100%;
	border-collapse: collapse;
	table-layout: fixed;
	font-size: 13px;
	color: #111;
	margin: 0;
}
/* 상·하단 영수/수당 열 시작점 맞춤: 앞쪽 58% 동일 (장기 회차는 계약자 쪽에서 5%만)
 * 수당계는 넓게 → 「수당 총계 : 금…원」 한 줄 */
.insupay-closing-auto col.c-date { width: 13%; }
.insupay-closing-auto col.c-no { width: 22%; }
.insupay-closing-auto col.c-name { width: 23%; }
.insupay-closing-auto col.c-prem { width: 17%; }
.insupay-closing-auto col.c-fee { width: 25%; }
.insupay-closing-long col.c-date { width: 13%; }
.insupay-closing-long col.c-no { width: 22%; }
.insupay-closing-long col.c-name { width: 18%; }
.insupay-closing-long col.c-round { width: 5%; }
.insupay-closing-long col.c-prem { width: 17%; }
.insupay-closing-long col.c-fee { width: 25%; }
.insupay-closing-sheet th,
.insupay-closing-sheet td {
	border: 1px solid #222;
	padding: 5px 7px;
	vertical-align: middle;
}
.insupay-closing-sec-title {
	text-align: center !important;
	font-weight: 700;
	font-size: 14px;
	letter-spacing: 0.02em;
}
.insupay-closing-colhead th {
	text-align: center;
	font-weight: 600;
}
/* 섹션제목·열헤드·영수일~회차: 중앙. 영수보험료·수당계 본문 숫자만 우측 */
.insupay-closing-sheet td.c-ctr {
	text-align: center;
}
.insupay-closing-sheet td.num {
	text-align: right;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}
.insupay-closing-sheet td.neg {
	color: #c00000 !important;
	font-weight: 600;
}
.insupay-closing-fee-sum {
	text-align: right !important;
	white-space: nowrap !important;
	font-variant-numeric: tabular-nums;
}
.insupay-closing-empty {
	text-align: center;
	color: #646970;
	background: #f6f7f7;
}
.insupay-closing-extra {
	background: #fffef5;
}
.insupay-closing-subtotal td {
	font-weight: 700;
}
.insupay-closing-grand td {
	font-weight: 700;
}
.insupay-closing-gap {
	height: 14px;
}
@media print {
	/* 명세표 fixed는 1장용. 마감은 여러 A4 연속 → static */
	.insupay-print-area.insupay-print-flow {
		position: static !important;
		left: auto !important;
		top: auto !important;
		right: auto !important;
		width: 100% !important;
		max-width: none !important;
		margin: 0 !important;
		padding: 0 !important; /* 매 페이지 상·하는 @page(마감 인쇄 시 JS로 설정) */
		border: none !important;
		box-shadow: none !important;
		background: #fff !important;
		overflow: visible !important;
		z-index: auto !important;
	}
	.insupay-closing-print {
		max-width: none !important;
		margin: 0 !important;
		padding: 0 !important;
		border: none !important;
		box-shadow: none !important;
	}
	.insupay-closing-sheet {
		font-size: 11.5px !important;
		page-break-inside: auto;
		break-inside: auto;
	}
	.insupay-closing-sheet thead {
		display: table-header-group;
	}
	.insupay-closing-sheet tbody {
		display: table-row-group;
	}
	.insupay-closing-sheet tr {
		page-break-inside: avoid;
		break-inside: avoid;
	}
	.insupay-closing-gap {
		height: 10px !important;
	}
	.insupay-closing-extra {
		background: #fff !important;
	}
}

/* ===== 입금총괄표 (숏코드 · 화면 조회 전용, 인쇄 불가) ===== */
.insupay-deposit-view {
	max-width: 920px;
	margin: 8px 0 24px;
	background: #fff;
	padding: 12px 14px;
	border: 1px solid #c3c4c7;
}
.insupay-deposit-title { margin: 0 0 10px; font-size: 18px; }
.insupay-deposit-title small { font-size: 13px; font-weight: 400; color: #555; margin-left: 6px; }
.insupay-deposit-sub-title { margin: 18px 0 6px; font-size: 15px; }
.insupay-deposit-sheet {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
	color: #111;
	margin: 0;
	page-break-inside: auto;
}
.insupay-deposit-sheet th,
.insupay-deposit-sheet td { border: 1px solid #333; padding: 5px 8px; }
.insupay-deposit-sheet tr { page-break-inside: avoid; break-inside: avoid; }
.insupay-deposit-sheet td.c-left { text-align: left; }
.insupay-deposit-sheet td.c-num { text-align: right; font-variant-numeric: tabular-nums; }
.insupay-deposit-sheet tr.insupay-deposit-sub td { font-size: 12px; color: #444; background: #fafafa; }
.insupay-deposit-sheet tr.insupay-deposit-total td { font-weight: 700; background: #f3f3f3; }
@media print {
	.insupay-deposit-view { display: none !important; }
}
