:root {
  --bg: #0d1117;
  --bg-elev: #151b23;
  --bg-elev2: #1b222c;
  --line: #262d38;
  --line-soft: #1f2630;
  --text: #e6edf3;
  --text-dim: #9198a1;
  --text-faint: #6b7280;
  --accent: #4fb8d8;
  --good: #3fb950;
  --warn: #d29922;
  --bad: #f85149;
  --purple: #a371f7;
  --radius: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Pretendard',
    'Malgun Gothic', 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

code, .num, .mono {
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

/* ── 상단바 ───────────────────────────────────────────── */

.topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 20px;
  height: 60px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 8px;
  background: linear-gradient(140deg, var(--accent), var(--purple));
  color: #08121a;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: -0.5px;
}

.brand-name { font-weight: 650; letter-spacing: -0.2px; }
.brand-sub { font-size: 11.5px; color: var(--text-faint); }

/* 메뉴가 19개다. 기본 flex로 두면 폭이 모자랄 때 **글자 단위로
   줄바꿈이 일어나** 한글이 세로로 선다 — 1,500px짜리 노트북에서도
   그랬다. 줄이지 말고 넘치게 두고, 넘친 만큼 가로로 굴린다. */
#nav {
  display: flex;
  gap: 2px;
  margin-left: auto;
  overflow-x: auto;
  overflow-y: hidden;
  /* flex 자식의 기본 min-width:auto가 축소를 막아 상단바를 밀어낸다 */
  min-width: 0;
  scrollbar-width: none;
  /* 끝에서 잘린 게 보이도록 — 더 있다는 신호가 없으면 아무도 안 굴린다 */
  mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent);
}
#nav::-webkit-scrollbar { display: none; }

#nav button {
  background: none;
  border: none;
  color: var(--text-dim);
  padding: 8px 14px;
  border-radius: 7px;
  font-size: 13.5px;
  font-family: inherit;
  cursor: pointer;
  transition: background .12s, color .12s;
  /* 이 두 줄이 세로 글자를 막는다 */
  white-space: nowrap;
  flex: 0 0 auto;
}
#nav button:hover { background: var(--bg-elev2); color: var(--text); }
#nav button.active { background: var(--bg-elev2); color: var(--text); font-weight: 600; }

.topbar-right { display: flex; align-items: center; flex: 0 0 auto; }

/* ── 레이아웃 ─────────────────────────────────────────── */

main { padding: 24px; max-width: 1480px; margin: 0 auto; }

.loading { color: var(--text-faint); padding: 60px; text-align: center; }

.page-head { margin-bottom: 20px; }
.page-title { font-size: 20px; font-weight: 680; letter-spacing: -0.3px; margin: 0 0 4px; }
.page-desc { color: var(--text-dim); font-size: 13px; margin: 0; max-width: 820px; }

.grid { display: grid; gap: 16px; }
.grid.c2 { grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); }
.grid.c3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid.c4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

.card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  min-width: 0;
}
.card.pad0 { padding: 0; overflow: hidden; }
.card h3 {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.01em;
}
.card .hint { color: var(--text-faint); font-size: 11.5px; margin: 0 0 14px; line-height: 1.5; }
.card-head { padding: 16px 18px 0; }

/* ── 지표 ─────────────────────────────────────────────── */

.metric { display: flex; flex-direction: column; gap: 2px; }
.metric-label { font-size: 11.5px; color: var(--text-faint); }
.metric-value {
  font-size: 26px;
  font-weight: 680;
  letter-spacing: -0.8px;
  font-family: 'SF Mono', Menlo, monospace;
  font-variant-numeric: tabular-nums;
}
.metric-sub { font-size: 11.5px; color: var(--text-dim); }

