/* ====================================================
   휴가원 공통 UI 스타일
   ==================================================== */
.print-warning {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: #fff3cd;
    color: #856404;
    padding: 10px 15px;
    margin: 0 20px 15px 20px;
    border-radius: 4px;
    border-left: 4px solid #ffeeba;
    font-size: 14px;
}

/* 휴가원 작성 폼 (화면용) */
.leave-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    padding: 15px;
}

.leave-form-grid .fg.full-width {
    grid-column: 1 / -1;
}

/* ====================================================
   휴가원 인쇄용 (A4) 스타일 — 원본 워드 파일 기준 정밀 복원
   폰트: 굴림체 (GulimChe, monospace)
   기본 본문: 12pt Bold
   ==================================================== */
.print-only {
    display: none;
}

/* 인쇄 뷰 컨테이너 (화면에서 미리보기) */
.print-preview-container {
    background: #525659;
    padding: 20px;
    display: none;
    justify-content: center;
    overflow-y: auto;
    height: 100%;
}

.print-page {
    background: white;
    width: 210mm;
    height: 297mm;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    padding: 20mm 18mm 15mm 18mm;
    box-sizing: border-box;
    font-family: 'GulimChe', '굴림체', monospace;
    color: #000;
    position: relative;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

/* 인쇄용 양식 내부 레이아웃 — 원본은 테두리 없음 */
.doc-border {
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    font-family: 'GulimChe', '굴림체', monospace;
    overflow: hidden;
    flex: 1;
}

/* ── 제목 ── */
.doc-title {
    text-align: center;
    font-size: 24pt;
    font-weight: bold;
    text-decoration: underline;
    text-underline-offset: 4px;
    margin-top: 10mm;
    margin-bottom: 12mm;
    /* 원본은 tab으로 분리, HTML에서 &emsp; 사용 */
}

/* ── 상단 인적사항 (테이블 기반) ── */
.doc-info-table {
    border-collapse: collapse;
    margin-left: 16pt;
    font-size: 12pt;
    font-weight: bold;
    margin-bottom: 6mm;
    width: 100%;
}
.doc-info-table td {
    vertical-align: top;
    padding: 0;
    line-height: 14pt;
}
.doc-info-table tr {
    height: 18pt;
}
.doc-info-table tr.row-rank {
    height: 24pt;
}
.doc-info-table tr.row-rank td {
    padding-top: 4pt;
}
.doc-info-table tr.row-name td {
    padding-top: 3pt;
    line-height: 13pt;
}
.doc-info-table td.col-label {
    width: 80pt;
    vertical-align: top;
    white-space: nowrap;
}
.doc-info-table td.col-value {
    padding-left: 10pt;
    vertical-align: top;
}

/* ── 본문 문구 ── */
.doc-statement {
    text-align: left;
    font-size: 12pt;
    font-weight: bold;
    line-height: 160%;
    margin-bottom: 2mm;
    word-break: keep-all;
    padding-left: 24pt;
    text-indent: 48pt;
}

/* ── 기간/사유 블록 ── */
.doc-detail-block {
    display: flex;
    flex-direction: column;
    font-size: 12pt;
    font-weight: bold;
    margin-bottom: 8mm;
    padding-left: 18pt;
}
.doc-detail-row {
    display: flex;
    align-items: baseline;
}
.doc-detail-row + .doc-detail-row {
    padding-top: 9pt;
}
.doc-detail-label {
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── 작성일자 ── */
.doc-date {
    text-align: right;
    font-size: 12pt;
    font-weight: bold;
    margin-bottom: 5mm;
}

/* ── 서명란 (우측) ── */
.doc-sign-block {
    display: flex;
    flex-direction: column;
    font-size: 12pt;
    font-weight: bold;
    align-items: flex-end;
    margin-bottom: 5mm;
}
.doc-sign-row {
    display: flex;
    justify-content: flex-start;
    width: 280px;
    line-height: 2.2;
}
.doc-sign-label {
    display: flex;
    justify-content: space-between;
    width: 70px;
    flex-shrink: 0;
    white-space: nowrap;
}
.doc-sign-value {
    flex: 1;
    display: flex;
    justify-content: space-between;
    padding-left: 10px;
}
.doc-sign-value .stamp {
    margin-left: auto;
}

/* ── 결재선 (하단) ── */
.doc-approval-wrap {
    display: flex;
    margin-bottom: 8px;
    width: 100%;
    margin-left: 28pt;
}
.doc-approval-header {
    width: 22pt;
    border: 2pt solid #000;
    border-right: 1pt solid #000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
    font-size: 12pt;
    font-weight: bold;
    line-height: 118%;
    padding: 2pt 5pt 2pt 5pt;
}
.doc-approval-table {
    border-collapse: collapse;
    text-align: center;
    font-size: 12pt;
    font-weight: bold;
    table-layout: fixed;
}
.doc-approval-table th {
    width: 44pt;
    height: 18pt;
    border: 1pt solid #000;
    font-weight: bold;
    padding-top: 1pt;
    line-height: 15pt;
}
.doc-approval-table td {
    width: 44pt;
    height: 43pt;
    border: 1pt solid #000;
}
/* 외곽 테두리 2pt */
.doc-approval-table th:first-child { border-left: none; }
.doc-approval-table td:first-child { border-left: none; }
.doc-approval-table th:last-child { border-right: 2pt solid #000; }
.doc-approval-table td:last-child { border-right: 2pt solid #000; }
.doc-approval-table thead tr th { border-top: 2pt solid #000; }
.doc-approval-table tbody tr:last-child td { border-bottom: 2pt solid #000; }

/* ── 수신자 ── */
.doc-recipient {
    font-size: 12pt;
    font-weight: bold;
    margin-bottom: 8px;
    padding-left: 26pt;
    padding-top: 3pt;
}

/* ── 하단 비고 ── */
.doc-remarks {
    border: 1px solid #000;
    padding: 8px 12px;
    font-size: 10pt;
    font-weight: normal;
    line-height: 1.5;
    margin-top: auto;
}
.doc-remarks-grid {
    display: flex;
}
.doc-remarks-label {
    width: 30px;
    flex-shrink: 0;
}

/* ── 문서 번호 ── */
.doc-id {
    font-size: 13pt;
    font-family: 'Century', serif;
    font-weight: normal;
    margin-top: 6pt;
    padding-left: 5pt;
}


/* ====================================================
   실제 인쇄(Ctrl+P) 시 동작할 미디어 쿼리
   ==================================================== */
@media print {
    @page {
        size: A4;
        margin: 0;
    }
    
    body * {
        visibility: hidden;
    }
    
    /* 화면용 모달이나 컨테이너 등 숨김 */
    .app-container, .sidebar, .header, .modal-header, .print-warning {
        display: none !important;
    }

    /* 프린트 영역만 보이게 처리 */
    #printArea, #printArea * {
        visibility: visible;
    }
    
    #printArea {
        position: absolute;
        left: 0;
        top: 0;
        width: 210mm;
        background: #fff;
        display: flex;
        justify-content: center;
        align-items: flex-start;
        font-family: 'GulimChe', '굴림체', monospace;
    }
    
    /* 인쇄 미리보기 컨테이너 배경 제거 */
    .print-preview-container {
        display: block !important;
        background: none !important;
        padding: 0 !important;
        height: auto !important;
        overflow: visible !important;
    }
    
    .print-page {
        box-shadow: none;
        margin: 0;
        padding: 20mm 18mm 15mm 18mm;
        width: 210mm;
        height: 297mm;
        page-break-after: always;
    }
    
    /* 폰트 강제 검정색 */
    .print-page * {
        color: #000 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
