/* ==========================================
   ops-report.css — 통보서 미리보기 창 전용 (RIMS v2)
   실무 앱(Lab Data) 원래 style.css 를 범위(.ops-scope) 씌우지 않고 그대로 둔 것.
   성분·톡신·살모넬라 통보서 새 창이 이 파일만 씀 (js/ops/report.js openPreviewWindow).
   통보서 모양을 고치려면 이 파일을 고친다. RIMS 화면에는 쓰이지 않는다.
   ========================================== */
/* ==========================================
   style.css - Lab Data 전체 디자인
   ==========================================
   여기에 색상, 폰트, 여백 등 모든 "보이는 것"을 정의합니다.
   색상 하나 바꾸고 싶으면 이 파일만 수정하면 전체에 적용됩니다.
   ========================================== */

/* --- 공통 초기화 (브라우저마다 다른 기본값을 통일) --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* --- 전체 폰트 및 기본 스타일 --- */
html, body {
    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;
}

/* ==========================================
   로그인 페이지 전용 스타일
   ========================================== */

.login-body {
    /* 화면 전체를 진한 남색 그라디언트로 */
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.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);
}

.login-logo {
    /* 상단 로고 영역 */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 28px;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: white;              /* 주황 그라디언트 → 흰 배경 */
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;               /* 추가 */
    padding: 4px;                   /* 추가 */
}

/* 이 부분을 새로 추가 */
.logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.logo-text h1 {
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.02em;
}

.logo-text p {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
}

.login-title {
    /* "로그인" 타이틀 */
    font-size: 15px;
    color: #475569;
    text-align: center;
    margin-bottom: 24px;
    font-weight: 500;
}

/* --- 입력창 --- */
.input-group {
    margin-bottom: 16px;
}

.input-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
}

.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;
}

.input-group input:focus {
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
}

/* --- 버튼 --- */
.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;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(249, 115, 22, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* --- 상태 메시지 (성공/실패 알림) --- */
.status-msg {
    margin-top: 14px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    text-align: center;
    display: none;  /* 기본값: 숨김 */
}

.status-msg.show { display: block; }

.status-msg.error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.status-msg.success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.status-msg.info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

/* --- 연결 상태 (하단 작은 표시) --- */
.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;
}

.conn-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #f59e0b;
    animation: pulse 1.5s infinite;
}

.conn-dot.ok {
    background: #10b981;
    animation: none;
}

.conn-dot.err {
    background: #ef4444;
    animation: none;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* --- 모바일 대응 --- */
@media (max-width: 480px) {
    .login-box {
        padding: 32px 24px;
    }
}
/* ==========================================
   메인 앱 페이지 전용 스타일
   ========================================== */

.app-body {
    background: #f1f5f9;
    min-height: 100vh;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* ==========================================
   사이드바 (왼쪽 메뉴)
   ========================================== */

.sidebar {
    width: 240px;
    background: #2C3E50;
    color: #ECF0F1;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 10px;
}

.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;
}

.sidebar-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.sidebar-title h2 {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: white;
}

.sidebar-title p {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 1px;
}

.nav-section {
    padding: 16px 12px;
    flex: 1;
}

.nav-label {
    font-size: 10px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 10px 12px 6px;
    font-weight: 600;
}

.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;
}

.nav-item:hover {
    background: #34495E;
    color: white;
}

.nav-item.active {
    background: #f97316;
    color: white;
}

.nav-item.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;    /* 클릭 자체를 막음 */
}

.nav-icon {
    font-size: 16px;
}

/* 사이드바 하단 (로그아웃 + 세션 시간) */
.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.session-info {
    font-size: 11px;
    color: #94a3b8;
    padding: 6px 12px 10px;
    text-align: center;
}

.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;
}

.logout-btn:hover {
    background: #dc2626;
    border-color: #dc2626;
    color: white;
}

/* ==========================================
   메인 컨텐츠 영역 (오른쪽)
   ========================================== */

.main-content {
    flex: 1;
    padding: 32px 40px;
    overflow-x: auto;
}

.page-header {
    margin-bottom: 24px;
}

.page-title {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: #0f172a;
    margin-bottom: 4px;
}

.page-subtitle {
    color: #64748b;
    font-size: 14px;
}

/* 페이지 전환 시 숨김/표시 */
.page {
    display: none;
}

.page.active {
    display: block;
}

/* 빈 페이지 안내 (임시) */
.empty-state {
    background: white;
    border: 2px dashed #e2e8f0;
    border-radius: 12px;
    padding: 60px 40px;
    text-align: center;
    color: #94a3b8;
}

.empty-state h3 {
    font-size: 18px;
    color: #64748b;
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
}

/* 모바일 대응 */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    .main-content {
        padding: 20px;
    }
}
/* ==========================================
   원료/제품 목록 관리 페이지 스타일
   ========================================== */

/* 카드 (공통) */
.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;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}

.card-title {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-count {
    font-size: 12px;
    color: #64748b;
    padding: 4px 10px;
    background: #f1f5f9;
    border-radius: 100px;
    font-weight: 500;
}

/* 공통 입력창/버튼 */
.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;
}

.input-field:focus {
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
}

.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;
}

.btn-orange {
    background: #f97316;
    color: white;
}
.btn-orange:hover { background: #ea580c; }
.btn-orange:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
}

.btn-gray {
    background: #64748b;
    color: white;
}
.btn-gray:hover { background: #475569; }

.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;
}
.btn-danger-sm:hover {
    background: #ef4444;
    color: white;
}

/* 검색창 (아이콘 포함) */
.search-box {
    position: relative;
    margin-bottom: 14px;
}

.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;
}

.search-box input:focus {
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
}

.search-box::before {
    content: '🔍';
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: #94a3b8;
    pointer-events: none;
}

/* 입력 행 (추가 폼) */
.input-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.input-row .input-field {
    flex: 1;
    min-width: 120px;
}

.input-row .input-field.input-code {
    max-width: 180px;
}

/* 데이터 표 (공통) */
.data-table-wrap {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    max-height: 520px;
    overflow-y: auto;
    background: white;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.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;
}

.data-table td {
    padding: 10px 14px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
}

.data-table tbody tr:hover td {
    background: #fff7ed;
}

.data-table .cell-code {
    font-family: 'SF Mono', Menlo, monospace;
    color: #7c3aed;
    font-weight: 600;
    width: 140px;
}

.data-table .cell-actions {
    text-align: right;
    width: 80px;
}

.table-empty {
    padding: 40px 20px;
    text-align: center;
    color: #94a3b8;
    font-size: 13px;
}

