/* 실무 앱(Lab Data) 원본 style.css — .ops-scope 안에서만 적용되도록 자동 변환 (tools/scope_css.py) */
/* ==========================================
   style.css - Lab Data 전체 디자인
   ==========================================
   여기에 색상, 폰트, 여백 등 모든 "보이는 것"을 정의합니다.
   색상 하나 바꾸고 싶으면 이 파일만 수정하면 전체에 적용됩니다.
   ========================================== */

/* --- 공통 초기화 (브라우저마다 다른 기본값을 통일) --- */
.ops-scope *{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* --- 전체 폰트 및 기본 스타일 --- */
.ops-scope{
    font-family: 'Pretendard Variable', Pretendard, -apple-system, 
                 BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1e293b;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ==========================================
   로그인 페이지 전용 스타일
   ========================================== */

.ops-scope .login-body{
    /* 화면 전체를 진한 남색 그라디언트로 */
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.ops-scope .login-box{
    /* 로그인 박스 (가운데 흰 카드) */
    background: white;
    border-radius: 16px;
    padding: 40px 36px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.ops-scope .login-logo{
    /* 상단 로고 영역 */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 28px;
}

.ops-scope .logo-icon{
    width: 48px;
    height: 48px;
    background: white;              /* 주황 그라디언트 → 흰 배경 */
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;               /* 추가 */
    padding: 4px;                   /* 추가 */
}

/* 이 부분을 새로 추가 */
.ops-scope .logo-icon img{
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ops-scope .logo-text h1{
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.02em;
}

.ops-scope .logo-text p{
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
}

.ops-scope .login-title{
    /* "로그인" 타이틀 */
    font-size: 15px;
    color: #475569;
    text-align: center;
    margin-bottom: 24px;
    font-weight: 500;
}

/* --- 입력창 --- */
.ops-scope .input-group{
    margin-bottom: 16px;
}

.ops-scope .input-group label{
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
}

.ops-scope .input-group input{
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: border 0.15s, box-shadow 0.15s;
}

.ops-scope .input-group input:focus{
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
}

/* --- 버튼 --- */
.ops-scope .btn-primary{
    width: 100%;
    height: 46px;
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: white;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    transition: transform 0.15s, box-shadow 0.15s;
}

.ops-scope .btn-primary:hover{
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(249, 115, 22, 0.4);
}

.ops-scope .btn-primary:active{
    transform: translateY(0);
}

.ops-scope .btn-primary:disabled{
    background: #cbd5e1;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* --- 상태 메시지 (성공/실패 알림) --- */
.ops-scope .status-msg{
    margin-top: 14px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    text-align: center;
    display: none;  /* 기본값: 숨김 */
}

.ops-scope .status-msg.show{ display: block; }

.ops-scope .status-msg.error{
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.ops-scope .status-msg.success{
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.ops-scope .status-msg.info{
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

/* --- 연결 상태 (하단 작은 표시) --- */
.ops-scope .connection-status{
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #f1f5f9;
    text-align: center;
    font-size: 11px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.ops-scope .conn-dot{
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #f59e0b;
    animation: pulse 1.5s infinite;
}

.ops-scope .conn-dot.ok{
    background: #10b981;
    animation: none;
}

.ops-scope .conn-dot.err{
    background: #ef4444;
    animation: none;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* --- 모바일 대응 --- */
@media (max-width: 480px) {
    .ops-scope .login-box{
        padding: 32px 24px;
    }
}
/* ==========================================
   메인 앱 페이지 전용 스타일
   ========================================== */

.ops-scope .app-body{
    background: #f1f5f9;
    min-height: 100vh;
}

.ops-scope .app-container{
    display: flex;
    min-height: 100vh;
}

/* ==========================================
   사이드바 (왼쪽 메뉴)
   ========================================== */

.ops-scope .sidebar{
    width: 240px;
    background: #2C3E50;
    color: #ECF0F1;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.ops-scope .sidebar-header{
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 10px;
}

.ops-scope .sidebar-logo{
    width: 36px;
    height: 36px;
    background: white;              /* 주황 그라디언트 → 흰 배경 (로고 이미지용) */
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 4px;
    flex-shrink: 0;
}

.ops-scope .sidebar-logo img{
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ops-scope .sidebar-title h2{
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: white;
}

.ops-scope .sidebar-title p{
    font-size: 11px;
    color: #94a3b8;
    margin-top: 1px;
}

.ops-scope .nav-section{
    padding: 16px 12px;
    flex: 1;
}

.ops-scope .nav-label{
    font-size: 10px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 10px 12px 6px;
    font-weight: 600;
}

.ops-scope .nav-item{
    padding: 11px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #cbd5e1;
    transition: all 0.15s;
    user-select: none;
}

.ops-scope .nav-item:hover{
    background: #34495E;
    color: white;
}

.ops-scope .nav-item.active{
    background: #f97316;
    color: white;
}

.ops-scope .nav-item.disabled{
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;    /* 클릭 자체를 막음 */
}

.ops-scope .nav-icon{
    font-size: 16px;
}

/* 사이드바 하단 (로그아웃 + 세션 시간) */
.ops-scope .sidebar-footer{
    padding: 16px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.ops-scope .session-info{
    font-size: 11px;
    color: #94a3b8;
    padding: 6px 12px 10px;
    text-align: center;
}

.ops-scope .logout-btn{
    width: 100%;
    padding: 10px 14px;
    background: transparent;
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.ops-scope .logout-btn:hover{
    background: #dc2626;
    border-color: #dc2626;
    color: white;
}

/* ==========================================
   메인 컨텐츠 영역 (오른쪽)
   ========================================== */

.ops-scope .main-content{
    flex: 1;
    padding: 32px 40px;
    overflow-x: auto;
}

.ops-scope .page-header{
    margin-bottom: 24px;
}

.ops-scope .page-title{
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: #0f172a;
    margin-bottom: 4px;
}

.ops-scope .page-subtitle{
    color: #64748b;
    font-size: 14px;
}

/* 페이지 전환 시 숨김/표시 */




/* 빈 페이지 안내 (임시) */
.ops-scope .empty-state{
    background: white;
    border: 2px dashed #e2e8f0;
    border-radius: 12px;
    padding: 60px 40px;
    text-align: center;
    color: #94a3b8;
}

.ops-scope .empty-state h3{
    font-size: 18px;
    color: #64748b;
    margin-bottom: 8px;
}

.ops-scope .empty-state p{
    font-size: 14px;
}

/* 모바일 대응 */
@media (max-width: 768px) {
    .ops-scope .app-container{
        flex-direction: column;
    }
    .ops-scope .sidebar{
        width: 100%;
        height: auto;
        position: relative;
    }
    .ops-scope .main-content{
        padding: 20px;
    }
}
/* ==========================================
   원료/제품 목록 관리 페이지 스타일
   ========================================== */

/* 카드 (공통) */
.ops-scope .card{
    background: white;
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    border: 1px solid #e2e8f0;
}

.ops-scope .card-header{
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}

.ops-scope .card-title{
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ops-scope .card-count{
    font-size: 12px;
    color: #64748b;
    padding: 4px 10px;
    background: #f1f5f9;
    border-radius: 100px;
    font-weight: 500;
}

/* 공통 입력창/버튼 */
.ops-scope .input-field{
    height: 38px;
    padding: 0 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: border 0.15s, box-shadow 0.15s;
    background: white;
}

.ops-scope .input-field:focus{
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
}

.ops-scope .btn{
    height: 38px;
    padding: 0 16px;
    border: none;
    border-radius: 6px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ops-scope .btn-orange{
    background: #f97316;
    color: white;
}
.ops-scope .btn-orange:hover{ background: #ea580c; }
.ops-scope .btn-orange:disabled{
    background: #cbd5e1;
    cursor: not-allowed;
}

.ops-scope .btn-gray{
    background: #64748b;
    color: white;
}
.ops-scope .btn-gray:hover{ background: #475569; }

.ops-scope .btn-danger-sm{
    height: 30px;
    padding: 0 10px;
    background: #fee2e2;
    color: #b91c1c;
    border: none;
    border-radius: 5px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.ops-scope .btn-danger-sm:hover{
    background: #ef4444;
    color: white;
}

/* 검색창 (아이콘 포함) */
.ops-scope .search-box{
    position: relative;
    margin-bottom: 14px;
}

.ops-scope .search-box input{
    width: 100%;
    height: 42px;
    padding: 0 14px 0 42px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    background: white;
    transition: border 0.15s, box-shadow 0.15s;
}

.ops-scope .search-box input:focus{
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
}

.ops-scope .search-box::before{
    content: '🔍';
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: #94a3b8;
    pointer-events: none;
}

/* 입력 행 (추가 폼) */
.ops-scope .input-row{
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.ops-scope .input-row .input-field{
    flex: 1;
    min-width: 120px;
}

.ops-scope .input-row .input-field.input-code{
    max-width: 180px;
}

/* 데이터 표 (공통) */
.ops-scope .data-table-wrap{
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    max-height: 520px;
    overflow-y: auto;
    background: white;
}

.ops-scope .data-table{
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.ops-scope .data-table th{
    background: #f8fafc;
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    color: #475569;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 1;
    white-space: nowrap;
}

.ops-scope .data-table td{
    padding: 10px 14px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
}

.ops-scope .data-table tbody tr:hover td{
    background: #fff7ed;
}

.ops-scope .data-table .cell-code{
    font-family: 'SF Mono', Menlo, monospace;
    color: #7c3aed;
    font-weight: 600;
    width: 140px;
}

.ops-scope .data-table .cell-actions{
    text-align: right;
    width: 80px;
}

.ops-scope .table-empty{
    padding: 40px 20px;
    text-align: center;
    color: #94a3b8;
    font-size: 13px;
}

.ops-scope .table-loading{
    padding: 40px 20px;
    text-align: center;
    color: #64748b;
    font-size: 13px;
}

/* ==========================================
   토스트 알림 (우측 하단)
   ========================================== */

.ops-scope .toast{
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 20px;
    border-radius: 8px;
    color: white;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s;
    pointer-events: none;
    z-index: 1000;
    max-width: 320px;
}

.ops-scope .toast.show{
    opacity: 1;
    transform: translateY(0);
}

.ops-scope .toast.ok{ background: #10b981; }
.ops-scope .toast.err{ background: #ef4444; }
.ops-scope .toast.info{ background: #3b82f6; }
.ops-scope .toast.warn{ background: #f59e0b; }
/* ==========================================
   데이터 누적·조회 페이지 스타일
   ========================================== */

/* 필터 영역 */
.ops-scope .filter-bar{
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: 14px;
}

.ops-scope .filter-group{
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ops-scope .filter-label{
    font-size: 11px;
    color: #64748b;
    font-weight: 600;
}

.ops-scope .filter-divider{
    width: 1px;
    height: 38px;
    background: #e2e8f0;
    align-self: flex-end;
    margin: 0 4px;
}

.ops-scope .filter-group select, .ops-scope .filter-group input[type="date"], .ops-scope .filter-group input[type="text"]{
    height: 38px;
    padding: 0 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-family: inherit;
    font-size: 13px;
    background: white;
    outline: none;
    transition: border 0.15s, box-shadow 0.15s;
}

.ops-scope .filter-group select:focus, .ops-scope .filter-group input:focus{
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
}

.ops-scope .filter-group.narrow input{ width: 100px; }
/* 검색창은 안내문이 안 잘리도록 넓게 */
.ops-scope #requestFilterSearch, .ops-scope #waterRequestFilterSearch, .ops-scope #waterAccumFilterSearch, .ops-scope #filterName{ width: 200px !important; }
.ops-scope .filter-group.medium input{ width: 140px; }
.ops-scope .filter-group.code-range{
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
}
.ops-scope .filter-group.code-range input{ width: 80px; height: 38px; padding: 0 10px; 
    border: 1px solid #e2e8f0; border-radius: 6px; font-family: inherit; font-size: 13px; }
.ops-scope .filter-group.code-range .dash{ color: #94a3b8; padding: 0 2px; }

/* 액션 버튼 바 */
.ops-scope .action-bar{
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    padding: 12px 0;
    border-top: 1px solid #f1f5f9;
    margin-top: 12px;
}

.ops-scope .action-bar-spacer{ flex: 1; }

.ops-scope .btn-red{
    background: #ef4444;
    color: white;
}
.ops-scope .btn-red:hover{ background: #dc2626; }
.ops-scope .btn-red:disabled{
    background: #cbd5e1;
    cursor: not-allowed;
}

.ops-scope .btn-green{
    background: #10b981;
    color: white;
}
.ops-scope .btn-green:hover{ background: #059669; }

/* 결과 요약 */
.ops-scope .result-summary{
    padding: 10px 14px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    color: #1e40af;
    font-size: 13px;
    margin-bottom: 12px;
    display: none;
}
.ops-scope .result-summary.show{ display: block; }

/* 가로 스크롤 가능한 넓은 표 */
.ops-scope .wide-table-wrap{
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: auto;
    max-height: 600px;
    background: white;
}

.ops-scope .wide-table{
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    min-width: 1440px;
}

.ops-scope .wide-table th{
    background: #f8fafc;
    padding: 6px 8px;
    text-align: left;
    font-weight: 600;
    font-size: 11px;
    color: #475569;
    border-bottom: 2px solid #e2e8f0;
    border-right: 1px solid #f1f5f9;
    position: sticky;
    top: 0;
    z-index: 2;
    white-space: nowrap;
}

.ops-scope .wide-table th.col-check{
    width: 40px;
    text-align: center;
}

.ops-scope .wide-table td{
    padding: 5px 8px;
    border-bottom: 1px solid #f1f5f9;
    border-right: 1px solid #f1f5f9;
    color: #334155;
    white-space: nowrap;
}

.ops-scope .wide-table td.col-check{
    text-align: center;
}

.ops-scope .wide-table tbody tr:hover td{
    background: #fff7ed;
}

.ops-scope .wide-table tbody tr.selected td{
    background: #fef3c7;
}

.ops-scope .wide-table input[type="checkbox"]{
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.ops-scope .col-factory{ color: #7c3aed; font-weight: 500; }
.ops-scope .col-analysis{ color: #0284c7; }
.ops-scope .col-date{ color: #475569; font-family: 'SF Mono', Menlo, monospace; }
.ops-scope .col-code-val{ color: #7c3aed; font-family: 'SF Mono', Menlo, monospace; font-weight: 600; }
/* ==========================================
   데이터 입력 페이지 스타일
   ========================================== */

/* 상단 컨트롤 바 */
.ops-scope .input-control-bar{
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.ops-scope .input-control-bar .filter-group select{
    min-width: 140px;
}

/* 입력 표 래퍼 (가로·세로 스크롤) */
.ops-scope .input-table-wrap{
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: auto;
    max-height: 620px;
    background: white;
}

/* 입력 가능한 편집 표 */
.ops-scope .input-table{
    border-collapse: separate;
    border-spacing: 0;
    font-size: 12px;
    min-width: 1500px;
    width: 100%;
}

.ops-scope .input-table thead th{
    background: #f1f5f9;
    padding: 7px 8px;
    text-align: center;
    font-weight: 600;
    font-size: 11px;
    color: #334155;
    border-bottom: 2px solid #cbd5e1;
    border-right: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 3;
    white-space: nowrap;
    user-select: none;
}

.ops-scope .input-table thead th.col-num{
    width: 42px;
    background: #e2e8f0;
    color: #64748b;
    font-size: 10px;
}

.ops-scope .input-table tbody td{
    padding: 0;
    border-bottom: 1px solid #f1f5f9;
    border-right: 1px solid #f1f5f9;
    background: white;
    height: 28px;
}

.ops-scope .input-table tbody td.cell-num{
    background: #f8fafc;
    color: #94a3b8;
    font-size: 10px;
    text-align: center;
    width: 42px;
    font-family: 'SF Mono', Menlo, monospace;
    user-select: none;
    position: sticky;
    left: 0;
    z-index: 2;
}

/* 실제 편집 가능한 셀 (input이 들어감) */
/* 셀 컨테이너 (엑셀 셀처럼 동작) */
.ops-scope .input-table tbody td.editable{
    padding: 0;
    position: relative;
    min-width: 60px;
    cursor: cell;
}

/* 표시 모드 (기본) - div로 내용만 보여줌 */
.ops-scope .input-table tbody td.editable .cell-view{
    width: 100%;
    height: 28px;
    padding: 0 6px;
    display: flex;
    align-items: center;
    font-size: 12px;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    user-select: none;
}

/* 선택된 셀 (클릭하면 이 상태) */
.ops-scope .input-table tbody td.editable.selected{
    background: #dbeafe;
    outline: 2px solid #2563eb;
    outline-offset: -2px;
    z-index: 1;
}

/* 편집 모드 (더블클릭/F2/Enter/타이핑) */
.ops-scope .input-table tbody td.editable .cell-input{
    width: 100%;
    height: 28px;
    padding: 0 6px;
    border: 2px solid #f97316;
    background: #fff7ed;
    font-family: inherit;
    font-size: 12px;
    color: #0f172a;
    outline: none;
    box-sizing: border-box;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 5;
}

/* 특수 컬럼 색상 힌트 (표시 모드) */
.ops-scope .input-table tbody td.col-date .cell-view{ 
    color: #0369a1; 
    font-family: 'SF Mono', Menlo, monospace; 
}
.ops-scope .input-table tbody td.col-code-in .cell-view{ 
    color: #7c3aed; 
    font-family: 'SF Mono', Menlo, monospace; 
    font-weight: 600; 
}

/* 특수 컬럼 색상 힌트 */
.ops-scope .input-table tbody td.col-date input{ color: #0369a1; font-family: 'SF Mono', Menlo, monospace; }
.ops-scope .input-table tbody td.col-code-in input{ color: #7c3aed; font-family: 'SF Mono', Menlo, monospace; font-weight: 600; }

/* 공장 열 — '기타'일 때만 편집 가능, 정식 공장이면 드롭다운 값을 회색 읽기전용으로 표시 */
.ops-scope .input-table .col-factory{
    min-width: 110px;
}
.ops-scope .input-table .col-factory .cell-view{
    color: #0f766e;
    font-size: 11px;
    font-weight: 600;
}
.ops-scope .input-table .col-factory-readonly{
    min-width: 55px;
    background: rgba(100, 116, 139, 0.06);
    cursor: default;
}
.ops-scope .input-table .col-factory-readonly .cell-view{
    color: #94a3b8;
    font-weight: 400;
    font-style: italic;
}

/* 입력 표 힌트 박스 */
.ops-scope .input-hint{
    padding: 8px 14px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    color: #1e40af;
    font-size: 12px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ops-scope .kbd{
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 11px;
    font-family: 'SF Mono', Menlo, monospace;
    box-shadow: 0 1px 0 #cbd5e1;
    color: #334155;
}

/* 행 조작 버튼 */
.ops-scope .row-controls{
    display: flex;
    gap: 8px;
    margin-top: 10px;
    align-items: center;
}

.ops-scope .row-controls .info-text{
    font-size: 12px;
    color: #64748b;
    margin-left: 6px;
}

.ops-scope .btn-sm{
    height: 32px;
    padding: 0 12px;
    font-size: 12px;
}

/* 자동완성 드롭다운 (나중에 쓸 예정) */
.ops-scope .autocomplete-box{
    position: absolute;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    min-width: 200px;
    display: none;
}

.ops-scope .autocomplete-item{
    padding: 8px 12px;
    font-size: 12px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
}

.ops-scope .autocomplete-item:last-child{ border-bottom: none; }
.ops-scope .autocomplete-item:hover, .ops-scope .autocomplete-item.active{
    background: #fff7ed;
    color: #ea580c;
}

.ops-scope .autocomplete-item .ac-code{
    font-family: 'SF Mono', Menlo, monospace;
    font-weight: 600;
    color: #7c3aed;
    margin-right: 8px;
}
/* ==========================================
   모달 다이얼로그 (덮어쓰기 확인 등)
   ========================================== */

.ops-scope .modal-backdrop{
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.ops-scope .modal-backdrop.show{
    display: flex;
}

.ops-scope .modal-box{
    background: white;
    border-radius: 12px;
    padding: 24px 28px;
    max-width: 560px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-height: 80vh;
    overflow-y: auto;
}

.ops-scope .modal-title{
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ops-scope .modal-body{
    font-size: 13px;
    color: #475569;
    line-height: 1.6;
    margin-bottom: 18px;
}

.ops-scope .modal-conflict-info{
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    padding: 12px 14px;
    margin: 12px 0;
    font-size: 12px;
    color: #78350f;
}

.ops-scope .modal-conflict-info .key{
    font-weight: 600;
    color: #92400e;
}

.ops-scope .modal-conflict-diff{
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #fcd34d;
    font-family: 'SF Mono', Menlo, monospace;
    font-size: 11px;
    line-height: 1.7;
}

.ops-scope .modal-conflict-diff .diff-row{
    display: flex;
    gap: 10px;
}

.ops-scope .modal-conflict-diff .diff-label{
    color: #92400e;
    min-width: 80px;
    font-weight: 600;
}

.ops-scope .modal-conflict-diff .old-val{
    color: #991b1b;
    text-decoration: line-through;
}

.ops-scope .modal-conflict-diff .new-val{
    color: #166534;
    font-weight: 600;
}

.ops-scope .modal-actions{
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.ops-scope .modal-btn{
    height: 38px;
    padding: 0 18px;
    border: none;
    border-radius: 6px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.ops-scope .modal-btn-primary{
    background: #f97316;
    color: white;
}
.ops-scope .modal-btn-primary:hover{ background: #ea580c; }

.ops-scope .modal-btn-secondary{
    background: #e2e8f0;
    color: #334155;
}
.ops-scope .modal-btn-secondary:hover{ background: #cbd5e1; }

.ops-scope .modal-btn-danger{
    background: #ef4444;
    color: white;
}
.ops-scope .modal-btn-danger:hover{ background: #dc2626; }

/* 진행 상태 바 (저장 중일 때) */
.ops-scope .save-progress{
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 14px 18px;
    margin: 12px 0;
    display: none;
}

.ops-scope .save-progress.show{ display: block; }

.ops-scope .save-progress-text{
    font-size: 13px;
    color: #1e40af;
    font-weight: 500;
    margin-bottom: 8px;
}

.ops-scope .save-progress-bar{
    width: 100%;
    height: 6px;
    background: #dbeafe;
    border-radius: 100px;
    overflow: hidden;
}

.ops-scope .save-progress-fill{
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #2563eb);
    width: 0%;
    transition: width 0.3s;
}
/* ==========================================
   공장 비밀번호 입력 모달
   ========================================== */

.ops-scope .pw-modal-title{
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ops-scope .pw-modal-sub{
    font-size: 13px;
    color: #64748b;
    margin-bottom: 16px;
}

.ops-scope .pw-modal-factory{
    display: inline-block;
    padding: 4px 10px;
    background: #fff7ed;
    color: #c2410c;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    margin: 0 4px;
}

.ops-scope .pw-input{
    width: 100%;
    height: 42px;
    padding: 0 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    margin-bottom: 10px;
    transition: border 0.15s, box-shadow 0.15s;
}

.ops-scope .pw-input:focus{
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
}

.ops-scope .pw-error{
    color: #dc2626;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 8px;
    min-height: 18px;
}

/* 비밀번호 틀렸을 때 입력칸 강조 */
.ops-scope .pw-input.pw-input-error{
    border-color: #dc2626;
    background: #fef2f2;
}
.ops-scope .pw-input.pw-input-error:focus{
    border-color: #dc2626;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.18);
}
/* ==========================================
   사이드바 사용자 정보 박스
   ========================================== */

.ops-scope .user-info-box{
    margin: 8px 12px 0;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.ops-scope .user-info-row{
    display: flex;
    align-items: center;
    gap: 10px;
}

.ops-scope .user-avatar{
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f97316, #ea580c);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.ops-scope .user-details{
    flex: 1;
    min-width: 0;
}

.ops-scope .user-name{
    font-size: 13px;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.ops-scope .user-factory{
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ops-scope .user-role-badge{
    display: inline-block;
    padding: 1px 6px;
    font-size: 9px;
    font-weight: 700;
    border-radius: 100px;
    margin-left: 4px;
    text-transform: uppercase;
}

.ops-scope .user-role-badge.admin{
    background: rgba(249, 115, 22, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(249, 115, 22, 0.4);
}

.ops-scope .user-role-badge.user{
    background: rgba(59, 130, 246, 0.2);   /* 연한 파랑 (viewer와 맞바꿈) */
    color: #60a5fa;
}

.ops-scope .user-role-badge.viewer{
    background: rgba(100, 116, 139, 0.3);  /* 슬레이트 (공장과 맞바꿈) */
    color: #cbd5e1;
}
/* ==========================================
   누적·조회 페이지 - 입력자 표시 기능
   ========================================== */

/* 토글 스위치 */
.ops-scope .toggle-group{
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    height: 38px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    user-select: none;
    transition: all 0.15s;
}

.ops-scope .toggle-group:hover{
    background: #e2e8f0;
}

.ops-scope .toggle-group.active{
    background: #fff7ed;
    border-color: #f97316;
    color: #c2410c;
}

.ops-scope .toggle-group input[type="checkbox"]{
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: #f97316;
}

.ops-scope .toggle-group label{
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

/* 입력자 표시 셀 (숨김 가능) */
.ops-scope .wide-table th.col-byinfo, .ops-scope .wide-table td.col-byinfo{
    background: #fefce8 !important;
    border-left: 2px solid #fde047;
}

.ops-scope .wide-table tbody tr:hover td.col-byinfo{
    background: #fef9c3 !important;
}

.ops-scope .col-byinfo{
    color: #713f12;
    font-size: 11px;
    min-width: 120px;
}

.ops-scope .col-byinfo.muted{
    color: #a8a29e;
    font-style: italic;
}

/* 영양소 셀 툴팁 (값에 마우스 올리면 입력자 표시) */
.ops-scope .wide-table td.col-value-with-by{
    position: relative;
    cursor: help;
}

.ops-scope .wide-table td.col-value-with-by::after{
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    background: #1e293b;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 11px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.ops-scope .wide-table td.col-value-with-by:hover::after{
    opacity: 1;
}

/* 값이 있지만 입력자 정보가 있는 셀 - 은은한 표시 */
.ops-scope .wide-table td.col-value-with-by{
    border-left: 2px solid #e5e7eb;
}

.ops-scope .wide-table td.col-value-with-by.has-author{
    border-left: 2px solid #10b981;
}

/* ==========================================
   기대치 조회 페이지 전용 스타일
   ========================================== */

/* 영양소 헤더 드롭다운 */
.ops-scope .nutrient-header-select{
    background: rgba(249, 115, 22, 0.15);
    color: #f97316;
    border: 1px solid rgba(249, 115, 22, 0.3);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
}

.ops-scope .nutrient-header-select:hover{
    background: rgba(249, 115, 22, 0.25);
}

.ops-scope .nutrient-header-select:focus{
    outline: none;
    border-color: #f97316;
}

/* 영양소 값 셀 (비어있는 셀) */
.ops-scope .col-nutrient-value{
    background: rgba(148, 163, 184, 0.08);
}

/* 기대치 페이지는 7개 열만 있어서 기본 min-width(1900px) 해제하고 열 너비 재정의 */
.ops-scope #page-expected .input-table{
    min-width: 100%;
    width: 100%;
    table-layout: fixed;
}

.ops-scope #page-expected .input-table thead th:nth-child(1){ width: 40px; }    /* # */
.ops-scope #page-expected .input-table thead th:nth-child(2){ width: 120px; }   /* 날짜 */
.ops-scope #page-expected .input-table thead th:nth-child(3){ width: 60px; }    /* 반복수 */
.ops-scope #page-expected .input-table thead th:nth-child(4){ width: 90px; }    /* 코드 */
.ops-scope #page-expected .input-table thead th:nth-child(5){ width: 130px; }   /* 원료or제품명 (고정값) */
.ops-scope #page-expected .input-table thead th:nth-child(6){ width: 130px; }   /* 납품처 */
.ops-scope #page-expected .input-table thead th:nth-child(7){ width: 110px; }   /* 영양소(드롭다운) */
.ops-scope #page-expected .input-table thead th:nth-child(8){ width: 80px; }    /* 기대치 */

/* 셀 내부 스타일 */
.ops-scope .col-expected-value{
    font-weight: 600;
    color: #94a3b8;
    background: rgba(16, 185, 129, 0.05);
    text-align: right;
    padding-right: 10px;
}

.ops-scope .col-expected-value.filled{
    color: #10b981;
}
/* ==========================================
   파란 버튼 (통보서 버튼용)
   ========================================== */
.ops-scope .btn.btn-blue{
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}
.ops-scope .btn.btn-blue:hover:not(:disabled){
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}
.ops-scope .btn.btn-blue:disabled{
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==========================================
   통보서 모달 전용 스타일
   ========================================== */
.ops-scope .modal-box.modal-report{
    width: 90%;
    max-width: 720px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.ops-scope .modal-report .modal-body{
    overflow-y: auto;
    padding: 20px 24px;
    flex: 1;
}

.ops-scope .report-form-section{
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}
.ops-scope .report-form-section:last-child{
    border-bottom: none;
    margin-bottom: 0;
}

.ops-scope .report-form-section h3{
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 12px;
}

.ops-scope .report-form-grid{
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.ops-scope .report-form-row{
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ops-scope .report-form-row.report-form-full{
    grid-column: 1 / -1;
}

.ops-scope .report-form-row label{
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
}

.ops-scope .report-form-row input, .ops-scope .modal-report textarea{
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
}

.ops-scope .report-form-row input:focus, .ops-scope .modal-report textarea:focus{
    outline: none;
    border-color: #f97316;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.15);
}

.ops-scope .modal-report textarea{
    width: 100%;
    resize: vertical;
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    font-size: 12px;
}

.ops-scope .form-hint{
    font-size: 11px;
    color: #94a3b8;
    margin-bottom: 6px;
}

.ops-scope .report-checkbox-grid{
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.ops-scope .report-check-item{
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    user-select: none;
    transition: all 0.15s;
}
.ops-scope .report-check-item:hover{
    background: #f1f5f9;
}
.ops-scope .report-check-item input[type="checkbox"]{
    cursor: pointer;
}
.ops-scope .report-check-item.checked{
    background: rgba(249, 115, 22, 0.1);
    border-color: #f97316;
}
.ops-scope .report-check-item label{
    font-size: 12px;
    cursor: pointer;
    flex: 1;
}

.ops-scope .modal-info{
    flex: 1;
    font-size: 12px;
    color: #64748b;
}

/* ==========================================
   PDF 미리보기 창 공통 스타일
   ========================================== */
.ops-scope .preview-window{
    background: #f1f5f9;
    padding: 20px;
    min-height: 100vh;
}

.ops-scope .preview-toolbar{
    background: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.ops-scope .preview-toolbar .preview-title{
    flex: 1;
    font-weight: 700;
    color: #1e293b;
}

.ops-scope .preview-toolbar button{
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.ops-scope .preview-toolbar .btn-print{
    background: #f97316;
    color: white;
}
.ops-scope .preview-toolbar .btn-print:hover{ background: #ea580c; }
.ops-scope .preview-toolbar .btn-back{
    background: #e2e8f0;
    color: #1e293b;
}

.ops-scope .preview-page{
    background: white;
    padding: 25mm 20mm;
    width: 210mm;
    min-height: 297mm;
    margin: 0 auto;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    box-sizing: border-box;
    color: #000;
}

/* ==========================================
   성분 분석 통보서 양식 스타일
   ========================================== */
.ops-scope .report-nutrient .report-title{
    font-size: 28pt;
    font-weight: 700;
    text-align: center;
    letter-spacing: 0.3em;
    margin-bottom: 16pt;
}

.ops-scope .report-nutrient table.header-table, .ops-scope .report-nutrient table.result-table, .ops-scope .report-nutrient table.note-table, .ops-scope .report-nutrient table.footer-table{
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 8pt;
}

.ops-scope .report-nutrient table.header-table td{
    border: 1px solid #000;
    padding: 4pt 6pt;
    font-size: 9pt;
    height: 18pt;
}
.ops-scope .report-nutrient table.header-table td.label{
    background: #f3f4f6;
    font-weight: 600;
    width: 90pt;
    text-align: center;
}

.ops-scope .report-nutrient .section-title{
    font-size: 12pt;
    font-weight: 700;
    margin: 12pt 0 4pt 0;
}

.ops-scope .report-nutrient table.result-table{
    border: 1.5px solid #000;
}
.ops-scope .report-nutrient table.result-table th, .ops-scope .report-nutrient table.result-table td{
    border: 1px solid #000;
    padding: 3pt 4pt;
    font-size: 8.5pt;
    text-align: center;
    height: 16pt;
    vertical-align: middle;
}
.ops-scope .report-nutrient table.result-table thead th{
    background: #f3f4f6;
    font-weight: 700;
}

.ops-scope .report-nutrient .note-section{
    margin-top: 14pt;
    border: 1.5px solid #000;
    padding: 8pt 10pt;
}
.ops-scope .report-nutrient .note-title{ font-weight: 700; font-size: 10pt; margin-bottom: 6pt; }
.ops-scope .report-nutrient .note-line{ font-size: 9pt; line-height: 1.6; padding-left: 12pt; }

.ops-scope .report-nutrient .footer-text{
    font-size: 9pt;
    line-height: 1.7;
    margin-top: 12pt;
    padding-top: 10pt;
    border-top: 1.5px solid #000;
}

.ops-scope .report-nutrient .signature-line{
    font-size: 16pt;
    font-weight: 700;
    text-align: center;
    margin-top: 24pt;
    letter-spacing: 0.05em;
}

/* ==========================================
   톡신 통보서 양식 스타일
   ========================================== */
.ops-scope .report-toxin .toxin-top-row{
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12pt;
}

.ops-scope .report-toxin .toxin-title{
    font-size: 22pt;
    font-weight: 700;
    color: #000;
}

.ops-scope .report-toxin table.signature-table{
    border-collapse: collapse;
}
.ops-scope .report-toxin table.signature-table th, .ops-scope .report-toxin table.signature-table td{
    border: 1px solid #000;
    padding: 4pt 12pt;
    font-size: 9pt;
    text-align: center;
    height: 50pt;
    vertical-align: middle;
    min-width: 60pt;
}
.ops-scope .report-toxin table.signature-table th{
    background: #1e293b;
    color: white;
    font-weight: 600;
    height: 18pt;
}
.ops-scope .report-toxin table.signature-table img{
    max-width: 50pt;
    max-height: 40pt;
}

.ops-scope .report-toxin .info-block{
    background: #1e293b;
    color: white;
    padding: 6pt 12pt;
    font-size: 9pt;
    font-weight: 600;
    margin: 12pt 0;
}
.ops-scope .report-toxin .info-block table{
    width: 100%;
    border-collapse: collapse;
}
.ops-scope .report-toxin .info-block td{
    padding: 3pt 6pt;
    color: white;
}
.ops-scope .report-toxin .info-block td.label{
    width: 80pt;
    font-weight: 700;
}

.ops-scope .report-toxin .purpose-section{
    margin: 14pt 0 4pt 0;
}
.ops-scope .report-toxin .purpose-section h3{
    font-size: 11pt;
    font-weight: 700;
    margin-bottom: 4pt;
}
.ops-scope .report-toxin .purpose-section p{
    font-size: 10pt;
    text-decoration: underline;
    padding-left: 14pt;
}

.ops-scope .report-toxin .result-section h3{
    font-size: 11pt;
    font-weight: 700;
    margin: 10pt 0 4pt 0;
}

.ops-scope .report-toxin table.toxin-result-table{
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 12pt;
}
.ops-scope .report-toxin table.toxin-result-table th, .ops-scope .report-toxin table.toxin-result-table td{
    border: 1px solid #000;
    padding: 3pt 4pt;
    font-size: 8.5pt;
    text-align: center;
    height: 18pt;
}
.ops-scope .report-toxin table.toxin-result-table thead th{
    background: #f3f4f6;
    font-weight: 700;
}

.ops-scope .report-toxin .lower-grid{
    display: grid;
    /* 기준 관리범위 표에 톡신이 늘어 좁아지므로 오른쪽을 넓게 (좌 1 : 우 2) */
    grid-template-columns: 1fr 2fr;
    gap: 12pt;
    margin-top: 14pt;
}

.ops-scope .report-toxin .lower-grid h4{
    font-size: 10pt;
    font-weight: 700;
    margin-bottom: 4pt;
}

.ops-scope .report-toxin table.method-table, .ops-scope .report-toxin table.criteria-table{
    width: 100%;
    border-collapse: collapse;
}
.ops-scope .report-toxin table.method-table th, .ops-scope .report-toxin table.method-table td, .ops-scope .report-toxin table.criteria-table th, .ops-scope .report-toxin table.criteria-table td{
    border: 1px solid #000;
    padding: 3pt 4pt;
    font-size: 8pt;
    text-align: center;
    vertical-align: middle;
}
.ops-scope .report-toxin table.method-table th, .ops-scope .report-toxin table.criteria-table th{
    background: #f3f4f6;
    font-weight: 700;
}

/* 기준 관리범위: 톡신 칸이 고르게 나뉘도록 '구분' 열 폭을 제한하고 여백을 줄임 */
.ops-scope .report-toxin table.criteria-table th, .ops-scope .report-toxin table.criteria-table td{
    padding: 3pt 2pt;
    word-break: keep-all;
}
.ops-scope .report-toxin table.criteria-table th:first-child, .ops-scope .report-toxin table.criteria-table td:first-child{
    width: 20%;
}

.ops-scope .report-toxin .footer-text{
    font-size: 8.5pt;
    line-height: 1.7;
    margin-top: 18pt;
}

.ops-scope .report-toxin .signature-bottom{
    font-size: 14pt;
    font-weight: 700;
    text-align: center;
    margin-top: 18pt;
}

/* ==========================================
   인쇄 시 적용 (PDF로 저장 시 토글바·여백 제거)
   ========================================== */
@media print {
    .ops-scope{ background: white !important; }
    .ops-scope .preview-toolbar{ display: none !important; }
    .ops-scope .preview-window{ padding: 0; background: white; }
    .ops-scope .preview-page{
        box-shadow: none;
        margin: 0;
        padding: 15mm 12mm;
        width: 100%;
        min-height: auto;
    }
    @page {
        size: A4;
        margin: 0;
    }
}
/* ==========================================
   설정 페이지 - 기대치 관리 카드
   ========================================== */
.ops-scope .expected-admin-grid{
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 8px;
}

.ops-scope .expected-admin-box{
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.ops-scope .expected-admin-icon{
    font-size: 36px;
    margin-bottom: 4px;
}

.ops-scope .expected-admin-box h3{
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
}

.ops-scope .expected-admin-box p{
    font-size: 12px;
    color: #64748b;
    line-height: 1.5;
    margin-bottom: 8px;
    flex: 1;
}

.ops-scope .expected-admin-box button{
    width: 100%;
    margin-top: 4px;
}

.ops-scope .expected-admin-hint{
    font-size: 12px;
    color: #94a3b8;
    margin-top: 16px;
    padding: 10px 12px;
    background: #fff7ed;
    border-radius: 6px;
    border: 1px solid #fed7aa;
    line-height: 1.6;
}

.ops-scope .expected-admin-hint code{
    background: rgba(0,0,0,0.06);
    padding: 1px 5px;
    border-radius: 3px;
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    font-size: 11px;
}

/* 메뉴 항목 숨김 (권한 없는 사용자용) */
.ops-scope .nav-item.hidden{
    display: none !important;
}
/* ==========================================
   기대치 관리 표 (편집형)
   ========================================== */
.ops-scope .expected-admin-table-wrap{
    overflow: auto;
    max-height: 60vh;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-top: 8px;
}

.ops-scope .expected-admin-table{
    border-collapse: collapse;
    min-width: 100%;
    font-size: 12px;
}

.ops-scope .expected-admin-table thead th{
    background: #1e293b;
    color: white;
    padding: 8px 6px;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
    border-right: 1px solid #334155;
}

.ops-scope .expected-admin-table thead th:first-child{
    width: 40px;
}

.ops-scope .expected-admin-table tbody td{
    padding: 0;
    border-right: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    height: 28px;
    text-align: center;
    background: white;
}

.ops-scope .expected-admin-table tbody td.cell-num{
    background: #f1f5f9;
    color: #64748b;
    font-size: 11px;
    width: 40px;
}

.ops-scope .expected-admin-table tbody td.editable{
    cursor: cell;
    position: relative;
    min-width: 60px;
    padding: 4px 6px;
}

.ops-scope .expected-admin-table tbody td.editable:hover{
    background: #fff7ed;
}

.ops-scope .expected-admin-table tbody td.editable.selected{
    background: rgba(249, 115, 22, 0.18);
    box-shadow: inset 0 0 0 2px #f97316;
}

.ops-scope .expected-admin-table tbody td.editable .cell-view{
    min-height: 20px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ops-scope .expected-admin-table tbody td.editable .cell-input{
    width: 100%;
    height: 100%;
    border: none;
    outline: none;
    padding: 4px 6px;
    background: white;
    font-family: inherit;
    font-size: 12px;
    text-align: inherit;
}

/* 키 컬럼(공장·코드·이름)은 좌측 정렬 + 강조 */
.ops-scope .expected-admin-table tbody td.col-key{
    text-align: left;
    background: #f8fafc;
    font-weight: 500;
}
/* ==========================================
   분석 의뢰 페이지 전용 스타일
   ========================================== */
.ops-scope .col-actions{
    width: 80px;
}

.ops-scope .request-status-badge{
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}
.ops-scope .request-status-badge.pending{ background: #fef3c7; color: #b45309; }
.ops-scope .request-status-badge.in_progress{ background: #dbeafe; color: #1e40af; }
.ops-scope .request-status-badge.done{ background: #d1fae5; color: #065f46; }

.ops-scope .request-receipt-no{
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    font-weight: 600;
    color: #f97316;
}
/* ==========================================
   분석 의뢰 등록 모달 (4단계 wizard)
   ========================================== */
.ops-scope .modal-box.modal-request{
    width: 92%;
    max-width: 880px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
}

/* 진행 단계 인디케이터 */
.ops-scope .wizard-steps{
    display: flex;
    align-items: center;
    padding: 16px 24px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    gap: 8px;
}

.ops-scope .wizard-step{
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.4;
    transition: opacity 0.2s;
}
.ops-scope .wizard-step.active{ opacity: 1; }
.ops-scope .wizard-step.complete{ opacity: 0.7; }

.ops-scope .wizard-num{
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #cbd5e1;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}
.ops-scope .wizard-step.active .wizard-num{ background: #f97316; }
.ops-scope .wizard-step.complete .wizard-num{ background: #10b981; }

.ops-scope .wizard-label{
    font-size: 12px;
    font-weight: 600;
    color: #1e293b;
}

.ops-scope .wizard-divider{
    flex: 1;
    height: 1px;
    background: #cbd5e1;
}

/* 모달 본문 */
.ops-scope .modal-request .modal-body{
    overflow-y: auto;
    padding: 20px 24px;
    flex: 1;
}

/* wizard 페인 */
.ops-scope .wizard-pane{
    display: none;
}
.ops-scope .wizard-pane.active{
    display: block;
}

.ops-scope .wizard-section{
    margin-bottom: 22px;
}
.ops-scope .wizard-section:last-child{
    margin-bottom: 0;
}
.ops-scope .wizard-section h3{
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
}

/* 이미지 붙여넣기 영역 */
.ops-scope .image-paste-zone{
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    padding: 20px;
    background: #f8fafc;
    text-align: center;
    cursor: pointer;
    outline: none;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.ops-scope .image-paste-zone:hover, .ops-scope .image-paste-zone:focus{
    border-color: #f97316;
    background: #fff7ed;
}
.ops-scope .image-paste-zone.has-image{
    border-style: solid;
    background: white;
    cursor: default;
}
.ops-scope .image-paste-placeholder{
    color: #64748b;
    font-size: 13px;
    font-weight: 500;
}

/* AI 사이트 링크 */
.ops-scope .ai-links{
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.ops-scope .ai-link{
    display: inline-block;
    padding: 4px 10px;
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s;
}
.ops-scope .ai-link:hover{
    background: rgba(59, 130, 246, 0.2);
    color: #1d4ed8;
}

/* 모달 안 textarea */
.ops-scope .modal-request textarea{
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    font-size: 12px;
    line-height: 1.5;
    resize: vertical;
}
.ops-scope .modal-request textarea:focus{
    outline: none;
    border-color: #f97316;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.15);
}

/* JSON 파싱 에러 표시 */
.ops-scope .parse-error{
    margin-top: 8px;
    padding: 10px 12px;
    background: #fee2e2;
    border: 1px solid #fca5a5;
    border-radius: 6px;
    color: #b91c1c;
    font-size: 12px;
    line-height: 1.5;
}

/* 시료 검수 표 */
.ops-scope .samples-review-table{
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
    font-size: 12px;
}
.ops-scope .samples-review-table th, .ops-scope .samples-review-table td{
    border: 1px solid #e2e8f0;
    padding: 6px 8px;
    text-align: left;
    vertical-align: top;
}
.ops-scope .samples-review-table thead th{
    background: #f1f5f9;
    font-weight: 700;
    color: #1e293b;
    font-size: 12px;
}
.ops-scope .samples-review-table tbody td input[type="text"], .ops-scope .samples-review-table tbody td input[type="number"], .ops-scope .samples-review-table tbody td input[type="date"]{
    width: 100%;
    border: none;
    padding: 4px 6px;
    font-size: 12px;
    background: transparent;
    border-radius: 3px;
}
.ops-scope .samples-review-table tbody td input:focus{
    background: #fff7ed;
    outline: 1px solid #f97316;
}
.ops-scope .samples-review-table tbody tr:hover{
    background: #fafbfc;
}

/* 시료 행의 분석항목 체크박스 그리드 */
.ops-scope .sample-items-grid{
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
}
.ops-scope .sample-item-check{
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 4px;
    font-size: 11px;
    cursor: pointer;
    user-select: none;
    border-radius: 3px;
}
.ops-scope .sample-item-check input[type="checkbox"]{
    margin: 0;
    cursor: pointer;
}
.ops-scope .sample-item-check.checked{
    background: rgba(249, 115, 22, 0.12);
}

.ops-scope .btn-row-delete{
    background: none;
    border: none;
    color: #dc2626;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 6px;
}
.ops-scope .btn-row-delete:hover{
    background: #fee2e2;
    border-radius: 3px;
}

/* 4단계 최종 요약 */
.ops-scope .final-summary{
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
}
.ops-scope .final-summary-row{
    display: grid;
    grid-template-columns: 120px 1fr;
    padding: 6px 0;
    border-bottom: 1px solid #e2e8f0;
    font-size: 13px;
}
.ops-scope .final-summary-row:last-child{
    border-bottom: none;
}
.ops-scope .final-summary-row .label{
    font-weight: 600;
    color: #64748b;
}
.ops-scope .final-summary-table{
    width: 100%;
    border-collapse: collapse;
    margin-top: 4px;
    font-size: 12px;
}
.ops-scope .final-summary-table th, .ops-scope .final-summary-table td{
    border: 1px solid #e2e8f0;
    padding: 4px 6px;
    text-align: left;
}
.ops-scope .final-summary-table th{
    background: #f1f5f9;
    font-weight: 700;
}
/* ==========================================
   분석 의뢰 목록 표 + 상세 모달
   ========================================== */

/* 클릭 가능한 행 */
.ops-scope .wide-table tbody tr.row-clickable{
    cursor: pointer;
}
.ops-scope .wide-table tbody tr.row-clickable:hover{
    background: #fff7ed;
}

/* 상태 토글 셀 */
.ops-scope .status-toggle{
    cursor: pointer;
    user-select: none;
    transition: all 0.15s;
}
.ops-scope .status-toggle:hover{
    transform: scale(1.05);
}

/* 의뢰 상세 모달 */
.ops-scope .req-detail-section{
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid #e2e8f0;
}
.ops-scope .req-detail-section:last-child{
    border-bottom: none;
}
.ops-scope .req-detail-section h3{
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
}

.ops-scope .req-detail-grid{
    display: grid;
    grid-template-columns: 110px 1fr 110px 1fr;
    gap: 6px 12px;
    font-size: 13px;
}
.ops-scope .req-detail-grid .label{
    color: #64748b;
    font-weight: 600;
}

.ops-scope .req-samples-table{
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.ops-scope .req-samples-table th, .ops-scope .req-samples-table td{
    border: 1px solid #e2e8f0;
    padding: 4px 8px;
    text-align: left;
    vertical-align: top;
}
.ops-scope .req-samples-table thead th{
    background: #f1f5f9;
    font-weight: 700;
}
.ops-scope .req-samples-table .item-tag{
    display: inline-block;
    background: rgba(249, 115, 22, 0.12);
    color: #ea580c;
    padding: 1px 6px;
    margin: 1px;
    border-radius: 3px;
    font-size: 11px;
}
/* ==========================================
   데이터 입력 페이지 - 접수번호 셀 드롭다운 + 체크박스
   ========================================== */

/* 체크박스 컬럼 (행 번호 앞) */
.ops-scope .input-table th.col-check, .ops-scope .input-table td.col-check{
    width: 28px;
    text-align: center;
    padding: 2px;
}
.ops-scope .input-table td.col-check input[type="checkbox"]{
    cursor: pointer;
    margin: 0;
}

/* 접수번호 셀 (첫 분석 컬럼) */
.ops-scope .input-table .col-receipt{
    min-width: 220px;
    cursor: pointer;
    background: rgba(59, 130, 246, 0.05);
}
.ops-scope .input-table .col-receipt:hover{
    background: rgba(59, 130, 246, 0.12);
}
.ops-scope .input-table .col-receipt .cell-view{
    color: #2563eb;
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    font-size: 11px;
}
.ops-scope .input-table .col-receipt.empty .cell-view::before{
    content: '▼ 의뢰 선택';
    color: #94a3b8;
    font-style: italic;
    font-family: inherit;
}
.ops-scope .input-table .col-receipt.empty .cell-view{
    color: #94a3b8;
}

/* 의뢰 선택 드롭다운 모달 */
.ops-scope .request-picker-backdrop{
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.ops-scope .request-picker-box{
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 720px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}

.ops-scope .request-picker-header{
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 12px;
}
.ops-scope .request-picker-header h3{
    flex: 1;
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
}
.ops-scope .request-picker-close{
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #64748b;
    padding: 4px 8px;
}
.ops-scope .request-picker-search{
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 13px;
}
.ops-scope .request-picker-search:focus{
    outline: none;
    border-color: #f97316;
}

.ops-scope .request-picker-list{
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.ops-scope .request-picker-item{
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid transparent;
    margin-bottom: 4px;
    transition: all 0.1s;
}
.ops-scope .request-picker-item:hover{
    background: #fff7ed;
    border-color: #fed7aa;
}

.ops-scope .request-picker-item .receipt-no{
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    font-weight: 600;
    color: #f97316;
    font-size: 13px;
}
.ops-scope .request-picker-item .meta{
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
}
.ops-scope .request-picker-item .samples-summary{
    font-size: 11px;
    color: #475569;
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px dashed #e2e8f0;
}

.ops-scope .request-picker-empty{
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
    font-size: 13px;
}
/* ==========================================
   데이터 입력 - 기대치 placeholder (회색)
   ========================================== */
.ops-scope .input-table .cell-placeholder{
    color: #cbd5e1;       /* 옅은 회색 */
    font-style: italic;
    font-weight: 400;
}

/* 편집 모드 input의 placeholder도 같은 회색으로 */
.ops-scope .input-table .cell-input::placeholder{
    color: #cbd5e1;
    font-style: italic;
}
/* ==========================================
   의뢰 등록 모드 선택 모달
   ========================================== */
.ops-scope .modal-box.modal-mode-picker{
    width: 90%;
    max-width: 540px;
}

.ops-scope .mode-option{
    width: 100%;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 18px;
    margin-bottom: 10px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s;
    font-family: inherit;
}
.ops-scope .mode-option:hover{
    border-color: #f97316;
    background: #fff7ed;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.15);
}
.ops-scope .mode-option:last-child{
    margin-bottom: 0;
}
.ops-scope .mode-option .mode-icon{
    font-size: 32px;
    flex-shrink: 0;
}
.ops-scope .mode-option .mode-content{
    flex: 1;
}
.ops-scope .mode-option .mode-title{
    font-weight: 700;
    font-size: 15px;
    color: #1e293b;
    margin-bottom: 4px;
}
.ops-scope .mode-option .mode-desc{
    font-size: 12px;
    color: #64748b;
    line-height: 1.5;
}

/* ==========================================
   시료 검수 표 - 반복 컬럼 너비 확장 + 정렬 개선
   ========================================== */
.ops-scope .samples-review-table tbody td input.sample-rep, .ops-scope .samples-review-table tbody td input.sample-no{
    text-align: center;
    min-width: 50px;
}

/* wizard 페인 숨김 (직접 입력 모드용) */
.ops-scope .wizard-steps.hidden, .ops-scope .wizard-pane.hidden-forced{
    display: none !important;
}
/* ==========================================
   분석항목 표시 토글 모달
   ========================================== */

/* 표/셀 숨김 — 옵션 A의 핵심 */
.ops-scope .col-hidden{
    display: none !important;
}

/* 모달 박스 */
.ops-scope .modal-box.col-vis-box{
    width: 92%;
    max-width: 760px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
}

.ops-scope .col-vis-grid{
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* 카테고리 블록 */
.ops-scope .col-vis-category{
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 14px;
    background: #f8fafc;
}

.ops-scope .col-vis-cat-header{
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    padding: 4px 0;
    margin-bottom: 8px;
    border-bottom: 1px dashed #cbd5e1;
}
.ops-scope .col-vis-cat-header strong{
    font-size: 14px;
    color: #1e293b;
}
.ops-scope .col-vis-cat-header.on strong{
    color: #f97316;
}
.ops-scope .col-vis-count{
    color: #64748b;
    font-size: 11px;
    margin-left: 4px;
}

.ops-scope .col-vis-fields{
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 4px;
}

.ops-scope .col-vis-field{
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    user-select: none;
    font-size: 12px;
    color: #64748b;
    transition: background 0.1s;
}
.ops-scope .col-vis-field:hover{
    background: #fff7ed;
}
.ops-scope .col-vis-field.on{
    background: rgba(249, 115, 22, 0.08);
    color: #1e293b;
    font-weight: 500;
}
.ops-scope .col-vis-field input[type="checkbox"]{
    margin: 0;
    cursor: pointer;
}

.ops-scope .col-vis-cat-toggle{
    cursor: pointer;
    margin: 0;
}
/* ==========================================
   수질 의뢰 - 시료 분석항목 체크박스 그리드
   ========================================== */
.ops-scope .sample-items-grid{
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 4px;
}

.ops-scope .sample-item-chk{
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    user-select: none;
}
.ops-scope .sample-item-chk:hover{
    background: #fff7ed;
}
.ops-scope .sample-item-chk input{
    margin: 0;
    cursor: pointer;
}
/* ==========================================
   수질 입력 페이지 - 입력 표
   ========================================== */
.ops-scope .water-input-table{
    table-layout: fixed;
}
.ops-scope .water-input-table th{
    font-size: 12px;
    line-height: 1.3;
}
.ops-scope .water-input-table th small{
    font-size: 10px;
    color: #94a3b8;
    font-weight: 400;
}
.ops-scope .water-input-table td{
    padding: 4px;
}
.ops-scope .water-cell-input{
    width: 100%;
    padding: 4px 6px;
    font-size: 13px;
    border: 1px solid #cbd5e1;
    border-radius: 3px;
    background: white;
    box-sizing: border-box;
}
.ops-scope .water-cell-input:focus{
    border-color: #f97316;
    outline: 2px solid rgba(249, 115, 22, 0.2);
}
.ops-scope .water-cell-input[type="date"]{
    padding: 3px 4px;
}
/* ==========================================
   수질 입력 - 엑셀 방식 셀
   ========================================== */
.ops-scope .water-input-table th{
    font-size: 12px;
    line-height: 1.3;
    text-align: center;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    padding: 6px 4px;
}
.ops-scope .water-input-table th small{
    font-size: 10px;
    color: #94a3b8;
    font-weight: 400;
    display: block;
    margin-top: 2px;
}
.ops-scope .water-input-table td{
    border: 1px solid #e2e8f0;
    padding: 0;
    height: 32px;
    position: relative;
    font-size: 13px;
}
.ops-scope .water-input-table td.editable{
    cursor: cell;
    background: white;
}
.ops-scope .water-input-table td.editable:hover{
    background: #f8fafc;
}
.ops-scope .water-input-table td.selected{
    outline: 2px solid #f97316;
    outline-offset: -2px;
    background: #fff7ed;
    z-index: 1;
}
.ops-scope .water-input-table td:not(.editable){
    background: #f8fafc;
    color: #64748b;
}
.ops-scope .water-input-table .cell-view{
    padding: 6px 8px;
    min-height: 18px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ops-scope .water-input-table .cell-input{
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 6px 8px;
    border: none;
    outline: 2px solid #f97316;
    background: white;
    font-size: 13px;
    box-sizing: border-box;
}
/* ==========================================
   수질 입력 - 사진 셀
   ========================================== */
.ops-scope .btn-photo-upload{
    width: 100%;
    padding: 6px 8px;
    background: #f1f5f9;
    border: 1px dashed #cbd5e1;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    color: #64748b;
    transition: all 0.15s;
}
.ops-scope .btn-photo-upload:hover{
    background: #fff7ed;
    border-color: #f97316;
    color: #f97316;
}

.ops-scope .water-photo-cell{
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px;
}
.ops-scope .water-photo-label{
    flex: 1;
    font-size: 11px;
    color: #16a34a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}
.ops-scope .btn-photo-view, .ops-scope .btn-photo-delete{
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 3px;
    padding: 3px 6px;
    cursor: pointer;
    font-size: 11px;
    flex-shrink: 0;
}
.ops-scope .btn-photo-view:hover{ background: #dbeafe; border-color: #2563eb; }
.ops-scope .btn-photo-delete:hover{ background: #fee2e2; border-color: #dc2626; color: #dc2626; }
/* ==========================================
   수질 결과 상세 - 사진 갤러리 (가로 2열)
   ========================================== */
.ops-scope .water-photo-gallery{
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 8px;
}

.ops-scope .water-photo-slot{
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 8px;
    background: white;
    text-align: center;
}
.ops-scope .water-photo-slot.empty{
    background: #f8fafc;
    border-style: dashed;
}
.ops-scope .water-photo-title{
    font-size: 12px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
    text-align: left;
}
.ops-scope .water-photo-slot img.water-detail-photo{
    width: 100%;
    max-height: 280px;
    object-fit: contain;
    cursor: zoom-in;
    border-radius: 4px;
    background: #f8fafc;
}
.ops-scope .water-photo-slot img.water-detail-photo:hover{
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.ops-scope .water-photo-noimg{
    padding: 60px 20px;
    color: #94a3b8;
    font-size: 12px;
}
/* ==========================================
   분석 의뢰 등록 모달 - 분석항목 카테고리 그룹
   ========================================== */
.ops-scope .sample-cat-block{
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-bottom: 8px;
    background: #fafbfc;
}
.ops-scope .sample-cat-block:last-child{
    margin-bottom: 0;
}

.ops-scope .sample-cat-header{
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px dashed #cbd5e1;
    background: #f1f5f9;
    border-radius: 6px 6px 0 0;
}
.ops-scope .sample-cat-header strong{
    font-size: 12px;
    color: #475569;
}
.ops-scope .sample-cat-header.some-checked strong{ color: #f97316; }
.ops-scope .sample-cat-header.all-checked strong{ color: #ea580c; }
.ops-scope .sample-cat-header.all-checked{ background: #fff7ed; }

.ops-scope .sample-cat-count{
    color: #94a3b8;
    font-size: 10px;
}

.ops-scope .sample-cat-toggle{
    margin: 0;
    cursor: pointer;
}

.ops-scope .sample-cat-items{
    padding: 6px 8px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 4px;
}


/* === 결과 판정 색상 (실측 vs 기대치 차이) — accum 분석값 셀 === */
.ops-scope .wide-table td.col-value-with-by.res-normal{
    border-left: 3px solid #10b981;   /* 정상 — 초록 */
}
.ops-scope .wide-table td.col-value-with-by.res-warn{
    border-left: 3px solid #f59e0b;   /* 경고 — 노랑 */
    background-color: #fffbeb;
}
.ops-scope .wide-table td.col-value-with-by.res-fail{
    border-left: 3px solid #ef4444;   /* 불량 — 빨강 */
    background-color: #fef2f2;
}

/* === 결과 판정 색상 기준 설정 표 (설정 페이지) === */
.ops-scope .threshold-table-wrap{
    max-height: 460px;
    overflow: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-top: 4px;
}
.ops-scope .threshold-table{
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.ops-scope .threshold-table thead th{
    position: sticky;
    top: 0;
    background: #f8fafc;
    color: #475569;
    font-weight: 700;
    padding: 8px 10px;
    text-align: left;
    border-bottom: 2px solid #e2e8f0;
    z-index: 1;
}
.ops-scope .threshold-table td{
    padding: 5px 10px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}
.ops-scope .threshold-table td.th-cat{
    font-weight: 700;
    color: #f97316;
    background: #fff7ed;
    border-right: 1px solid #fed7aa;
    white-space: nowrap;
    text-align: center;
}
.ops-scope .threshold-table td.th-item{ font-weight: 600; color: #1e293b; }
.ops-scope .threshold-table td.th-unit{ color: #94a3b8; text-align: center; }
.ops-scope .threshold-table input.th-input{
    width: 100%;
    box-sizing: border-box;
    padding: 4px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    font-size: 13px;
    font-family: inherit;
}
.ops-scope .threshold-table input.th-warn:focus{
    outline: none;
    border-color: #f59e0b;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}
.ops-scope .threshold-table input.th-fail:focus{
    outline: none;
    border-color: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}
.ops-scope .threshold-table tbody tr:hover{ background: #f8fafc; }


/* === 표시 컬럼 순서변경(▲▼) === */
.ops-scope .col-vis-fields{ display: flex; flex-direction: column; gap: 3px; }
.ops-scope .col-vis-field{ justify-content: space-between; }
.ops-scope .col-vis-field-label{ display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; cursor: pointer; }
.ops-scope .col-vis-field-label span{ overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ops-scope .col-vis-order-btns{ display: inline-flex; gap: 2px; flex-shrink: 0; }
.ops-scope .col-vis-move{
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #64748b;
    border-radius: 4px;
    width: 22px;
    height: 22px;
    line-height: 1;
    font-size: 9px;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.ops-scope .col-vis-move:hover{ background: #f97316; color: #fff; border-color: #f97316; }


/* 입력 페이지 순서 고정 안내 (모달) */
.ops-scope .col-vis-note-input{
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 6px;
    padding: 8px 10px;
    color: #9a3412;
    margin-top: 6px;
}


/* === 패치노트 게시판 + 버전 배지 === */
.ops-scope .app-version{
    font-size: 10px;
    font-weight: 500;
    color: #64748b;
    margin-left: 4px;
    letter-spacing: 0;
    vertical-align: 1px;
}
.ops-scope .pn-open-btn{
    background: none;
    border: none;
    cursor: pointer;
    font-size: 11px;
    margin-left: 4px;
    padding: 0 2px;
    opacity: 0.55;
    vertical-align: 1px;
}
.ops-scope .pn-open-btn:hover{ opacity: 1; }

.ops-scope .modal-box.pn-box{
    width: min(560px, 92vw);
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}
.ops-scope .pn-box .modal-body{ overflow-y: auto; }

.ops-scope .pn-form{
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 12px;
    background: #f8fafc;
}
.ops-scope .pn-form-row{ display: flex; gap: 6px; margin-bottom: 6px; }
.ops-scope .pn-form-row input#pnTitle{ flex: 1; }
.ops-scope .pn-form-row input#pnVersion{ width: 90px; }
.ops-scope .pn-form input, .ops-scope .pn-form textarea{
    padding: 6px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    box-sizing: border-box;
}
.ops-scope .pn-form textarea{ width: 100%; resize: vertical; }
.ops-scope .pn-form-actions{
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 6px;
}
.ops-scope .pn-form-actions .info-text{ font-size: 11px; color: #94a3b8; }

.ops-scope .pn-list{ display: flex; flex-direction: column; gap: 8px; }
.ops-scope .pn-empty{ color: #94a3b8; text-align: center; padding: 24px 0; font-size: 13px; }
.ops-scope .pn-item{
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 12px;
}
.ops-scope .pn-item-head{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}
.ops-scope .pn-item-title{ font-weight: 700; font-size: 13px; color: #1e293b; }
.ops-scope .pn-item-meta{
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #94a3b8;
    flex-shrink: 0;
}
.ops-scope .pn-item-ver{
    background: #fff7ed;
    color: #ea580c;
    border: 1px solid #fed7aa;
    border-radius: 4px;
    padding: 0 5px;
    font-weight: 700;
}
.ops-scope .pn-item-content{ font-size: 12px; color: #475569; line-height: 1.55; white-space: normal; }
.ops-scope .pn-del{
    background: none;
    border: none;
    color: #cbd5e1;
    cursor: pointer;
    font-size: 12px;
    padding: 0 2px;
}
.ops-scope .pn-del:hover{ color: #dc2626; }


/* === 습식 vs NIR 비교 탭 === */
.ops-scope .sub-tab-bar{
    display: flex;
    gap: 4px;
    margin-bottom: 14px;
    border-bottom: 2px solid #e2e8f0;
}
.ops-scope .sub-tab{
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    color: #94a3b8;
    cursor: pointer;
}
.ops-scope .sub-tab:hover{ color: #f97316; }
.ops-scope .sub-tab.active{
    color: #ea580c;
    border-bottom-color: #f97316;
}

.ops-scope .nc-hint{ font-size: 11px; color: #94a3b8; }

/* 2단 헤더 */
.ops-scope .nc-table thead tr:first-child th{ top: 0; height: 26px; }
.ops-scope .nc-table thead tr:last-child th{ top: 26px; }
.ops-scope .nc-table th.nc-group-head{
    text-align: center;
    background: #fff7ed;
    color: #9a3412;
    border-right: 2px solid #fed7aa;
}
.ops-scope .nc-table th.nc-sub{
    text-align: center;
    font-size: 10px;
    color: #64748b;
}
.ops-scope .nc-table th.nc-sub-diff{
    color: #ea580c;
    border-right: 2px solid #fed7aa;
}
.ops-scope .nc-table td.nc-val{ text-align: right; font-variant-numeric: tabular-nums; }
.ops-scope .nc-table td.nc-diff{
    font-weight: 700;
    border-right: 2px solid #fed7aa;
    background: #fffdf9;
}
.ops-scope .nc-table td.nc-both{ color: #16a34a; font-weight: 600; }
.ops-scope .nc-table td.nc-one{ color: #dc2626; font-weight: 600; }


/* === 기대치 추가/수정 폼 === */
.ops-scope .exp-form-mode{
    font-size: 11px;
    font-weight: 700;
    color: #ea580c;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 5px;
    padding: 3px 8px;
}
.ops-scope .exp-form-meta{
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}
.ops-scope .exp-m{ display: flex; flex-direction: column; gap: 3px; }
.ops-scope .exp-m.wide{ flex: 1; min-width: 180px; }
.ops-scope .exp-m label{ font-size: 11px; font-weight: 600; color: #64748b; }
.ops-scope .exp-m input, .ops-scope .exp-m select{
    padding: 6px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    min-width: 120px;
    box-sizing: border-box;
}
.ops-scope .exp-m.wide input{ width: 100%; min-width: 0; }
.ops-scope .exp-m input:focus, .ops-scope .exp-m select:focus{
    outline: none;
    border-color: #f97316;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.15);
}

.ops-scope .exp-cat{ margin-bottom: 10px; }
.ops-scope .exp-cat-title{
    font-size: 11px;
    font-weight: 700;
    color: #ea580c;
    background: #fff7ed;
    border-left: 3px solid #f97316;
    padding: 4px 8px;
    margin-bottom: 6px;
    border-radius: 0 4px 4px 0;
}
.ops-scope .exp-cat-grid{
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 6px 10px;
}
.ops-scope .exp-f{ display: flex; align-items: center; gap: 6px; }
.ops-scope .exp-f label{
    font-size: 11px;
    color: #475569;
    width: 74px;
    flex-shrink: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ops-scope .exp-f input{
    flex: 1;
    min-width: 0;
    padding: 4px 6px;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    font-size: 12px;
    font-family: inherit;
    text-align: right;
}
.ops-scope .exp-f input:focus{
    outline: none;
    border-color: #f97316;
    background: #fffbeb;
}

/* 목록의 적용 기간 표시 */
.ops-scope .data-table td.exp-range{ color: #1e293b; font-size: 12px; }
.ops-scope .data-table td.exp-range-open{ color: #94a3b8; font-size: 12px; font-style: italic; }
/* ===== 서버 통신 표시 (사이드바 제목 옆) ===== */
/* 제목 줄은 폭이 좁다(약 154px). 글자가 붙으면 줄바꿈되므로
   제목 줄에는 그림만 두고, 숫자는 바로 아랫줄 여백에 붙인다. */
.ops-scope .sidebar-title h2{ white-space: nowrap; }
.ops-scope .busy{
    display: none;
    align-items: center;
    gap: 3px;
    margin-left: 5px;
    vertical-align: 1px;
}
.ops-scope .busy.on{ display: inline-flex; }
.ops-scope .busy-ani{
    font-size: 12px;
    line-height: 1;
    display: inline-block;
    animation: busyHop .45s ease-in-out infinite alternate;
}
.ops-scope .busy-sec{
    font-size: 9.5px;
    font-weight: 600;
    color: #64748b;
    letter-spacing: 0;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
/* 사이드바 아랫줄(부제)에 붙는 숫자 — 비어 있을 땐 자리를 차지하지 않는다 */
.ops-scope .sidebar-title p .busy-sec:not(:empty){
    margin-left: 6px;
    padding-left: 6px;
    border-left: 1px solid rgba(255,255,255,.18);
    color: #f8b26a;
}
@keyframes busyHop {
    from { transform: translateY(1px); }
    to   { transform: translateY(-2px); }
}
@media (prefers-reduced-motion: reduce) {
    .ops-scope .busy-ani{ animation: none; }
}
/* 로그인 화면 — 버튼 오른쪽 안쪽에 표시 */
.ops-scope .login-btn-wrap{ position: relative; }
.ops-scope .busy.busy-on-btn{
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 0;
    pointer-events: none;
}
.ops-scope .busy.busy-on-btn.on{ display: inline-flex; }
.ops-scope .busy.busy-on-btn .busy-ani{ font-size: 15px; }
.ops-scope .busy.busy-on-btn .busy-sec{ color: rgba(255,255,255,.85); font-size: 10.5px; }

/* ==========================================
   분석 의뢰 등록 - 시료명 사전 검색 + 분석항목 접기/끄기 (2026-11-19)
   ========================================== */

/* 시료명 드롭다운: 의뢰 창(z-index 2000) 위에 뜨고, 창 안을 굴려도 칸을 따라가게 fixed */
.ops-scope .autocomplete-box.req-name-ac{
    position: fixed;
    display: block;
    z-index: 3000;
    max-height: 260px;
    max-width: 440px;
}
.ops-scope .req-name-ac .autocomplete-item{
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}
.ops-scope .req-name-ac .ac-name{
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ops-scope .req-name-ac .autocomplete-item .ac-code{
    flex-shrink: 0;
    margin-right: 0;
    font-size: 10px;
    font-weight: 500;
    color: #94a3b8;
}

/* 분석항목 칸에 자리를 더 주려고 의뢰 등록 창만 넓힘 (상세 보기·텍스트 등록 창은 그대로) */
#requestModal .modal-box.modal-request{
    max-width: 1180px;
}
#samplesReviewWrap th.col-items{
    width: 42%;
}
#samplesReviewWrap .samples-review-table.items-off th.col-items{
    width: auto;
}

/* 분석항목 칸: 분류는 한 줄짜리 칩으로 접어 두고, 펼친 분류만 한 줄을 다 쓴다 */
#samplesReviewWrap .sample-items-grid{
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 4px;
}
#samplesReviewWrap .sample-cat-block{
    flex: 0 0 auto;
    max-width: 100%;
    margin: 0;
}
#samplesReviewWrap .sample-cat-block.open{
    flex-basis: 100%;
}
#samplesReviewWrap .sample-cat-header{
    gap: 5px;
    padding: 3px 8px;
    border-bottom: none;
    border-radius: 6px;
    cursor: default;
    white-space: nowrap;
}
#samplesReviewWrap .sample-cat-block.open .sample-cat-header{
    border-bottom: 1px dashed #cbd5e1;
    border-radius: 6px 6px 0 0;
}
#samplesReviewWrap .sample-cat-fold{
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    user-select: none;
}
#samplesReviewWrap .sample-cat-fold:hover strong{
    color: #ea580c;
}
#samplesReviewWrap .sample-cat-arrow{
    display: inline-block;
    width: 9px;
    font-size: 8px;
    color: #64748b;
}
#samplesReviewWrap .sample-cat-arrow::before{ content: '▶'; }
#samplesReviewWrap .sample-cat-block.open .sample-cat-arrow::before{ content: '▼'; }
#samplesReviewWrap .sample-cat-block:not(.open) .sample-cat-count{ display: none; }
#samplesReviewWrap .sample-cat-picked{
    display: inline-block;
    min-width: 16px;
    padding: 0 5px;
    border-radius: 8px;
    background: #f97316;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
}
#samplesReviewWrap .sample-cat-picked[hidden]{ display: none; }
#samplesReviewWrap .sample-cat-items{
    display: none;
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
}
#samplesReviewWrap .sample-cat-block.open .sample-cat-items{
    display: grid;
}
#samplesReviewWrap .sample-items-picked{
    margin-top: 5px;
    font-size: 11px;
    line-height: 1.5;
    color: #c2410c;
}
#samplesReviewWrap .sample-items-picked[hidden]{ display: none; }

/* 머리글 '분석항목' 체크 — 끄면 분석항목 없이 저장 */
#samplesReviewWrap .req-items-switch{
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
#samplesReviewWrap .req-items-switch input{
    margin: 0;
    cursor: pointer;
}
#samplesReviewWrap .req-items-switch-note{
    font-weight: 400;
    opacity: .8;
}
#samplesReviewWrap td.col-items.is-off{
    background: #f8fafc;
    vertical-align: middle;
}
#samplesReviewWrap .req-items-off-text{
    color: #94a3b8;
    font-size: 11px;
    white-space: nowrap;
}
