/* ============================================
   🖨️ 인쇄 전용 스타일
   각 작업모드 결과 카드를 깔끔하게 프린트
   ============================================ */

@media print {

    /* 1. 전체 레이아웃 리셋: 사이드바/지도 모두 숨김 */
    body * {
        visibility: hidden;
    }

    /* 2. 인쇄 영역만 표시 */
    #print-area,
    #print-area * {
        visibility: visible !important;
    }

    #print-area {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        padding: 20px;
        background: white !important;
        color: #1e293b !important;
        font-family: 'Pretendard', 'Apple SD Gothic Neo', sans-serif;
    }

    /* 3. 페이지 설정 */
    @page {
        size: A4;
        margin: 15mm;
    }

    /* 4. 섹션별 페이지 나누기 */
    .print-section {
        page-break-after: always;
        margin-bottom: 0;
    }

    .print-section:last-child {
        page-break-after: auto;
    }

    /* 5. 섹션 헤더 */
    .print-section-header {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 12px 16px;
        background: #1e293b !important;
        color: white !important;
        border-radius: 8px;
        margin-bottom: 16px;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .print-section-header h2 {
        margin: 0;
        font-size: 16px;
        font-weight: 700;
    }

    .print-section-header .badge {
        background: #3b82f6;
        color: white;
        padding: 2px 10px;
        border-radius: 12px;
        font-size: 12px;
        font-weight: 600;
    }

    /* 6. 프린트 타이틀 */
    .print-title-bar {
        text-align: center;
        padding: 20px 0 16px;
        border-bottom: 2px solid #1e293b;
        margin-bottom: 24px;
    }

    .print-title-bar h1 {
        margin: 0 0 6px;
        font-size: 22px;
        font-weight: 800;
        color: #1e293b;
    }

    .print-title-bar .print-meta {
        font-size: 12px;
        color: #64748b;
    }

    /* 7. 카드 스타일 */
    .print-card {
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        padding: 12px 16px;
        margin-bottom: 10px;
        page-break-inside: avoid;
        background: #fafbfc !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .print-card-title {
        font-size: 13px;
        font-weight: 700;
        color: #1e293b;
        margin-bottom: 6px;
    }

    .print-card-body {
        font-size: 12px;
        color: #475569;
        line-height: 1.6;
    }

    .print-card-body .label {
        color: #94a3b8;
        font-weight: 600;
        min-width: 60px;
        display: inline-block;
    }

    /* 8. 테이블 스타일 */
    .print-table {
        width: 100%;
        border-collapse: collapse;
        font-size: 11px;
        margin-top: 8px;
    }

    .print-table th {
        background: #f1f5f9 !important;
        padding: 8px 10px;
        text-align: left;
        font-weight: 700;
        color: #334155;
        border-bottom: 2px solid #cbd5e1;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .print-table td {
        padding: 6px 10px;
        border-bottom: 1px solid #e2e8f0;
        color: #475569;
    }

    .print-table tr:nth-child(even) td {
        background: #f8fafc !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* 9. 합계 행 */
    .print-total-row {
        background: #f0f9ff !important;
        font-weight: 700;
        color: #0369a1 !important;
        border-top: 2px solid #3b82f6;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* 10. 프린트 버튼 자체는 숨김 */
    .no-print,
    #print-report-btn {
        display: none !important;
    }
}