.table-loading {
    padding: 40px 20px;
    text-align: center;
    color: #64748b;
    font-size: 13px;
}

/* ==========================================
   토스트 알림 (우측 하단)
   ========================================== */

.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;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.ok { background: #10b981; }
.toast.err { background: #ef4444; }
.toast.info { background: #3b82f6; }
.toast.warn { background: #f59e0b; }
/* ==========================================
   데이터 누적·조회 페이지 스타일
   ========================================== */

/* 필터 영역 */
.filter-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: 14px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-label {
    font-size: 11px;
    color: #64748b;
    font-weight: 600;
}

.filter-divider {
    width: 1px;
    height: 38px;
    background: #e2e8f0;
    align-self: flex-end;
    margin: 0 4px;
}

.filter-group select,
.filter-group input[type="date"],
.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;
}

.filter-group select:focus,
.filter-group input:focus {
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
}

.filter-group.narrow input { width: 100px; }
/* 검색창은 안내문이 안 잘리도록 넓게 */
#requestFilterSearch,
#waterRequestFilterSearch,
#waterAccumFilterSearch,
#filterName { width: 200px !important; }
.filter-group.medium input { width: 140px; }
.filter-group.code-range {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
}
.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; }
.filter-group.code-range .dash { color: #94a3b8; padding: 0 2px; }

/* 액션 버튼 바 */
.action-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    padding: 12px 0;
    border-top: 1px solid #f1f5f9;
    margin-top: 12px;
}

.action-bar-spacer { flex: 1; }

.btn-red {
    background: #ef4444;
    color: white;
}
.btn-red:hover { background: #dc2626; }
.btn-red:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
}

.btn-green {
    background: #10b981;
    color: white;
}
.btn-green:hover { background: #059669; }

/* 결과 요약 */
.result-summary {
    padding: 10px 14px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    color: #1e40af;
    font-size: 13px;
    margin-bottom: 12px;
    display: none;
}
.result-summary.show { display: block; }

/* 가로 스크롤 가능한 넓은 표 */
.wide-table-wrap {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: auto;
    max-height: 600px;
    background: white;
}

.wide-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    min-width: 1440px;
}

.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;
}

.wide-table th.col-check {
    width: 40px;
    text-align: center;
}

.wide-table td {
    padding: 5px 8px;
    border-bottom: 1px solid #f1f5f9;
    border-right: 1px solid #f1f5f9;
    color: #334155;
    white-space: nowrap;
}

.wide-table td.col-check {
    text-align: center;
}

.wide-table tbody tr:hover td {
    background: #fff7ed;
}

.wide-table tbody tr.selected td {
    background: #fef3c7;
}

.wide-table input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.col-factory { color: #7c3aed; font-weight: 500; }
.col-analysis { color: #0284c7; }
.col-date { color: #475569; font-family: 'SF Mono', Menlo, monospace; }
.col-code-val { color: #7c3aed; font-family: 'SF Mono', Menlo, monospace; font-weight: 600; }
/* ==========================================
   데이터 입력 페이지 스타일
   ========================================== */

/* 상단 컨트롤 바 */
.input-control-bar {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.input-control-bar .filter-group select {
    min-width: 140px;
}

/* 입력 표 래퍼 (가로·세로 스크롤) */
.input-table-wrap {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: auto;
    max-height: 620px;
    background: white;
}

/* 입력 가능한 편집 표 */
.input-table {
    border-collapse: separate;
    border-spacing: 0;
    font-size: 12px;
    min-width: 1500px;
    width: 100%;
}

.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;
}

.input-table thead th.col-num {
    width: 42px;
    background: #e2e8f0;
    color: #64748b;
    font-size: 10px;
}

.input-table tbody td {
    padding: 0;
    border-bottom: 1px solid #f1f5f9;
    border-right: 1px solid #f1f5f9;
    background: white;
    height: 28px;
}

.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이 들어감) */
/* 셀 컨테이너 (엑셀 셀처럼 동작) */
.input-table tbody td.editable {
    padding: 0;
    position: relative;
    min-width: 60px;
    cursor: cell;
}

/* 표시 모드 (기본) - div로 내용만 보여줌 */
.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;
}

/* 선택된 셀 (클릭하면 이 상태) */
.input-table tbody td.editable.selected {
    background: #dbeafe;
    outline: 2px solid #2563eb;
    outline-offset: -2px;
    z-index: 1;
}

/* 편집 모드 (더블클릭/F2/Enter/타이핑) */
.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;
}

/* 특수 컬럼 색상 힌트 (표시 모드) */
.input-table tbody td.col-date .cell-view { 
    color: #0369a1; 
    font-family: 'SF Mono', Menlo, monospace; 
}
.input-table tbody td.col-code-in .cell-view { 
    color: #7c3aed; 
    font-family: 'SF Mono', Menlo, monospace; 
    font-weight: 600; 
}

/* 특수 컬럼 색상 힌트 */
.input-table tbody td.col-date input { color: #0369a1; font-family: 'SF Mono', Menlo, monospace; }
.input-table tbody td.col-code-in input { color: #7c3aed; font-family: 'SF Mono', Menlo, monospace; font-weight: 600; }

/* 공장 열 — '기타'일 때만 편집 가능, 정식 공장이면 드롭다운 값을 회색 읽기전용으로 표시 */
.input-table .col-factory {
    min-width: 110px;
}
.input-table .col-factory .cell-view {
    color: #0f766e;
    font-size: 11px;
    font-weight: 600;
}
.input-table .col-factory-readonly {
    min-width: 55px;
    background: rgba(100, 116, 139, 0.06);
    cursor: default;
}
.input-table .col-factory-readonly .cell-view {
    color: #94a3b8;
    font-weight: 400;
    font-style: italic;
}

/* 입력 표 힌트 박스 */
.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;
}

.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;
}

/* 행 조작 버튼 */
.row-controls {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    align-items: center;
}

.row-controls .info-text {
    font-size: 12px;
    color: #64748b;
    margin-left: 6px;
}

.btn-sm {
    height: 32px;
    padding: 0 12px;
    font-size: 12px;
}

/* 자동완성 드롭다운 (나중에 쓸 예정) */
.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;
}

.autocomplete-item {
    padding: 8px 12px;
    font-size: 12px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
}

.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover,
.autocomplete-item.active {
    background: #fff7ed;
    color: #ea580c;
}

.autocomplete-item .ac-code {
    font-family: 'SF Mono', Menlo, monospace;
    font-weight: 600;
    color: #7c3aed;
    margin-right: 8px;
}
/* ==========================================
   모달 다이얼로그 (덮어쓰기 확인 등)
   ========================================== */

.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;
}