.good { color: var(--good); }
.warn { color: var(--warn); }
.bad { color: var(--bad); }
.dim { color: var(--text-dim); }
.faint { color: var(--text-faint); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-elev2);
  border: 1px solid var(--line);
  color: var(--text-dim);
  white-space: nowrap;
}
.pill.ok { color: var(--good); border-color: #1f4028; background: #11291a; }
.pill.warn { color: var(--warn); border-color: #413015; background: #2a2010; }
.pill.bad { color: var(--bad); border-color: #4d2321; background: #2d1615; }
.pill.info { color: var(--accent); border-color: #1d3b46; background: #0f232a; }

/* ── 표 ───────────────────────────────────────────────── */

.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
thead th {
  text-align: left;
  padding: 9px 12px;
  color: var(--text-faint);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.03em;
  background: var(--bg-elev2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  position: sticky;
  top: 0;
}
tbody td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line-soft);
  white-space: nowrap;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #10161e; }
tbody tr.clickable { cursor: pointer; }
tbody tr.sel { background: #132029; }
td.r, th.r { text-align: right; }
td.num, th.num {
  text-align: right;
  font-family: 'SF Mono', Menlo, monospace;
  font-variant-numeric: tabular-nums;
}
tr.total td { font-weight: 700; background: var(--bg-elev2); }
.wrap-cell { white-space: normal; max-width: 420px; line-height: 1.45; }

/* ── 커버리지 바 ──────────────────────────────────────── */

.bar {
  position: relative;
  height: 10px;
  border-radius: 5px;
  background: var(--bg-elev2);
  overflow: hidden;
  border: 1px solid var(--line);
}
.bar > span { position: absolute; top: 0; bottom: 0; left: 0; }
.bar .fill-measured { background: var(--good); }
.bar .fill-ceiling { background: #1f4a2c; }
.bar-legend { display: flex; gap: 14px; margin-top: 8px; font-size: 11px; color: var(--text-faint); }
.swatch { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

/* 수량 구간 막대 */
.qbar { height: 18px; background: var(--bg-elev2); border-radius: 3px; overflow: hidden; display: flex; min-width: 150px; }
.qbar i { display: block; height: 100%; }
.qbar .base { background: #2d4a5c; }
.qbar .co { background: var(--warn); }
.qbar .lr { background: var(--purple); }

/* ── 선택 컨트롤 ──────────────────────────────────────── */

.controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 18px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 11px; color: var(--text-faint); }
.field select, .field input {
  background: var(--bg-elev2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px 10px;
  font-family: inherit;
  font-size: 13px;
  min-width: 120px;
}
.field input { font-family: 'SF Mono', Menlo, monospace; width: 110px; }
.field select:focus, .field input:focus { outline: 2px solid #1d3b46; border-color: var(--accent); }

/* ── 주석 박스 ────────────────────────────────────────── */

.note {
  border-left: 3px solid var(--accent);
  background: #101a20;
  padding: 11px 14px;
  border-radius: 0 7px 7px 0;
  font-size: 12.5px;
  color: var(--text-dim);
  line-height: 1.6;
  margin: 14px 0 0;
}
.note.warn { border-left-color: var(--warn); background: #1d1708; }
.note.bad { border-left-color: var(--bad); background: #1e1211; }
.note strong { color: var(--text); font-weight: 650; }

/* ── 차트 ─────────────────────────────────────────────── */

svg.chart { display: block; width: 100%; height: auto; }
svg.chart text { fill: var(--text-faint); font-size: 10px; font-family: 'SF Mono', Menlo, monospace; }
svg.chart .axis { stroke: var(--line); stroke-width: 1; }
svg.chart .gridline { stroke: var(--line-soft); stroke-width: 1; }

/* ── 순서 비교 ────────────────────────────────────────── */

.seq { display: flex; flex-direction: column; gap: 6px; }
.seq-row {
  display: grid;
  grid-template-columns: 78px 1fr 62px;
  gap: 10px;
  align-items: center;
  padding: 7px 10px;
  background: var(--bg-elev2);
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 12px;
}
.seq-row .po { font-family: 'SF Mono', Menlo, monospace; color: var(--text-dim); font-size: 11px; }
.seq-row .style { display: flex; align-items: center; gap: 7px; min-width: 0; }
.seq-row .style span { overflow: hidden; text-overflow: ellipsis; }
.seq-row .co { text-align: right; font-family: 'SF Mono', Menlo, monospace; }
.seq-row.big { border-color: #4d2321; background: #1e1413; }
.type-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.type-dot.BAG { background: var(--purple); }
.type-dot.GARMENT_KNIT { background: var(--accent); }

/* 노트북~태블릿 가로: 메뉴에 자리를 더 준다. 공장 이름 줄을 접고
   글자를 줄여 굴려야 하는 거리를 줄인다 */
@media (max-width: 1500px) {
  .topbar { gap: 12px; padding: 0 14px; }
  #nav button { padding: 8px 10px; font-size: 12.5px; }
}
@media (max-width: 1150px) {
  .brand-sub { display: none; }
  #nav button { padding: 7px 9px; font-size: 12px; }
}

/* 세로 태블릿·폰: 메뉴를 아래 한 줄로 내린다 */
@media (max-width: 860px) {
  .topbar { flex-wrap: wrap; height: auto; padding: 10px 14px; gap: 10px; }
  .brand { order: 1; }
  .topbar-right { order: 2; margin-left: auto; }
  #nav {
    margin-left: 0;
    order: 3;
    width: 100%;
    border-top: 1px solid var(--line);
    padding-top: 8px;
  }
  main { padding: 14px; }
  .page-title { font-size: 20px; }
  /* 지표 카드가 한 줄에 하나씩 서면 화면이 끝없이 길어진다 */
  .grid.c4, .grid.c3 { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
  .grid.c2 { grid-template-columns: 1fr; }
  .card { padding: 14px; }
}

/* 표는 이미 .table-wrap이 가로 스크롤을 잡는다. 다만 좁은 화면에서
   칸이 짓눌려 글자가 세로로 서는 건 같은 문제다 */
@media (max-width: 860px) {
  table th, table td { white-space: nowrap; }
  table td.wrap-cell { white-space: normal; min-width: 180px; }
}

/* ── 로그인 ───────────────────────────────────────────── */

.login-wrap { display: grid; place-items: center; padding: 48px 16px; }
.login-form {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
}
.login-form .field input { width: 100%; font-family: inherit; }
.login-form .page-title { margin: 0; }
.login-form .page-desc { margin: 0 0 4px; }

.btn {
  background: var(--accent);
  color: #06161c;
  border: none;
  border-radius: 7px;
  padding: 9px 16px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 650;
  cursor: pointer;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.ghost {
  background: none;
  color: var(--text-dim);
  border: 1px solid var(--line);
  font-weight: 500;
  padding: 6px 12px;
  font-size: 12.5px;
}
.btn.ghost:hover { background: var(--bg-elev2); color: var(--text); }

.topbar-right { gap: 10px; }
.user-chip { display: flex; flex-direction: column; line-height: 1.25; font-size: 12px; text-align: right; }
.user-chip .faint { font-size: 10.5px; }

/* ── 다이얼로그 ───────────────────────────────────────── */

.dlg {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elev);
  color: var(--text);
  padding: 0;
  max-width: 560px;
  width: calc(100% - 32px);
}
.dlg::backdrop { background: rgba(2, 6, 10, .66); }
.dlg form { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.dlg h3 { margin: 0; font-size: 15px; }
.dlg .hint { margin: 0; }
.dlg-row { display: flex; gap: 12px; align-items: flex-end; }
.dlg-row .field.grow { flex: 1; }
.dlg-row .field.grow select { width: 100%; }
.dlg textarea {
  background: var(--bg-elev2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 11px;
  font-family: inherit;
  font-size: 13px;
  resize: vertical;
  line-height: 1.5;
}
.dlg textarea:focus { outline: 2px solid #1d3b46; border-color: var(--accent); }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 2px; }
.req { color: var(--bad); font-size: 10.5px; font-weight: 600; }

.btn.tiny { padding: 3px 9px; font-size: 11.5px; border-radius: 6px; }

/* 현장 단말 링크. 같은 서버가 아니라 별도 프로세스(3200)로 뜬다 —
   본사 UI는 원가를 보고 현장 단말은 DB 롤에 그 권한이 없다. */
.pill.link {
  text-decoration: none;
  color: var(--accent);
  border: 1px solid var(--line);
}
.pill.link:hover { background: var(--bg-elev2); }

/* ── 오더 생애주기 ────────────────────────────────────── */

.lc-list { max-height: 72vh; overflow-y: auto; }

.lc-order {
  display: block; width: 100%; text-align: left;
  background: var(--bg-elev2); border: 1px solid var(--line);
  border-radius: 8px; padding: 10px 12px; margin-top: 8px;
  color: var(--text); font-family: inherit; font-size: 13px; cursor: pointer;
}
.lc-order:hover { border-color: var(--accent); }
.lc-order.on { border-color: var(--accent); border-width: 2px; }
.lc-order-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.lc-order-sub { color: var(--text-dim); font-size: 12px; margin-top: 3px; }
.lc-order-sub.dim { color: var(--text-faint); }

.stage-tag {
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  background: var(--line); color: var(--text-dim); white-space: nowrap;
}
.stage-tag.s-QUOTE { background: #2a2f3a; color: var(--text-dim); }
.stage-tag.s-MATERIAL { background: #3a2f1a; color: var(--warn); }
.stage-tag.s-PRODUCTION { background: #1a3050; color: var(--accent); }
.stage-tag.s-SHIPPED { background: #2a2050; color: var(--purple); }
.stage-tag.s-INVOICED { background: #1f3a24; color: var(--good); }
.stage-tag.s-PAID { background: #1f3a24; color: var(--good); }

.lc-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

/* 단계 타임라인. 지난 단계는 채우고, 현재 단계만 강조한다 */
.lc-timeline { display: flex; align-items: center; margin: 14px 0 4px; }
.lc-step { flex: 1; display: flex; flex-direction: column; align-items: center; position: relative; }
.lc-step::before {
  content: ''; position: absolute; top: 6px; left: -50%; width: 100%;
  height: 2px; background: var(--line);
}
.lc-step:first-child::before { display: none; }
.lc-step.done::before, .lc-step.now::before { background: var(--accent); }
.lc-dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg-elev2); border: 2px solid var(--line); z-index: 1;
}
.lc-step.done .lc-dot { background: var(--accent); border-color: var(--accent); }
.lc-step.now .lc-dot {
  background: var(--accent); border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(79, 184, 216, .2);
}
.lc-step-label { font-size: 11px; color: var(--text-faint); margin-top: 6px; }
.lc-step.done .lc-step-label, .lc-step.now .lc-step-label { color: var(--text); }

/* 수량 구간 막대의 자재 잔량 구간 (MOQ·롤 올림) */
.qbar .mx { background: var(--bad); }

/* ── 테크팩 ───────────────────────────────────────────── */

.tp-upload { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.tp-upload select, .tp-upload input[type=file] {
  background: var(--bg-elev2); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit;
}
.tp-upload select { min-width: 220px; }

.tp-apply { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.tp-apply input {
  flex: 1; min-width: 260px;
  background: var(--bg-elev2); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font: inherit;
}

.btn.tiny.on { background: var(--accent); border-color: var(--accent); color: #08121a; }

/* 단위 환산이 일어난 셀 표시. 숫자만 보면 바이어가 적은 값과 달라 보인다 */
.conv-mark { font-style: normal; color: var(--accent); margin-left: 4px; cursor: help; }

.diff-tag {
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  background: var(--line); color: var(--text-dim);
}
.diff-tag.d-NEW { background: #1f3a24; color: var(--good); }
.diff-tag.d-CHANGED { background: #3a2f1a; color: var(--warn); }
.diff-tag.d-MISSING { background: #3a1f1f; color: var(--bad); }

/* 테크팩 줄 편집 */
.tp-editor {
  margin-top: 14px; padding: 14px;
  background: var(--bg-elev2); border: 1px solid var(--accent); border-radius: 10px;
}
.tp-editor-head { font-weight: 700; font-size: 14px; margin-bottom: 10px; }
.tp-editor-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tp-editor-row select { min-width: 280px; }
.tp-editor-row input { width: 130px; }
.tp-editor-row select, .tp-editor-row input {
  background: var(--bg-elev); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit;
}
.btn.small { min-height: 36px; padding: 0 14px; font-size: 14px; }

/* ── 생산 계획 간트 ───────────────────────────────────── */

.gantt-row { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.gantt-label {
  flex: 0 0 110px; font-size: 13px; font-weight: 600;
  color: var(--text-dim); text-align: right;
}
.gantt-track {
  flex: 1; position: relative; height: 30px;
  background: var(--bg-elev2); border-radius: 6px;
  border: 1px solid var(--line-soft);
}
.gantt-bar {
  position: absolute; top: 3px; height: 24px;
  background: rgba(79, 184, 216, .22); border: 1px solid var(--accent);
  border-radius: 5px; font-size: 11px; line-height: 22px;
  padding: 0 7px; white-space: nowrap; overflow: hidden;
  color: var(--text); cursor: help;
}
/* 확정은 채워서 그린다 — 가배정과 눈으로 구분돼야 한다 */
.gantt-bar.confirmed { background: rgba(79, 184, 216, .45); }
.gantt-bar.late { border-color: var(--bad); background: rgba(248, 81, 73, .18); }

/* ── 재고 ───────────────────────────────────────────────── */
/* 로트는 자재에 딸린 줄이다. 같은 무게로 보이면 자재가 몇 종인지 안 보인다 */
tr.sub-row td { background: color-mix(in srgb, var(--bg) 70%, transparent); font-size: 0.92em; }
tr.sub-row td:first-child { padding-left: 20px; }
tr.warn-row td { border-top: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); }
tr.dim-row td { opacity: 0.85; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.stage-tag.s-CANCELLED { background: color-mix(in srgb, var(--bad) 18%, transparent); color: var(--bad); }

/* ── 운영 관리 ───────────────────────────────────────────── */
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-head h3 { margin: 0; flex: 0 0 auto; white-space: nowrap; }
/* 좁아지면 제목 옆에 설명을 두지 않는다. flex가 제목을 눌러 글자
   단위로 줄바꿈하면 한글이 세로로 선다 — 네비와 같은 문제다 */
@media (max-width: 860px) {
  .card-head { flex-direction: column; align-items: flex-start; gap: 6px; }
  .card-head h3 { white-space: normal; }
}

/* 발급된 비밀번호·PIN. 한 번만 보이고 닫으면 끝이라 눈에 띄어야 한다 */
.secret-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 20px; letter-spacing: .06em; word-break: break-all;
  padding: 14px 16px; margin-top: 8px;
  background: color-mix(in srgb, var(--warn) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent);
  border-radius: 10px; color: var(--text);
}

.toast-web {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: var(--panel, #1b2330); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 18px; font-weight: 600; z-index: 50;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
}

/* 민감도 격자 — 목표 회수기간을 넘는 조합과 아닌 조합을 색으로 가른다.
   "불가"는 색을 빼서 숫자가 있는 칸과 성격이 다르다는 걸 보인다. */
table.sens td.ok { background: rgba(63, 185, 80, 0.16); color: var(--good); font-weight: 600; }
table.sens td.here { outline: 2px solid var(--purple); outline-offset: -2px; }
table.sens tbody th { color: var(--text); font-weight: 600; padding: 9px 12px; }

/* 공정 칸반 — 가방은 공정이 20개라 가로 배치가 화면 밖으로 나간다 */
.wip { display: flex; flex-direction: column; gap: 4px; }
.wip-row {
  display: grid;
  grid-template-columns: 28px minmax(120px, 1.4fr) 3fr 64px 56px;
  align-items: center; gap: 10px;
  padding: 6px 8px; border-radius: 6px; font-size: 12.5px;
}
.wip-row.hot { background: rgba(248, 81, 73, 0.1); }
.wip-seq { color: var(--text-faint); font-variant-numeric: tabular-nums; text-align: right; }
.wip-name { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wip-bar { background: var(--bg-elev2); border-radius: 4px; height: 14px; overflow: hidden; }
.wip-bar i { display: block; height: 100%; background: var(--accent); }
.wip-row.hot .wip-bar i { background: var(--bad); }
.wip-qty, .wip-bundles {
  text-align: right; font-variant-numeric: tabular-nums;
  font-family: 'SF Mono', Menlo, monospace;
}
.wip-bundles { color: var(--text-faint); }
.wip-row.top { outline: 1px solid var(--accent); outline-offset: -1px; }

/* ── 라인 레이아웃 격자 ──────────────────────────────────
   작업대를 실제 배치대로 늘어놓는다. 목록으로 보면 역행이
   안 보이고, 역행은 위치로만 보인다. */
.ws-grid { display: flex; flex-direction: column; gap: 8px; overflow-x: auto; }
.ws-row { display: flex; gap: 8px; }
.ws-cell {
  min-width: 96px; padding: 8px 10px; border-radius: 6px;
  border: 1px solid var(--line); background: var(--bg-elev2);
  font-size: 12px; line-height: 1.45;
}
/* 빈 자리와 "작업대가 없는 칸"은 다르다 */
.ws-cell.empty { border-style: dashed; opacity: .3; }
.ws-cell.idle { border-color: var(--warn); }
/* 역행에 걸린 작업대 — 번들이 여기서 라인을 거슬러 간다 */
.ws-cell.back { border-color: var(--bad); box-shadow: inset 0 0 0 1px var(--bad); }
.ws-code { font-weight: 600; }
.ws-op { color: var(--text-dim); }
.ws-machine { color: var(--text-faint); font-size: 11px; }

/* 결재 — 올린 내용 원문. 바꿀 수 없는 값이라 그대로 보여준다 */
.payload {
  margin: 8px 0 0;
  padding: 10px 12px;
  background: var(--bg-elev2);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-dim);
  overflow-x: auto;
  white-space: pre;
}
