/* 전체 컨테이너 - 중앙 카드 형태 */
.payslip-viewer-container {
  max-width: 600px;
  margin: 40px auto;
  padding: 32px 40px;
  background-color: #fefcf9;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  font-family: 'Noto Sans KR', sans-serif;
  color: #333;
}

/* 헤더 로고 영역 */
.viewer-header {
  text-align: center;
  padding: 0;
  margin-bottom: 30px;
}

.viewer-logo {
  max-width: 120px;
  height: auto;
}

/* 항목 제목 */
.viewer-title {
  text-align: left;
  font-size: 24px;
  font-weight: 600;
  margin: 20px 0 35px;
  color: #333;
  font-family: 'IBM Plex Sans KR', sans-serif;
}

/* 섹션 제목 */
.viewer-section-title {
  font-weight: bold;
  font-size: 14px;
  color: #666;
  margin: 30px 0 0px;
  border-bottom: 0px solid rgba(0, 0, 0, 0.1);
  padding-bottom: 4px;
}

/* 항목 테이블 */
.viewer-table {
  width: 100%;
  margin-top: 16px;
}

/* 각 항목 행 */
.viewer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 0;
  font-size: 16px;
  border-bottom: 1px solid rgba(0, 27, 55, 0.1);
  white-space: nowrap;
}

.viewer-row.total {
  font-weight: bold;
  font-size: 17px;
  border-bottom: none;
}

/* 하단 고지 사항 */
.viewer-appendix {
  margin-top: 40px;
  font-size: 12px;
  color: #555;
  text-align: left;
  line-height: 1.3;
  padding: 0 50px;
}
.viewer-appendix p {
  margin-top: 6px;
  margin-bottom: 6px;
  line-height: 1.5;
  margin-left: 5px;
  Text-indent: -5px;
}

/* 발급자 정보 */
.viewer-issued {
  margin-top: 40px;
  font-size: 13px;
  color: #555;
  text-align: left;
  line-height: 1.3;
  padding: 0 50px;
}
.viewer-issued p {
  margin-top: 6px;
  margin-bottom: 6px;
  line-height: 1;
}

/* 푸터 (저작권 등) */
.viewer-footer {
  margin-top: 40px;
  font-size: 12px;
  text-align: center;
  color: #aaa;
}

/* PDF 출력 버튼 (오른쪽 상단) */
.viewer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.viewer-print-btn {
  background-color: #857e6e !important;
  color: white;
  font-size: 13px;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  height: fit-content;
  margin-top: 4px;
}

.viewer-print-btn:hover {
  background-color: #36322b !important;
}

/* 출력 버튼 */
.viewer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.viewer-controls {
  display: flex;
  gap: 20px;
}

.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.icon-image {
  width: 22px;
  height: 22px;
  transition: opacity 0.2s ease;
}
.icon-btn:hover .icon-image {
  opacity: 0.7;
}

/* 반응형 모바일 대응 */
@media screen and (max-width: 500px) {
  .payslip-viewer-container {
    padding: 24px 20px;
  }

  .viewer-header {
    margin-bottom: 20px;
  }

  .viewer-title {
    font-size: 20px;
    margin-top: 10px;
  }

  .viewer-row {
    font-size: 15px;
    padding: 10px 0;
  }

  .viewer-logo {
    max-width: 100px;
  }

  .viewer-appendix {
    padding: 0 10px;
  }

  .viewer-issued {
    padding: 0 10px;
  }

}