.modal-backdrop.show {
    display: flex;
}

.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;
}

.modal-title {
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-body {
    font-size: 13px;
    color: #475569;
    line-height: 1.6;
    margin-bottom: 18px;
}

.modal-conflict-info {
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    padding: 12px 14px;
    margin: 12px 0;
    font-size: 12px;
    color: #78350f;
}

.modal-conflict-info .key {
    font-weight: 600;
    color: #92400e;
}

.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;
}

.modal-conflict-diff .diff-row {
    display: flex;
    gap: 10px;
}

.modal-conflict-diff .diff-label {
    color: #92400e;
    min-width: 80px;
    font-weight: 600;
}

.modal-conflict-diff .old-val {
    color: #991b1b;
    text-decoration: line-through;
}

.modal-conflict-diff .new-val {
    color: #166534;
    font-weight: 600;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.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;
}

.modal-btn-primary {
    background: #f97316;
    color: white;
}
.modal-btn-primary:hover { background: #ea580c; }

.modal-btn-secondary {
    background: #e2e8f0;
    color: #334155;
}
.modal-btn-secondary:hover { background: #cbd5e1; }

.modal-btn-danger {
    background: #ef4444;
    color: white;
}
.modal-btn-danger:hover { background: #dc2626; }

/* 진행 상태 바 (저장 중일 때) */
.save-progress {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 14px 18px;
    margin: 12px 0;
    display: none;
}

.save-progress.show { display: block; }

.save-progress-text {
    font-size: 13px;
    color: #1e40af;
    font-weight: 500;
    margin-bottom: 8px;
}

.save-progress-bar {
    width: 100%;
    height: 6px;
    background: #dbeafe;
    border-radius: 100px;
    overflow: hidden;
}

.save-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #2563eb);
    width: 0%;
    transition: width 0.3s;
}
/* ==========================================
   공장 비밀번호 입력 모달
   ========================================== */

.pw-modal-title {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pw-modal-sub {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 16px;
}

.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;
}

.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;
}

.pw-input:focus {
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
}

.pw-error {
    color: #dc2626;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 8px;
    min-height: 18px;
}

/* 비밀번호 틀렸을 때 입력칸 강조 */
.pw-input.pw-input-error {
    border-color: #dc2626;
    background: #fef2f2;
}
.pw-input.pw-input-error:focus {
    border-color: #dc2626;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.18);
}
/* ==========================================
   사이드바 사용자 정보 박스
   ========================================== */

.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;
}

.user-info-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.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;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.user-factory {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.user-role-badge {
    display: inline-block;
    padding: 1px 6px;
    font-size: 9px;
    font-weight: 700;
    border-radius: 100px;
    margin-left: 4px;
    text-transform: uppercase;
}

.user-role-badge.admin {
    background: rgba(249, 115, 22, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(249, 115, 22, 0.4);
}

.user-role-badge.user {
    background: rgba(59, 130, 246, 0.2);   /* 연한 파랑 (viewer와 맞바꿈) */
    color: #60a5fa;
}

.user-role-badge.viewer {
    background: rgba(100, 116, 139, 0.3);  /* 슬레이트 (공장과 맞바꿈) */
    color: #cbd5e1;
}
/* ==========================================
   누적·조회 페이지 - 입력자 표시 기능
   ========================================== */

/* 토글 스위치 */
.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;
}

.toggle-group:hover {
    background: #e2e8f0;
}

.toggle-group.active {
    background: #fff7ed;
    border-color: #f97316;
    color: #c2410c;
}

.toggle-group input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: #f97316;
}

.toggle-group label {
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

/* 입력자 표시 셀 (숨김 가능) */
.wide-table th.col-byinfo,
.wide-table td.col-byinfo {
    background: #fefce8 !important;
    border-left: 2px solid #fde047;
}

.wide-table tbody tr:hover td.col-byinfo {
    background: #fef9c3 !important;
}

.col-byinfo {
    color: #713f12;
    font-size: 11px;
    min-width: 120px;
}

.col-byinfo.muted {
    color: #a8a29e;
    font-style: italic;
}

/* 영양소 셀 툴팁 (값에 마우스 올리면 입력자 표시) */
.wide-table td.col-value-with-by {
    position: relative;
    cursor: help;
}

.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);
}

.wide-table td.col-value-with-by:hover::after {
    opacity: 1;
}

/* 값이 있지만 입력자 정보가 있는 셀 - 은은한 표시 */
.wide-table td.col-value-with-by {
    border-left: 2px solid #e5e7eb;
}

.wide-table td.col-value-with-by.has-author {
    border-left: 2px solid #10b981;
}

/* ==========================================
   기대치 조회 페이지 전용 스타일
   ========================================== */

/* 영양소 헤더 드롭다운 */
.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;
}

.nutrient-header-select:hover {
    background: rgba(249, 115, 22, 0.25);
}

.nutrient-header-select:focus {
    outline: none;
    border-color: #f97316;
}

/* 영양소 값 셀 (비어있는 셀) */
.col-nutrient-value {
    background: rgba(148, 163, 184, 0.08);
}

/* 기대치 페이지는 7개 열만 있어서 기본 min-width(1900px) 해제하고 열 너비 재정의 */
#page-expected .input-table {
    min-width: 100%;
    width: 100%;
    table-layout: fixed;
}

#page-expected .input-table thead th:nth-child(1) { width: 40px; }    /* # */
#page-expected .input-table thead th:nth-child(2) { width: 120px; }   /* 날짜 */
#page-expected .input-table thead th:nth-child(3) { width: 60px; }    /* 반복수 */
#page-expected .input-table thead th:nth-child(4) { width: 90px; }    /* 코드 */
#page-expected .input-table thead th:nth-child(5) { width: 130px; }   /* 원료or제품명 (고정값) */
#page-expected .input-table thead th:nth-child(6) { width: 130px; }   /* 납품처 */
#page-expected .input-table thead th:nth-child(7) { width: 110px; }   /* 영양소(드롭다운) */
#page-expected .input-table thead th:nth-child(8) { width: 80px; }    /* 기대치 */

/* 셀 내부 스타일 */
.col-expected-value {
    font-weight: 600;
    color: #94a3b8;
    background: rgba(16, 185, 129, 0.05);
    text-align: right;
    padding-right: 10px;
}

.col-expected-value.filled {
    color: #10b981;
}
/* ==========================================
   파란 버튼 (통보서 버튼용)
   ========================================== */
