/* PIPE Cutting Plan 페이지 전용 스타일 */

/* PIPE 리비전 상태 표시 */
.revision-status-section {
    margin: 20px 0;
    padding: 0 20px;
}

.revision-alert {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 20px;
    border-radius: 12px;
    border-left: 5px solid;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.revision-alert.pre-cutting {
    border-left-color: #3b82f6;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

.revision-alert.post-cutting {
    border-left-color: #f59e0b;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.alert-icon {
    font-size: 24px;
    margin-top: 2px;
}

.alert-content h4 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.alert-content p {
    margin: 0 0 12px 0;
    color: #4b5563;
    line-height: 1.5;
}

.revision-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 12px;
}

.revision-summary span {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Cutting Plan 관리 섹션 */
.cutting-plan-management-section {
    margin: 30px 0;
    padding: 25px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.cutting-plan-management-section .section-header h3 {
    margin: 0 0 20px 0;
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cutting-plan-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.cutting-plan-actions button {
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
}

.btn-export-temp {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.btn-export-temp:hover:not(:disabled) {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.4);
}

.btn-finalize-cutting-plan {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.3);
}

.btn-finalize-cutting-plan:hover:not(:disabled) {
    background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(220, 38, 38, 0.4);
}

.btn-export-finalized {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(5, 150, 105, 0.3);
}

.btn-export-finalized:hover:not(:disabled) {
    background: linear-gradient(135deg, #047857 0%, #065f46 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(5, 150, 105, 0.4);
}

.btn-issue-management {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(124, 58, 237, 0.3);
}

.btn-issue-management:hover:not(:disabled) {
    background: linear-gradient(135deg, #6d28d9 0%, #5b21b6 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(124, 58, 237, 0.4);
}

.cutting-plan-actions button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.action-descriptions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 15px;
    background: rgba(249, 250, 251, 0.8);
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.action-desc {
    font-size: 13px;
    color: #4b5563;
    line-height: 1.4;
}

.action-desc strong {
    color: #1f2937;
    font-weight: 600;
}

/* 반응형 */
@media (max-width: 768px) {
    .cutting-plan-actions {
        grid-template-columns: 1fr;
    }
    
    .cutting-plan-actions button {
        font-size: 13px;
        padding: 10px 16px;
    }
}

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

/* 리비전 경고 섹션 */
.revision-warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fbbf24 100%);
    border: 2px solid #f59e0b;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
}

.warning-content h3 {
    margin: 0 0 12px 0;
    color: #92400e;
    font-size: 18px;
    font-weight: 700;
}

.warning-content p {
    margin: 0 0 16px 0;
    color: #92400e;
    font-size: 14px;
    line-height: 1.5;
}

.highlight {
    background: rgba(239, 68, 68, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    color: #dc2626;
}

.btn-force-upload {
    background: #dc2626;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-force-upload:hover {
    background: #b91c1c;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

/* 분류 섹션 */
.classification-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;
}

.classification-controls {
    display: grid;
    grid-template-columns: 200px 1fr 250px;
    gap: 20px;
    padding: 20px 24px;
    align-items: end;
}

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

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

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

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

.control-group select:disabled,
.control-group input:disabled {
    background: #f9fafb;
    color: #9ca3af;
    cursor: not-allowed;
}

.btn-start-cutting-plan {
    padding: 12px 20px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    height: fit-content;
}

.btn-start-cutting-plan:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-start-cutting-plan:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 자재 현황 요약 */
.materials-summary {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 20px 24px;
    margin-bottom: 24px;
    border: 1px solid #e2e8f0;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #f1f5f9;
}

.stat-label {
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
}

/* Cutting Plan 콘텐츠 */
.cutting-plan-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* 구역 섹션 */
.area-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.area-section.unassigned {
    border-color: #fbbf24;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

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

.area-section.unassigned .area-header {
    background: #fbbf24;
    color: white;
}

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

.area-section.unassigned .area-header h4 {
    color: white;
}

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

.area-section.unassigned .area-count {
    color: rgba(255, 255, 255, 0.9);
}

/* PIPE 테이블 */
.pipe-table {
    width: 100%;
}

.pipe-table .table-header {
    display: grid;
    grid-template-columns: 100px 150px 120px 200px 100px 120px 100px;
    gap: 12px;
    padding: 16px 24px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-weight: 600;
    font-size: 14px;
    color: #374151;
}

.area-section.unassigned .pipe-table .table-header {
    background: rgba(251, 191, 36, 0.1);
}

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

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

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

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

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

.pipe-table .table-cell select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    background: white;
}

.pipe-table .table-cell select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

/* 액션 버튼 */
.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;
    min-width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.btn-small.btn-edit {
    color: #f59e0b;
}

.btn-small.btn-delete {
    color: #ef4444;
}

.btn-small.btn-delete:hover {
    background: #fef2f2;
    border-color: #fca5a5;
}

/* 빈 상태 */
.empty-state {
    padding: 60px 20px;
    text-align: center;
    color: #6b7280;
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

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

/* 반응형 디자인 */
@media (max-width: 1400px) {
    .pipe-table .table-header,
    .pipe-table .table-row {
        grid-template-columns: 80px 130px 100px 180px 80px 100px 80px;
    }
}

@media (max-width: 1200px) {
    .classification-controls {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .pipe-table .table-header,
    .pipe-table .table-row {
        grid-template-columns: 80px 120px 160px 80px 100px 80px;
    }
    
    .pipe-table .table-header .header-cell:nth-child(3),
    .pipe-table .table-row .table-cell:nth-child(3) {
        display: none;
    }
}

@media (max-width: 768px) {
    .pipe-cutting-plan-page {
        padding: 16px;
    }
    
    .classification-controls {
        padding: 16px;
    }
    
    .summary-stats {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 12px;
    }
    
    .pipe-table .table-header {
        display: none;
    }
    
    .pipe-table .table-row {
        grid-template-columns: 1fr;
        gap: 8px;
        flex-direction: column;
        align-items: stretch;
        padding: 16px;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        margin-bottom: 8px;
    }
    
    .pipe-table .table-cell {
        justify-content: space-between;
        padding: 4px 0;
        border-bottom: 1px solid #f3f4f6;
    }
    
    .pipe-table .table-cell:last-child {
        border-bottom: none;
        justify-content: center;
    }
    
    .pipe-table .table-cell::before {
        content: attr(data-label);
        font-weight: 600;
        color: #6b7280;
        min-width: 80px;
    }
    
    .area-header {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
        text-align: center;
    }
}

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

.area-section {
    animation: slideIn 0.3s ease-out;
}

.pipe-table .table-row {
    animation: slideIn 0.2s ease-out;
}

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

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

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

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