/* 전역 스타일 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
    padding: 10px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* 헤더 */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

header h1 {
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* 버튼 스타일 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: bold;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.btn-back {
    background: #6c757d;
    color: white;
    text-decoration: none;
}

.btn-back:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-report {
    background: #FF9800;
    color: white;
    text-decoration: none;
}

.btn-report:hover {
    background: #F57C00;
    transform: translateY(-2px);
}

.btn-save {
    background: #2196F3;
    color: white;
}

.btn-save:hover {
    background: #1976D2;
    transform: translateY(-2px);
}

.btn-print {
    background: #667eea;
    color: white;
}

.btn-print:hover {
    background: #5568d3;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #FF9800;
    color: white;
}

.btn-secondary:hover {
    background: #F57C00;
    transform: translateY(-2px);
}

/* 날짜 섹션 */
.date-section {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.date-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.date-input-group, .initial-meter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.date-input-group label, .initial-meter-group label {
    font-weight: bold;
    color: #555;
    white-space: nowrap;
}

.date-input-group input, .initial-meter-group input {
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 0.95rem;
    min-width: 150px;
}

.date-input-group input:focus, .initial-meter-group input:focus {
    outline: none;
    border-color: #667eea;
}

#initial-meter {
    min-width: 200px;
}

/* 계기표 섹션 */
.meter-section {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.meter-title {
    color: #000;
    margin-bottom: 60px;
    font-size: 1.5rem;
    text-align: center;
    font-weight: bold;
}

/* 계기표 테이블 */
.meter-table {
    width: 85%;
    margin: 0 auto;
    border-collapse: collapse;
    font-size: 1rem;
    background: white;
}

.meter-table th,
.meter-table td {
    border: 1px solid #333;
    padding: 10px;
    text-align: center;
}

.meter-table thead th {
    background: #ffffff;
    color: #000;
    font-weight: bold;
    font-size: 1.1rem;
    border: 1px solid #000;
}

.meter-table tbody tr:hover {
    background: #f5f5f5;
}

.meter-table tbody tr:nth-child(odd) {
    background: #ffffff;
}

.meter-table tbody tr:nth-child(even) {
    background: #ffffff;
}

.date-cell {
    font-weight: bold;
    color: #000;
    width: 150px;
}

.fuel-cell {
    font-weight: bold;
    color: #000;
    width: 200px;
}

.meter-cell {
    font-weight: bold;
    color: #000;
    width: 200px;
}

.current-meter-cell {
    font-weight: bold;
    color: #000;
    width: 200px;
}

/* 일요일 */
.sunday {
    background: #ffffff !important;
    color: #000 !important;
}

/* 안내 섹션 */
.info-section {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.info-section h3 {
    color: #667eea;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-section ul {
    list-style: none;
}

.info-section li {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.info-section li:last-child {
    border-bottom: none;
}

.info-section strong {
    color: #667eea;
}

/* 인쇄 스타일 */
@media print {
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    body {
        background: white;
        padding: 0;
        margin: 0;
    }
    
    .no-print {
        display: none !important;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
        margin: 0;
    }
    
    .meter-section {
        padding: 5px;
        box-shadow: none;
        margin: 0;
    }
    
    .meter-title {
        font-size: 16pt;
        margin-bottom: 20px;
        font-weight: bold;
        color: #000 !important;
    }
    
    .meter-table {
        font-size: 8pt;
        width: 85%;
        margin: 0 auto;
        border-collapse: collapse;
    }
    
    .meter-table th,
    .meter-table td {
        padding: 3px 5px;
        border: 1px solid #000 !important;
        line-height: 1.2;
    }
    
    .meter-table thead th {
        background: #ffffff !important;
        color: #000 !important;
        font-size: 9pt;
        padding: 5px;
        border: 1px solid #000 !important;
    }
    
    .meter-table tbody tr:nth-child(odd) {
        background: #ffffff !important;
    }
    
    .meter-table tbody tr:nth-child(even) {
        background: #ffffff !important;
    }
    
    .sunday {
        background: #ffffff !important;
        color: #000 !important;
    }
    
    .date-cell {
        width: 22%;
    }
    
    .fuel-cell {
        width: 26%;
    }
    
    .meter-cell {
        width: 26%;
    }
    
    .current-meter-cell {
        width: 26%;
    }
    
    /* 페이지 나누기 방지 */
    .meter-section {
        page-break-inside: avoid;
    }
    
    .meter-table {
        page-break-inside: auto;
    }
    
    .meter-table tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }
    
    .meter-table thead {
        display: table-header-group;
    }
    
    @page {
        size: A4 portrait !important;
        margin: 10mm 12mm;
    }
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .header-controls {
        width: 100%;
        justify-content: flex-start;
    }
    
    .date-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .date-input-group, .initial-meter-group {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .meter-table {
        font-size: 0.85rem;
    }
    
    .meter-table th,
    .meter-table td {
        padding: 6px;
    }
}