.btn.btn-blue {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}
.btn.btn-blue:hover:not(:disabled) {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}
.btn.btn-blue:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==========================================
   통보서 모달 전용 스타일
   ========================================== */
.modal-box.modal-report {
    width: 90%;
    max-width: 720px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-report .modal-body {
    overflow-y: auto;
    padding: 20px 24px;
    flex: 1;
}

.report-form-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}
.report-form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.report-form-section h3 {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 12px;
}

.report-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.report-form-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.report-form-row.report-form-full {
    grid-column: 1 / -1;
}

.report-form-row label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
}

.report-form-row input,
.modal-report textarea {
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
}

.report-form-row input:focus,
.modal-report textarea:focus {
    outline: none;
    border-color: #f97316;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.15);
}

.modal-report textarea {
    width: 100%;
    resize: vertical;
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    font-size: 12px;
}

.form-hint {
    font-size: 11px;
    color: #94a3b8;
    margin-bottom: 6px;
}

.report-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.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;
}
.report-check-item:hover {
    background: #f1f5f9;
}
.report-check-item input[type="checkbox"] {
    cursor: pointer;
}
.report-check-item.checked {
    background: rgba(249, 115, 22, 0.1);
    border-color: #f97316;
}
.report-check-item label {
    font-size: 12px;
    cursor: pointer;
    flex: 1;
}

.modal-info {
    flex: 1;
    font-size: 12px;
    color: #64748b;
}

/* ==========================================
   PDF 미리보기 창 공통 스타일
   ========================================== */
.preview-window {
    background: #f1f5f9;
    padding: 20px;
    min-height: 100vh;
}

.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;
}

.preview-toolbar .preview-title {
    flex: 1;
    font-weight: 700;
    color: #1e293b;
}

.preview-toolbar button {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.preview-toolbar .btn-print {
    background: #f97316;
    color: white;
}
.preview-toolbar .btn-print:hover { background: #ea580c; }
.preview-toolbar .btn-back {
    background: #e2e8f0;
    color: #1e293b;
}

.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;
}

/* ==========================================
   성분 분석 통보서 양식 스타일
   ========================================== */
.report-nutrient .report-title {
    font-size: 28pt;
    font-weight: 700;
    text-align: center;
    letter-spacing: 0.3em;
    margin-bottom: 16pt;
}

.report-nutrient table.header-table,
.report-nutrient table.result-table,
.report-nutrient table.note-table,
.report-nutrient table.footer-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 8pt;
}

.report-nutrient table.header-table td {
    border: 1px solid #000;
    padding: 4pt 6pt;
    font-size: 9pt;
    height: 18pt;
}
.report-nutrient table.header-table td.label {
    background: #f3f4f6;
    font-weight: 600;
    width: 90pt;
    text-align: center;
}

.report-nutrient .section-title {
    font-size: 12pt;
    font-weight: 700;
    margin: 12pt 0 4pt 0;
}

.report-nutrient table.result-table {
    border: 1.5px solid #000;
}
.report-nutrient table.result-table th,
.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;
}
.report-nutrient table.result-table thead th {
    background: #f3f4f6;
    font-weight: 700;
}

.report-nutrient .note-section {
    margin-top: 14pt;
    border: 1.5px solid #000;
    padding: 8pt 10pt;
}
.report-nutrient .note-title { font-weight: 700; font-size: 10pt; margin-bottom: 6pt; }
.report-nutrient .note-line { font-size: 9pt; line-height: 1.6; padding-left: 12pt; }

.report-nutrient .footer-text {
    font-size: 9pt;
    line-height: 1.7;
    margin-top: 12pt;
    padding-top: 10pt;
    border-top: 1.5px solid #000;
}

.report-nutrient .signature-line {
    font-size: 16pt;
    font-weight: 700;
    text-align: center;
    margin-top: 24pt;
    letter-spacing: 0.05em;
}

/* ==========================================
   톡신 통보서 양식 스타일
   ========================================== */
.report-toxin .toxin-top-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12pt;
}

.report-toxin .toxin-title {
    font-size: 22pt;
    font-weight: 700;
    color: #000;
}

.report-toxin table.signature-table {
    border-collapse: collapse;
}
.report-toxin table.signature-table th,
.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;
}
.report-toxin table.signature-table th {
    background: #1e293b;
    color: white;
    font-weight: 600;
    height: 18pt;
}
.report-toxin table.signature-table img {
    max-width: 50pt;
    max-height: 40pt;
}

.report-toxin .info-block {
    background: #1e293b;
    color: white;
    padding: 6pt 12pt;
    font-size: 9pt;
    font-weight: 600;
    margin: 12pt 0;
}
.report-toxin .info-block table {
    width: 100%;
    border-collapse: collapse;
}
.report-toxin .info-block td {
    padding: 3pt 6pt;
    color: white;
}
.report-toxin .info-block td.label {
    width: 80pt;
    font-weight: 700;
}

.report-toxin .purpose-section {
    margin: 14pt 0 4pt 0;
}
.report-toxin .purpose-section h3 {
    font-size: 11pt;
    font-weight: 700;
    margin-bottom: 4pt;
}
.report-toxin .purpose-section p {
    font-size: 10pt;
    text-decoration: underline;
    padding-left: 14pt;
}

.report-toxin .result-section h3 {
    font-size: 11pt;
    font-weight: 700;
    margin: 10pt 0 4pt 0;
}

.report-toxin table.toxin-result-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 12pt;
}
.report-toxin table.toxin-result-table th,
.report-toxin table.toxin-result-table td {
    border: 1px solid #000;
    padding: 3pt 4pt;
    font-size: 8.5pt;
    text-align: center;
    height: 18pt;
}
.report-toxin table.toxin-result-table thead th {
    background: #f3f4f6;
    font-weight: 700;
}

.report-toxin .lower-grid {
    display: grid;
    /* 기준 관리범위 표에 톡신이 늘어 좁아지므로 오른쪽을 넓게 (좌 1 : 우 2) */
    grid-template-columns: 1fr 2fr;
    gap: 12pt;
    margin-top: 14pt;
}

.report-toxin .lower-grid h4 {
    font-size: 10pt;
    font-weight: 700;
    margin-bottom: 4pt;
}

.report-toxin table.method-table,
.report-toxin table.criteria-table {
    width: 100%;
    border-collapse: collapse;
}
.report-toxin table.method-table th,
.report-toxin table.method-table td,
.report-toxin table.criteria-table th,
.report-toxin table.criteria-table td {
    border: 1px solid #000;
    padding: 3pt 4pt;
    font-size: 8pt;
    text-align: center;
    vertical-align: middle;
}
.report-toxin table.method-table th,
.report-toxin table.criteria-table th {
    background: #f3f4f6;
    font-weight: 700;
}

