/* 카테고리별 리비전 페이지 공통 스타일 */

.category-revision-page {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    min-height: 100vh;
    padding: 20px;
}

/* 헤더 스타일 - 기존 materials-page와 통일 */
.materials-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 24px;
    border: 1px solid #e2e8f0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.back-button {
    padding: 8px 16px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    color: #475569;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.back-button:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
    color: #334155;
}

.header-center h1 {
    margin: 0 0 4px 0;
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
}

.header-subtitle {
    color: #64748b;
    font-size: 14px;
    font-weight: 400;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* 컨트롤 섹션 */
.control-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 24px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.section-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
}

.processing-summary {
    font-size: 14px;
    color: #64748b;
    font-weight: 500;
}

.control-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px 24px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.control-group label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.control-group input,
.control-group select {
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    transition: all 0.2s ease;
}

.control-group input:focus,
.control-group select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* 선택된 자재 액션 */
.selected-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: #f0f9ff;
    border-top: 1px solid #e2e8f0;
}

.selected-count {
    font-size: 14px;
    font-weight: 600;
    color: #0369a1;
}

.action-buttons {
    display: flex;
    gap: 8px;
}

.btn-action {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-purchase {
    background: #10b981;
    color: white;
}

.btn-purchase:hover {
    background: #059669;
}

.btn-inventory {
    background: #f59e0b;
    color: white;
}

.btn-inventory:hover {
    background: #d97706;
}

.btn-delete {
    background: #ef4444;
    color: white;
}

.btn-delete:hover {
    background: #dc2626;
}

/* 자재 테이블 */
.materials-table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.table-header {
    display: grid;
    grid-template-columns: 50px 100px 2fr 1fr 80px 80px 1fr 1fr 100px;
    gap: 12px;
    padding: 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-weight: 600;
    font-size: 14px;
    color: #374151;
}

.header-cell {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.checkbox-cell {
    justify-content: center;
}

.table-body {
    max-height: 600px;
    overflow-y: auto;
}

.table-row {
    display: grid;
    grid-template-columns: 50px 100px 2fr 1fr 80px 80px 1fr 1fr 100px;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
    color: #374151;
    transition: all 0.2s ease;
    align-items: center;
}

.table-row:hover {
    background: #f8fafc;
}

.table-row:last-child {
    border-bottom: none;
}

.table-cell {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 40px;
}

.table-cell.checkbox-cell {
    justify-content: center;
}

.table-cell.quantity-cell {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

/* 상태별 스타일 */
.table-row.status-revision {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
}

.table-row.status-inventory {
    background: #dbeafe;
    border-left: 4px solid #3b82f6;
}

.table-row.status-deleted {
    background: #fee2e2;
    border-left: 4px solid #ef4444;
    opacity: 0.7;
}

.table-row.status-new {
    background: #dcfce7;
    border-left: 4px solid #22c55e;
}

.table-row.status-normal {
    background: white;
}

/* 상태 배지 */
.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    min-width: 80px;
}

.status-badge.status-revision {
    background: #fbbf24;
    color: #92400e;
}

.status-badge.status-inventory {
    background: #60a5fa;
    color: #1e40af;
}

.status-badge.status-deleted {
    background: #f87171;
    color: #991b1b;
}

.status-badge.status-new {
    background: #4ade80;
    color: #166534;
}

.status-badge.status-normal {
    background: #e5e7eb;
    color: #374151;
}

/* 자재 정보 */
.material-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.material-name {
    font-weight: 500;
    color: #1f2937;
}

.material-notes {
    font-size: 12px;
    color: #6b7280;
    font-style: italic;
}

/* 수량 표시 */
.quantity-value {
    font-weight: 600;
    color: #1f2937;
}

.quantity-change {
    font-size: 12px;
    color: #6b7280;
}

/* 액션 버튼 */
.action-buttons-small {
    display: flex;
    gap: 4px;
}

.btn-small {
    padding: 4px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: white;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-small:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.btn-view {
    color: #3b82f6;
}

.btn-edit {
    color: #f59e0b;
}

/* 빈 상태 */
.empty-state {
    padding: 60px 20px;
    text-align: center;
    color: #6b7280;
}

.empty-state p {
    margin: 0;
    font-size: 16px;
}

/* 반응형 디자인 */
@media (max-width: 1400px) {
    .table-header,
    .table-row {
        grid-template-columns: 50px 100px 2fr 1fr 80px 80px 1fr 100px;
    }
    
    .table-header .header-cell:nth-child(7),
    .table-row .table-cell:nth-child(7) {
        display: none;
    }
}

@media (max-width: 1200px) {
    .control-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .table-header,
    .table-row {
        grid-template-columns: 50px 100px 2fr 80px 80px 100px;
    }
    
    .table-header .header-cell:nth-child(4),
    .table-row .table-cell:nth-child(4) {
        display: none;
    }
}

@media (max-width: 768px) {
    .category-revision-page {
        padding: 16px;
    }
    
    .materials-header {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    
    .header-left {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .control-grid {
        grid-template-columns: 1fr;
    }
    
    .selected-actions {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .action-buttons {
        justify-content: stretch;
    }
    
    .btn-action {
        flex: 1;
    }
    
    .table-header,
    .table-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .table-header {
        display: none;
    }
    
    .table-row {
        flex-direction: column;
        align-items: stretch;
        padding: 16px;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        margin-bottom: 8px;
    }
    
    .table-cell {
        justify-content: space-between;
        padding: 4px 0;
        border-bottom: 1px solid #f3f4f6;
    }
    
    .table-cell:last-child {
        border-bottom: none;
    }
    
    .table-cell::before {
        content: attr(data-label);
        font-weight: 600;
        color: #6b7280;
        min-width: 80px;
    }
    
    .checkbox-cell::before {
        content: "선택";
    }
}

/* 애니메이션 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.table-row {
    animation: fadeIn 0.3s ease-out;
}

.control-section,
.materials-table-container {
    animation: fadeIn 0.4s ease-out;
}

/* 스크롤바 스타일 */
.table-body::-webkit-scrollbar {
    width: 8px;
}

.table-body::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.table-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.table-body::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
