:root {
  /* 2026-11 리디자인: 차분한 회색 바탕 + 흰 카드 + 파랑 강조 하나 */
  --bg: #f3f5f8;
  --surface: #fff;
  --text: #111;
  --muted: #111;
  /* 비활성 줄(취소·단종·사용 안 함)만 회색 */
  --inactive: #8a94a3;
  --border: #e1e5eb;
  --border-strong: #c9d0da;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #eef4ff;
  --primary-text: #fff;
  --danger: #d92d20;
  --ok-bg: #ecfdf3;
  --ok-border: #abefc6;
  --warn-bg: #fffaeb;
  --warn-border: #fedf89;
  --err-bg: #fef3f2;
  --err-border: #fecdca;
  --row-hover: #f5f8ff;
  --head-bg: #f6f8fb;
  --radius: 8px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, .08);
  /* 글자 크기 단계: 제목 20 / 소제목 16 / 본문·표 14 / 빽빽한 표 13 / 보조 12 */
  --fs-title: 20px;
  --fs-sub: 16px;
  --fs-body: 14px;
  --fs-dense: 13px;
  --fs-small: 12px;
  --control-h: 34px;
  --font: "Pretendard Variable", Pretendard, "Malgun Gothic", "맑은 고딕", "Apple SD Gothic Neo", system-ui, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.45;
  /* 숫자 폭을 고정해 표에서 자릿수가 세로로 맞게 */
  font-variant-numeric: tabular-nums;
  color: var(--text);
  background: var(--bg);
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: var(--fs-title); margin: 0; }
h2 { font-size: var(--fs-sub); margin: 24px 0 8px; }
h3 { font-size: var(--fs-body); margin: 14px 0 6px; }
.container > h1 { margin-bottom: 16px; }
small { font-size: var(--fs-small); }
/* 품번·등록번호: 글꼴은 본문과 같게(한글과 섞여도 고르게), 숫자 폭만 고정 */
.mono { font-family: var(--font); font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.muted { color: var(--muted); }
.danger { color: var(--danger); }
.nowrap { white-space: nowrap; }

.topbar {
  display: flex; align-items: center; gap: 24px;
  padding: 0 20px; height: 48px;
  background: #1f2d3d; color: #fff;
}
.topbar a { color: #cfd8e3; }
.brand { font-weight: bold; color: #fff !important; font-size: var(--fs-sub); }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { padding: 6px 12px; border-radius: 4px; }
.nav a.active, .nav a:hover { background: #33475e; color: #fff; text-decoration: none; }
.user { display: flex; align-items: center; gap: 12px; }
.user form { margin: 0; }
.user .link { color: #cfd8e3; }

.container { max-width: 1680px; margin: 0 auto; padding: 20px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.actions { display: flex; gap: 8px; }

button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-height: var(--control-h); padding: 0 14px; white-space: nowrap; vertical-align: middle;
  border: 1px solid var(--border); border-radius: 4px;
  background: var(--surface); color: var(--text);
  font: inherit; cursor: pointer;
}
button:hover, .button:hover { border-color: #aab3bf; text-decoration: none; }
button.primary, .button.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
button.danger { color: var(--danger); border-color: var(--err-border); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.link { border: 0; background: none; padding: 0; min-height: 0; color: var(--primary); }

input, select, textarea {
  font: inherit; padding: 6px 8px; color: var(--text);
  border: 1px solid var(--border); border-radius: 4px; background: var(--surface);
  vertical-align: middle;
}
input:not([type=checkbox]):not([type=radio]):not([type=file]), select { height: var(--control-h); }
input[type=checkbox], input[type=radio] { width: 15px; height: 15px; margin: 0; accent-color: var(--primary); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(36, 89, 196, .18); }
::placeholder { color: #9aa3ad; font-family: var(--font); font-size: var(--fs-body); }
/* 파일 선택: 다른 버튼과 같은 모양 */
input[type=file] { padding: 0; border: 0; background: none; font-size: var(--fs-body); color: var(--muted); }
input[type=file]::file-selector-button {
  font: inherit; color: var(--text); height: var(--control-h); padding: 0 14px; margin-right: 10px;
  border: 1px solid var(--border); border-radius: 4px; background: var(--surface); cursor: pointer;
}
input[type=file]::file-selector-button:hover { border-color: #aab3bf; }
input[readonly] { background: #eef0f3; }
input.num { text-align: right; }
input.short { width: 80px; }

.notice, .alert, .warn { padding: 10px 14px; border-radius: 4px; margin-bottom: 14px; border: 1px solid; }
.notice { background: var(--ok-bg); border-color: var(--ok-border); }
.alert { background: var(--err-bg); border-color: var(--err-border); }
.warn { background: var(--warn-bg); border-color: var(--warn-border); }

.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.filters input[type=search] { width: 260px; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 4px; }
/* 표: 칸마다 연한 실선, 머리글은 진한 배경 + 아래 굵은 선, 줄무늬, 열 묶음(.gs) 사이 진한 세로선.
   머리글 위치 = 그 열 내용 위치 (숫자 th.num/td.num 오른쪽 · 글자 왼쪽 · .center 가운데).
   바깥 테두리는 감싸는 상자(.table-wrap·.panel)가 그린다. 머리글 고정(sticky)과 선이 같이 움직이도록 separate */
table.grid { --line: #d5dbe3; --line-strong: #8d99a8; --head: #e3e8ef; --zebra: #f6f8fa; --hover: #e4edfb;
  width: 100%; border-collapse: separate; border-spacing: 0; }
.grid th, .grid td { padding: 7px 10px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); text-align: left; vertical-align: middle; }
.grid th:last-child, .grid td:last-child { border-right: 0; }
.grid th { background: var(--head); color: var(--text); font-weight: 600; white-space: nowrap; }
.grid thead th { box-shadow: inset 0 -2px 0 var(--line-strong); }
.grid th.num { text-align: right; }
.grid th.center, .grid td.center { text-align: center; }
/* 열 묶음 머리글 (두 줄 머리글의 윗줄) */
.grid thead tr.grp th { text-align: center; color: #3d4a59; background: #d6dde6; box-shadow: none; height: 26px; padding-top: 3px; padding-bottom: 3px; }
.grid thead tr.grp + tr th { top: 26px; }
/* 두 줄을 차지하는 머리글은 아랫줄 머리글처럼 */
.grid thead tr.grp th[rowspan] { vertical-align: bottom; text-align: left; color: var(--text); background: var(--head); box-shadow: inset 0 -2px 0 var(--line-strong); }
.grid .gs { border-left: 2px solid var(--line-strong); }
.grid tfoot th { border-top: 2px solid var(--line-strong); }
/* 줄무늬·마우스 올린 줄. :where 로 우선순위를 낮춰 상태 줄·칸(완료·오류·긴급 등) 색이 이긴다 */
:where(.grid > tbody > tr:nth-child(even)) > td { background: var(--zebra); }
:where(.grid > tbody > tr:hover) > td { background: var(--hover); }
.grid tr.inactive td { color: var(--inactive); }
.grid .empty { text-align: center; color: var(--muted); padding: 30px; }

.pager { display: flex; gap: 4px; justify-content: center; margin: 16px 0; flex-wrap: wrap; }
.pager a, .pager span { padding: 5px 10px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); }
.pager .current { background: var(--primary); color: #fff; border-color: var(--primary); }

fieldset { border: 1px solid var(--border); border-radius: 4px; background: var(--surface); margin: 0 0 14px; padding: 12px 16px 16px; }
legend { font-weight: 600; padding: 0 6px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 16px; }
.form-grid label, label.wide { display: flex; flex-direction: column; gap: 4px; }
label.wide textarea { width: 100%; }
.req { color: var(--danger); font-style: normal; font-weight: 600; }
.form-grid label > span, .entry-row label > span { font-size: var(--fs-dense); font-weight: 600; color: var(--text); }
.form-grid label > span small, .entry-row label > span small { font-weight: normal; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--danger); background: var(--err-bg); }
small.error { color: var(--danger); }
.form-actions { display: flex; gap: 8px; margin: 14px 0; }
.form-actions form { margin: 0; }
.toggle-active { margin-top: 24px; padding-top: 14px; border-top: 1px dashed var(--border); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 16px 20px; }
.steps { margin: 0 0 14px; padding-left: 20px; line-height: 1.8; }
.upload-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.stats { display: flex; gap: 12px; margin: 14px 0; flex-wrap: wrap; }
.stat { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 10px 16px; min-width: 140px; }
.stat span { display: block; color: var(--muted); font-size: var(--fs-small); margin-bottom: 2px; }
.stat strong { font-size: 22px; }
.stat strong + small { display: inline; margin-left: 4px; }
.stat.bad { border-color: var(--err-border); background: var(--err-bg); }

.badge { padding: 2px 8px; border-radius: 10px; font-size: var(--fs-small); background: var(--head-bg); white-space: nowrap; }
.badge.pending { background: var(--warn-bg); }
.badge.applied { background: var(--ok-bg); }
.badge.discarded { color: var(--muted); }

.changes { margin: 0; padding-left: 16px; }
.changes .from { color: var(--muted); text-decoration: line-through; }
.changes .to { font-weight: 600; }

.login-box, .error-box { max-width: 380px; margin: 60px auto; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 24px 28px; }
.error-box { max-width: 520px; }
.login-box h1 { margin-bottom: 16px; }
.login-box form { display: flex; flex-direction: column; gap: 12px; }
.login-box label { display: flex; flex-direction: column; gap: 4px; }

/* ── 일일입력 ── */
.date-pick { display: flex; align-items: center; gap: 8px; margin: 0; }
.subtabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 16px; }
.subtabs a { padding: 8px 16px; border: 1px solid transparent; border-bottom: 0; border-radius: 4px 4px 0 0; color: var(--muted); }
.subtabs a.active { background: var(--surface); border-color: var(--border); color: var(--text); font-weight: 600; margin-bottom: -2px; border-bottom: 2px solid var(--surface); }
.entry { margin-bottom: 16px; }
.entry-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.entry-row label { display: flex; flex-direction: column; gap: 4px; }
.entry-row label.grow { flex: 1; min-width: 160px; }
.entry-row input.num { width: 100px; }
input.big { font-size: 18px; width: 190px; padding: 6px 10px; font-weight: 600; }
input.big::placeholder { font-size: var(--fs-body); font-weight: normal; }
.lot-info { margin-top: 12px; padding: 10px 12px; background: #f7f9fc; border: 1px dashed var(--border); border-radius: 4px; }
.lot-info .lot-head { margin-bottom: 6px; }
table.mini { border-collapse: collapse; margin-top: 8px; }
table.mini th, table.mini td { border: 1px solid var(--border); padding: 3px 10px; text-align: right; }
table.mini th { background: #eef1f5; font-weight: 600; text-align: center; }
table.mini td.hot { background: var(--warn-bg); font-weight: 600; }
a.stat { color: var(--text); text-decoration: none; }
a.stat:hover { border-color: #aab3bf; }
.stat.selected { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.grid td.num { text-align: right; }
.grid tr.highlight td { background: var(--ok-bg); }
.grid td form { margin: 0; display: inline; }
button.link.danger { color: var(--danger); }
.created-lot { display: flex; align-items: baseline; gap: 14px; padding: 14px 20px; margin-bottom: 16px; background: var(--ok-bg); border: 1px solid var(--ok-border); border-radius: 6px; }
.created-lot strong { font-size: 34px; }

/* 제품 구분 */
.status { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: var(--fs-small); background: var(--head-bg); white-space: nowrap; }
.status-MASS { background: var(--ok-bg); }
.status-DEV { background: #e6efff; }
.status-AS { background: var(--warn-bg); }
.status-EOL { color: var(--muted); }

/* LOT 등록: 제품 마스터 값 표시 */
.kv-row { display: flex; flex-wrap: wrap; gap: 6px 24px; margin-bottom: 6px; }
.kv span { color: var(--muted); font-size: var(--fs-small); margin-right: 6px; }
small.error.block { display: block; margin-top: 6px; }
/* ── LOT 현황판 ── */
.board-filters { gap: 6px; }
.board-filters .wide-search { width: 300px; }
.board-filters .short-text { width: 90px; }
.board-filters .range { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
.board-filters .range input { width: 135px; }
.board-filters .range input.lot-range { width: 90px; }
.hint { font-size: var(--fs-small); }
kbd { border: 1px solid var(--border); border-radius: 3px; padding: 0 4px; font-family: var(--font); font-size: var(--fs-small); background: var(--surface); }
.board-wrap { max-height: 70vh; overflow: auto; }
table.board { font-size: var(--fs-dense); }
/* 넓은 표는 한 줄로 (넘치면 가로 스크롤), 긴 글 칸(.wrap)만 줄바꿈 */
table.board td, table.stock td, table.dev-list td, table.parts td, table.defects td, table.hours-week td, table.errors td { white-space: nowrap; }
.grid td.wrap { white-space: normal; min-width: 160px; max-width: 320px; }
table.board td.wrap { white-space: pre-wrap; }
table.board th { position: sticky; top: 0; z-index: 2; }
table.board th a.sort { color: inherit; }
table.board th a.sort.active { color: var(--primary); }
table.board td, table.board th { padding: 4px 6px; }
table.board .sticky-col { position: sticky; left: 0; z-index: 1; background: var(--surface); }
table.board thead .sticky-col { z-index: 3; background: var(--head); }
table.board tbody .sticky-col { box-shadow: inset -1px 0 0 var(--line); }
table.board > tbody > tr:nth-child(even) > td.sticky-col { background: var(--zebra); }
table.board > tbody > tr:hover > td.sticky-col { background: var(--hover); }
table.board td.wrap { min-width: 140px; max-width: 260px; }
table.board td.stage { text-align: center; white-space: nowrap; min-width: 62px; }
table.board td.stage.na { color: #c3c9d1; background: #fafbfc; }
table.board td.st-done { color: #1d6b34; }
table.board td.st-partial .partial { color: #a36500; font-weight: 600; }
table.board td.st-partial small { color: var(--muted); }
table.board tr.done td { background: #f4faf5; }
table.board td.cell.editing { padding: 0; }
table.board .cell-input { width: 100%; min-width: 80px; border: 0; border-radius: 0; padding: 4px 6px; font: inherit; background: #fffbe6; }
table.board tr.saved td { animation: saved-flash 0.9s ease-out; }
@keyframes saved-flash { from { background: var(--ok-bg); } to { background: transparent; } }
table.board td.pos { color: var(--muted); }
table.board td form { margin: 0; }

/* 재고현황판 */
table.stock td.num, table.stock th.num { text-align: right; min-width: 64px; }
table.stock td.strong { font-weight: 600; }
table.stock .neg { color: var(--danger); font-weight: 600; }
/* 구매품 현황: 입력 카드 나란히, LOT 상태 */
.card-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(480px, 100%), 1fr)); gap: 16px; margin-bottom: 16px; }
.card-row > .card { margin: 0; }
.lot-waiting { color: #5b6470; border-color: #cfd5dc; background: #f4f6f8; }
.lot-partial { color: #8a4b00; border-color: #f0c98a; background: #fff4e0; }
.lot-ready { color: #0b6b5c; border-color: #a7dccf; background: #eaf8f4; }
.lot-used { color: #8a929b; border-color: #e1e5ea; background: #fafbfc; }
/* 마이너스 재고(보정 필요) */
.neg-panel { border-color: #efb4ab; }
.neg-panel .panel-head { background: #fdeeeb; }
.neg-panel .neg, .subtabs .neg { color: var(--danger); font-weight: 600; }
table.stock tfoot th { position: sticky; bottom: 0; background: #eef1f5; }
.card-title { margin: 0 0 10px; font-size: var(--fs-sub); }

/* LOT 분할 */
table.board tr.split-child td:first-child a::before { content: '↳ '; color: var(--muted); }
table.board td.stage.inherited { color: #9aa3ad; background: #fafbfc; font-style: italic; }
.split-note { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 8px; background: var(--warn-bg); font-size: var(--fs-small); }

/* 상단 메뉴: 관리자 | 공정 탭, 관리자 하위 메뉴 */
.nav-sep { width: 1px; background: #40546b; margin: 8px 6px; }
.adminbar { display: flex; gap: 2px; padding: 0 20px; background: #e9eef4; border-bottom: 1px solid var(--border); }
.adminbar a { padding: 8px 14px; color: var(--text); border-bottom: 2px solid transparent; }
.bar-sep { width: 1px; background: #c6d0db; margin: 9px 8px; }
.adminbar a.active { border-bottom-color: var(--primary); color: var(--primary); font-weight: 600; }
.adminbar a:hover { text-decoration: none; background: #dde5ee; }
.short-text-w { width: 140px; }
table.board td.st-closed { color: #9aa3ad; text-decoration: line-through; }
.grid td.strong { font-weight: 600; }

/* 작업지시서 */
/* 날짜 지남·임박: 진한 바탕 대신 옅은 바탕 + 진한 글씨 (화면이 빨갛게 덮이지 않게) */
.dday-late { color: #b42318; background: #fdecea; font-weight: 700; text-align: center; }
.dday-soon { background: #fff4dc; color: #8a5a00; font-weight: 600; text-align: center; }
table.board tr.prep td { color: var(--muted); }
table.board tr.prep td.strong { color: var(--text); }
/* 긴급 칸은 회색 줄(선행 준비)에서도 흰 글자 */
table.board tr.prep td.dday-late, .grid td.dday-late, .grid td.dday-late small { color: #b42318; }
table.board tr.short td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
@media print {
  .topbar, .adminbar, .subtabs, .filters, .stats, .pager, .date-pick { display: none !important; }
  .board-wrap { max-height: none; overflow: visible; }
  body { background: #fff; }
}
table.wo .neg { color: var(--danger); }
/* 등록번호: LOT 하나에 한 줄 (공정이동표와 맞춰 보기) */
table.wo td.lot-list { white-space: nowrap; }
table.wo td.lot-list .lot-qty { display: inline-block; min-width: 2.5em; text-align: right; color: var(--muted); }
table.wo td.lot-list .lot-qty::after { content: '개'; }
.print-title { display: none; }
@media print { .print-title { display: block; margin-bottom: 6px; } table.wo { font-size: 10px; } }

/* 근무시간 */
.hours-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.hours-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
table.hours input[type="time"] { width: 132px; }
table.hours input.wide { width: 100%; min-width: 180px; }
table.hours td.center, table.hours-week th { text-align: center; }
table.hours-week th:nth-child(2) { text-align: left; }
table.hours tfoot td { font-weight: 600; }
table.hours tfoot td.right { text-align: right; }
.grid tr.row-error td { background: var(--err-bg); }
.field-error { color: var(--danger); font-size: var(--fs-small); font-weight: normal; }
table.hours-week .today { background: #eef4ff; }
table.hours-week th.weekend { color: var(--danger); }
form.inline { display: inline; }

/* 개발/초도품 */
.form-grid .span2 { grid-column: span 2; }
.form-grid .span-all { grid-column: 1 / -1; }
.form-grid fieldset { border: 1px solid var(--border); border-radius: 4px; padding: 10px 14px; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 12px; }
.plan-grid label { display: flex; flex-direction: column; gap: 4px; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: var(--fs-small); font-weight: 600; border: 1px solid; vertical-align: middle; white-space: nowrap; }
.tag-dev { color: #5b3cc4; border-color: #c9bdf2; background: #f4f0ff; }
.tag-first { color: #0b6b5c; border-color: #a7dccf; background: #eaf8f4; }
/* 품목 유형: 하위자재·구매품 */
.type-PART { color: #1d5fa8; border-color: #b3cdee; background: #eef5fd; }
.type-BUY { color: #7a5a00; border-color: #e6d08a; background: #fdf8e6; }
.check-col { width: 28px; text-align: center; }
.consume-warn { color: #a32b1c; font-size: var(--fs-small); }
[data-types][hidden] { display: none !important; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px 16px; margin: 0 0 14px; }
.facts dt { color: var(--muted); font-size: var(--fs-small); }
.facts dd { margin: 2px 0 0; }
.card.memo { white-space: pre-wrap; margin-bottom: 14px; }
.grid td.ok { background: var(--ok-bg); }
.grid td.na { background: repeating-linear-gradient(45deg, #f3f3f3, #f3f3f3 4px, #e9e9e9 4px, #e9e9e9 8px); color: var(--muted); }
.grid td.center { text-align: center; }
table.schedule th { white-space: nowrap; }
table.parts { font-size: var(--fs-dense); }
table.parts td { padding: 5px 6px; }
table.parts input[type="date"] { width: 124px; height: 30px; padding: 2px 4px; font-size: var(--fs-dense); }
.parts-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.inline-upload { display: inline-flex; gap: 6px; align-items: center; }

/* 불량내역 */
.defect-form .card { margin-bottom: 14px; }
.defect-form h2 { margin-top: 0; font-size: var(--fs-sub); }
.inline-label { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
table.defects td.title-cell { min-width: 220px; }
/* 불량 처리상태 (제품 구분 .status 와 별도) */
.state { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: var(--fs-small); font-weight: 600; border: 1px solid; white-space: nowrap; vertical-align: middle; }
.state-open { color: #b42318; border-color: var(--err-border); background: var(--err-bg); }
.state-in_progress { color: #8a5a00; border-color: var(--warn-border); background: var(--warn-bg); }
.state-done { color: #1d6b35; border-color: var(--ok-border); background: var(--ok-bg); }
.pre { white-space: pre-wrap; line-height: 1.6; }
.gallery { display: flex; flex-wrap: wrap; gap: 12px; }
.gallery figure { margin: 0; width: 220px; }
.gallery img { width: 220px; height: 165px; object-fit: cover; border: 1px solid var(--border); border-radius: 4px; display: block; }
.gallery figcaption { font-size: var(--fs-small); margin-top: 4px; word-break: break-all; }
.file-icon { display: flex; width: 220px; height: 165px; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 4px; font-weight: 700; color: var(--muted); background: var(--surface); text-decoration: none; }
.file-list { list-style: none; padding: 0; margin: 0 0 10px; display: flex; flex-direction: column; gap: 6px; }
.file-list li { display: flex; align-items: center; gap: 8px; }
.thumb { width: 64px; height: 48px; object-fit: cover; border: 1px solid var(--border); border-radius: 3px; }
.inline-details { display: inline-block; font-size: var(--fs-small); } .inline-details summary { cursor: pointer; color: var(--muted); }
/* 입력칸이 있는 표: 글자와 입력칸 높이를 가운데로 맞춤 */
table.hours td, table.parts td, table.crew td { vertical-align: middle; }

/* BOM */
input.wide-code { width: 240px; }
table.bom-direct td, table.bom-tree td { vertical-align: middle; white-space: nowrap; }
table.bom-direct input:not(.short) { width: 100%; min-width: 160px; }
table.bom-tree tr.lv1 td { background: #f7f9fc; font-weight: 600; }
table.bom-tree tr.lv1 td a { font-weight: 600; }
table.parts tr.top td:not(.na):not(.ok) { background: #f7f9fc; font-weight: 600; }
.part-add { margin-bottom: 12px; }
.part-add textarea { width: 100%; min-height: 34px; }
table.parts input.seq { width: 56px; }

/* 패널: 제목 줄 + 내용이 한 테두리 안에 (제품 상세 등) */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; margin-bottom: 16px; overflow: hidden; }
.panel-head { display: flex; align-items: baseline; gap: 10px; padding: 12px 20px; border-bottom: 1px solid var(--border); background: #fafbfc; }
.panel-head h2 { margin: 0; font-size: var(--fs-sub); }
.panel-body { padding: 16px 20px; }
.panel-body .facts { margin: 0; }
.panel-body .alert { margin-bottom: 12px; }
.panel-table { overflow-x: auto; }
.panel-body + .panel-table { border-top: 1px solid var(--border); }
.panel-table table.grid tbody tr:last-child td { border-bottom: 0; }
.panel .empty-note { margin: 0; }

/* 안전재고 가상 발주 */
.tag-safety { color: #8a4b00; border-color: #f0c98a; background: #fff4e0; }
table.board tr.virtual td:first-child { box-shadow: inset 3px 0 0 #f0a640; }

/* 외주업체·제작처 */
.check-row { display: flex; gap: 16px; flex-wrap: wrap; padding: 4px 0; }
.maker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 16px; }
.maker-grid label { display: flex; flex-direction: column; gap: 4px; }
.maker-grid label.na select { background: #f3f3f3; color: var(--muted); }
.maker-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px 16px; margin: 0; }
.maker-list dt { color: var(--muted); font-size: var(--fs-small); }
.maker-list dd { margin: 2px 0 0; }
.maker-list .na dd { color: #b8bfc8; }

/* BOM (표준품번 기준) */
input.tiny { width: 72px; }
.panel-foot { padding: 12px 20px; border-top: 1px solid var(--border); }
.panel-foot summary { cursor: pointer; font-weight: 600; color: var(--primary); }
.panel-foot .entry-row { margin-top: 12px; }
table.bom-tree td.wrap { min-width: 160px; }

/* BOM 접기·펼치기 */
.bom-toggle { min-height: 0; width: 20px; height: 20px; padding: 0; margin-right: 4px; border: 1px solid var(--border); border-radius: 3px; font-size: 11px; line-height: 1; color: var(--muted); }
.bom-toggle:hover { color: var(--primary); border-color: var(--primary); }
.bom-toggle-gap { display: inline-block; width: 24px; }
.bom-levels { display: flex; gap: 4px; padding: 8px 20px; flex-wrap: wrap; }
.bom-levels button { min-height: 28px; padding: 0 10px; font-size: var(--fs-dense); }
.bom-levels button.on { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.grid tr.bom-detail > td { background: #fafbfc; padding: 8px 12px 12px; }
.grid tr.bom-detail .bom-levels { padding: 0 0 8px; }

/* 확정+소요 */
.plan-firm { color: var(--primary); font-weight: 600; }
.plan-net { color: #8a4b00; }
table.plan td, table.plan th { padding: 3px 6px; }
table.plan td.num { min-width: 46px; text-align: right; }
table.plan th { min-width: 46px; text-align: center; }
table.plan td.sticky-col, table.plan th.sticky-col { text-align: left; }
table.plan .plan-weekend { background: #f6f7f9; }
table.plan .plan-past { background: #fff6f4; }
table.plan .neg { color: var(--danger); }

/* 외주 */
.po-bar { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-bottom: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 4px; flex-wrap: wrap; }
.po-bar .grow { flex: 1 1 240px; }
table.needs input.num { width: 76px; }
table.needs input[type="date"] { width: 132px; }
table.needs input.po-note { width: 140px; }
table.needs tr.late td { background: #fff6f4; }
.tag-late { color: #a32b1c; border-color: #efb4ab; background: #fdeeeb; }
.tag-manual { color: #5b3cc4; border-color: #c9bdf2; background: #f4f0ff; }
table.needs tr.manual td { background: #faf8ff; }
table.needs input.po-code { width: 150px; }
table.needs input.po-name { width: 150px; }
.badge.po-open { color: #8a4b00; background: #fff4e0; }
.badge.po-partial { color: #1b5fb0; background: #e8f1fc; }
.badge.po-done { color: #1d6b34; background: #e6f4ea; }
.badge.po-cancelled { color: var(--inactive); background: #eef1f5; }

/* 작업지시서(작업자용): 글씨 한 단계 크게, 줄 간격 넉넉히, 작업할 수량 강조, 긴급 줄 전체 배경 */
table.grid.wo { font-size: 15px; }
table.grid.wo td, table.grid.wo th { padding: 7px 8px; }
table.grid.wo thead th.key-head { background: #c9d9f7; color: #0f2f73; }
table.grid.wo tbody tr td.key { background: #e8f0ff; font-size: 17px; font-weight: 700; color: #0f2f73; }
/* 긴급 줄: 줄 전체를 칠하지 않고 아주 옅은 바탕 + 맨 왼쪽 칸에 색 띠 (멀리서도 보이되 덜 자극적으로) */
table.grid.wo tbody tr.urgent-late td { background: #fff6f5; }
table.grid.wo tbody tr.urgent-soon td { background: #fffbf0; }
table.grid.wo tbody tr.urgent-late td:first-child { box-shadow: inset 4px 0 0 #f04438; }
table.grid.wo tbody tr.urgent-soon td:first-child { box-shadow: inset 4px 0 0 #f5a524; }
table.grid.wo tbody tr.urgent-late td.key, table.grid.wo tbody tr.urgent-soon td.key { background: #e8f0ff; }
table.grid.wo tbody tr td.dday-late { background: #fdecea; color: #b42318; }
table.grid.wo tbody tr td.dday-soon { background: #fff4dc; color: #8a5a00; }
@media print {
  table.grid.wo { font-size: 10px; }
  table.grid.wo tbody tr td.key { font-size: 11px; }
  :where(.grid > tbody > tr:nth-child(even)) > td { background: none; }
}

/* HiSRM 반영 시각 배지: 오늘 반영 = 차분하게, 오늘 반영 없음 = 주황 경고 */
.stamps { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 10px; }
.stamp { display: inline-block; padding: 3px 10px; border-radius: 4px; border: 1px solid var(--line); background: var(--head); font-weight: 600; font-size: var(--fs-small); }
.stamp-stale, .stamp-none { background: var(--warn-bg); border-color: var(--warn-border); color: #8a5a00; }

/* 앞 공정 실적 누락: 뒤 공정은 입력됐는데 이 공정 실적이 없음 (관리자 확인) */
table.board td.st-missing { background: var(--warn-bg); }
.missing { color: #b42318; font-weight: 600; }
table.mini td.missing { background: var(--err-bg); }
.skip-note { margin: 8px 0 0; }
.count-badge { display: inline-block; min-width: 18px; padding: 0 6px; margin-left: 4px; border-radius: 9px; background: #b42318; color: #fff; font-size: var(--fs-small); font-weight: 700; text-align: center; line-height: 18px; }
/* AS */
.count-badge.count-info { background: #2557a7; }
.warn-text { color: #8a5a00; font-weight: 600; margin-left: 4px; }
.tag-as { color: #1d4f91; border-color: #a9c2ea; background: #edf3fc; }
.tag-special { color: #8a2a6b; border-color: #e0a9cf; background: #fbeef7; }
/* 개발/초도품 품질팀 검사 */
.insp-line { margin-top: 3px; }
.insp { display: inline-block; padding: 0 7px; border-radius: 9px; font-size: var(--fs-small); font-weight: 600; border: 1px solid; line-height: 18px; min-height: 0; cursor: default; white-space: nowrap; }
button.insp { cursor: pointer; }
.insp-PASS { color: #0b6b3a; border-color: #9fd8b5; background: #e9f7ef; }
.insp-FAIL { color: #b42318; border-color: #f5b8b0; background: #fdecea; }
.insp-none { color: var(--muted); border-color: var(--line, #ccd3dd); border-style: dashed; background: transparent; font-weight: 400; }
.insp-fail-text { color: #b42318; font-weight: 600; }
.insp-dialog { border: 1px solid var(--line, #ccd3dd); border-radius: 8px; padding: 18px 22px; min-width: 360px; }
.insp-dialog::backdrop { background: rgba(15, 23, 42, 0.35); }
.insp-dialog h3 { margin: 0 0 10px; }
.insp-dialog label.block { display: flex; align-items: center; gap: 8px; margin: 10px 0; }
.insp-dialog label.block span { min-width: 48px; color: var(--muted); }
.insp-dialog input.wide { flex: 1; }
.insp-results { display: flex; gap: 10px; margin: 10px 0; }
.insp-choice { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px; border-radius: 6px; border: 1px solid; font-weight: 600; cursor: pointer; }
.insp-choice.insp-FAIL { background: #fdeeeb; color: #a32b1c; border-color: #efb4ab; }
.insp-dialog .actions { display: flex; gap: 8px; margin-top: 12px; }
.insp-dialog .small-note { font-size: var(--fs-small); margin: 6px 0 0; }
#insp-cancel { margin-top: 10px; text-align: right; }

/* 제품 이미지 */
.item-images { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.item-images li { width: 180px; border: 1px solid var(--line); border-radius: 6px; padding: 6px; background: var(--surface); }
.item-images li.primary { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.item-images img { display: block; width: 100%; height: 140px; object-fit: contain; background: var(--head); border-radius: 4px; }
.item-images .img-meta { display: flex; gap: 4px; align-items: center; margin-top: 6px; font-size: var(--fs-small); min-width: 0; }
.item-images .img-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-images .img-actions { display: flex; gap: 6px; margin-top: 6px; }
.item-images .img-actions button { padding: 2px 8px; font-size: var(--fs-small); }
.tag-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.img-upload { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.has-img { display: inline-flex; vertical-align: -2px; margin-left: 2px; color: #7b8494; }
.has-img:hover { color: var(--primary); }
.has-img svg { fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linejoin: round; stroke-linecap: round; }

/* 화면 위 창 (public/js/modal.js): 제품·LOT·실적·BOM 줄·개발/초도품·업체 등록 */
dialog.app-modal { width: min(920px, 96vw); max-height: 92vh; padding: 0; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 12px 40px rgba(0, 0, 0, .25); display: flex; flex-direction: column; }
dialog.app-modal:not([open]) { display: none; }
dialog.app-modal.wide { width: min(1180px, 96vw); }
dialog.app-modal::backdrop { background: rgba(15, 23, 42, .45); }
.app-modal .modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--head); }
.app-modal .modal-head h2 { margin: 0; font-size: 1.1rem; }
.app-modal .modal-head .actions { display: flex; gap: 12px; align-items: center; }
.app-modal .modal-x { font-size: 1.4rem; line-height: 1; padding: 2px 10px; }
.app-modal .modal-body { overflow: auto; padding: 12px 16px 0; }
.app-modal .form-actions { position: sticky; bottom: 0; background: var(--surface); padding: 10px 0; margin: 0; border-top: 1px solid var(--line); }
.app-modal .modal-loading { padding: 40px; text-align: center; color: var(--muted); }
.app-modal .modal-body > .page-head, .app-modal .modal-body > h1, .app-modal .page-back { display: none; }
.app-modal .modal-body > .card, .app-modal .modal-body > form.card { box-shadow: none; border: 0; padding: 0; margin: 0; }
.app-modal .modal-body > :last-child { margin-bottom: 12px; }
.app-modal .modal-body form:not(.item-form) .form-actions { position: static; border-top: 0; }
/* 창에서 저장한 뒤 다시 불러온 화면의 알림 (잠깐 떴다 사라짐) */
.notice-float { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); z-index: 1000; box-shadow: 0 6px 20px rgba(0, 0, 0, .18); transition: opacity .6s; }
.notice-float.hide { opacity: 0; }

/* 작업지시서: 등록번호(LOT) 기준, 발주 하나 = 한 줄 (LOT 첫 줄은 굵게·위 굵은 선) */
table.grid.wo.wo-lots { font-size: 14px; }
table.grid.wo.wo-lots td, table.grid.wo.wo-lots th { padding: 3px 6px; line-height: 1.35; }
table.grid.wo.wo-lots tbody tr td.key { font-size: 15px; }
table.grid.wo.wo-lots td.dday-late, table.grid.wo.wo-lots td.dday-soon { font-size: 13px; }
table.wo-lots tbody tr.lot-top td { border-top: 2px solid #8a94a6; font-weight: 600; }
table.wo-lots tbody tr.lot-sub td { border-top: 1px dotted var(--line); font-weight: 400; }
table.wo-lots tbody tr.lot-sub .lot-label, table.wo-lots tbody tr.lot-sub td.mono, table.wo-lots tbody tr.lot-sub td.item-name { color: var(--muted); }
table.wo-lots tbody tr.lot-sub[hidden] { display: none; }
table.wo-lots td.item-name { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
table.grid.wo.wo-lots button.wo-toggle { border: 0; background: none; padding: 0; margin: 0; width: 1.1em; height: auto; min-height: 0; font-size: 13px; line-height: 1; vertical-align: baseline; box-shadow: none; cursor: pointer; color: var(--primary); }
table.wo-lots .wo-toggle-gap { display: inline-block; width: 1.1em; }
table.wo-lots tr.lot-top:not(.collapsed) .wo-more { display: none; }
/* 긴급 줄 색은 LOT 첫 줄만 (나머지 줄은 긴급여부 칸만) */
table.grid.wo.wo-lots tbody tr.lot-sub td { background: var(--surface); }
table.grid.wo.wo-lots tbody tr.lot-sub td.dday-late { background: #fdecea; color: #b42318; }
table.grid.wo.wo-lots tbody tr.lot-sub td.dday-soon { background: #fff4dc; color: #8a5a00; }
.wo-toggle-all { display: inline-flex; gap: 4px; }
.wo-count { margin: 4px 0; }
@media print {
  .wo-toggle { display: none; }
  table.wo-lots td, table.wo-lots th { padding: 1px 4px; }
}

/* 작업지시서 '사진/불량' 칸과 창 (process/itemInfo.ejs) */
table.wo-lots td.info-cell a { font-weight: 400; }
table.wo-lots td.info-cell a.info-defect-link { color: var(--muted); }
table.wo-lots td.info-cell a.info-defect-link.has { color: var(--danger); font-weight: 700; }
.item-info { display: grid; grid-template-columns: minmax(240px, 2fr) 3fr; gap: 16px; align-items: start; }
@media (max-width: 760px) { .item-info { grid-template-columns: 1fr; } }
.item-info h2 { font-size: 1rem; margin: 0 0 8px; }
.info-photo img { display: block; width: 100%; max-height: 60vh; object-fit: contain; background: var(--head); border: 1px solid var(--line); border-radius: 6px; }
.defect-card { border: 1px solid var(--line); border-left: 4px solid var(--danger); border-radius: 6px; padding: 8px 12px; margin-bottom: 10px; background: var(--surface); }
.defect-card header { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; margin-bottom: 6px; }
.defect-card header strong { font-size: 1.02rem; }
.defect-card dl { margin: 0; display: grid; gap: 4px; }
.defect-card dl > div { display: grid; grid-template-columns: 7.5em 1fr; gap: 8px; }
.defect-card dt { color: var(--muted); font-size: var(--fs-small); padding-top: 2px; }
.defect-card dd { margin: 0; white-space: pre-wrap; }
.defect-card .action dd { font-weight: 600; color: #0f2f73; }
.defect-card .status-pill { margin-left: auto; font-size: var(--fs-small); padding: 1px 8px; border-radius: 10px; background: var(--head); }
.defect-card .status-pill.st-OPEN { background: #fde5e1; color: #a32b1c; }
.defect-card .status-pill.st-IN_PROGRESS { background: #fff3dc; color: #8a5a00; }
.defect-card .status-pill.st-DONE { background: #e6f4ea; color: #1d6b34; }
.defect-photos { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.defect-photos img { width: 110px; height: 82px; object-fit: cover; border: 1px solid var(--line); border-radius: 4px; }
.app-modal .modal-body > h1 + .item-info, .app-modal .item-info { margin-top: 4px; }

/* 요청사항 (공정 탭 게시판 · 모아보기) */
.nav-badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; line-height: 17px; text-align: center; }
.req-cat { display: inline-block; padding: 1px 8px; border-radius: 4px; font-size: var(--fs-small); font-weight: 600; background: var(--head); }
.req-cat.cat-CONSUMABLE { background: #e8f0ff; color: #0f2f73; }
.req-cat.cat-PURCHASE { background: #efe8fb; color: #4b2a85; }
.req-cat.cat-IMPROVE { background: #e6f4ea; color: #1d6b34; }
.req-status { display: inline-block; padding: 1px 9px; border-radius: 10px; font-size: var(--fs-small); font-weight: 600; background: var(--head); color: var(--muted); }
.req-status.st-OPEN { background: #fde5e1; color: #a32b1c; }
.req-status.st-IN_PROGRESS { background: #fff3dc; color: #8a5a00; }
.req-status.st-DONE { background: #e6f4ea; color: #1d6b34; }
.req-status.st-REJECTED { background: #eef1f5; color: #4a5462; }
.req-urgent-tag { background: #fdecea; color: #b42318; border-color: #f5b8b0; font-weight: 700; }
table.req-list tr.req-urgent td:first-child { box-shadow: inset 4px 0 0 var(--danger); }
table.req-list a.req-title { font-weight: 600; }
.req-form .req-urgent-check { align-self: end; }
.req-form fieldset { margin: 10px 0; }
.req-form > label.wide { display: block; margin-top: 10px; }
.req-form > label.wide > span { display: block; font-weight: 600; font-size: var(--fs-dense); margin-bottom: 4px; }
.req-form textarea { width: 100%; }
.req-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 10px; }
.req-facts { margin: 0 0 10px; }
.req-content { white-space: pre-wrap; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; margin-bottom: 10px; }
.req-photos { margin-bottom: 12px; }
.req-status-form { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin: 12px 0; padding: 10px 12px; }
.req-status-choices { display: flex; flex-wrap: wrap; gap: 6px; }
.req-status-choice { padding: 3px 10px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; }
.req-status-choice.current { opacity: .55; cursor: default; }
.req-status-form .req-note { flex: 1 1 260px; min-width: 200px; }
.req-timeline h2 { font-size: 1rem; margin: 14px 0 6px; }
.req-timeline ul { list-style: none; padding: 0; margin: 0 0 8px; }
.req-timeline li { padding: 6px 10px; border-left: 3px solid var(--line); margin-bottom: 6px; background: var(--surface); }
.req-timeline li.by-admin { border-left-color: var(--primary); }
.req-timeline li.tl-status, .req-timeline li.tl-cancel { background: var(--head); font-size: var(--fs-small); }
.req-timeline .tl-meta { font-size: var(--fs-small); margin-bottom: 2px; }
.req-timeline .tl-body { white-space: pre-wrap; }
.req-comment-form { display: flex; gap: 8px; align-items: flex-end; }
.req-comment-form textarea { flex: 1; }

/* ── 사용자 관리 · 권한 ── */
.user .user-name { color: #e6ecf3; }
.user .user-name:hover { text-decoration: underline; }
.readonly-note { margin: 0 0 12px; padding: 6px 12px; border: 1px solid #e6d3a3; background: #fff8e6; border-radius: 4px; font-size: var(--fs-dense); color: #6b5310; }
form.readonly-form button[disabled] { cursor: not-allowed; }
.user-form .perm-template { border: 1px solid var(--border); border-radius: 4px; padding: 8px 14px 10px; margin: 14px 0; }
.perm-template legend { font-weight: 600; font-size: var(--fs-dense); padding: 0 4px; }
.perm-template-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 4px; }
.perm-template-tabs { display: inline-flex; flex-wrap: wrap; gap: 4px 12px; }
.perm-template-tabs[hidden] { display: none; }
.perm-grid { margin-top: 12px; }
.perm-table { width: auto; min-width: 520px; }
.perm-table th.perm-group { text-align: left; vertical-align: top; white-space: nowrap; background: var(--head-bg); min-width: 130px; }
.perm-table tr.perm-first > * { border-top: 2px solid var(--border); }
.perm-bulk { display: flex; flex-wrap: wrap; gap: 2px 8px; margin-top: 4px; font-weight: normal; font-size: var(--fs-small); }
.perm-proc button.link { font-size: var(--fs-small); }
.perm-sub { margin: 18px 0 6px; font-size: var(--fs-sub); }
td.seg { white-space: nowrap; text-align: center; padding: 3px 6px; }
td.seg label, td.seg .seg-none { display: inline-block; margin: 0 1px; }
td.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
td.seg label span { display: inline-block; min-width: 38px; padding: 2px 6px; border: 1px solid var(--border); border-radius: 3px; cursor: pointer; font-size: var(--fs-small); color: var(--muted); background: #fff; }
td.seg .seg-none { min-width: 38px; color: #c3c9d1; font-size: var(--fs-small); }
td.seg input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 1px; }
td.seg .seg-0 input:checked + span { background: #eef0f3; color: #3e4a57; border-color: #b9c1cb; font-weight: 600; }
td.seg .seg-1 input:checked + span { background: #e6efff; color: #1d4aa8; border-color: #9fbcf0; font-weight: 600; }
td.seg .seg-2 input:checked + span { background: var(--ok-bg); color: #1d6b34; border-color: #94cfa3; font-weight: 600; }
td.seg input:disabled + span { cursor: default; }

/* ── 확정조립서열 (호기별 단품) ── */
.seq-table tbody[data-seq-hogi] > tr.seq-part { display: none; }
.seq-table tbody[data-seq-hogi].open > tr.seq-part { display: table-row; }
.seq-table tbody[data-seq-hogi] > tr.seq-head > * { border-top: 2px solid var(--border); }
.seq-table tr.seq-part td { background: #fafbfd; font-size: var(--fs-dense); }
.seq-table tr.seq-part td.seq-indent { border-left: 3px solid #c9d6ea; }
.seq-toggle { min-width: 24px; padding: 0 4px; border: 0; background: none; box-shadow: none; color: var(--muted); font-size: 16px; line-height: 1; cursor: pointer; }
.seq-toggle:hover { color: var(--text, #222); background: #e9eef6; }
.seq-toggle::before { content: '▸'; }
tbody[data-seq-hogi].open .seq-toggle::before { content: '▾'; }
.seq-parts-brief { color: var(--muted); font-size: var(--fs-small); }
.tag-special { color: #7a2d8f; border-color: #d6b1e2; background: #f8eefc; }
.seq-src { font-size: var(--fs-small); color: var(--muted); }
.seq-model { margin-bottom: 14px; }
.seq-model h3 { margin: 0 0 6px; font-size: var(--fs-sub); }
.tag-logi { color: #1f5f8b; border-color: #a9cbe6; background: #eaf4fc; }
tr.warn-row > td { background: #fff8e6; }

/* 화면별 사용법: 상단 [사용법] 버튼 + 매뉴얼 본문 (views/manual) */
.user .manual-btn { color: #fff; background: #2f6fb3; border-radius: 4px; padding: 3px 10px; font-weight: 600; }
.user .manual-btn:hover { background: #3b82cc; text-decoration: none; }
.manual { max-width: 860px; line-height: 1.65; }
.manual .lead { font-size: 1.05em; margin: 0 0 14px; padding: 10px 14px; background: #f2f6fb; border-left: 4px solid #2f6fb3; border-radius: 4px; }
.manual h3 { margin: 22px 0 8px; font-size: var(--fs-sub); border-bottom: 1px solid var(--border); padding-bottom: 4px; }
.manual ol, .manual ul { margin: 6px 0 10px; padding-left: 22px; }
.manual li { margin: 3px 0; }
.manual dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 6px 0 10px; }
.manual dt { font-weight: 600; white-space: nowrap; }
.manual dd { margin: 0; }
.manual .tip { background: #fff8e6; border: 1px solid #f0d9a4; border-radius: 4px; padding: 8px 12px; margin: 10px 0; }
.manual details { margin: 14px 0; border: 1px solid var(--border); border-radius: 4px; padding: 6px 12px; }
.manual details summary { cursor: pointer; font-weight: 600; }
.manual kbd { border: 1px solid #b9c2cf; border-bottom-width: 2px; border-radius: 3px; padding: 0 5px; font-size: .9em; background: #fafbfc; }
.manual .btn-like { display: inline-block; border: 1px solid #b9c2cf; border-radius: 3px; padding: 0 6px; background: #f4f6f9; font-size: .92em; }

/* 구매 → 입고 일정: 품번마다 필요 / 입고 예정 / 예상 재고 세 줄 */
table.sched tr.sched-need > td { border-top: 2px solid var(--line-strong, #8d99a8); }
table.sched tr.sched-proj > td { background: #f7f9fc; }


/* ═══════════════════════════════════════════════════════════════════
   2026-11 리디자인 (최신 UI): 아래가 위 규칙을 덮어쓴다
   - 표: 화면 최대 폭으로 꽉 채움, 품명·내용 같은 긴 글 칸은 줄바꿈 허용 (public/js/app.js 가 .col-fill 지정)
   - 가로줄·세로줄 모두 연하게, 열 묶음(.gs) 구분선은 조금 진하게
   ═══════════════════════════════════════════════════════════════════ */
body { letter-spacing: -0.01em; -webkit-font-smoothing: antialiased; }
h1 { font-weight: 700; letter-spacing: -0.02em; }
h2 { font-weight: 700; letter-spacing: -0.01em; }

/* 상단 메뉴 */
.topbar { background: #101828; height: 52px; gap: 20px; box-shadow: 0 1px 0 rgba(255, 255, 255, .04); }
.topbar a { color: #c4cad4; }
.brand { letter-spacing: .02em; }
.nav { gap: 2px; }
.nav a { padding: 7px 12px; border-radius: var(--radius-sm); font-weight: 500; }
.nav a.active { background: rgba(255, 255, 255, .12); color: #fff; }
.nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav-sep { background: #344054; margin: 12px 6px; }
.user .user-name { color: #e4e7ec; font-weight: 500; }
.adminbar { background: var(--surface); border-bottom: 1px solid var(--border); padding: 0 20px; gap: 0; }
.adminbar a { padding: 11px 14px; color: var(--text); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.adminbar a:hover { background: none; color: var(--text); }
.adminbar a.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.bar-sep { background: var(--border); margin: 12px 8px; }

/* 하위 탭: 밑줄형 */
.subtabs { gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.subtabs a { padding: 10px 14px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; margin-bottom: -1px; color: var(--text); font-weight: 500; white-space: nowrap; }
.subtabs a:hover { color: var(--text); text-decoration: none; }
.subtabs a.active { background: none; border: 0; border-bottom: 2px solid var(--primary); color: var(--primary); font-weight: 600; margin-bottom: -1px; }

.container { padding: 22px 24px 40px; }
.page-head { margin-bottom: 14px; }

/* 버튼·입력 */
button, .button { border-radius: var(--radius-sm); border-color: var(--border-strong); font-weight: 500; box-shadow: var(--shadow); transition: background-color .12s, border-color .12s, color .12s; }
button:hover, .button:hover { background: #f9fafb; border-color: #98a2b3; }
button.primary, .button.primary { background: var(--primary); border-color: var(--primary); }
button.primary:hover, .button.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
button.link { box-shadow: none; font-weight: 400; }
button.link:hover { background: none; text-decoration: underline; }
button.small { min-height: 28px; padding: 0 10px; font-size: var(--fs-dense); }
input, select, textarea { border-radius: var(--radius-sm); border-color: var(--border-strong); }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); }
input[readonly] { background: #f2f4f7; }
input[type=file]::file-selector-button { border-radius: var(--radius-sm); border-color: var(--border-strong); }

/* 알림 */
.notice, .alert, .warn { border-radius: var(--radius); padding: 10px 14px; }
.notice { color: #05603a; }
.alert { color: #912018; }
.warn { color: #93370d; }

/* 카드·패널·숫자 칸 */
.card, .panel, fieldset { border-radius: 10px; border-color: var(--border); box-shadow: var(--shadow); }
.panel-head { background: var(--surface); padding: 12px 18px; }
.panel-body { padding: 16px 18px; }
.panel-foot { padding: 12px 18px; }
.stats { gap: 10px; }
.stat { border-radius: 10px; border-color: var(--border); box-shadow: var(--shadow); padding: 11px 16px; min-width: 150px; }
.stat span { color: var(--text); font-weight: 500; }
.stat strong { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
a.stat:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.stat.selected { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary), var(--shadow); background: var(--primary-soft); }
.stat.bad { border-color: var(--err-border); background: var(--err-bg); }
.stat.bad strong { color: #b42318; }

/* 태그·상태·배지: 테두리 없는 알약 */
.tag, .status, .badge { border-radius: 999px; padding: 2px 9px; font-weight: 600; font-size: var(--fs-small); line-height: 1.5; }
.tag { border-color: transparent !important; }
.stamp { border-radius: 999px; padding: 3px 11px; }
.pager a, .pager span { border-radius: var(--radius-sm); min-width: 34px; text-align: center; }

/* 표 */
.table-wrap { border-radius: 10px; border-color: var(--border); box-shadow: var(--shadow); }
table.grid { --line: #edf0f4; --line-strong: #d0d5dd; --head: #f6f8fb; --zebra: #fbfcfd; --hover: #f2f6ff; }
.grid th, .grid td { padding: 8px 12px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
/* 맨 오른쪽 칸은 상자 테두리와 겹치므로 세로줄 없음 */
.grid tr > :last-child { border-right: 0; }
.grid td { white-space: nowrap; }
.grid th { color: var(--text); font-weight: 600; font-size: var(--fs-dense); background: var(--head); }
.grid thead th { box-shadow: inset 0 -1px 0 var(--line-strong); }
.grid thead tr.grp th { background: #eef1f6; color: var(--text); font-size: var(--fs-small); }
.grid thead tr.grp th[rowspan] { box-shadow: inset 0 -1px 0 var(--line-strong); }
.grid .gs { border-left: 1px solid var(--line-strong); }
.grid tfoot th { border-top: 1px solid var(--line-strong); }
/* 표 폭 = 화면 최대 폭 (내용이 짧아도 꽉 채움). 남는 폭은 칸 내용 길이에 비례해 나눠 가짐, 화면보다 넓으면 가로 스크롤 */
table.grid { width: 100%; }
table.grid.perm-table { width: auto; }
.table-wrap, .board-wrap { width: auto; max-width: 100%; }
/* 품명·내용·메모 같은 긴 글 칸: 줄바꿈 허용 */
.grid td.col-fill { white-space: normal; min-width: 120px; }
/* 긴 글 칸 */
.grid td.wrap { white-space: normal; min-width: 160px; max-width: 420px; }
table.board td, table.board th { padding: 6px 10px; }
.board-wrap { max-height: 72vh; }
/* 일반 표도 머리글 고정 (표 상자가 스크롤될 때) */
.table-wrap > table.grid thead th { position: sticky; top: 0; z-index: 2; }

/* 창 */
dialog.app-modal { border-radius: 14px; border-color: var(--border); box-shadow: 0 24px 48px rgba(16, 24, 40, .18); }

/* 로그인 */
.login-box, .error-box { border-radius: 14px; box-shadow: var(--shadow-md); border-color: var(--border); }

/* 작은 화면: 여백 줄이기 */
@media (max-width: 760px) {
  .container { padding: 14px 12px 32px; }
  .topbar { padding: 0 12px; gap: 10px; overflow-x: auto; }
  .adminbar { padding: 0 8px; overflow-x: auto; }
  .stat { min-width: 120px; }
  .filters input[type=search] { width: 100%; }
}

/* 업로드 줄: 제목 폭을 맞춰 버튼이 세로로 줄 서게 */
.upload-form > strong:first-child { min-width: 190px; }
.upload-form input[type=file] { min-width: 260px; }

/* 공정별 제작 유의사항 */
.stage-notes { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.stage-note { display: flex; gap: 10px; align-items: flex-start; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.stage-note.kind-CHECK { border-color: #fda29b; background: #fff8f7; }
.stage-note .note-body { flex: 1; min-width: 0; }
.stage-note .note-content { white-space: pre-wrap; word-break: break-word; }
.stage-note .note-actions { display: flex; gap: 6px; align-items: center; }
.stage-note .note-actions form { margin: 0; }
.tag.note-kind-CHECK { background: #fee4e2; color: #b42318; white-space: nowrap; }
.tag.note-kind-NOTE { background: #fef0c7; color: #93370d; white-space: nowrap; }
.note-photos { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.note-photos img { width: 96px; height: 72px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.note-photos.edit { gap: 12px; }
.note-photo-pick { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
h3.note-stage { margin: 12px 0 6px; font-size: var(--fs-body); }
h3.note-stage:first-child { margin-top: 0; }
.note-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.note-add textarea { flex: 1 1 320px; min-height: 34px; }
.note-add small { flex-basis: 100%; }
.info-notes { margin-bottom: 16px; }
.worklog-notes { margin-top: 10px; }
.worklog-notes > strong { display: block; margin-bottom: 6px; }
a.note-badge { display: inline-block; padding: 1px 8px; border-radius: 999px; background: #fef0c7; color: #93370d; font-weight: 600; font-size: var(--fs-small); text-decoration: none; }
a.note-badge.check { background: #fee4e2; color: #b42318; }
/* 발주현황·포털 불량내역 칸 (공정 탭과 같은 표시) */
.grid a.info-defect-link { color: var(--inactive); }
.grid a.info-defect-link.has { color: var(--danger); font-weight: 700; }
/* 외주 클레임 상태 */
.badge.claim-PENDING { background: #f2f4f7; color: #475467; }
.badge.claim-NOTIFIED { background: #fef0c7; color: #93370d; }
.badge.claim-IN_PROGRESS { background: #eef4ff; color: #1d4ed8; }
.badge.claim-CLOSED { background: #ecfdf3; color: #05603a; }
.claim-vendors { margin: 0 0 14px; }
.claim-vendors > summary { cursor: pointer; font-weight: 600; margin-bottom: 8px; }
.claim-card { margin-bottom: 12px; }
.tag.tag-warn { background: #fef0c7; color: #93370d; }
/* 창 안에서는 하위 탭을 숨긴다 (본문만) */
.app-modal .modal-body > .subtabs, .app-modal .modal-body > nav.subtabs { display: none; }

/* 창(modal) 본문: 회색 바탕 위 흰 카드로 구역을 나눈다 (구역 테두리·제목 밑줄) */
.app-modal .modal-body { background: var(--bg); padding: 14px 16px 2px; }
.app-modal .modal-body > .card, .app-modal .modal-body > form > .card, .app-modal .modal-body > form.card, .app-modal .modal-body > section.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px 18px; margin: 0 0 12px; box-shadow: var(--shadow);
}
.app-modal .modal-body .card > h2 { font-size: 15px; margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.app-modal .modal-body .card > h3 { font-size: 14px; margin: 14px 0 6px; }
.app-modal .modal-body > dl.facts { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 18px; margin: 0 0 12px; box-shadow: var(--shadow); }
.app-modal .facts dt { font-weight: 600; font-size: var(--fs-small); color: #475467; }
.app-modal .facts dd { font-size: 14px; }
.app-modal .modal-body .pre { background: #f9fafb; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 12px; }
.app-modal .modal-body > h2 { font-size: 15px; margin: 4px 0 8px; }
.app-modal .modal-body > p.muted { margin: 0 0 12px; }
/* 창 제목줄에 이미 제목이 있으므로 본문 제목(h1)만 숨기고, 수정·취소 같은 버튼은 보인다 */
.app-modal .modal-body > .page-head { display: flex; justify-content: flex-end; margin: 0 0 10px; }
.app-modal .modal-body > .page-head > h1 { display: none; }
.app-modal .modal-body > .page-head:not(:has(> :not(h1))) { display: none; }
/* 테스트 서버 표시 띠 (APP_ENV_LABEL) */
.env-bar { background: #fde68a; color: #78350f; text-align: center; font-weight: 700; font-size: var(--fs-dense); padding: 4px 12px; }
.lock-box { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.lock-box form { margin: 0; }

/* ── 표 머리글 필터 (colfilter.js) ── */
/* 버튼은 머리글 칸 오른쪽 끝. 오른쪽 여백(30px)은 버튼이 붙기 전부터 똑같이 잡아 두고 버튼은 그 여백 위에 놓는다
   → 버튼이 붙어도 칸 크기가 전혀 안 바뀜 (표가 커지며 붙는 느낌 없음). 표마다 다른 머리글 여백보다 우선하도록 !important */
table.grid[data-colfilter] thead tr:last-child th:not([data-cf-off]),
table.grid[data-colfilter] thead th[rowspan]:not([data-cf-off]) { padding-right: 28px !important; white-space: nowrap; }
.grid th.cf-th > .cf-btn { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); margin: 0; }
/* 필터 버튼: 테두리 없는 작은 아이콘 (공통 버튼 모양·최소 높이를 모두 지움 → 어떤 표 머리글에서도 안 튀어나옴) */
button.cf-btn, button.cf-btn:hover { min-height: 0; height: 18px; width: 18px; padding: 0; margin: 0; border: 0; border-radius: 3px; box-shadow: none; background: transparent; color: #98a2b3; font-size: 11px; font-weight: 400; line-height: 18px; }
button.cf-btn:hover { background: rgba(16, 24, 40, .08); color: var(--text); }
/* 필터 걸린 열: 아이콘 파랑 + 머리글 칸 옅은 파랑 / 정렬한 열: ▲▼ 파랑 */
button.cf-btn.active, button.cf-btn.sorted { color: var(--primary); font-weight: 700; }
table.grid thead th.cf-filtered { background: #dce8fb; }
/* 필터 표는 다 받고 필터를 붙인 뒤 한 번에 보임 (colfilterEarly.js) — 받는 동안 열 폭이 출렁이는 것을 안 보이게 */
.cf-loading table[data-colfilter]:not([data-cf-on]) { visibility: hidden; }

tr.cf-hidden { display: none; }
/* 다른 페이지 줄 (300줄씩). 필터가 붙기 전에도 301번째 줄부터는 그리지 않음 → 줄이 많은 화면도 빨리 열림 */
tr.cf-off { display: none; }
table[data-colfilter]:not([data-cf-on]) > tbody > tr:nth-child(n+301) { display: none; }
.cf-pager[hidden] { display: none; }
.cf-pager small { align-self: center; margin-left: 8px; }
.cf-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 6px 0; padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--primary-soft); font-size: 13px; }
.cf-bar[hidden] { display: none; }
.cf-bar .cf-desc { color: var(--text); }
.cf-bar .cf-none { color: var(--danger); font-weight: 600; }
.cf-bar button { padding: 2px 10px; font-size: 13px; }
.cf-pop { position: fixed; z-index: 1000; width: 270px; padding: 6px 8px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); box-shadow: 0 6px 24px rgba(0, 0, 0, .18); font-size: 14px; }
.cf-pop hr { border: 0; border-top: 1px solid var(--border); margin: 4px 0; }
.cf-pop .cf-sort { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 3px 6px; border-radius: 3px; cursor: pointer; }
.cf-pop .cf-sort:hover:not(:disabled) { background: var(--row-hover); }
.cf-pop .cf-sort.on { color: var(--primary); font-weight: 700; }
.cf-pop .cf-sort:disabled { color: var(--muted); cursor: default; }
.cf-pop .cf-cond { display: flex; gap: 4px; margin-bottom: 4px; }
.cf-pop .cf-cond select { flex: 0 0 auto; }
.cf-pop .cf-cond input { flex: 1 1 0; min-width: 0; }
.cf-pop .cf-search { width: 100%; box-sizing: border-box; margin-bottom: 4px; }
.cf-pop .cf-list { max-height: 220px; overflow: auto; border: 1px solid var(--border); border-radius: 3px; padding: 4px 6px; }
.cf-pop .cf-list label { display: block; padding: 1px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.cf-pop .cf-list label.cf-all { border-bottom: 1px solid var(--border); margin-bottom: 2px; padding-bottom: 4px; }
.cf-pop .cf-list p { margin: 4px 0; font-size: 12px; }
.cf-pop .cf-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 6px; }
.row-cap { margin: 6px 0; }
/* 인쇄는 페이지와 상관없이 걸러진 줄 전부 */
@media print { .cf-btn, .cf-bar button, .cf-pager { display: none !important; } tr.cf-off { display: table-row !important; } }

/* 상세 정보 칸(dl.facts): 칸마다 연한 구분선 (표처럼). 바깥 테두리 하나 + 칸 오른쪽·아래 선, 가장자리 선은 겹치지 않게 1px 당겨서 가림 */
.facts { gap: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface); }
.facts > div { padding: 8px 12px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); margin: 0 -1px -1px 0; min-width: 0; }
.facts dt { color: var(--muted); font-size: var(--fs-small); }
.facts dd { margin: 3px 0 0; overflow-wrap: anywhere; }
.app-modal .modal-body > dl.facts { padding: 0; }
.facts > div.wide { grid-column: span 2; }
/* 제품 제작처(공정별 업체·단가·작업자)도 상세 정보 칸과 같은 구분선 */
.maker-list { gap: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface); }
.maker-list > div { padding: 8px 12px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); margin: 0 -1px -1px 0; min-width: 0; }
.maker-list dd { margin-top: 3px; }
.nav-badge.nav-badge-info { background: var(--primary); }

/* ── 개발/초도품 ── */
/* 목록: 프로젝트명 앞 ▸ 펼치기, 펼친 줄 = 단품 목록 */
table.dev-list button.dev-toggle { border: 0; background: none; box-shadow: none; padding: 0 2px; margin: 0; min-height: 0; height: auto; font-size: 13px; line-height: 1; color: var(--primary); cursor: pointer; }
table.dev-list button.dev-toggle:disabled { color: #c4cad3; cursor: default; opacity: 1; }
table.dev-list tr.dev-parts-row > td { background: #f7f9fc; padding: 8px 12px 12px 34px; }
.dev-panel { border: 1px solid var(--border); border-radius: 8px; background: var(--surface); overflow: hidden; }
.dev-panel-head { display: flex; justify-content: space-between; align-items: center; padding: 6px 12px; border-bottom: 1px solid var(--border); background: #fafbfc; font-size: var(--fs-dense); }
.dev-panel table.grid { margin: 0; }
.dev-panel-loading { padding: 8px 0; }
/* 단품 표: 공정 칸 ✓완료일 · 검사, 사진은 맨 오른쪽 */
table.dev-parts td.stage-done { color: #0b6b3a; font-weight: 600; }
table.dev-parts td.stage-na { color: #c4cad3; background: #fafbfc; }
.insp-mini { display: inline-block; padding: 0 5px; border-radius: 8px; font-size: 11px; font-weight: 600; line-height: 16px; border: 1px solid; }
.insp-mini.insp-PASS { color: #0b6b3a; border-color: #9fd8b5; background: #e9f7ef; }
.insp-mini.insp-FAIL { color: #b42318; border-color: #f5b8b0; background: #fdecea; }
table.dev-parts td.photo-cell { padding: 4px 8px; width: 84px; }
.part-photo { display: block; width: 72px; height: 54px; object-fit: cover; border-radius: 4px; border: 1px solid var(--border); background: #f2f4f7; margin: 0 auto; }
.no-photo { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; color: #b42318; background: #fdecea; white-space: nowrap; }
/* 상세: 일정 한 칸에 계획·완료·진행·검사 */
table.dev-schedule td.sched-cell { vertical-align: top; padding: 8px 6px; line-height: 1.45; }
table.dev-schedule .sched-plan { font-size: var(--fs-small); color: var(--muted); }
table.dev-schedule .sched-plan.late { color: #b42318; font-weight: 700; }
table.dev-schedule .sched-main { font-weight: 600; }
table.dev-schedule td.sched-done .sched-main { color: #0b6b3a; }
.facts > div.wide-all { grid-column: 1 / -1; }
.pre-wrap { white-space: pre-wrap; }
details.history-panel > summary { cursor: pointer; list-style: none; }
details.history-panel > summary::-webkit-details-marker { display: none; }
details.history-panel > summary h2::before { content: '▸ '; color: var(--muted); }
details.history-panel[open] > summary h2::before { content: '▾ '; }
details.history-panel:not([open]) > summary { border-bottom: 0; }
.panel-head .actions { margin-left: auto; display: flex; gap: 6px; }
/* 단품 입력 창 */
.part-date-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px 14px; margin: 10px 0; }
.part-date-grid label span { display: block; font-size: var(--fs-small); color: var(--muted); margin-bottom: 2px; }
/* 개발 단품 ↔ 등록번호 연동: 자동 완료일 칸은 파란 밑줄, 입력 창에서는 읽기만 */
table.dev-parts td.stage-auto { box-shadow: inset 0 -2px 0 #9db8e8; }
table.dev-parts .dev-lot-nos { color: #2f5fb3; font-family: inherit; }
.part-date-grid .auto-date output { display: flex; align-items: center; min-height: var(--control-h); padding: 0 10px; border: 1px dashed #9db8e8; border-radius: 6px; background: #f3f7fe; }
.tag.tag-auto { color: #2f5fb3; border-color: #9db8e8; background: #f3f7fe; font-weight: 500; }
table.dev-lot-table { width: auto; margin: 6px 0 4px; }
.dev-lot-sub { margin: 12px 0 2px; font-size: var(--fs-base, 14px); }
.insp-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.insp-row input[name=note] { flex: 1 1 140px; min-width: 120px; }
.form-stack { display: flex; flex-direction: column; gap: 10px; }
.form-stack textarea { width: 100%; box-sizing: border-box; }
.danger-zone { text-align: right; }
/* 단품 입력 창의 검사 줄: 합격·불합격을 작은 버튼 크기로 한 줄에 */
.insp-row .insp-choice { display: inline-flex; align-items: center; gap: 4px; width: auto; flex: 0 0 auto; padding: 3px 10px; margin: 0; border-radius: 14px; font-size: var(--fs-dense); }
.part-dates label.block { display: flex; align-items: center; gap: 8px; }
.part-dates input.seq { width: 80px; }
table.grid.insp-table td { white-space: normal; }
.insp-row input[name=note] { flex: 1 1 100px; min-width: 90px; }
/* 사진 창 */
.photo-viewer { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.photo-main { max-width: 100%; max-height: 70vh; object-fit: contain; border: 1px solid var(--border); border-radius: 8px; background: #f2f4f7; }
.photo-thumbs { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
button.photo-thumb { padding: 0; min-height: 0; width: 76px; height: 58px; border: 2px solid transparent; border-radius: 6px; background: none; box-shadow: none; overflow: hidden; }
button.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
button.photo-thumb.on { border-color: var(--primary); }

/* ── 작업지시서 인쇄 (현장용, A4 세로) ──
   걸러진 줄만, 다른 페이지 줄도 모두. 현위치·유의/사진/불량 칸과 화면 장식은 빼고 글자는 읽기 좋게 */
.print-only { display: none; }
@page { size: A4 portrait; margin: 10mm 8mm 12mm; @bottom-center { content: counter(page) " / " counter(pages); font-size: 9pt; color: #555; } }
@media print {
  .print-only { display: inline; }
  .no-print, .cf-bar, .row-cap, .manual-btn, .env-bar, .notice { display: none !important; }
  body:has(table.wo) .page-head, body:has(table.wo) .stamps { display: none !important; }
  .container { max-width: none; padding: 0; }
  .print-title { display: block; margin: 0 0 4mm; padding-bottom: 2mm; border-bottom: 2px solid #000; }
  .print-title-main { display: flex; justify-content: space-between; align-items: baseline; font-size: 15pt; }
  .print-title-main .print-date { font-size: 10pt; font-weight: 400; }
  .print-title-sub { font-size: 9.5pt; margin-top: 1mm; }
  .table-wrap, .board-wrap { overflow: visible !important; max-height: none !important; border: 0; box-shadow: none; }
  table.grid.wo { width: 100%; font-size: 8.5pt; border: 1px solid #000; }
  table.grid.wo th, table.grid.wo td { padding: 0.9mm 1.2mm !important; border-color: #888 !important; position: static !important; }
  table.grid.wo thead th { white-space: normal; }
  /* 인쇄에는 필터 버튼이 없으므로 버튼 자리(오른쪽 여백)도 뺀다 */
  table.grid[data-colfilter] thead tr:last-child th, table.grid[data-colfilter] thead th[rowspan] { padding-right: 1.2mm !important; white-space: normal !important; }
  table.grid.wo td.col-fill { min-width: 0; }
  /* 줄바꿈은 자재명·납품처만 (날짜·번호는 한 줄) */
  table.grid.wo td.item-name, table.grid.wo td.cust-cell { white-space: normal !important; }
  table.grid.wo .tag { font-size: 7.5pt; padding: 0 3px; }
  /* 발주 줄(딸린 줄)은 등록번호·자재번호·자재명을 다시 쓰지 않음 (첫 줄에만) */
  table.grid.wo tbody tr.lot-sub td:nth-child(2) *, table.grid.wo tbody tr.lot-sub td:nth-child(3), table.grid.wo tbody tr.lot-sub td:nth-child(4) { visibility: hidden; }
  table.grid.wo thead th { background: #e8e8e8 !important; color: #000; box-shadow: none; padding-right: 1.5mm !important; }
  table.grid.wo thead { display: table-header-group; }
  table.grid.wo tr { break-inside: avoid; }
  table.grid.wo tbody tr.lot-top td { border-top: 1px solid #000 !important; font-weight: 600; }
  table.grid.wo tbody tr.lot-sub td { font-weight: 400; color: #333; }
  table.grid.wo td.item-name { max-width: 40mm; }
  table.grid.wo tbody tr td.key { font-size: 10pt; background: none !important; color: #000; }
  /* 긴급 표시는 인쇄에도 (왼쪽 띠·긴급 칸 색) */
  table.grid.wo, table.grid.wo * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  table.grid.wo tbody tr.urgent-late td, table.grid.wo tbody tr.urgent-soon td { background: none; }
  .print-note { font-weight: 700; margin-right: 1mm; }
}

/* ── 라인 공정 작업일지 (로딩 / 언로딩) ── */
.line-mode { display: flex; gap: 8px; margin-bottom: 10px; }
.line-mode-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 18px; border: 1px solid var(--border-strong); border-radius: 8px; cursor: pointer; font-weight: 700; font-size: 15px; background: var(--surface); }
.line-mode-btn small { font-weight: 400; color: var(--muted); }
.line-mode-btn:has(input:checked) { background: var(--primary); border-color: var(--primary); color: #fff; }
.line-mode-btn:has(input:checked) small { color: #dbe6fb; }
#line-form.mode-load .for-unload, #line-form.mode-unload .for-load { display: none; }
.check-label .check { display: inline-flex; align-items: center; gap: 4px; height: var(--control-h); font-weight: 600; }
.kv-hl strong { color: var(--primary); }
.kv-warn strong { color: #b54708; }
.line-now { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 12px; margin: 12px 0; }
.line-now .panel { margin: 0; }
.tag.line-LOAD { color: #1d4ed8; border-color: #bfd3fb; background: #eef4ff; }
.tag.line-UNLOAD { color: #0b6b3a; border-color: #9fd8b5; background: #e9f7ef; }
.tag.line-rework { color: #b54708; border-color: #f7c98b; background: #fff4e5; }
.rework-num { color: #b54708; font-weight: 700; }
.stat.warn-stat strong { color: #b54708; }

/* 작업일지 불량유형 설정 */
.defect-type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.defect-type-grid textarea { width: 100%; box-sizing: border-box; font: inherit; }
/* 작업일지 불량사유 빠른 선택 */
.chip-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; max-width: 520px; }
button.chip { min-height: 0; padding: 2px 10px; border-radius: 12px; font-size: var(--fs-dense); font-weight: 600; background: #f2f4f7; border: 1px solid var(--border); box-shadow: none; }
button.chip:hover { background: #fdecea; border-color: #f5b8b0; color: #b42318; }
button.chip.on { background: #b42318; border-color: #b42318; color: #fff; }
button.chip[hidden] { display: none; }

/* ── 작업지시서 인쇄 머리 (엑셀 참고): 회사 이름·결재란·큰 제목·날짜 / 표는 화면 표 그대로, 한 줄 글로 낮게 ── */
@media print {
  .print-title.wo-print-head { border-bottom: 0; padding: 0; margin-bottom: 2mm; color: #000; }
  .wo-print-top { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 1px solid #000; padding-bottom: 1mm; }
  .wo-print-company { font-size: 15pt; font-weight: 800; padding: 3mm 1mm; }
  table.wo-sign { border-collapse: collapse; font-size: 8pt; }
  table.wo-sign th, table.wo-sign td { border: 1px solid #000; width: 15mm; text-align: center; font-weight: 400; padding: 0.4mm; background: none; }
  table.wo-sign td { height: 10mm; }
  table.wo-sign th.wo-sign-label { width: 6mm; line-height: 1.5; }
  .wo-print-title { text-align: center; font-size: 19pt; font-weight: 800; letter-spacing: 1px; padding: 1.5mm 0 0; }
  .wo-print-date { text-align: center; font-size: 11pt; font-weight: 700; padding: 0.5mm 0 1mm; border-bottom: 1.5px solid #000; }
  .wo-print-head .print-title-sub { font-size: 8pt; margin-top: 1mm; color: #333; }
  /* 행 높이: 한 줄 글, 좁은 여백 */
  table.grid.wo th, table.grid.wo td { padding: 0.6mm 1.2mm !important; line-height: 1.25; border-color: #555 !important; }
  table.grid.wo td.item-name, table.grid.wo td.cust-cell { white-space: nowrap !important; overflow: hidden; text-overflow: ellipsis; }
  table.grid.wo td.item-name { max-width: 44mm; }
  table.grid.wo td.cust-cell { max-width: 30mm; }
  table.grid.wo thead th { background: #d9e1f2 !important; font-weight: 800; text-align: center; }
  table.grid.wo .wo-toggle, table.grid.wo .wo-toggle-gap { display: none; }
  /* 필터 버튼 자리(오른쪽 28px)는 인쇄에서 빼고, 머리글은 한 줄로 */
  table.grid.wo[data-colfilter] thead th, table.grid.wo[data-colfilter] thead tr:last-child th:not([data-cf-off]) { padding-right: 1.2mm !important; white-space: nowrap !important; font-size: 8pt; }
  table.grid.wo.wo-lots { font-size: 8.5pt; }
  table.grid.wo.wo-lots tbody tr td.key { font-size: 9.5pt; }
  table.grid.wo.wo-lots td.dday-late, table.grid.wo.wo-lots td.dday-soon, table.grid.wo.wo-lots small { font-size: 8pt; }
  /* 접어 둔 발주 줄은 다른 페이지 줄이어도 인쇄하지 않음 */
  table.grid.wo tbody tr[hidden] { display: none !important; }
  /* 긴급여부(D-day) 칸 색은 인쇄에도 */
  table.grid.wo tbody tr td.dday-late { background: #fdecea !important; color: #b42318; }
  table.grid.wo tbody tr td.dday-soon { background: #fff4dc !important; color: #8a5a00; }
}

/* ── 작업일지 일괄 입력 (구글시트처럼 등록번호만 쭉) ── */
.wl-batch { padding: 12px 14px; }
.wl-batch-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.wl-batch-head h2 { margin: 0; }
.wl-batch-help { font-size: var(--fs-dense); }
.wl-batch-help kbd, .wl-batch kbd { font: inherit; font-size: 12px; padding: 0 5px; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 4px; background: var(--surface); }
.wl-batch-drafts { padding: 8px 12px; border-radius: 6px; margin-bottom: 8px; background: #fff4e5; border: 1px solid #f7c98b; }
.wl-batch-drafts a { font-weight: 600; }
.wl-batch-msg { padding: 8px 12px; border-radius: 6px; margin-bottom: 8px; border: 1px solid var(--border); }
.wl-batch-msg.notice { background: #e9f7ef; border-color: #9fd8b5; }
.wl-batch-msg.warn { background: #fff4e5; border-color: #f7c98b; }
.wl-batch-msg.alert { background: #fdecea; border-color: #f5b8b0; color: #b42318; }
.wl-batch-msg .wl-splits { margin-top: 4px; }
.wl-batch-msg .wl-splits ul { margin: 2px 0 0; padding-left: 20px; }
.wl-grid-wrap { max-height: 62vh; overflow: auto; }
table.grid.wl-grid { font-size: var(--fs-dense); }
table.grid.wl-grid thead th { position: sticky; top: 0; z-index: 1; white-space: nowrap; }
table.grid.wl-grid td { padding: 0; height: 30px; vertical-align: middle; }
table.grid.wl-grid td.wl-no { padding: 0 6px; color: var(--muted); width: 32px; }
table.grid.wl-grid td input, table.grid.wl-grid td select { width: 100%; box-sizing: border-box; height: 30px; min-height: 0; border: 0; border-radius: 0; background: transparent; padding: 0 6px; font: inherit; box-shadow: none; }
table.grid.wl-grid td input:focus, table.grid.wl-grid td select:focus { outline: 2px solid var(--primary); outline-offset: -2px; background: #fff; }
table.grid.wl-grid td input[readonly] { color: var(--muted); }
table.grid.wl-grid td input.num { text-align: right; }
table.grid.wl-grid td.wl-kind { width: 76px; }
table.grid.wl-grid td.wl-lot { width: 96px; }
table.grid.wl-grid td.wl-lot input { font-weight: 700; }
table.grid.wl-grid td.wl-code { width: 130px; }
table.grid.wl-grid td.wl-name { padding: 0 6px; min-width: 120px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.grid.wl-grid td.wl-wait { padding: 0 6px; width: 64px; color: var(--muted); }
table.grid.wl-grid td.wl-vendor, table.grid.wl-grid td.wl-inbound { padding: 0 6px; white-space: nowrap; }
table.grid.wl-grid td.wl-worker { width: 96px; }
table.grid.wl-grid td.wl-qty { width: 64px; }
table.grid.wl-grid td.wl-reason { width: 130px; }
table.grid.wl-grid td.wl-note { min-width: 110px; }
table.grid.wl-grid td.wl-status { padding: 0 6px; min-width: 180px; font-size: 12px; line-height: 1.3; }
table.grid.wl-grid td.wl-del { width: 26px; text-align: center; }
table.grid.wl-grid button.wl-x { color: #98a2b3 !important; padding: 0 4px; min-height: 0; }
table.grid.wl-grid button.wl-x:hover { color: #b42318 !important; }
table.grid.wl-grid tr.wl-error td { background: #fff3f2; }
table.grid.wl-grid tr.wl-error td.wl-status .danger { font-weight: 600; }
table.grid.wl-grid tr.wl-is-record td { background: #f7f7f2; }
table.grid.wl-grid tr.wl-is-record.wl-error td { background: #fff3f2; }
table.grid.wl-grid .ok-mark { color: #0b6b3a; font-weight: 800; }
table.grid.wl-grid .warn-text { color: #b54708; font-weight: 600; }
table.grid.wl-grid .note-badge { color: #b54708; cursor: help; }
.tag.wl-tag-record { color: #5b5b4a; border-color: #d6d6c2; background: #f3f3e6; }
.wl-batch-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.wl-batch-foot .grow { flex: 1; }
.wl-batch-sum { display: inline-flex; gap: 12px; font-size: var(--fs-dense); font-weight: 600; }
.wl-batch-note { font-size: 12px; margin: 8px 0 0; line-height: 1.6; }
.wl-batch.saving { opacity: 0.6; pointer-events: none; }
/* 라인 공정 일괄 입력: 색상·라인 안·재도장 칸, 구분에 따라 꺼진 칸 */
table.grid.wl-grid td.wl-color { padding: 0 6px; white-space: nowrap; max-width: 90px; overflow: hidden; text-overflow: ellipsis; }
table.grid.wl-grid td.wl-inline { padding: 0 6px; width: 56px; white-space: nowrap; }
table.grid.wl-grid td.wl-rw { width: 44px; text-align: center; }
table.grid.wl-grid td.wl-rw input { width: auto; height: auto; }
table.grid.wl-grid td input:disabled { background: repeating-linear-gradient(135deg, #f4f5f7 0 6px, #eceef1 6px 7px); color: transparent; cursor: not-allowed; }
table.grid.wl-grid .tag.line-rework { font-size: 11px; padding: 0 4px; }

/* ── LOT 상세(수정 창): 공정별 완료 ── */
.lot-stages-box h3 { margin-top: 4px; }
.lot-stages-help { font-size: 12px; line-height: 1.6; margin: 0 0 8px; }
.lot-outsource { margin: 10px 0 0; font-size: 13px; display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.lot-outsource .strike { text-decoration: line-through; }
table.grid.lot-stages td { vertical-align: top; }
table.grid.lot-stages .st-badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; font-weight: 700; border: 1px solid var(--border); background: #f2f4f7; }
table.grid.lot-stages .st-badge.st-done, table.grid.lot-stages .st-badge.st-closed { color: #0b6b3a; background: #e9f7ef; border-color: #9fd8b5; }
table.grid.lot-stages .st-badge.st-partial { color: #1d4ed8; background: #eef4ff; border-color: #bfd3fb; }
table.grid.lot-stages .st-badge.st-missing { color: #b42318; background: #fdecea; border-color: #f5b8b0; }
table.grid.lot-stages .ev { line-height: 1.7; white-space: nowrap; }
table.grid.lot-stages .ev-date { display: inline-block; min-width: 64px; font-weight: 600; }
table.grid.lot-stages .ev-edit { margin-left: 4px; }
table.grid.lot-stages .st-actions { min-width: 300px; }
table.grid td form.st-form, .st-form { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0 0 4px; }
.st-form input[type=date] { width: 140px; }
.st-form .st-q { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; }
.st-form .st-q input { width: 64px; }
.st-alert { margin: 0 0 4px; padding: 4px 8px; font-size: 12px; }

/* 조립 작업일지 (품번·수량 입력) */
.assy-form-head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: baseline; margin-bottom: 8px; }
.assy-form-head h2 { margin: 0; }
.assy-form-head .muted { font-size: 12px; }
table.grid.assy-grid td { padding: 2px 4px; vertical-align: top; }
table.grid.assy-grid input, table.grid.assy-grid select { width: 100%; min-width: 60px; }
table.grid.assy-grid td:nth-child(2) input { min-width: 160px; }
table.grid.assy-grid td small.danger { display: block; font-size: 11px; }
.assy-note { font-size: 12px; margin: 8px 0 0; }

/* 조립 작업지시서 (서열 호기 + 확정발주 단품) */
table.assy-orders tr.seq-head td { background: #f4f7fb; }
table.assy-orders tr.seq-head td > span, table.assy-orders tr.seq-head td > strong { margin-right: 10px; }
table.assy-orders .ao-model { font-size: 15px; }
/* 상태: 납기 순 누계 / 재고 (조립 3/105 · 전착 2/20 · 미착수 1) */
.ao-st { display: inline-block; padding: 1px 6px; border-radius: 4px; font-size: 12px; font-weight: 600; white-space: nowrap; background: #eef1f5; color: #344054; }
.ao-st.ao-ready { background: #e3f4e8; color: #1b6b35; }
.ao-st.ao-wait { background: #fef3e2; color: #93370d; }
.ao-st.ao-none { background: #f2f4f7; color: #475467; border: 1px dashed #98a2b3; }
.ao-d.late { color: #a3221b; font-weight: 600; }
.ao-d.soon { color: #b54708; font-weight: 600; }
td.ao-state-cell small { color: var(--muted); }

/* 조립 작업일지: 목록에서 체크해 완료 */
.ac-box { padding-bottom: 0; }
.ac-help { font-size: 13px; margin: 0 0 8px; }
table.assy-orders.selectable tr[data-ac-hogi] { cursor: pointer; }
table.assy-orders.selectable tr[data-ac-hogi]:hover td { background: #e9f0fb; }
table.assy-orders.selectable tr.ac-on td { background: #eaf6ee !important; }
table.assy-orders input.ac-qty { width: 64px; text-align: right; }
table.assy-orders input.ac-pick, table.assy-orders input.ac-hogi { width: 18px; height: 18px; vertical-align: middle; cursor: pointer; }
.ac-bar { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin: 12px -16px 0; padding: 10px 16px; background: var(--card-bg, #fff); border-top: 1px solid var(--border); box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.06); }
.ac-bar [data-ac-count] { font-weight: 600; margin-right: auto; }
.ac-bar.has-pick { background: #f0f8f3; }
.assy-direct { margin-top: 16px; }
.assy-direct > summary { cursor: pointer; font-weight: 600; }

/* 조립반 재고 · 보정 요청 */
.assy-req-form { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; }
.assy-req-form label { display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.assy-req-form label.grow { flex: 1 1 260px; }
.assy-req-form label.grow input { width: 100%; }
table.assy-stock tr.minus-row td { background: #fff5f5; }
.req-st { font-weight: 600; font-size: 12px; padding: 1px 6px; border-radius: 4px; background: #eef1f5; }
.req-st.req-pending { background: #fef3e2; color: #93370d; }
.req-st.req-approved { background: #e3f4e8; color: #1b6b35; }
.req-st.req-rejected { background: #fde8e8; color: #a3221b; }
form.req-decide input { margin-right: 4px; }
/* 작업일지 공유 시트: 저장된 줄 / 고침 / 방금 저장 */
table.grid.wl-grid td.wl-time { padding: 0 6px; width: 48px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
table.grid.wl-grid tr.wl-saved td { background: #f6fbf7; }
table.grid.wl-grid tr.wl-saved.wl-dirty td { background: #fffaeb; }
table.grid.wl-grid tr.wl-saved.wl-error td { background: #fff3f2; }
table.grid.wl-grid tr.wl-saved.wl-pending td { opacity: .7; }
table.grid.wl-grid tr.wl-just td { background: #dcfae6; transition: background 1.5s; }
table.grid.wl-grid tr.wl-saved input[readonly] { color: var(--text); }
table.grid.wl-grid tr.wl-saved.wl-check td { background: #fffaeb; }
/* 저장한 줄을 지움 (일괄 저장 때 반영) */
table.grid.wl-grid tr.wl-saved.wl-deleted td { background: #f2f4f7; }
table.grid.wl-grid tr.wl-saved.wl-deleted td input, table.grid.wl-grid tr.wl-saved.wl-deleted td select, table.grid.wl-grid tr.wl-saved.wl-deleted td.wl-name { text-decoration: line-through; color: var(--muted); }
/* 라인 공정 로딩 / 언로딩 탭 */
.wl-views { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin: 0 0 8px; }
.wl-views button { border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: none; padding: 8px 18px; font-size: 15px; font-weight: 600; color: var(--muted); margin-bottom: -1px; min-height: 0; }
.wl-views button.active { color: var(--primary); border-bottom-color: var(--primary); }
.wl-views button small { font-weight: 400; }
.wl-view-count { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 10px; background: #fff4e5; color: #b54708; font-size: 12px; font-weight: 600; }
.wl-batch[data-view=LOAD] .wl-grid [data-c=kind], .wl-batch[data-view=LOAD] .wl-grid [data-c=good_qty], .wl-batch[data-view=LOAD] .wl-grid [data-c=defect_qty],
.wl-batch[data-view=LOAD] .wl-grid [data-c=rework_qty], .wl-batch[data-view=LOAD] .wl-grid [data-c=defect_reason],
.wl-batch[data-view=UNLOAD] .wl-grid [data-c=qty], .wl-batch[data-view=UNLOAD] .wl-grid [data-c=is_rework], .wl-batch[data-view=UNLOAD] .wl-grid [data-c=waiting] { display: none; }
table.grid.wl-grid tr.wl-auto td { background: #f5f8ff; }
table.grid.wl-grid tr.wl-auto td input::placeholder { color: #98a2b3; }
.wl-view-inline { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 10px; background: #e6efff; color: #1d4aa8; font-size: 12px; font-weight: 600; }
table.grid.wl-grid tbody tr[hidden], .wl-view-count[hidden], .wl-view-inline[hidden] { display: none !important; }
.wl-batch [data-batch-save].wl-save-pending { box-shadow: 0 0 0 3px #fedf89; }
/* AS → 양산재고 사용 */
.as-stock-use { margin-top: 3px; }
.as-stock-open { margin-top: 3px; }
.as-stock-dialog { width: min(540px, 94vw); }
.as-stock-dialog label.block span { min-width: 70px; }
/* 외주포털: 줄 아이콘 · 팝업 시트(납품예정일 일괄 등록 · 공정이동표 일괄 출력) */
a.tv-icon { color: var(--primary); display: inline-flex; }
a.tv-icon:hover { color: #1d4aa8; }
/* 공정 탭 → 공정이동표 출력 */
.tv-find { display: flex; flex-direction: column; gap: 10px; }
.tv-find-row { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.tv-find-row label { display: flex; flex-direction: column; gap: 4px; min-width: 280px; }
.tv-find-row input { font-size: 16px; }
.tv-pick-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 14px 0 8px; }
.tv-pick-head h2 { margin: 0; }
.tv-pick input.tv-qty { width: 90px; }
.tv-pick input[type=checkbox] { width: 18px; height: 18px; }
a.tv-mini { color: var(--muted); margin-left: 3px; vertical-align: -2px; display: inline-flex; }
a.tv-mini:hover { color: var(--primary); }
@media print { a.tv-mini { display: none; } }
.portal-actions { margin-bottom: 10px; }
dialog.sheet-dialog { width: min(1100px, 96vw); max-height: 90vh; padding: 0; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 40px rgba(0, 0, 0, .25); }
dialog.sheet-dialog[open] { display: flex; flex-direction: column; }
dialog.sheet-dialog::backdrop { background: rgba(15, 23, 42, .4); }
.sd-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px 4px; }
.sd-head h2 { margin: 0; }
.sd-head .link { font-size: 18px; }
.sd-help { margin: 0 16px 8px; font-size: var(--fs-dense); }
.sd-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 0 16px 8px; }
.sd-table { flex: 1; overflow: auto; margin: 0 16px; border: 1px solid var(--border); border-radius: 6px; min-height: 200px; }
.sd-foot { display: flex; align-items: center; gap: 10px; padding: 10px 16px 14px; flex-wrap: wrap; }
.sd-foot [data-msg]:empty { display: none; }
.sd-foot .notice-text { color: #1d6b34; font-weight: 600; }
table.grid.ms-grid { font-size: var(--fs-dense); width: 100%; }
table.grid.ms-grid thead th { position: sticky; top: 0; z-index: 1; white-space: nowrap; }
table.grid.ms-grid td { padding: 0 6px; height: 30px; }
table.grid.ms-grid td input { width: 100%; height: 30px; border: 0; border-radius: 0; background: transparent; padding: 0 4px; font: inherit; box-shadow: none; }
table.grid.ms-grid td input:focus { outline: 2px solid var(--primary); outline-offset: -2px; background: #fff; }
table.grid.ms-grid td:has(input) { padding: 0; }
/* 칸 범위 선택 (sheetRange.js): 작은 입력 표 · 작업일지 */
table.grid td.sr-sel { background: #dbe7fb !important; box-shadow: inset 0 0 0 1px #9db8ec; }
table.grid td.sr-sel input:focus { background: #eef3fd; }
table.grid.sr-ranging td input { user-select: none; }
table.grid.sr-ranging td.sr-sel input { background: transparent; }
table.grid.ms-grid .ms-no { width: 32px; color: var(--muted); text-align: right; }
table.grid.ms-grid .ms-key { width: 130px; }
table.grid.ms-grid .ms-date { width: 110px; }
table.grid.ms-grid .ms-code { white-space: nowrap; }
table.grid.ms-grid .ms-name { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.grid.ms-grid .ms-status { min-width: 160px; font-size: 12px; }
table.grid.ms-grid .ms-del { width: 26px; text-align: center; }
table.grid.ms-grid button.ms-x { color: #98a2b3 !important; padding: 0 4px; min-height: 0; }
table.grid.ms-grid tr.ms-ok td { background: #f6fbf7; }
table.grid.ms-grid tr.ms-ok td.ms-status { color: #1d6b34; }
table.grid.ms-grid tr.ms-error td { background: #fff3f2; }
table.grid.ms-grid tr.ms-error td.ms-status { color: #b42318; font-weight: 600; }
.sd-head .grow, .sd-foot .grow { flex: 1; }
/* 회사 로고 (왼쪽 위): 진한 상단 띠 위에서도 원래 색이 보이게 흰 바탕 */
.brand-logo { display: block; height: 40px; width: auto; background: #fff; border-radius: 6px; padding: 3px 8px; }
.company-logo .logo-preview { display: inline-block; padding: 10px 16px; border: 1px solid var(--border); border-radius: 8px; background: #fff; margin-bottom: 10px; }
.company-logo .logo-preview img { display: block; height: 80px; width: auto; }
.company-logo .logo-upload { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
/* BOM 표에서 고치기 */
.bom-sheet { padding: 0 0 4px; }
.bom-sheet .bom-sheet-help { margin: 8px 16px; font-size: var(--fs-dense); }
.bom-sheet .sd-table { max-height: 70vh; }
table.grid.ms-grid.bom-ms th.ms-lv, table.grid.ms-grid.bom-ms td.ms-lv { width: 26px; text-align: center; }
table.grid.ms-grid.bom-ms td.ms-lv input { text-align: center; padding: 0; }
table.grid.ms-grid.bom-ms .ms-code-in { min-width: 150px; }
table.grid.ms-grid.bom-ms .ms-ver { width: 50px; }
table.grid.ms-grid.bom-ms .ms-name-in { min-width: 150px; }
table.grid.ms-grid.bom-ms .ms-qty { width: 60px; }
table.grid.ms-grid.bom-ms .ms-qty input { text-align: right; }
table.grid.ms-grid.bom-ms .ms-mat { width: 80px; }
table.grid.ms-grid.bom-ms .ms-dim { width: 52px; }
table.grid.ms-grid.bom-ms .ms-note { min-width: 110px; }
table.grid.ms-grid.bom-ms .ms-total { width: 64px; padding: 0 6px; }
table.grid.ms-grid.bom-ms tr.lv1 td { font-weight: 700; background: #eef3fb; }
table.grid.ms-grid.bom-ms tr.lv3 td.ms-code-in input { padding-left: 16px; }
table.grid.ms-grid.bom-ms tr.lv4 td.ms-code-in input { padding-left: 30px; }
table.grid.ms-grid button.ms-ins { color: #98a2b3 !important; padding: 0 3px; min-height: 0; }
table.grid.ms-grid button.ms-ins:hover { color: var(--primary) !important; }
table.grid.ms-grid .ms-del { width: 44px; white-space: nowrap; }
/* 등록번호 현황판 → LOT 등록 시트 */
table.grid.ms-grid.lot-ms .ms-key { width: 170px; }
table.grid.ms-grid.lot-ms .ms-qty { width: 70px; }
table.grid.ms-grid.lot-ms .ms-qty input { text-align: right; }
table.grid.ms-grid.lot-ms .ms-date { width: 100px; }
table.grid.ms-grid.lot-ms .ms-note { min-width: 160px; }
table.grid.ms-grid tr.ms-warn td { background: #fffaeb; }
table.grid.ms-grid tr.ms-warn td.ms-status { color: #b54708; font-weight: 600; }
.lot-done { margin-top: 12px; padding: 10px 12px; border: 1px solid #9fd8b5; background: #e9f7ef; border-radius: 8px; }
.lot-done-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lot-done-head .grow { flex: 1; }
.lot-done-list { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: var(--fs-dense); }
.board-head { display: flex; align-items: center; gap: 10px; margin: 4px 0 8px; }
.board-head h2 { margin: 0; }
.board-head .grow { flex: 1; }
dialog.sheet-dialog.lot-sheet { width: min(1300px, 96vw); }
dialog.sheet-dialog.lot-sheet .sd-table { max-height: 60vh; margin: 0 16px; }
dialog.sheet-dialog.lot-sheet .lot-done { margin: 10px 16px 0; }
/* 수동 발주 등록: 납품처·발주번호·받은 날 (시트 위) */
dialog.sheet-dialog.order-sheet .order-head { align-items: flex-end; gap: 12px; }
dialog.sheet-dialog.order-sheet .order-head label { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
dialog.sheet-dialog.order-sheet .order-head label.grow { flex: 1; min-width: 200px; }
dialog.sheet-dialog.order-sheet .order-head input[data-h=order_no] { width: 260px; }
/* 구매 재고 팝업 시트 */
.buy-actions { margin-bottom: 12px; }
table.grid.ms-grid.buy-ms .ms-key { width: 170px; }
table.grid.ms-grid.buy-ms .ms-qty { width: 80px; }
table.grid.ms-grid.buy-ms .ms-qty input { text-align: right; }
table.grid.ms-grid.buy-ms .ms-loc { width: 100px; }
table.grid.ms-grid.buy-ms .ms-note { min-width: 160px; }
table.grid.ms-grid.po-ms .ms-key { width: 160px; }
table.grid.ms-grid.po-ms .ms-name-in { min-width: 150px; }
table.grid.ms-grid.po-ms .ms-qty { width: 80px; }
table.grid.ms-grid.po-ms .ms-qty input { text-align: right; }
table.grid.ms-grid.po-ms .ms-date { width: 90px; }
table.grid.ms-grid.po-ms .ms-note { min-width: 120px; }

/* 출하: 납품처별 요약 카드 */
.ship-cards { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.ship-card { display: flex; flex-direction: column; gap: 2px; min-width: 170px; padding: 8px 12px; border: 1px solid var(--border, #d9dde3); border-radius: 8px; background: var(--card, #fff); color: inherit; text-decoration: none; font-size: 13px; }
.ship-card strong { font-size: 14px; }
.ship-card:hover { border-color: #2f6fed; }
.ship-card.active { border-color: #2f6fed; box-shadow: 0 0 0 2px rgba(47, 111, 237, .15); }
.tag.tag-manual { background: #eef4ff; color: #1d4ed8; }
.ok-text { color: #1f7a3a; font-weight: 600; margin-left: 4px; }

/* 한 탭 안의 보기 전환 (예: HiSRM 입고현황 → 입고 기록 / 확정발주 기입고) */
.seg-tabs { display: inline-flex; gap: 0; margin: 0 0 12px; border: 1px solid var(--border, #d9dde3); border-radius: 8px; overflow: hidden; background: #fff; }
.seg-tabs a { padding: 6px 14px; color: var(--muted, #5b6573); text-decoration: none; font-size: 14px; border-right: 1px solid var(--border, #d9dde3); }
.seg-tabs a:last-child { border-right: 0; }
.seg-tabs a small { margin-left: 4px; font-size: 12px; color: var(--muted, #8a94a3); }
.seg-tabs a.active { background: #eef4ff; color: #1d4ed8; font-weight: 600; }
/* 확정조립서열: 서열 / 물류 올리기 두 칸 */
.upload-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 12px; margin-bottom: 16px; }
.upload-pair .card { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.upload-pair .card h3 { margin: 0; font-size: 15px; }
.upload-pair .card h3 .step { display: inline-block; min-width: 22px; height: 22px; margin-right: 6px; border-radius: 11px; background: #2f6fed; color: #fff; font-size: 13px; line-height: 22px; text-align: center; }
.upload-pair .card.logi h3 .step { background: #0f8a6a; }
.upload-pair .card.logi { border-top: 3px solid #0f8a6a; }
.upload-pair .card.seq { border-top: 3px solid #2f6fed; }
.upload-pair .card p { margin: 0; font-size: 13px; }
/* 외주포털: 지난 접속 이후 새 발주 · 납기요청일 변경 */
.tag.tag-new { background: #e7f6ec; color: #1f7a3a; border-color: #a6dbb6; }
.tag.tag-chg { background: #fff4e5; color: #8a5a00; border-color: #f0cf96; }
/* 제품 시트: 칸이 많아 가로로 넘김 */
dialog.sheet-dialog.item-sheet { width: 98vw; max-width: 98vw; }
table.grid.ms-grid.item-ms .ms-key { min-width: 150px; }
table.grid.ms-grid.item-ms .ms-name-in { min-width: 180px; }
table.grid.ms-grid.item-ms .ms-cell { min-width: 90px; }
table.grid.ms-grid.item-ms .ms-status { min-width: 220px; max-width: 360px; white-space: normal; }

/* 링크 단추를 끈 모양 (AS 발주리스트 외주 발주: 고른 줄 없음) */
a.button.disabled { opacity: 0.5; }

/* 제품 등록: 공정표 (공정 한 줄에 제작처·외주단가·작업자·작업시간·긴급) */
.route-preview { margin: 8px 0 0; }
.route-preview strong { color: var(--accent, #1a5fb4); }
.route-urgent-toggle { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; }
table.route-table { width: auto; min-width: 640px; }
table.route-table th, table.route-table td { vertical-align: middle; padding: 4px 8px; }
table.route-table tbody th { text-align: left; white-space: nowrap; }
table.route-table select { min-width: 170px; }
table.route-table input.num { width: 90px; }
table.route-table .time-cell { display: inline-flex; align-items: center; gap: 4px; }
table.route-table .time-cell small { width: 3em; }
table.route-table [hidden] { display: none !important; }
table.route-table small.error { display: block; }

/* 품번·등록번호 검색 (맨 위 [품번 검색] → 화면 위 창) */
.user .find-btn { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 14px; background: rgba(255, 255, 255, .14); color: #fff; font-weight: 600; text-decoration: none; }
.user .find-btn:hover { background: rgba(255, 255, 255, .26); }
.find-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 4px 0 12px; }
.find-form input[name=q] { width: min(420px, 100%); font-size: 16px; padding: 7px 10px; }
.find-result.loading { opacity: .45; transition: opacity .15s; }
.find-hint { padding: 24px 0; }
.find-choices { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 4px; }
.find-choices a { display: block; padding: 6px 10px; border: 1px solid var(--border); border-radius: 4px; text-decoration: none; }
.find-choices a:hover { background: var(--ok-bg); }
.find-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.find-head h2 { margin: 0 0 4px; font-size: 1.25rem; }
.find-flow { font-weight: 600; }
.find-makers { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: var(--fs-small); margin-top: 2px; }
.find-makers strong { color: var(--text, inherit); font-weight: 600; }
.find-stats { margin: 10px 0 4px; }
.find-stats .stat { padding: 6px 14px; min-width: 120px; }
.find-stats .stat strong { font-size: 20px; }
.find-sec { margin: 14px 0 6px; }
.find-sec h3 { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 0 0 6px; font-size: 1.02rem; border-left: 4px solid var(--primary); padding-left: 8px; }
.find-sec .find-more { font-size: var(--fs-small); font-weight: 400; }
.find-sec .find-more:first-of-type { margin-left: auto; }
.find-sec .empty-note { margin: 2px 0 8px; color: var(--muted); }
.find-sec table.grid { font-size: 13.5px; }
.find-sec table.grid td, .find-sec table.grid th { padding: 3px 8px; }
.find-sec .neg { color: var(--danger); font-weight: 600; }
.find-lots td.st-done { color: #1d6b34; }
.find-lots td.stage { text-align: center; white-space: nowrap; }
.find-lots tr.done td { color: var(--muted); }
.find-demand td.find-early { color: #b42318; font-weight: 600; }
.find-cover-sum { margin: 2px 0 6px; }
.find-cover-sum .find-ok { color: #1d6b34; font-weight: 600; }
.app-modal .find-view > h1 { display: none; }
/* 공정 재고 (제관·전착·도장): 작업지시서에 없는 등록번호 */
table.stage-stock tr.off-order td { background: #fffaf0; }
.tag.tag-off { background: #fff3dc; color: #8a5a00; border: 1px solid #f1d39a; }

/* 엑셀 대조 (daily/compare) */
.seg-tabs button { padding: 6px 14px; border: 0; border-right: 1px solid var(--border, #d9dde3); border-radius: 0; background: none; color: var(--muted, #5b6573); font-size: 14px; cursor: pointer; }
.seg-tabs button:last-child { border-right: 0; }
.seg-tabs button.active { background: #eef4ff; color: #1d4ed8; font-weight: 600; }
/* 대조 시트: 사이트 머리글 칸에 엑셀 값을 붙여넣음 (줄이 많으면 상자 안에서 스크롤) */
.cmp-sheet { max-height: 55vh; overflow: auto; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.cmp-sheet table.grid.ms-grid { width: 100%; }
.cmp-sheet table.grid.ms-grid .ms-key { width: 170px; }
.cmp-sheet table.grid.ms-grid .ms-qty { width: 90px; }
.cmp-sheet table.grid.ms-grid .ms-qty input { text-align: right; }
.cmp-sheet table.grid.ms-grid .ms-date { width: 120px; }
.cmp-actions { display: flex; gap: 8px; align-items: center; margin: 6px 0 10px; }
.cmp-result.loading { opacity: .45; }
.cmp-note { margin: 0 0 8px; }
.cmp-toggle { display: inline-flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.cmp-table.only-bad tr.cmp-same { display: none; }
.cmp-table td.cmp-cell-diff { background: var(--err-bg); }
.cmp-table .cmp-ex { color: #7b8494; }
.cmp-tag { display: inline-block; padding: 0 8px; border-radius: 10px; font-size: var(--fs-small); border: 1px solid var(--border); }
.cmp-tag-diff { background: var(--err-bg); border-color: var(--err-border); color: var(--danger); }
.cmp-tag-excelOnly, .cmp-tag-systemOnly { background: var(--warn-bg); border-color: var(--warn-border); }
.cmp-tag-same { background: var(--ok-bg); border-color: var(--ok-border); }
.cmp-allgood { color: #1d6b34; font-weight: 600; }

/* ── 표 칸 너비 (2026-11-28): 글 칸(품명·납품처·비고 등)은 화면 폭에 맞춘 고정 너비 + 한 줄, 넘치면 … (마우스를 올리면 전체)
   사무실 1920 · 현장 키오스크 1280 기준. 인쇄 양식은 건드리지 않음 ── */
@media screen {
  .container { max-width: none; }
  :root {
    --clip-w: clamp(120px, 10vw, 220px);      /* 품명·납품처 */
    --clip-wide: clamp(160px, 16vw, 340px);   /* 비고·사유·메모 */
    --clip-sm: clamp(80px, 6vw, 120px);       /* 모델·저장위치 같은 보조 칸 */
  }
  table.grid td.clip, table.grid td.wrap, table.grid td.wrap-sm, table.grid td.col-fill, table.grid td.item-name, table.grid td.cust-cell {
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    width: var(--clip-w); min-width: 0; max-width: var(--clip-w);
  }
  table.grid td.clip-wide, table.grid td.wrap { width: var(--clip-wide); max-width: var(--clip-wide); }
  table.grid td.clip.clip-sm { width: var(--clip-sm); max-width: var(--clip-sm); }
  /* 칸 안에서 바로 고치는 중(입력칸)이면 자르지 않음 */
  table.grid td.editing, table.grid td.clip:has(input, select, textarea) { overflow: visible; max-width: none; }
  /* 칸이 많은 현황판: 머리글은 띄어쓰기에서 두 줄 허용, 필터 ▾ 자리 줄임 */
  table.grid.board thead th, table.grid.board[data-colfilter] thead tr:last-child th:not([data-cf-off]) { white-space: normal; word-break: keep-all; }
  table.grid.board[data-colfilter] thead tr:last-child th:not([data-cf-off]), table.grid.board[data-colfilter] thead th[rowspan]:not([data-cf-off]) { padding-right: 18px !important; }
}
/* 작은 화면(현장 키오스크 1280×1024): 칸 여백을 줄이고 머리글은 띄어쓰기에서 두 줄 허용 */
@media screen and (max-width: 1440px) {
  .container { padding: 14px 10px; }
  .grid th, .grid td { padding: 6px 7px; }
  table.board td, table.board th { padding: 4px 5px; }
  table.grid thead th { white-space: normal; word-break: keep-all; }
  table.grid[data-colfilter] thead tr:last-child th:not([data-cf-off]), table.grid[data-colfilter] thead th[rowspan]:not([data-cf-off]) { padding-right: 18px !important; white-space: normal; word-break: keep-all; }
  table.grid.wo td, table.grid.wo th { padding: 5px 6px; }
  table.grid.assy-orders { font-size: 13px; }
  table.grid.assy-orders td, table.grid.assy-orders th { padding: 5px 6px; }
}
/* 개발 일괄 검사 창 */
.bulk-insp-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 12px 0 10px; }
.bulk-insp-head input[name=note] { width: 260px; }
table.bulk-insp-table { width: auto; min-width: 640px; }
table.bulk-insp-table tr.picked td { background: #f3f7fe; }
table.bulk-insp-table td.stage-done { color: #0b6b3a; font-weight: 600; }
/* 개발 목록·단품 표 칸 너비 (2026-11-28): 공정 칸은 완료·대기 상관없이 같은 너비 */
table.dev-parts th.dev-stage, table.dev-parts td.dev-stage { width: 112px; min-width: 112px; max-width: 112px; }
table.dev-list th.dev-c-stage, table.dev-list td.dev-c-stage { width: 78px; min-width: 78px; }
table.dev-list td.dev-c-title { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.grid.dev-list td.clip.dev-c-model { width: 150px; max-width: 150px; }
table.grid.dev-list td.clip.dev-c-cust { width: 160px; max-width: 160px; }
table.dev-list th.dev-c-owner, table.dev-list td.dev-c-owner { width: 90px; }
table.dev-list th.dev-c-date, table.dev-list td.dev-c-date { width: 118px; }
.dev-panel-actions { display: inline-flex; align-items: center; gap: 12px; }
table.dev-parts th.dev-seq { width: 56px; }
table.dev-parts th.dev-code { width: 170px; }
table.dev-parts th.dev-pc { width: 70px; }
table.dev-parts th.dev-color { width: 120px; }
table.grid.dev-parts td.clip { width: auto; max-width: 360px; }
table.dev-parts th.dev-qty { width: 60px; }
.part-head-fields { display: flex; gap: 18px; align-items: flex-end; flex-wrap: wrap; }
/* 개발 Part List: 비고 칸 · 일괄 입력 표 · 품번 추가 시트 */
table.grid.dev-parts td.clip.dev-note { width: 160px; max-width: 160px; }
.part-head-fields label.grow { flex: 1; min-width: 240px; }
.part-head-fields label.grow input { width: 100%; }
table.parts-bulk-table td { padding: 3px 5px; vertical-align: middle; }
table.parts-bulk-table input { height: 30px; }
table.parts-bulk-table input.pb-seq { width: 56px; }
table.parts-bulk-table input.pb-qty { width: 64px; }
table.parts-bulk-table input.pb-note { width: 180px; }
table.parts-bulk-table td.pb-date input { width: 132px; }
table.parts-bulk-table td.pb-auto { color: #0b6b3a; background: #f3f7fe; }
table.parts-bulk-table td.stage-na { color: #c4cad3; background: #fafbfc; }
table.grid.ms-grid.dev-ms .ms-qty { width: 80px; }
table.grid.ms-grid.dev-ms .ms-qty input { text-align: right; }
table.grid.ms-grid.dev-ms .ms-note { width: 220px; }
dialog.sheet-dialog.dev-add-sheet { width: min(1100px, 96vw); }
dialog.sheet-dialog.dev-add-sheet .sd-table { max-height: 60vh; }
dialog.sheet-dialog.dev-bulk-sheet { width: min(1700px, 98vw); }
dialog.sheet-dialog.dev-bulk-sheet form { display: flex; flex-direction: column; min-height: 0; max-height: 90vh; }
dialog.sheet-dialog.dev-bulk-sheet .sd-table { max-height: 64vh; }
/* 맨 위 [공정이동표] 버튼: 작은 화면(현장 키오스크 1280)에서는 아이콘만 */
@media screen and (max-width: 1440px) {
  .user .tv-btn { padding: 4px 9px; }
  .user .tv-btn .tv-btn-text { display: none; }
}
@media screen and (max-width: 1440px) {
  .nav a { white-space: nowrap; padding: 6px 8px; }
}

/* 제품 시트 분류 탭 (기본정보·표준작업시간·…·전체) — 버튼 탭, 공정 하위 탭과 같은 모양 */
.subtabs.item-sheet-tabs { margin: 0 0 6px; }
.subtabs.item-sheet-tabs button { background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; margin-bottom: -1px; padding: 8px 14px; color: var(--text); font-weight: 500; white-space: nowrap; cursor: pointer; }
.subtabs.item-sheet-tabs button[aria-selected="true"] { border-bottom-color: var(--primary); color: var(--primary); font-weight: 600; }
.subtabs.item-sheet-tabs .tab-count { margin-left: 4px; font-size: 12px; color: var(--muted); }
table.grid.ms-grid.item-ms .ms-name { min-width: 160px; color: var(--muted); }

/* 목록 검색칸: [품번] [등록번호] (partials/codeSearch) */
.filters input.code-search, input.code-search { width: 200px; }
.filters input.lot-search, input.lot-search { width: 110px; }
.find-form input.code-search { width: min(300px, 100%); }
.find-form input.lot-search { width: 130px; font-size: 16px; padding: 7px 10px; }
@media (max-width: 760px) { .filters input.code-search, .filters input.lot-search { width: 100%; } }

/* 전환작업: 바꿀 수 없는 이유 */
.danger-text { color: var(--danger); }
.convert-renumber input[name=from], .convert-renumber input[name=to] { width: 110px; }
.convert-delete input[name=reason] { width: 320px; max-width: 100%; }

/* 제품 일괄 보기: 분류 탭 = 그 분류 칸만 (표 하나에서 칸 숨김) */
.subtabs.ov-tabs button { background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; margin-bottom: -2px; padding: 8px 14px; color: var(--text); font-weight: 500; white-space: nowrap; cursor: pointer; }
.subtabs.ov-tabs button[aria-selected="true"] { border-bottom-color: var(--primary); color: var(--primary); font-weight: 600; }
.ov-table[data-tab="basic"] .gc:not(.gc-basic),
.ov-table[data-tab="time"] .gc:not(.gc-time),
.ov-table[data-tab="lead"] .gc:not(.gc-lead),
.ov-table[data-tab="order"] .gc:not(.gc-order),
.ov-table[data-tab="maker"] .gc:not(.gc-maker),
.ov-table[data-tab="price"] .gc:not(.gc-price),
.ov-table[data-tab="all"] .gc:not(.gc-all) { display: none; }
.ov-table.ov-only[data-tab="basic"] tbody tr:not([data-miss-basic]),
.ov-table.ov-only[data-tab="maker"] tbody tr:not([data-miss-maker]),
.ov-table.ov-only[data-tab="all"] tbody tr:not([data-miss-all]) { display: none; }
.ov-table td.miss, .ov-miss-key { background: #fef7c3; }
.ov-table td.na, .ov-na-key { color: var(--muted); text-align: center; }
.ov-table td { white-space: nowrap; }
.ov-tools label.check { display: inline-flex; align-items: center; gap: 4px; }

/* 상자(패널) 정리: 머리줄 오른쪽 상태·숫자, 버튼 줄, 상자 안 표 위 실행 줄 */
.panel-head { flex-wrap: wrap; }
.panel-head small { line-height: 1.5; }
.panel-head .grow { flex: 1; }
.card-row > .panel { margin: 0; }
.panel-body > :last-child { margin-bottom: 0; }
.panel-body .filters { margin-top: 0; }
.panel-body .small-note { margin: 8px 0 0; font-size: var(--fs-small); }
.step-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.panel-actions { margin: 0; padding: 10px 20px; border-top: 1px solid var(--border); background: #fafbfc; }
.panel-actions + .panel-table { border-top: 1px solid var(--border); }
.next-lot-no { font-size: 1.25rem; color: var(--primary); }

/* ── 휴대폰 (조회용: 품번 검색 위주). PC 화면은 그대로 ── */
.nav-toggle { display: none; }
@media (max-width: 760px) {
  /* 아이폰이 입력칸을 누를 때 화면을 확대하지 않게 16px, 손가락으로 누르기 쉽게 버튼 높이 */
  input, select, textarea { font-size: 16px; }
  :root { --control-h: 40px; }

  /* 맨 위 줄: 로고 · 품번 검색 · ☰ · 로그아웃. 메뉴는 ☰ 로 펼침 */
  .topbar { flex-wrap: wrap; height: auto; min-height: 52px; padding: 6px 12px; gap: 8px; overflow: visible; }
  .topbar .user { margin-left: auto; gap: 10px; }
  .topbar .user .tv-btn, .topbar .user .manual-btn, .topbar .user .user-name { display: none; }
  .topbar .user .find-btn { padding: 7px 14px; border-radius: 18px; }
  .nav-toggle { display: inline-flex; min-height: 36px; padding: 0 12px; font-size: 18px; line-height: 1; color: #fff; background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .25); box-shadow: none; }
  .nav-toggle:hover { background: rgba(255, 255, 255, .2); border-color: rgba(255, 255, 255, .35); }
  .topbar .nav { display: none; order: 9; flex: 0 0 100%; flex-direction: column; gap: 2px; padding: 6px 0 4px; border-top: 1px solid #344054; }
  body.nav-open .topbar .nav { display: flex; }
  .topbar .nav a { padding: 10px 12px; }
  .topbar .nav-sep { width: auto; height: 1px; margin: 4px 0; }
  .adminbar { display: none; }
  body.nav-open .adminbar { display: flex; flex-wrap: wrap; overflow: visible; }
  body.nav-open .adminbar .bar-sep { display: none; }

  /* 휴대폰에서 덜 중요한 칸·PC 화면 링크 숨김 */
  .m-hide { display: none !important; }

  /* 품번 검색 */
  .find-form { display: grid; grid-template-columns: 1fr 110px; gap: 8px; }
  .find-form input.code-search, .find-form input.lot-search { width: 100%; }
  .find-form button[type=submit] { grid-column: 1 / -1; }
  .find-form small { grid-column: 1 / -1; }
  .find-head h2 { font-size: 1.1rem; word-break: break-all; }
  .find-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .find-stats .stat { min-width: 0; padding: 8px 12px; }
  .find-choices a { padding: 10px 12px; }
  /* 표: 옆으로 밀어서 보되 첫 칸(등록번호·발주번호·납품처)은 고정 */
  .find-sec table.grid { font-size: 13px; }
  .find-sec table.grid tr > :first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); box-shadow: 1px 0 0 var(--border); }
  .find-sec table.grid thead tr > :first-child { z-index: 3; background: var(--head-bg); }
  .find-sec table.grid tr.highlight > :first-child { background: var(--ok-bg); }
  .brand-logo { height: 34px; }
}