/* 기준 관리범위: 톡신 칸이 고르게 나뉘도록 '구분' 열 폭을 제한하고 여백을 줄임 */
.report-toxin table.criteria-table th,
.report-toxin table.criteria-table td {
    padding: 3pt 2pt;
    word-break: keep-all;
}
.report-toxin table.criteria-table th:first-child,
.report-toxin table.criteria-table td:first-child {
    width: 20%;
}

.report-toxin .footer-text {
    font-size: 8.5pt;
    line-height: 1.7;
    margin-top: 18pt;
}

.report-toxin .signature-bottom {
    font-size: 14pt;
    font-weight: 700;
    text-align: center;
    margin-top: 18pt;
}

/* ==========================================
   인쇄 시 적용 (PDF로 저장 시 토글바·여백 제거)
   ========================================== */
@media print {
    body { background: white !important; }
    .preview-toolbar { display: none !important; }
    .preview-window { padding: 0; background: white; }
    .preview-page {
        box-shadow: none;
        margin: 0;
        padding: 15mm 12mm;
        width: 100%;
        min-height: auto;
    }
    @page {
        size: A4;
        margin: 0;
    }
}
/* ==========================================
   설정 페이지 - 기대치 관리 카드
   ========================================== */
.expected-admin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 8px;
}

.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;
}

.expected-admin-icon {
    font-size: 36px;
    margin-bottom: 4px;
}

.expected-admin-box h3 {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
}

.expected-admin-box p {
    font-size: 12px;
    color: #64748b;
    line-height: 1.5;
    margin-bottom: 8px;
    flex: 1;
}

.expected-admin-box button {
    width: 100%;
    margin-top: 4px;
}

.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;
}

.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;
}

/* 메뉴 항목 숨김 (권한 없는 사용자용) */
.nav-item.hidden {
    display: none !important;
}
/* ==========================================
   기대치 관리 표 (편집형)
   ========================================== */
.expected-admin-table-wrap {
    overflow: auto;
    max-height: 60vh;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-top: 8px;
}

.expected-admin-table {
    border-collapse: collapse;
    min-width: 100%;
    font-size: 12px;
}

.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;
}

.expected-admin-table thead th:first-child {
    width: 40px;
}

.expected-admin-table tbody td {
    padding: 0;
    border-right: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    height: 28px;
    text-align: center;
    background: white;
}

.expected-admin-table tbody td.cell-num {
    background: #f1f5f9;
    color: #64748b;
    font-size: 11px;
    width: 40px;
}

.expected-admin-table tbody td.editable {
    cursor: cell;
    position: relative;
    min-width: 60px;
    padding: 4px 6px;
}

.expected-admin-table tbody td.editable:hover {
    background: #fff7ed;
}

.expected-admin-table tbody td.editable.selected {
    background: rgba(249, 115, 22, 0.18);
    box-shadow: inset 0 0 0 2px #f97316;
}

.expected-admin-table tbody td.editable .cell-view {
    min-height: 20px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.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;
}

/* 키 컬럼(공장·코드·이름)은 좌측 정렬 + 강조 */
.expected-admin-table tbody td.col-key {
    text-align: left;
    background: #f8fafc;
    font-weight: 500;
}
/* ==========================================
   분석 의뢰 페이지 전용 스타일
   ========================================== */
.col-actions {
    width: 80px;
}

.request-status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}
.request-status-badge.pending     { background: #fef3c7; color: #b45309; }
.request-status-badge.in_progress { background: #dbeafe; color: #1e40af; }
.request-status-badge.done        { background: #d1fae5; color: #065f46; }

.request-receipt-no {
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    font-weight: 600;
    color: #f97316;
}
/* ==========================================
   분석 의뢰 등록 모달 (4단계 wizard)
   ========================================== */
.modal-box.modal-request {
    width: 92%;
    max-width: 880px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
}

/* 진행 단계 인디케이터 */
.wizard-steps {
    display: flex;
    align-items: center;
    padding: 16px 24px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    gap: 8px;
}

.wizard-step {
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.4;
    transition: opacity 0.2s;
}
.wizard-step.active   { opacity: 1; }
.wizard-step.complete { opacity: 0.7; }

.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;
}
.wizard-step.active .wizard-num   { background: #f97316; }
.wizard-step.complete .wizard-num { background: #10b981; }

.wizard-label {
    font-size: 12px;
    font-weight: 600;
    color: #1e293b;
}

.wizard-divider {
    flex: 1;
    height: 1px;
    background: #cbd5e1;
}

/* 모달 본문 */
.modal-request .modal-body {
    overflow-y: auto;
    padding: 20px 24px;
    flex: 1;
}

/* wizard 페인 */
.wizard-pane {
    display: none;
}
.wizard-pane.active {
    display: block;
}

.wizard-section {
    margin-bottom: 22px;
}
.wizard-section:last-child {
    margin-bottom: 0;
}
.wizard-section h3 {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
}

/* 이미지 붙여넣기 영역 */
.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;
}
.image-paste-zone:hover,
.image-paste-zone:focus {
    border-color: #f97316;
    background: #fff7ed;
}
.image-paste-zone.has-image {
    border-style: solid;
    background: white;
    cursor: default;
}
.image-paste-placeholder {
    color: #64748b;
    font-size: 13px;
    font-weight: 500;
}

/* AI 사이트 링크 */
.ai-links {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.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;
}
.ai-link:hover {
    background: rgba(59, 130, 246, 0.2);
    color: #1d4ed8;
}

/* 모달 안 textarea */
.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;
}
.modal-request textarea:focus {
    outline: none;
    border-color: #f97316;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.15);
}

/* JSON 파싱 에러 표시 */
.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;
}

/* 시료 검수 표 */
.samples-review-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
    font-size: 12px;
}
.samples-review-table th,
.samples-review-table td {
    border: 1px solid #e2e8f0;
    padding: 6px 8px;
    text-align: left;
    vertical-align: top;
}
.samples-review-table thead th {
    background: #f1f5f9;
    font-weight: 700;
    color: #1e293b;
    font-size: 12px;
}
.samples-review-table tbody td input[type="text"],
.samples-review-table tbody td input[type="number"],
.samples-review-table tbody td input[type="date"] {
    width: 100%;
    border: none;
    padding: 4px 6px;
    font-size: 12px;
    background: transparent;
    border-radius: 3px;
}
.samples-review-table tbody td input:focus {
    background: #fff7ed;
    outline: 1px solid #f97316;
}
.samples-review-table tbody tr:hover {
    background: #fafbfc;
}

