/* * file name : style_maintenance.css
description : 유지보수 시스템 공통 스타일 (원가계산, 대시보드, 개요 통합)
*/
:root {
/* Color Palette */
--primary: #2563eb;
--primary-hover: #1d4ed8;
--bg-main: #f8fafc;
--ink: #0f172a;
--muted: #475569;
--border: #e2e8f0;
--grid: #4b5563;
--paper: #ffffff;
--hl-bg: #f1f5f9;
--danger: #ef4444;
--success: #10b981;
}

/* Base Reset */
body {
background-color: var(--bg-main);
color: var(--ink);
font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
line-height: 1.5;
margin: 0;
 -webkit-print-color-adjust: exact;
justify-content: center; /* 가로 중앙 정렬 */
align-items: center;     /* 세로 중앙 정렬 (필요 시) */
}

/* Layout Containers */
.container {
max-width: 1200px;
margin: 0 auto;
padding: 1rem;
}

/* Typography */
.page-title {
font-size: 1.5rem;
font-weight: 800;
text-align: center;
margin-bottom: 1.5rem;
color: var(--ink);
}

/* Common Card/Section Style */
.maint-card, .doc-section, .sheet {
background: var(--paper);
border: 1px solid var(--border);
border-radius: 12px;
padding: 1.25rem;
margin-bottom: 1.5rem;
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* --- Table Styles (Cost / Documentation) --- */
.cost-table, .doc-table {
width: 100%;
border-collapse: collapse;
table-layout: fixed;
font-size: 0.875rem;
border: 1px solid var(--grid);
}

.cost-table th, .cost-table td,
.doc-table th, .doc-table td {
border: 1px solid var(--grid);
padding: 1px 8px;
text-align: center;
height: 28px;
}

.cost-table th, .doc-table thead th {
background-color: var(--grid);
color: white;
font-weight: 700;
}

.bg-gray-custom, .rowhead {
background-color: #f3f4f6;
font-weight: 700;
color: var(--ink);
}

/* Numerical Cells */
.amount-cell, .price-input, .num {
text-align: right !important;
padding-right: 10px !important;
font-variant-numeric: tabular-nums;
}

/* Inputs in Tables */
input[type="number"], .price-input input {
width: 100%;
border: none;
outline: none;
background: transparent;
text-align: right;
font-family: inherit;
font-size: inherit;
}

/* --- Hero & KPI (Dashboard & Intro) --- */
.maint-hero {
display: flex;
align-items: center;
justify-content: space-between;
padding: 2rem;
background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(15, 23, 42, 0.05));
border-radius: 16px;
border: 1px solid var(--border);
margin-bottom: 2rem;
}

.kpi-container {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 1rem;
margin-bottom: 2rem;
}

.kpi-box {
background: white;
padding: 1rem;
border-radius: 12px;
border: 1px solid var(--border);
text-align: center;
}

/* --- Remarks & Notes --- */
.remarks-container, .foot-notes {
margin-top: 1rem;
padding: 1rem;
border: 1px solid var(--border);
background-color: #f9fafb;
border-radius: 8px;
font-size: 0.85rem;
color: var(--muted);
}

.remarks-list, .list {
padding-left: 1.5rem;
margin: 0.5rem 0;
}

.remarks-list li {
margin-bottom: 4px;
}

/* --- Actions & Buttons --- */
.btn-area {
display: flex;
justify-content: flex-end;
gap: 10px;
margin-top: 1.5rem;
}

.maint-btn {
display: inline-flex;
align-items: center;
gap: 8px;
padding: 0.5rem 1.25rem;
border-radius: 6px;
font-weight: 600;
cursor: pointer;
transition: all 0.2s;
text-decoration: none;
}

.maint-btn.primary {
background-color: var(--primary);
color: white;
border: none;
}

.maint-btn.primary:hover {
background-color: var(--primary-hover);
}

/* 4. 인쇄 전용 스타일 (핵심) */
    @media print {
        @page {
            size: A4 landscape;
            margin: 10mm 15mm; /* 상하 10mm, 좌우 15mm 여백 고정 */
        }
        
        body { background: white; }

        /* 변경 후: 외부 인클루드 파일(헤더, 푸터)의 공통 레이아웃 요소까지 숨김 처리 추가 */
        .no-print, header, footer, #header, #footer, .header, .footer, nav, .nav, aside, #sidebar { 
            display: none !important; 
        }
        
        .content-wrapper {
            padding: 0;
            display: block; /* 인쇄 시 flex 해제 */
        }

        .printable-area {
            width: 100% !important;
            max-width: none !important;
            margin: 0 auto !important; /* 가로 중앙 정렬 */
        }

        .cost-table, .remarks-container {
            border: 1.5px solid #000 !important;
            page-break-inside: avoid;
        }

        .cost-table th, .cost-table td {
            border: 1px solid #000 !important;
            color: #000 !important;
        }

        .bg-final-total {
            background-color: #fef08a !important;
            -webkit-print-color-adjust: exact;
        }

        /* 입력 필드 테두리 제거 */
        input, select {
            border: none !important;
            background: transparent !important;
            appearance: none;
            -webkit-appearance: none;
        }
    }