@media print {
  /* 기본 페이지 설정 */
  @page {
    size: A4;
    margin: 20mm;
  }
  
  /* 모든 요소 숨김 */
  body * {
    visibility: hidden;
  }
  
  /* 명세서 컨테이너만 표시 */
  .payslip-viewer-container, 
  .payslip-viewer-container * {
    visibility: visible;
  }
  
  /* 컨테이너 기본 설정 */
  .payslip-viewer-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 20px !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    background: white !important;
    font-family: 'Malgun Gothic', sans-serif !important;
  }
  
  /* 헤더 영역 */
  .viewer-header {
    display: block !important;
    text-align: center !important;
    margin-bottom: 30px !important;
    page-break-inside: avoid;
  }
  
  /* 불필요한 요소들 숨김 */
  .viewer-controls, 
  .icon-btn,
  button,
  .print-hide {
    display: none !important;
  }
  
  /* 로고 */
  .viewer-logo {
    max-width: 120px !important;
    height: auto !important;
    margin: 0 auto 20px !important;
    display: block !important;
  }
  
  /* 제목 */
  .viewer-title {
    font-size: 22px !important;
    font-weight: bold !important;
    margin: 20px 0 30px !important;
    text-align: center !important;
    color: #000 !important;
  }
  
  /* 기본 정보 테이블 (지급일, 성명, 부서 등) */
  .viewer-info-table,
  .viewer-table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin-bottom: 20px !important;
    font-size: 14px !important;
  }
  
  .viewer-info-table tr,
  .viewer-table tr {
    border-bottom: 1px solid #ddd !important;
  }
  
  .viewer-info-table td,
  .viewer-table td {
    padding: 0px 12px !important;
    vertical-align: middle !important;
    border: none !important;
  }
  
  .viewer-info-table td:first-child,
  .viewer-table td:first-child {
    background-color: #f8f9fa !important;
    font-weight: bold !important;
    width: 30% !important;
    text-align: left !important;
  }
  
  .viewer-info-table td:last-child,
  .viewer-table td:last-child {
    text-align: right !important;
    width: 70% !important;
  }
  
  /* 상세내역 섹션 */
  .viewer-section-title {
    font-size: 16px !important;
    font-weight: bold !important;
    margin: 30px 0 15px !important;
    padding-bottom: 8px !important;
    border-bottom: 2px solid #333 !important;
  }
  
  /* 급여 항목들 */
  .viewer-salary-table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin-bottom: 20px !important;
  }
  
  .viewer-salary-table tr {
    border-bottom: 1px solid #eee !important;
  }
  
  .viewer-salary-table td {
    padding: 0px 20px !important;
    font-size: 14px !important;
  }
  
  .viewer-salary-table td:first-child {
    background-color: #f8f9fa !important;
    font-weight: normal !important;
    width: 40% !important;
    text-align: left !important;
  }
  
  .viewer-salary-table td:last-child {
    text-align: right !important;
    font-weight: normal !important;
  }
  
  /* 총 지급액 강조 */
  .viewer-salary-table tr.total,
  .viewer-row.total {
    background-color: #f0f0f0 !important;
    font-weight: bold !important;
    font-size: 15px !important;
    border-top: 2px solid #333 !important;
    border-bottom: 2px solid #333 !important;
  }
  
  .viewer-salary-table tr.total td {
    padding: 12px 20px !important;
    font-weight: bold !important;
  }
  
  /* 하단 안내문구 */
  .viewer-issued,
  .viewer-appendix {
    text-align: center !important;
    font-size: 12px !important;
    margin-top: 40px !important;
    line-height: 1.6 !important;
    page-break-inside: avoid;
  }
  
  /* 발급자 정보 */
  .viewer-footer {
    text-align: left !important;
    font-size: 11px !important;
    margin-top: 30px !important;
    color: #666 !important;
    page-break-inside: avoid;
  }
  
  /* 링크 스타일 제거 */
  a[href]:after {
    content: "" !important;
  }
  
  a {
    color: inherit !important;
    text-decoration: none !important;
  }
  
  /* 페이지 나누기 방지 */
  .payslip-viewer-container {
    page-break-inside: avoid;
  }
  
  /* 색상 보정 */
  * {
    color-adjust: exact !important;
    -webkit-print-color-adjust: exact !important;
  }
  
  /* 여백 및 패딩 정리 */
  .viewer-content {
    margin: 0 !important;
    padding: 0 !important;
  }
  
  /* 반응형 테이블을 일반 테이블로 변환 */
  .viewer-responsive-table {
    display: table !important;
  }
  
  .viewer-responsive-row {
    display: table-row !important;
  }
  
  .viewer-responsive-cell {
    display: table-cell !important;
  }
}