/* 시료 행의 분석항목 체크박스 그리드 */
.sample-items-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
}
.sample-item-check {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 4px;
    font-size: 11px;
    cursor: pointer;
    user-select: none;
    border-radius: 3px;
}
.sample-item-check input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}
.sample-item-check.checked {
    background: rgba(249, 115, 22, 0.12);
}

.btn-row-delete {
    background: none;
    border: none;
    color: #dc2626;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 6px;
}
.btn-row-delete:hover {
    background: #fee2e2;
    border-radius: 3px;
}

/* 4단계 최종 요약 */
.final-summary {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
}
.final-summary-row {
    display: grid;
    grid-template-columns: 120px 1fr;
    padding: 6px 0;
    border-bottom: 1px solid #e2e8f0;
    font-size: 13px;
}
.final-summary-row:last-child {
    border-bottom: none;
}
.final-summary-row .label {
    font-weight: 600;
    color: #64748b;
}
.final-summary-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 4px;
    font-size: 12px;
}
.final-summary-table th,
.final-summary-table td {
    border: 1px solid #e2e8f0;
    padding: 4px 6px;
    text-align: left;
}
.final-summary-table th {
    background: #f1f5f9;
    font-weight: 700;
}
/* ==========================================
   분석 의뢰 목록 표 + 상세 모달
   ========================================== */

/* 클릭 가능한 행 */
.wide-table tbody tr.row-clickable {
    cursor: pointer;
}
.wide-table tbody tr.row-clickable:hover {
    background: #fff7ed;
}

/* 상태 토글 셀 */
.status-toggle {
    cursor: pointer;
    user-select: none;
    transition: all 0.15s;
}
.status-toggle:hover {
    transform: scale(1.05);
}

/* 의뢰 상세 모달 */
.req-detail-section {
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid #e2e8f0;
}
.req-detail-section:last-child {
    border-bottom: none;
}
.req-detail-section h3 {
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
}

.req-detail-grid {
    display: grid;
    grid-template-columns: 110px 1fr 110px 1fr;
    gap: 6px 12px;
    font-size: 13px;
}
.req-detail-grid .label {
    color: #64748b;
    font-weight: 600;
}

.req-samples-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.req-samples-table th,
.req-samples-table td {
    border: 1px solid #e2e8f0;
    padding: 4px 8px;
    text-align: left;
    vertical-align: top;
}
.req-samples-table thead th {
    background: #f1f5f9;
    font-weight: 700;
}
.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;
}
/* ==========================================
   데이터 입력 페이지 - 접수번호 셀 드롭다운 + 체크박스
   ========================================== */

/* 체크박스 컬럼 (행 번호 앞) */
.input-table th.col-check,
.input-table td.col-check {
    width: 28px;
    text-align: center;
    padding: 2px;
}
.input-table td.col-check input[type="checkbox"] {
    cursor: pointer;
    margin: 0;
}

/* 접수번호 셀 (첫 분석 컬럼) */
.input-table .col-receipt {
    min-width: 220px;
    cursor: pointer;
    background: rgba(59, 130, 246, 0.05);
}
.input-table .col-receipt:hover {
    background: rgba(59, 130, 246, 0.12);
}
.input-table .col-receipt .cell-view {
    color: #2563eb;
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    font-size: 11px;
}
.input-table .col-receipt.empty .cell-view::before {
    content: '▼ 의뢰 선택';
    color: #94a3b8;
    font-style: italic;
    font-family: inherit;
}
.input-table .col-receipt.empty .cell-view {
    color: #94a3b8;
}

/* 의뢰 선택 드롭다운 모달 */
.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;
}

.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);
}

.request-picker-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 12px;
}
.request-picker-header h3 {
    flex: 1;
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
}
.request-picker-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #64748b;
    padding: 4px 8px;
}
.request-picker-search {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 13px;
}
.request-picker-search:focus {
    outline: none;
    border-color: #f97316;
}

.request-picker-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.request-picker-item {
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid transparent;
    margin-bottom: 4px;
    transition: all 0.1s;
}
.request-picker-item:hover {
    background: #fff7ed;
    border-color: #fed7aa;
}

.request-picker-item .receipt-no {
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    font-weight: 600;
    color: #f97316;
    font-size: 13px;
}
.request-picker-item .meta {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
}
.request-picker-item .samples-summary {
    font-size: 11px;
    color: #475569;
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px dashed #e2e8f0;
}

.request-picker-empty {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
    font-size: 13px;
}
/* ==========================================
   데이터 입력 - 기대치 placeholder (회색)
   ========================================== */
.input-table .cell-placeholder {
    color: #cbd5e1;       /* 옅은 회색 */
    font-style: italic;
    font-weight: 400;
}

/* 편집 모드 input의 placeholder도 같은 회색으로 */
.input-table .cell-input::placeholder {
    color: #cbd5e1;
    font-style: italic;
}
/* ==========================================
   의뢰 등록 모드 선택 모달
   ========================================== */
.modal-box.modal-mode-picker {
    width: 90%;
    max-width: 540px;
}

.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;
}
.mode-option:hover {
    border-color: #f97316;
    background: #fff7ed;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.15);
}
.mode-option:last-child {
    margin-bottom: 0;
}
.mode-option .mode-icon {
    font-size: 32px;
    flex-shrink: 0;
}
.mode-option .mode-content {
    flex: 1;
}
.mode-option .mode-title {
    font-weight: 700;
    font-size: 15px;
    color: #1e293b;
    margin-bottom: 4px;
}
.mode-option .mode-desc {
    font-size: 12px;
    color: #64748b;
    line-height: 1.5;
}

/* ==========================================
   시료 검수 표 - 반복 컬럼 너비 확장 + 정렬 개선
   ========================================== */
.samples-review-table tbody td input.sample-rep,
.samples-review-table tbody td input.sample-no {
    text-align: center;
    min-width: 50px;
}

/* wizard 페인 숨김 (직접 입력 모드용) */
.wizard-steps.hidden,
.wizard-pane.hidden-forced {
    display: none !important;
}
/* ==========================================
   분석항목 표시 토글 모달
   ========================================== */

/* 표/셀 숨김 — 옵션 A의 핵심 */
.col-hidden {
    display: none !important;
}

/* 모달 박스 */
.modal-box.col-vis-box {
    width: 92%;
    max-width: 760px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
}

.col-vis-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* 카테고리 블록 */
.col-vis-category {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 14px;
    background: #f8fafc;
}

.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;
}
.col-vis-cat-header strong {
    font-size: 14px;
    color: #1e293b;
}
.col-vis-cat-header.on strong {
    color: #f97316;
}
.col-vis-count {
    color: #64748b;
    font-size: 11px;
    margin-left: 4px;
}

.col-vis-fields {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 4px;
}

.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;
}
.col-vis-field:hover {
    background: #fff7ed;
}
.col-vis-field.on {
    background: rgba(249, 115, 22, 0.08);
    color: #1e293b;
    font-weight: 500;
}
.col-vis-field input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

.col-vis-cat-toggle {
    cursor: pointer;
    margin: 0;
}
/* ==========================================
   수질 의뢰 - 시료 분석항목 체크박스 그리드
   ========================================== */
.sample-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 4px;
}

.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;
}
.sample-item-chk:hover {
    background: #fff7ed;
}
.sample-item-chk input {
    margin: 0;
    cursor: pointer;
}
/* ==========================================
   수질 입력 페이지 - 입력 표
   ========================================== */
.water-input-table {
    table-layout: fixed;
}
.water-input-table th {
    font-size: 12px;
    line-height: 1.3;
}
.water-input-table th small {
    font-size: 10px;
    color: #94a3b8;
    font-weight: 400;
}
.water-input-table td {
    padding: 4px;
}
.water-cell-input {
    width: 100%;
    padding: 4px 6px;
    font-size: 13px;
    border: 1px solid #cbd5e1;
    border-radius: 3px;
    background: white;
    box-sizing: border-box;
}
.water-cell-input:focus {
    border-color: #f97316;
    outline: 2px solid rgba(249, 115, 22, 0.2);
}
.water-cell-input[type="date"] {
    padding: 3px 4px;
}
/* ==========================================
   수질 입력 - 엑셀 방식 셀
   ========================================== */
.water-input-table th {
    font-size: 12px;
    line-height: 1.3;
    text-align: center;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    padding: 6px 4px;
}
.water-input-table th small {
    font-size: 10px;
    color: #94a3b8;
    font-weight: 400;
    display: block;
    margin-top: 2px;
}
.water-input-table td {
    border: 1px solid #e2e8f0;
    padding: 0;
    height: 32px;
    position: relative;
    font-size: 13px;
}
.water-input-table td.editable {
    cursor: cell;
    background: white;
}
.water-input-table td.editable:hover {
    background: #f8fafc;
}
.water-input-table td.selected {
    outline: 2px solid #f97316;
    outline-offset: -2px;
    background: #fff7ed;
    z-index: 1;
}
.water-input-table td:not(.editable) {
    background: #f8fafc;
    color: #64748b;
}
.water-input-table .cell-view {
    padding: 6px 8px;
    min-height: 18px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.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;
}
/* ==========================================
   수질 입력 - 사진 셀
   ========================================== */
.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;
}
.btn-photo-upload:hover {
    background: #fff7ed;
    border-color: #f97316;
    color: #f97316;
}

.water-photo-cell {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px;
}
.water-photo-label {
    flex: 1;
    font-size: 11px;
    color: #16a34a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}
.btn-photo-view, .btn-photo-delete {
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 3px;
    padding: 3px 6px;
    cursor: pointer;
    font-size: 11px;
    flex-shrink: 0;
}
.btn-photo-view:hover { background: #dbeafe; border-color: #2563eb; }
.btn-photo-delete:hover { background: #fee2e2; border-color: #dc2626; color: #dc2626; }
/* ==========================================
   수질 결과 상세 - 사진 갤러리 (가로 2열)
   ========================================== */
.water-photo-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 8px;
}

.water-photo-slot {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 8px;
    background: white;
    text-align: center;
}
.water-photo-slot.empty {
    background: #f8fafc;
    border-style: dashed;
}
.water-photo-title {
    font-size: 12px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
    text-align: left;
}
.water-photo-slot img.water-detail-photo {
    width: 100%;
    max-height: 280px;
    object-fit: contain;
    cursor: zoom-in;
    border-radius: 4px;
    background: #f8fafc;
}
.water-photo-slot img.water-detail-photo:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.water-photo-noimg {
    padding: 60px 20px;
    color: #94a3b8;
    font-size: 12px;
}
/* ==========================================
   분석 의뢰 등록 모달 - 분석항목 카테고리 그룹
   ========================================== */
.sample-cat-block {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-bottom: 8px;
    background: #fafbfc;
}
.sample-cat-block:last-child {
    margin-bottom: 0;
}

.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;
}
.sample-cat-header strong {
    font-size: 12px;
    color: #475569;
}
.sample-cat-header.some-checked strong { color: #f97316; }
.sample-cat-header.all-checked strong { color: #ea580c; }
.sample-cat-header.all-checked { background: #fff7ed; }

.sample-cat-count {
    color: #94a3b8;
    font-size: 10px;
}

.sample-cat-toggle {
    margin: 0;
    cursor: pointer;
}

.sample-cat-items {
    padding: 6px 8px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 4px;
}


/* === 결과 판정 색상 (실측 vs 기대치 차이) — accum 분석값 셀 === */
.wide-table td.col-value-with-by.res-normal {
    border-left: 3px solid #10b981;   /* 정상 — 초록 */
}
.wide-table td.col-value-with-by.res-warn {
    border-left: 3px solid #f59e0b;   /* 경고 — 노랑 */
    background-color: #fffbeb;
}
.wide-table td.col-value-with-by.res-fail {
    border-left: 3px solid #ef4444;   /* 불량 — 빨강 */
    background-color: #fef2f2;
}

/* === 결과 판정 색상 기준 설정 표 (설정 페이지) === */
.threshold-table-wrap {
    max-height: 460px;
    overflow: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-top: 4px;
}
.threshold-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.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;
}
.threshold-table td {
    padding: 5px 10px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}
.threshold-table td.th-cat {
    font-weight: 700;
    color: #f97316;
    background: #fff7ed;
    border-right: 1px solid #fed7aa;
    white-space: nowrap;
    text-align: center;
}
.threshold-table td.th-item { font-weight: 600; color: #1e293b; }
.threshold-table td.th-unit { color: #94a3b8; text-align: center; }
.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;
}
.threshold-table input.th-warn:focus {
    outline: none;
    border-color: #f59e0b;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}
.threshold-table input.th-fail:focus {
    outline: none;
    border-color: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}
.threshold-table tbody tr:hover { background: #f8fafc; }


/* === 표시 컬럼 순서변경(▲▼) === */
.col-vis-fields { display: flex; flex-direction: column; gap: 3px; }
.col-vis-field { justify-content: space-between; }
.col-vis-field-label { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; cursor: pointer; }
.col-vis-field-label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col-vis-order-btns { display: inline-flex; gap: 2px; flex-shrink: 0; }
.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;
}
.col-vis-move:hover { background: #f97316; color: #fff; border-color: #f97316; }


/* 입력 페이지 순서 고정 안내 (모달) */
.col-vis-note-input {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 6px;
    padding: 8px 10px;
    color: #9a3412;
    margin-top: 6px;
}


/* === 패치노트 게시판 + 버전 배지 === */
.app-version {
    font-size: 10px;
    font-weight: 500;
    color: #64748b;
    margin-left: 4px;
    letter-spacing: 0;
    vertical-align: 1px;
}
.pn-open-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 11px;
    margin-left: 4px;
    padding: 0 2px;
    opacity: 0.55;
    vertical-align: 1px;
}
.pn-open-btn:hover { opacity: 1; }

.modal-box.pn-box {
    width: min(560px, 92vw);
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}
.pn-box .modal-body { overflow-y: auto; }

.pn-form {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 12px;
    background: #f8fafc;
}
.pn-form-row { display: flex; gap: 6px; margin-bottom: 6px; }
.pn-form-row input#pnTitle { flex: 1; }
.pn-form-row input#pnVersion { width: 90px; }
.pn-form input, .pn-form textarea {
    padding: 6px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    box-sizing: border-box;
}
.pn-form textarea { width: 100%; resize: vertical; }
.pn-form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 6px;
}
.pn-form-actions .info-text { font-size: 11px; color: #94a3b8; }

.pn-list { display: flex; flex-direction: column; gap: 8px; }
.pn-empty { color: #94a3b8; text-align: center; padding: 24px 0; font-size: 13px; }
.pn-item {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 12px;
}
.pn-item-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}
.pn-item-title { font-weight: 700; font-size: 13px; color: #1e293b; }
.pn-item-meta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #94a3b8;
    flex-shrink: 0;
}
.pn-item-ver {
    background: #fff7ed;
    color: #ea580c;
    border: 1px solid #fed7aa;
    border-radius: 4px;
    padding: 0 5px;
    font-weight: 700;
}
.pn-item-content { font-size: 12px; color: #475569; line-height: 1.55; white-space: normal; }
.pn-del {
    background: none;
    border: none;
    color: #cbd5e1;
    cursor: pointer;
    font-size: 12px;
    padding: 0 2px;
}
.pn-del:hover { color: #dc2626; }


/* === 습식 vs NIR 비교 탭 === */
.sub-tab-bar {
    display: flex;
    gap: 4px;
    margin-bottom: 14px;
    border-bottom: 2px solid #e2e8f0;
}
.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;
}
.sub-tab:hover { color: #f97316; }
.sub-tab.active {
    color: #ea580c;
    border-bottom-color: #f97316;
}

.nc-hint { font-size: 11px; color: #94a3b8; }

/* 2단 헤더 */
.nc-table thead tr:first-child th { top: 0; height: 26px; }
.nc-table thead tr:last-child th { top: 26px; }
.nc-table th.nc-group-head {
    text-align: center;
    background: #fff7ed;
    color: #9a3412;
    border-right: 2px solid #fed7aa;
}
.nc-table th.nc-sub {
    text-align: center;
    font-size: 10px;
    color: #64748b;
}
.nc-table th.nc-sub-diff {
    color: #ea580c;
    border-right: 2px solid #fed7aa;
}
.nc-table td.nc-val { text-align: right; font-variant-numeric: tabular-nums; }
.nc-table td.nc-diff {
    font-weight: 700;
    border-right: 2px solid #fed7aa;
    background: #fffdf9;
}
.nc-table td.nc-both { color: #16a34a; font-weight: 600; }
.nc-table td.nc-one { color: #dc2626; font-weight: 600; }


/* === 기대치 추가/수정 폼 === */
.exp-form-mode {
    font-size: 11px;
    font-weight: 700;
    color: #ea580c;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 5px;
    padding: 3px 8px;
}
.exp-form-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}
.exp-m { display: flex; flex-direction: column; gap: 3px; }
.exp-m.wide { flex: 1; min-width: 180px; }
.exp-m label { font-size: 11px; font-weight: 600; color: #64748b; }
.exp-m input, .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;
}
.exp-m.wide input { width: 100%; min-width: 0; }
.exp-m input:focus, .exp-m select:focus {
    outline: none;
    border-color: #f97316;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.15);
}

.exp-cat { margin-bottom: 10px; }
.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;
}
.exp-cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 6px 10px;
}
.exp-f { display: flex; align-items: center; gap: 6px; }
.exp-f label {
    font-size: 11px;
    color: #475569;
    width: 74px;
    flex-shrink: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.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;
}
.exp-f input:focus {
    outline: none;
    border-color: #f97316;
    background: #fffbeb;
}

/* 목록의 적용 기간 표시 */
.data-table td.exp-range { color: #1e293b; font-size: 12px; }
.data-table td.exp-range-open { color: #94a3b8; font-size: 12px; font-style: italic; }
/* ===== 서버 통신 표시 (사이드바 제목 옆) ===== */
/* 제목 줄은 폭이 좁다(약 154px). 글자가 붙으면 줄바꿈되므로
   제목 줄에는 그림만 두고, 숫자는 바로 아랫줄 여백에 붙인다. */
.sidebar-title h2 { white-space: nowrap; }
.busy {
    display: none;
    align-items: center;
    gap: 3px;
    margin-left: 5px;
    vertical-align: 1px;
}
.busy.on { display: inline-flex; }
.busy-ani {
    font-size: 12px;
    line-height: 1;
    display: inline-block;
    animation: busyHop .45s ease-in-out infinite alternate;
}
.busy-sec {
    font-size: 9.5px;
    font-weight: 600;
    color: #64748b;
    letter-spacing: 0;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
/* 사이드바 아랫줄(부제)에 붙는 숫자 — 비어 있을 땐 자리를 차지하지 않는다 */
.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) {
    .busy-ani { animation: none; }
}
/* 로그인 화면 — 버튼 오른쪽 안쪽에 표시 */
.login-btn-wrap { position: relative; }
.busy.busy-on-btn {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 0;
    pointer-events: none;
}
.busy.busy-on-btn.on { display: inline-flex; }
.busy.busy-on-btn .busy-ani { font-size: 15px; }
.busy.busy-on-btn .busy-sec { color: rgba(255,255,255,.85); font-size: 10.5px; }
