:root {
  --navy: #1f3a5f;
  --bg: #f3f5f8;
  --card: #fff;
  --line: #e3e7ee;
  --text: #1b2430;
  --muted: #6b7686;
  --in: #1565c0;
  --in-bg: #e7f0fc;
  --out: #d84315;
  --out-bg: #fdece6;
  --adj: #6a4fb3;
  --adj-bg: #efeafb;
  --warn: #c62828;
  --ok: #2e7d32;
  --radius: 14px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  background: var(--bg); color: var(--text); font-size: 16px; line-height: 1.4;
  overscroll-behavior-y: none;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.err { color: var(--warn); min-height: 1.2em; font-size: 14px; margin: 8px 0 0; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea {
  font: inherit; font-size: 16px; /* iOS 확대 방지 */
  width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--navy); outline-offset: -1px; border-color: transparent; }
label { display: block; font-size: 14px; color: var(--muted); margin: 12px 0 0; }
label > input, label > select, label > textarea { margin-top: 6px; }

.btn { border: 0; border-radius: 12px; padding: 12px 16px; font-weight: 600; background: #e8ecf2; }
.btn.primary { background: var(--navy); color: #fff; }
.btn.big { width: 100%; padding: 16px; font-size: 17px; margin-top: 18px; }
.btn.wide { width: 100%; }
.btn.ghost { background: transparent; color: var(--navy); }
.btn.in { background: var(--in); color: #fff; }
.btn.out { background: var(--out); color: #fff; }
.btn.adj { background: var(--adj); color: #fff; }
.btn:disabled { opacity: .5; }
.btn.small { padding: 6px 10px; font-size: 13px; border-radius: 8px; }

/* 로그인 */
.login { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 24px; background: linear-gradient(160deg, #1f3a5f, #2f5d8a); }
.login-card { background: #fff; border-radius: 20px; padding: 28px 22px; width: 100%; max-width: 380px; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.login-card h1 { margin: 4px 0 2px; font-size: 24px; }
.login-logo { font-size: 40px; }

/* 상단 */
.top {
  position: sticky; top: 0; z-index: 5; background: var(--navy); color: #fff;
  display: flex; justify-content: space-between; align-items: center;
  padding: calc(12px + var(--safe-t)) 16px 12px;
}
.top .title { font-weight: 700; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.who { font-size: 14px; opacity: .9; }
.live { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: #4caf50; box-shadow: 0 0 0 3px rgba(76,175,80,.3); }
.live.off { background: #ff7043; box-shadow: 0 0 0 3px rgba(255,112,67,.3); }
.offline { background: #fff3e0; color: #a14a00; font-size: 13px; padding: 8px 16px; text-align: center; position: sticky; top: 48px; z-index: 4; }

main { padding: 0 0 calc(80px + var(--safe-b)); max-width: 760px; margin: 0 auto; }
.view { padding: 12px 12px 0; }

.searchbar input { border-radius: 12px; padding: 13px 14px; background: #fff; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 14px; white-space: nowrap; font-size: 14px; }
.chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip.warn.on { background: var(--warn); border-color: var(--warn); }
.summary { font-size: 13px; color: var(--muted); padding: 6px 2px; }

.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.item {
  background: var(--card); border-radius: var(--radius); padding: 14px; display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--line); transition: background .6s;
}
.item:active { background: #eef2f7; }
.item.flash { background: #fff8d6; }
.item .info { flex: 1; min-width: 0; }
.item .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .qty { text-align: right; font-variant-numeric: tabular-nums; }
.item .qty b { font-size: 20px; }
.item .qty small { color: var(--muted); margin-left: 2px; }
.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; vertical-align: 1px; }
.badge.low { background: #fde7e7; color: var(--warn); }
.badge.cat { background: #eef1f6; color: #4b5668; }
.badge.IN { background: var(--in-bg); color: var(--in); }
.badge.OUT { background: var(--out-bg); color: var(--out); }
.badge.ADJUST { background: var(--adj-bg); color: var(--adj); }
.badge.CANCEL { background: #eceff1; color: #546e7a; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* 이력 */
.tx { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.tx .row1 { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.tx .what { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx .delta { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tx .delta.plus { color: var(--in); }
.tx .delta.minus { color: var(--out); }
.tx .row2 { font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; margin-top: 4px; }
.tx .note { font-size: 13px; margin-top: 4px; color: #3b4656; }
.tx.canceled .what, .tx.canceled .delta { text-decoration: line-through; opacity: .55; }

/* 하단 탭 */
.bottom {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 5; background: #fff; border-top: 1px solid var(--line);
  display: flex; padding-bottom: var(--safe-b);
}
.bottom button { flex: 1; border: 0; background: none; padding: 8px 0 10px; font-size: 12px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.bottom button span { font-size: 20px; filter: grayscale(1); opacity: .6; }
.bottom button.on { color: var(--navy); font-weight: 700; }
.bottom button.on span { filter: none; opacity: 1; }

/* 바텀시트 */
.sheet-wrap { position: fixed; inset: 0; z-index: 20; }
.sheet-bg { position: absolute; inset: 0; background: rgba(10,20,35,.45); animation: fade .15s; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 92vh; overflow-y: auto; background: #fff;
  border-radius: 20px 20px 0 0; padding: 8px 18px calc(20px + var(--safe-b)); animation: up .2s ease-out;
  max-width: 760px; margin: 0 auto;
}
.sheet-handle { width: 40px; height: 5px; background: #d5dae2; border-radius: 3px; margin: 2px auto 10px; }
@keyframes up { from { transform: translateY(40px); opacity: .4; } }
@keyframes fade { from { opacity: 0; } }
.sheet h2 { margin: 4px 0 2px; font-size: 20px; }
.sheet .head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.bigqty { text-align: center; padding: 18px 0 10px; font-variant-numeric: tabular-nums; }
.bigqty b { font-size: 40px; letter-spacing: -1px; }
.bigqty span { font-size: 18px; color: var(--muted); margin-left: 4px; }
.bigqty .safety { font-size: 13px; color: var(--muted); margin-top: 2px; }
.actions { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin: 6px 0 16px; }
.actions .btn { padding: 15px 0; font-size: 16px; }
.section-title { font-size: 14px; font-weight: 700; color: var(--muted); margin: 14px 0 8px; }

.form-type { font-size: 13px; font-weight: 700; }
.amount-input { font-size: 30px !important; text-align: right; font-weight: 700; padding: 14px; font-variant-numeric: tabular-nums; }
.preview { display: flex; justify-content: space-between; background: #f5f7fa; border-radius: 10px; padding: 12px 14px; margin-top: 12px; font-variant-numeric: tabular-nums; }
.preview b.neg { color: var(--warn); }
.quick { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.quick button { flex: 1; min-width: 50px; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 8px 0; font-size: 14px; }
.row-btns { display: flex; gap: 8px; margin-top: 18px; }
.row-btns .btn { flex: 1; padding: 15px; }

/* 설정 */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.card h3 { margin: 0 0 8px; font-size: 16px; }
.card .btn { margin-top: 8px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.user-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.user-row:last-child { border-bottom: 0; }
.check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 15px; }
.check input { width: auto; }

.toast {
  position: fixed; left: 50%; bottom: calc(90px + var(--safe-b)); transform: translateX(-50%); z-index: 40;
  background: #1b2430; color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 15px; max-width: 90vw; text-align: center;
  box-shadow: 0 6px 24px rgba(0,0,0,.25); animation: up .2s;
}
.toast.error { background: var(--warn); }
a.btn { color: var(--navy); }
.grid2 > label { min-width: 0; }
input[type=date] { min-width: 0; -webkit-appearance: none; appearance: none; min-height: 46px; }

/* 품목 사진 */
.thumb { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; background: #eef1f6; flex: none; }
.thumb.none { display: grid; place-items: center; font-size: 22px; opacity: .7; }
.photo-box { margin-top: 12px; }
.photo-big { width: 100%; max-height: 260px; object-fit: contain; background: #f3f5f8; border-radius: 12px; display: block; cursor: zoom-in; }
.photo-empty { height: 90px; border: 2px dashed var(--line); border-radius: 12px; display: grid; place-items: center; color: var(--muted); font-size: 14px; }
.photo-btns { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.photo-btns label.btn { margin: 0; color: var(--text); display: inline-block; cursor: pointer; }
.photo-btns label.btn[disabled] { opacity: .5; pointer-events: none; }
.move-head { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.move-head .thumb { width: 44px; height: 44px; }
.photo-viewer { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.92); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px; }
.photo-viewer img { max-width: 100%; max-height: 85vh; object-fit: contain; border-radius: 6px; }
.photo-viewer .cap { color: #ddd; font-size: 14px; margin-top: 12px; text-align: center; }

/* 창고 */
.whs { font-size: 12px; color: var(--navy); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.whname { font-size: 11px; color: var(--muted); }
#whChips .chip.on { background: #0f6e6e; border-color: #0f6e6e; }
.wh-list { background: #f5f7fa; border-radius: 12px; padding: 4px 12px; margin-bottom: 12px; }
.wh-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.wh-row:last-child { border-bottom: 0; }
.wh-row.zero { color: var(--muted); }
.wh-row small { color: var(--muted); font-weight: 400; margin-left: 2px; }
.actions.four { grid-template-columns: repeat(4, 1fr); }
:root { --mv: #0f6e6e; --mv-bg: #e2f3f2; }
.btn.mv { background: var(--mv); color: #fff; }
.badge.MOVE { background: var(--mv-bg); color: var(--mv); }
.tx .delta.move { color: var(--mv); }
.pick-title { font-size: 14px; color: var(--muted); margin: 12px 0 6px; }
.wh-pick { display: flex; gap: 8px; flex-wrap: wrap; }
.whbtn { border: 1.5px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 12px; text-align: left; font-size: 15px; font-weight: 600; min-width: 90px; }
.whbtn small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.whbtn.on { border-color: var(--navy); background: #eaf0f8; box-shadow: inset 0 0 0 1px var(--navy); }
.whbtn:disabled { opacity: .35; }
.wh-single { margin-top: 10px; font-size: 14px; color: var(--muted); }
.preview-box .preview { margin-top: 8px; }
.add-row { display: flex; gap: 8px; margin-top: 10px; }
.add-row .btn { margin: 0; white-space: nowrap; }
.btn.danger { background: var(--warn); color: #fff; }

/* 발주 */
.nav-badge { position: absolute; top: 4px; margin-left: 22px; background: var(--warn); color: #fff; font-style: normal; font-size: 11px; font-weight: 700; min-width: 18px; height: 18px; line-height: 18px; border-radius: 9px; padding: 0 5px; }
.bottom button { position: relative; }
.badge.st-REQUESTED { background: #fff3e0; color: #b45309; }
.badge.st-ORDERED { background: var(--in-bg); color: var(--in); }
.badge.st-RECEIVED { background: #e6f4ea; color: var(--ok); }
.badge.st-REJECTED, .badge.st-CANCELED { background: #eceff1; color: #546e7a; }
.badge.ok { background: #e6f4ea; color: var(--ok); }
.pr { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.pr-top { display: flex; gap: 10px; align-items: flex-start; }
.pr-top .info { flex: 1; min-width: 0; }
.pr-top .name { font-weight: 600; }
.pr-top .sub { font-size: 13px; color: var(--muted); }
.pr-body { font-size: 14px; margin-top: 8px; display: flex; flex-direction: column; gap: 3px; }
.pr-body .muted { font-size: 13px; }
.pr-body .badges { margin-top: 2px; }
.pr-btns { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.pr-btns .btn { flex: 1; padding: 11px 8px; font-size: 15px; text-align: center; text-decoration: none; color: var(--text); }
.pr-btns .btn.primary { color: #fff; }
.pr-banner { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-radius: 12px; padding: 10px 12px; margin: -4px 0 14px; font-size: 14px; }
.pr-banner small { color: var(--muted); }
.pr-banner .btn { white-space: nowrap; margin: 0; }
.pr-banner.low { background: #fdecea; color: #8a1c1c; }
.pr-banner.req { background: #fff3e0; color: #7a4a00; }
.pr-banner.ord { background: var(--in-bg); color: #0d3c78; }
.pr-banner.plain { background: #f5f7fa; }
.dialog-wrap { position: fixed; inset: 0; z-index: 60; background: rgba(10,20,35,.55); display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .15s; }
.dialog { background: #fff; border-radius: 18px; padding: 22px 18px 14px; width: 100%; max-width: 360px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.35); animation: up .2s; }
.dialog h3 { margin: 6px 0 8px; font-size: 19px; }
.dialog p { margin: 0 0 6px; color: #3b4656; font-size: 15px; }
.dialog-icon { font-size: 40px; }
.dialog .btn.big { margin-top: 14px; }
textarea { resize: vertical; }

/* 입고예정 */
.incoming { font-size: 12px; color: #0d3c78; margin-top: 2px; font-weight: 600; }
.incoming.late, b.late { color: var(--warn); }
.pr-banner.col { align-items: flex-start; flex-direction: column; }
.banner-btns { display: flex; gap: 6px; width: 100%; justify-content: flex-end; }
.progress { height: 6px; background: #e6ebf2; border-radius: 3px; overflow: hidden; margin-top: 4px; }
.progress i { display: block; height: 100%; background: var(--in); }
.incoming-link { background: var(--in-bg); padding: 10px 12px; border-radius: 10px; font-size: 14px; }
.incoming-link small { color: var(--muted); }

/* 지급 */
.pay-upload { list-style: none; }
.upload-btn { display: block; text-align: center; color: #fff !important; margin-top: 4px; cursor: pointer; }
.pay-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pay-sum div { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px; text-align: center; }
.pay-sum small { display: block; color: var(--muted); font-size: 12px; }
.pay-sum b { font-size: 16px; font-variant-numeric: tabular-nums; }
.pay-row { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.pay-row .amt { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pay-row .amt .btn { margin-top: 4px; }
.ok-text { color: var(--ok); }
li.section-title { list-style: none; margin: 10px 0 0; }

/* ===== 컴퓨터 (넓은 화면) ===== */
@media (min-width: 900px) {
  :root { --side: 190px; }
  body { font-size: 15px; }
  .top { position: fixed; left: 0; right: 0; top: 0; height: 56px; padding: 0 20px; z-index: 6; }
  #offline { position: fixed; top: 56px; left: var(--side); right: 0; }
  .bottom { top: 56px; bottom: 0; left: 0; right: auto; width: var(--side); flex-direction: column; justify-content: flex-start;
    border-top: 0; border-right: 1px solid var(--line); padding: 14px 10px; gap: 4px; }
  .bottom button { flex: none; flex-direction: row; gap: 10px; font-size: 15px; padding: 11px 14px; border-radius: 10px; justify-content: flex-start; }
  .bottom button.on { background: #eaf0f8; }
  .bottom button span { font-size: 18px; }
  .nav-badge { position: static; margin-left: auto; }
  main { margin: 0 0 0 var(--side); max-width: none; padding: 70px 24px 40px; }
  .view { max-width: 1280px; padding: 0; }
  .demo-bar { margin-left: var(--side); margin-top: 56px; }
  .chips { flex-wrap: wrap; overflow: visible; }

  /* 재고 표 */
  #itemList.table { gap: 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
  .trow { display: grid; grid-template-columns: var(--cols); align-items: center; gap: 12px; padding: 8px 14px; border-bottom: 1px solid var(--line); border-radius: 0 !important; border-left: 0 !important; border-right: 0 !important; border-top: 0 !important; }
  .trow.item { cursor: pointer; }
  .trow.item:hover { background: #f5f8fc; }
  .trow .thumb { width: 44px; height: 44px; }
  .thead { background: #f5f7fa; font-size: 13px; color: var(--muted); font-weight: 700; z-index: 1; padding: 10px 14px; }
  .trow .num { text-align: right; font-variant-numeric: tabular-nums; }
  .trow .num.zero { color: #c3cad5; }
  .trow .state { font-size: 13px; }
  .trow .incoming { display: inline; }

  /* 이력·발주: 두 줄 카드 */
  .tx-list, #historyList { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  #prList { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-items: start; }
  #prList > li:not(.pr) { grid-column: 1 / -1; }
  #prList .pay-row { grid-column: auto; }
  #moreHistory { max-width: 400px; margin: 10px auto; display: block; }

  /* 상세·입력 창 → 오른쪽 패널 */
  .sheet { top: 0; bottom: 0; left: auto; right: 0; width: 480px; max-height: none; border-radius: 0; padding: 20px 24px; animation: slide .2s ease-out; }
  .sheet-handle { display: none; }
  .sheet .tx-list { grid-template-columns: 1fr; }
  .sheet-bg { background: rgba(10,20,35,.25); }
  @keyframes slide { from { transform: translateX(40px); opacity: .5; } }
  .toast { bottom: 30px; left: calc(50% + var(--side) / 2); }
  .sim-panel { left: auto !important; width: 420px; }

  /* 설정: 두 열 */
  #view-settings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
  #view-settings .card { margin: 0; }
  #view-settings > p { grid-column: 1 / -1; }
}
@media (min-width: 1500px) {
  #prList, .tx-list, #historyList { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* 계정 */
.login-note { background: #f3f6fb; border-radius: 10px; padding: 10px 12px; font-size: 14px; margin: 12px 0 0; line-height: 1.5; }
.invite-code { font-size: 30px; font-weight: 800; letter-spacing: 3px; text-align: center; background: #f3f6fb; border-radius: 12px; padding: 14px; margin: 10px 0 6px; font-variant-numeric: tabular-nums; }
.invite-link { font-size: 12px; color: var(--muted); word-break: break-all; text-align: center; margin-bottom: 8px; user-select: all; }

.summary { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.summary .btn { margin: 0; }
/* 거래명세서 → 입고 */
.sum-btns { display: flex; gap: 6px; }
.file-btn { display: block; text-align: center; margin: 14px 0; }
.stmt-reading { text-align: center; padding: 28px 10px; }
.spinner { width: 36px; height: 36px; margin: 0 auto 12px; border: 4px solid var(--line); border-top-color: var(--navy); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.stmt-head { display: flex; gap: 12px; align-items: flex-start; margin: 6px 0 10px; font-size: 14px; line-height: 1.5; }
.stmt-img { width: 96px; height: 128px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); cursor: zoom-in; flex: none; }
.stmt-note { background: #fff7e0; border-radius: 8px; padding: 8px 10px; font-size: 13px; }
.stmt-lines { list-style: none; padding: 0; margin: 8px 0; }
.stmt-lines > li { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; display: block; }
.stmt-lines:not(.edit) > li { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.stmt-lines .plus { color: var(--in); }
.stmt-lines > li.off { opacity: .55; }
.stmt-lines .check span { line-height: 1.35; }
.stmt-match { font-size: 12px; font-weight: 700; margin: 6px 0 4px; }
.stmt-match.ok { color: var(--ok); } .stmt-match.warn { color: #b26a00; } .stmt-match.bad { color: var(--warn); }
.stmt-row { display: flex; gap: 8px; align-items: flex-end; margin: 6px 0; }
.stmt-row select, .stmt-row label { flex: 1; min-width: 0; }
.stmt-row label { margin: 0; font-size: 13px; }
.stmt-row .btn { margin: 0; flex: none; }
.stmt-warn { font-size: 12px; color: #b26a00; margin: 4px 0; }
.badge.st-DRAFT { background: #fff2d6; color: #b26a00; }
.badge.st-APPLIED { background: #e6f4ea; color: var(--ok); }
.badge.st-DISCARDED, .badge.st-FAILED { background: #eee; color: var(--muted); }
/* 생산관리 */
.pbar { height: 8px; background: var(--line); border-radius: 6px; overflow: hidden; margin: 6px 0 2px; }
.pbar i { display: block; height: 100%; background: var(--navy); border-radius: 6px; transition: width .3s; }
.pbar.done i { background: var(--ok); }
.proj { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 8px; cursor: pointer; list-style: none; }
.proj .row1, .proj .row2, .stage .row1, .daily .row1, .dl { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.proj .row2 { font-size: 13px; margin-top: 2px; }
.proj-add { list-style: none; margin-bottom: 10px; }
.late { color: var(--warn); font-weight: 700; }
.proj-big { display: flex; align-items: baseline; gap: 6px; }
.proj-big b { font-size: 34px; font-variant-numeric: tabular-nums; }
.proj-big span { color: var(--muted); }
.proj-big em { margin-left: auto; font-style: normal; font-weight: 700; color: var(--navy); font-size: 18px; }
.stages .stage { font-size: 14px; margin-bottom: 8px; }
.stage em, .dl em { color: var(--warn); font-style: normal; font-size: 12px; }
.mat-table { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; font-size: 13px; }
.mat-table .mh, .mat-table .mr { display: grid; grid-template-columns: 1fr 64px 76px 70px; gap: 6px; padding: 8px 10px; align-items: start; }
.mat-table .mh { background: #f4f6f9; color: var(--muted); font-size: 12px; }
.mat-table .mh span:not(:first-child), .mat-table .mr > span:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.mat-table .mr { border-top: 1px solid var(--line); }
.mat-table .mr small { display: block; color: var(--muted); font-size: 11px; }
.mat-table .mr small.neg { color: var(--warn); }
.mat-table .mr.short { background: #fff4f2; }
.short-line { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; color: var(--warn); font-weight: 600; }
.short-line .btn { margin: 0; }
.bom-lines { list-style: none; padding: 0; margin: 6px 0; }
.bom-lines li { border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin-bottom: 8px; }
.bom-preview { border: 1px dashed var(--line); border-radius: 10px; padding: 6px 10px; margin: 6px 0 10px; }
.daily-range { list-style: none; display: flex; gap: 6px; align-items: center; margin-bottom: 10px; }
.daily-range input { flex: 1; }
.daily { list-style: none; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 8px; }
.daily .row1 { margin-bottom: 6px; }
.dw { border-top: 1px solid var(--line); padding: 6px 0; font-size: 14px; }
.dl { font-size: 13px; color: var(--text); padding: 2px 0 0 20px; }
/* 생산계획 달력 */
.cal-head { list-style: none; display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.cal-head b { font-size: 18px; flex: 1; text-align: center; }
.cal-head .btn { margin: 0; }
.cal-warn { list-style: none; background: #fff4f2; border: 1px solid #f3c7bf; border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; font-size: 13px; color: var(--warn); }
.cal-warn > div { color: var(--text); padding: 4px 0 0; cursor: pointer; }
.cal { list-style: none; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 8px; margin-bottom: 8px; }
.cw, .cg { display: grid; grid-template-columns: repeat(7, 1fr); }
.cw span { text-align: center; font-size: 12px; color: var(--muted); padding: 2px 0 4px; }
.cw span:first-child { color: var(--warn); }
.cd { min-height: 58px; border-top: 1px solid var(--line); padding: 2px 0 3px; cursor: pointer; position: relative; }
.cd.empty { cursor: default; }
.cd .dn { display: block; font-size: 12px; padding-left: 3px; }
.cd.we .dn { color: var(--muted); }
.cd.today .dn { color: #fff; background: var(--navy); border-radius: 9px; display: inline-block; min-width: 18px; text-align: center; margin-left: 2px; }
.cd.sel { background: #eaf0f8; }
.cd .pb { display: block; height: 5px; margin: 2px 0 0; opacity: .85; }
.cd .pb.s { margin-left: 3px; border-radius: 3px 0 0 3px; }
.cd .pb.e { margin-right: 3px; border-radius: 0 3px 3px 0; }
.cd small { font-size: 10px; color: var(--muted); padding-left: 3px; }
.cd .marks { font-size: 11px; padding-left: 2px; line-height: 1.3; }
.cd .marks b { color: var(--ok); margin-left: 2px; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 8px; font-size: 12px; }
.cal-legend span { cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.cal-legend i, .cdl > i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }
.cal-day { list-style: none; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.cdl { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; border-top: 1px solid var(--line); font-size: 14px; cursor: pointer; }
.cdl > i { margin-top: 5px; }
.cdl span { flex: 1; }
.cdl em { font-style: normal; color: var(--ok); font-size: 13px; white-space: nowrap; }
/* 회사 간 거래명세서 */
.ist-filter { list-style: none; margin-bottom: 8px; }
.chips.sub { margin-bottom: 6px; }
.chips.sub .chip { font-size: 13px; padding: 6px 10px; }
.ist-search { display: flex; gap: 6px; align-items: center; }
.ist-search input[type=search] { flex: 2; min-width: 0; }
.ist-search input[type=date] { flex: 1; min-width: 0; font-size: 13px; padding: 8px 4px; }
.ist-sum { list-style: none; background: #f4f6f9; border-radius: 12px; padding: 8px 12px; margin-bottom: 8px; font-size: 13px; }
.ist-sum div { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; }
.ist-sum em, .isl-sub em { color: var(--warn); font-style: normal; font-weight: 600; }
.ist { list-style: none; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; margin-bottom: 8px; }
.ist .row1 { display: flex; justify-content: space-between; }
.ist-co { display: flex; align-items: center; gap: 6px; font-size: 14px; margin: 2px 0 4px; }
.ist-co .btn { margin: 0 0 0 auto; }
.isl { display: flex; gap: 8px; align-items: flex-start; border-top: 1px solid var(--line); padding: 8px 0 4px; font-size: 14px; }
.isl input[type=checkbox], .isl .ck { width: 20px; height: 20px; margin-top: 2px; flex: none; }
.isl .isl-main { flex: 1; min-width: 0; }
.isl .btn { margin: 0; flex: none; }
.isl-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.isl.CANCELED { opacity: .5; }
.isl.CANCELED .isl-main > b { text-decoration: line-through; }
.isl.fix { background: #fff4f2; }
.isl-fix { color: var(--warn); font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.ist-bar { list-style: none; position: sticky; bottom: 70px; font-size: 14px; background: var(--navy); color: #fff; border-radius: 14px; padding: 10px 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; z-index: 5; }
.ist-bar .btn { margin: 0; background: #fff; color: var(--navy); }
.ist-prices div { display: flex; align-items: center; gap: 8px; font-size: 14px; padding: 4px 0; }
.ist-prices div span { flex: 1; }
.ist-prices .btn { margin: 0; }
.ist-bar .btn { white-space: nowrap; padding: 10px 12px; }
/* 🎤 말로 입력 */
.voice-fab { position: fixed; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom)); width: 58px; height: 58px; border-radius: 50%; border: 0; background: var(--navy); color: #fff; font-size: 26px; box-shadow: 0 4px 14px rgba(0,0,0,.25); z-index: 20; cursor: pointer; }
.voice-fab:disabled { opacity: .4; }
@media (min-width: 900px) { .voice-fab { bottom: 24px; right: 24px; } }
.voice-said { background: #f4f6f9; border-radius: 10px; padding: 8px 12px; font-size: 15px; margin: -4px 0 10px; }
.vhead { display: flex; align-items: center; gap: 8px; }
.vhead .check { margin: 0; }
.vtype { width: auto; flex: none; font-weight: 700; }
.vtype.in { color: var(--in); } .vtype.out { color: var(--out); } .vtype.mv { color: var(--mv); }
.vok { color: var(--ok); font-weight: 700; font-size: 14px; margin: 4px 0; }
.stmt-lines > li.vdone { background: #f1f8f3; }
#vText { width: 100%; box-sizing: border-box; font-size: 17px; }
.ai-use { width: 100%; border-collapse: collapse; font-size: 13px; margin: 8px 0 4px; }
.ai-use th, .ai-use td { padding: 4px 6px; border-bottom: 1px solid var(--line); text-align: right; }
.ai-use th:first-child, .ai-use td:first-child { text-align: left; }
.file-btns { display: flex; gap: 8px; margin: 14px 0; }
.file-btns .file-btn { flex: 1; margin: 0; text-align: center; }
.isl-btns { display: flex; gap: 4px; flex: none; }
.stmt-imgbox { display: flex; flex-direction: column; align-items: center; gap: 2px; flex: none; }
.stmt-noimg { display: flex; flex-direction: column; align-items: center; justify-content: center; background: #f1f3f6; color: var(--muted); font-size: 28px; text-align: center; }
.stmt-noimg small { font-size: 10px; line-height: 1.2; }
.ist-bar-btns { display: flex; gap: 6px; }
.ist-bar .btn { font-size: 13px; padding: 8px 10px; }
.ist-sum [data-pair] { cursor: pointer; }

/* v10 매입 단가 */
.buy-sum{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;margin:4px 0 8px}
.buy-sum>div{background:var(--card2,#f4f6f9);border-radius:10px;padding:8px;display:flex;flex-direction:column;gap:2px;min-width:0}
.buy-sum small{font-size:11px;color:var(--muted,#667);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.buy-sum b{font-size:16px}
.buy-list{list-style:none;margin:0 0 6px;padding:0}
.buy-list li{display:flex;align-items:center;gap:8px;padding:7px 0;border-bottom:1px solid var(--line,#e5e7eb);font-size:13px}
.buy-list li>span:first-child{flex:1;min-width:0}
.buy-list .r{text-align:right}
.buy-hint{font-size:12px;margin:3px 0;padding:4px 8px;border-radius:8px;background:var(--card2,#f4f6f9)}
.buy-hint .neg{color:#d33}

/* v10 공정 한 화면 기록 */
.stage-grid{display:flex;flex-direction:column;gap:4px;margin-bottom:8px}
.stage-grid .sg-h,.stage-grid .sg-r{display:grid;grid-template-columns:1fr 64px 72px 60px;gap:6px;align-items:center}
.stage-grid .sg-h{font-size:12px;color:var(--muted,#667);padding:0 4px}
.stage-grid .sg-r{padding:6px 4px;border-radius:10px;border:1px solid var(--line,#e5e7eb);font-size:14px}
.stage-grid .sg-r.filled{border-color:var(--mv,#7a5cff);background:rgba(122,92,255,.06)}
.stage-grid .sg-r>span:nth-child(2){font-size:12px;text-align:right}
.stage-grid input{width:100%;padding:8px 6px;font-size:16px;text-align:right;box-sizing:border-box}
.sg-saved{font-size:13px;color:#1a7f37;background:rgba(26,127,55,.08);border-radius:8px;padding:6px 8px;margin-bottom:6px}
.stage[data-stagego]{cursor:pointer}
.newmat{border:1px dashed var(--line,#cbd2dc);border-radius:10px;padding:8px;margin:6px 0;background:var(--card2,#f7f9fb)}

/* v11 */
.toolrow{display:flex;gap:6px;margin:6px 0 2px;overflow-x:auto}
.toolrow .btn{white-space:nowrap;flex:0 0 auto}
.bizwarn{font-size:13px;margin:2px 0 6px;padding:5px 8px;border-radius:8px;background:#fff6e0;color:#8a5a00}
.bizday{color:#8a5a00}
.bsearch{position:relative;margin:8px 0}
.bsearch input{width:100%;box-sizing:border-box}
.bres{list-style:none;margin:4px 0 0;padding:0;border:1px solid var(--line,#e5e7eb);border-radius:10px;overflow:hidden}
.bres li{display:flex;justify-content:space-between;gap:8px;padding:10px;border-bottom:1px solid var(--line,#e5e7eb);cursor:pointer;font-size:14px}
.bres li:last-child{border-bottom:0}
.bres li:active{background:var(--card2,#f4f6f9)}
.blines{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px}
.blines li{border:1px solid var(--line,#e5e7eb);border-radius:10px;padding:8px}
.blines li.short{border-color:#d33}
.blines .bl1{display:flex;align-items:center;gap:6px}
.blines .bl1 b{flex:0 1 auto}.blines .bl1 small{flex:1}
.blines .bl2{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin-top:4px}
.blines .bl2 input{font-size:16px;text-align:right}
.past-list,.imp-list{list-style:none;margin:0;padding:0}
.past-list li{display:flex;justify-content:space-between;gap:8px;padding:8px 2px;border-bottom:1px solid var(--line,#e5e7eb);font-size:14px}
.past-list .r{text-align:right;white-space:nowrap}
.imp-sum{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;margin:4px 0}
.imp-sum button{border:1px solid var(--line,#e5e7eb);background:var(--card2,#f4f6f9);border-radius:10px;padding:6px;display:flex;flex-direction:column;align-items:center;font:inherit;color:inherit}
.imp-sum button.on{outline:2px solid var(--primary,#1e3a5f)}
.imp-sum button.bad{background:#fdecec;color:#b00}
.imp-sum b{font-size:18px}.imp-sum small{font-size:11px}
.imp-list li{padding:7px 2px;border-bottom:1px solid var(--line,#e5e7eb);font-size:14px}
.subbom{margin:4px 0 0 8px;padding:4px 8px;border-left:3px solid var(--line,#cbd2dc);font-size:12px;color:var(--muted,#667)}
.past-list .neg{color:#d33}

/* v11.1 포장 내역 */
.pack-sum{font-size:13px;margin:4px 0 6px;padding:6px 8px;border-radius:8px;background:rgba(26,127,55,.08);color:#1a5f2f}
.pack-sum.bad{background:#fdecec;color:#b00}
.pack-tag{border:1px solid var(--line,#d6dbe3);background:var(--card2,#f4f6f9);border-radius:999px;padding:2px 8px;font-size:12px;margin-right:6px;color:inherit;font-family:inherit;cursor:pointer}
.pallet{border:1px solid var(--line,#e5e7eb);border-radius:10px;padding:8px;margin:6px 0}
.pallet-h{font-weight:600;margin-bottom:6px}
.rolls{display:grid;grid-template-columns:repeat(5,1fr);gap:4px}
.rolls span{background:var(--card2,#f4f6f9);border-radius:6px;padding:4px;text-align:center;font-weight:600;font-size:14px;display:flex;flex-direction:column}
.rolls small{font-size:10px;font-weight:400;color:var(--muted,#667)}
textarea#packText,textarea#packIn,textarea[data-f="packing"]{width:100%;box-sizing:border-box;font-size:16px;font-family:inherit}
.pack-row{margin:2px 0 4px}.pack-tag{white-space:nowrap}

/* v11.2 거래처 */
.vbox{border:1px solid var(--line,#d6dbe3);border-radius:12px;padding:10px;margin:8px 0;font-size:14px;background:var(--card2,#f7f9fb)}
.vbox.ok{background:rgba(26,127,55,.07);border-color:rgba(26,127,55,.3)}
.vread{margin:6px 0;padding:6px 8px;background:#fff;border-radius:8px;line-height:1.5}
.vread.sim{background:#fff8e6}
.vread .warn{color:#8a5a00}
.vbtns{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}
.vf{display:block;font-size:12px;margin:4px 0}
.vf input{width:100%;box-sizing:border-box;font-size:16px}
.vlist{list-style:none;margin:8px 0;padding:0}
.vlist li{padding:9px 4px;border-bottom:1px solid var(--line,#e5e7eb);cursor:pointer;position:relative;font-size:14px}
.vcnt{position:absolute;right:4px;top:10px;font-size:11px;background:var(--card2,#eef1f5);border-radius:999px;padding:1px 7px}
.vchips{display:flex;flex-wrap:wrap;gap:4px;align-items:center;margin:-2px 0 6px}
.vchips .chip{font-size:13px;padding:4px 10px}
.vchip-on{font-size:13px;margin:-2px 0 6px;padding:5px 8px;border-radius:8px;background:rgba(26,127,55,.08)}
.vsum{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;margin-bottom:6px}
.vsum>div{background:var(--card2,#f4f6f9);border-radius:10px;padding:8px 4px;text-align:center;display:flex;flex-direction:column;min-width:0}
.vsum b{font-size:15px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vsum small{font-size:11px;color:var(--muted,#667)}
.vitems{list-style:none;margin:0 0 6px;padding:0}
.vitems li{display:flex;justify-content:space-between;gap:8px;padding:8px 2px;border-bottom:1px solid var(--line,#e5e7eb);font-size:14px}
.vitems li[data-vitem],.vitems li[data-vstmt]{cursor:pointer}
.vitems .r{text-align:right;white-space:nowrap}

/* v11.4 서류 연결 */
.link-box{border:1px dashed var(--line,#c9d1dc);border-radius:10px;padding:8px;margin:6px 0;background:#fbfcfe}
.link-h{font-size:13px;font-weight:600;margin-bottom:4px}
.link-box .check{display:flex;gap:8px;align-items:flex-start;font-size:14px;margin:6px 0}
.link-box .check input{margin-top:3px}
.link-ok{font-size:12px;color:#1a5f2f;background:rgba(26,127,55,.08);border-radius:8px;padding:5px 8px}
.link-diff{font-size:13px;background:#fff6e0;color:#6b4700;border-radius:8px;padding:6px 8px}
.link-diff .check{font-size:13px;margin:4px 0 0}

/* v12 발주 건 정산 */
.spill{display:inline-block;font-size:12px;border-radius:999px;padding:2px 8px;margin:2px 4px 2px 0;white-space:nowrap;background:#eef1f5;color:#4b5563}
.spill.ok{background:rgba(26,127,55,.12);color:#16632f}
.spill.no{background:#fdecec;color:#b42318}
.spill.part{background:#fff3d6;color:#8a5a00}
.spill.na{background:#eef1f5;color:#6b7684}
.settle-top{list-style:none}
.settle-row{list-style:none;background:var(--card,#fff);border:1px solid var(--line,#e5e7eb);border-radius:12px;padding:10px;margin:6px 0;cursor:pointer}
.settle-row.done{opacity:.75}
.settle-row .sr1{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.spills{margin-top:4px}
.settle-sec{border:1px solid var(--line,#e5e7eb);border-radius:12px;padding:10px;margin:10px 0}
.ss-h{font-weight:700;margin-bottom:6px}
.ss-item{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:6px 0;border-bottom:1px dashed var(--line,#e5e7eb);font-size:14px}
.ss-btns{display:flex;flex-wrap:wrap;gap:6px;margin:6px 0 2px}
.small-check{font-size:13px;margin:4px 0}
.docs{list-style:none;margin:4px 0;padding:0}
.doc-row{display:flex;justify-content:space-between;gap:8px;padding:8px;border-radius:10px;background:var(--card2,#f6f8fb);margin:4px 0;cursor:pointer;font-size:14px}
.doc-row .r{text-align:right}
.settle-sum{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;background:var(--card2,#f4f6f9);border-radius:12px;padding:10px;margin-top:6px}
.settle-sum>div{display:flex;flex-direction:column;font-size:12px}.settle-sum b{font-size:15px}
.grid3{display:grid;grid-template-columns:1fr 1fr 1fr;gap:6px}
.grid3 input{width:100%;box-sizing:border-box}
.cost-img{width:100%;max-height:220px;object-fit:contain;background:#f2f4f7;border-radius:10px;margin:6px 0;cursor:zoom-in}
.pr-pick{list-style:none;margin:0 0 6px;padding:0;max-height:320px;overflow:auto}
.pr-pick li{border-bottom:1px solid var(--line,#e5e7eb)}
.pr-pick .check{display:flex;gap:8px;align-items:flex-start;padding:7px 2px;font-size:14px}
.pr-pick input{margin-top:3px}
.share-thumbs{display:flex;gap:6px;overflow-x:auto;margin:6px 0 10px;align-items:center}
.share-thumbs img{height:84px;border-radius:8px;object-fit:cover}
.share-opts{display:flex;flex-direction:column;gap:8px}
.share-opt{display:flex;flex-direction:column;align-items:flex-start;gap:2px;text-align:left;border:1px solid var(--line,#d6dbe3);background:var(--card,#fff);border-radius:12px;padding:12px;font:inherit;color:inherit;cursor:pointer}
.share-opt b{font-size:16px}.share-opt small{color:var(--muted,#667);font-size:12px}
.toolrow label.btn{display:inline-flex;align-items:center;margin:0}
.file-btns{display:flex;gap:6px;flex-wrap:wrap;align-items:stretch}.file-btns>.btn{display:inline-flex;align-items:center;justify-content:center;margin:0}

/* v12.1 메일 세금계산서 */
.mail-box{background:var(--card,#fff);border:1px solid var(--line,#e5e7eb);border-radius:12px;padding:10px;margin:8px 0}
.mail-box:empty{display:none}
.mtx-h{font-weight:700}
.mtx-list{list-style:none;margin:0;padding:0}
.mtx{padding:8px 4px;border-bottom:1px solid var(--line,#e5e7eb);cursor:pointer;font-size:14px}
.mtx.err{cursor:default}
.mtx1{display:flex;align-items:center;gap:6px}
.mtx-amt{margin-left:auto;font-weight:700}
.mtx-table{width:100%;border-collapse:collapse;font-size:13px;margin:8px 0}
.mtx-table th,.mtx-table td{border-bottom:1px solid var(--line,#e5e7eb);padding:6px 4px;text-align:right}
.mtx-table th:first-child,.mtx-table td:first-child{text-align:left}
.mtx-table tr.sum td{font-weight:700}
.co-grid{display:grid;grid-template-columns:1fr 1fr;gap:0 10px}
.co-grid label.wide{grid-column:1/-1}
.warn-txt{color:#b26a00}
/* v12.3 이력: 한 줄 목록, 누르면 펼침 */
#historyList.cx-list { display: flex; flex-direction: column; gap: 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.tx.cx { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 0; }
.tx.cx:last-child { border-bottom: 0; }
.cx-line { display: flex; align-items: center; gap: 8px; padding: 9px 12px; cursor: pointer; min-height: 40px; }
.cx-line:hover { background: #f5f7fa; }
.tx.cx.open .cx-line { background: #eef3fb; }
.cx-line .badge { flex: none; }
.cx-line .what { flex: 1 1 auto; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-line .cx-wh { flex: 0 1 190px; min-width: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-line .delta { flex: none; text-align: right; min-width: 70px; }
.cx-line .cx-time { flex: none; font-size: 12px; width: 52px; text-align: right; white-space: nowrap; }
.cx-line .cx-arrow { flex: none; color: var(--muted); width: 12px; }
.cx-body { padding: 4px 14px 12px 14px; background: #f8fafd; border-top: 1px dashed var(--line); }
.cx-full { font-size: 14px; margin: 6px 0 2px; word-break: keep-all; }
@media (max-width: 640px) {
  .cx-line { gap: 6px; padding: 9px 10px; }
  .cx-line .cx-wh { display: none; }
  .cx-line .delta { min-width: 0; }
  .cx-line .cx-time { width: auto; }
}
.small-sel{padding:4px 6px;border:1px solid var(--line);border-radius:8px;font-size:13px;background:#fff;width:auto}
.mt-range{display:flex;flex-wrap:wrap;align-items:center;gap:6px;font-size:13px;margin:6px 0}.mt-range input[type=date]{width:auto;padding:5px 6px;font-size:14px;margin:0}.mt-quick{display:flex;gap:4px}.mt-quick .chip{padding:3px 9px;font-size:12px}
.tx.tx-doc{cursor:pointer}.tx.tx-doc:hover{background:#f7f9fc}
/* v13 롤 재고 */
.roll-box{margin-top:6px}
.roll-wh{background:#f8fafd;border:1px solid var(--line);border-radius:12px;padding:8px 10px;margin:6px 0}
.roll-wh-h{font-size:14px;margin-bottom:4px}
.roll-chip{display:inline-flex;flex-direction:column;align-items:center;justify-content:center;min-width:46px;padding:4px 6px;margin:2px;border:1px solid var(--line);border-radius:10px;background:#fff;font-weight:700;font-size:14px;line-height:1.1;cursor:pointer;font-variant-numeric:tabular-nums}
.roll-chip small{font-size:10px;color:var(--muted);font-weight:500}
.roll-chip.cut{border-color:#f0a35e;background:#fff6ec}
.roll-chip.used{opacity:.4;text-decoration:line-through}
.roll-chip.on{background:var(--navy);border-color:var(--navy);color:#fff}
.roll-chip.on small{color:#cfe0ff}
.roll-foot{display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap;margin-top:4px}
.roll-pick{margin:6px 0 4px;padding:8px;border:1px dashed var(--line);border-radius:12px}
.roll-pick .rolls{display:grid;grid-template-columns:repeat(6,1fr);gap:4px;margin:2px 0 6px}
.pal-lbl{font-size:11px;color:var(--muted);margin-right:4px;min-width:18px}
.pal-lbl::before{content:'📦'}
.roll-pick-sum{font-size:13px;margin-top:6px;display:flex;gap:6px;align-items:center;flex-wrap:wrap}
.roll-big{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:8px 0}
.roll-big div{background:#f5f7fa;border-radius:10px;padding:8px;text-align:center}
.roll-big b{display:block;font-size:18px}
.vitems .minus{color:var(--out)}
.rolls .roll-chip{margin:0;min-width:0}
.doc-rolls{background:#eef5ff;border:1px solid #cfe0ff;border-radius:10px;padding:8px 10px;font-size:13px;margin:4px 0 8px;line-height:1.5}.doc-link{display:inline-block;margin-left:6px;font-size:12px}
.pack-grid .rolls{grid-template-columns:repeat(6,1fr)}
.buy-amt{font-size:13px}.buy-amt b{color:var(--navy)}
.tx-amt{font-size:13px;margin:4px 0 2px;color:var(--text)}.tx-amt b{color:var(--navy)}
/* 새 버전 받기 */
.upd-list { list-style: none; margin: 8px 0 0; padding: 0; }
.upd-list li { border-top: 1px solid var(--line); padding: 8px 0; }
.upd-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.upd-st { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.upd-notes { white-space: pre-wrap; font-size: 12px; color: var(--muted); padding: 4px 0; }
/* 이력 → 입고: 체크해서 판매 */
.insell-bar { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 8px; }
.tx-list .day-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 4px 4px; background: none; border: 0; font-size: 14px; }
.tx-list li.insell { display: flex; align-items: center; gap: 6px; padding: 8px 10px; }
.tx-list li.insell > label { flex: 1; display: flex; align-items: center; gap: 8px; margin: 0; min-width: 0; }
.tx-list li.insell .what { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tx-list li.insell .what small { font-size: 11px; }
.tx-list li.insell.off { opacity: .6; }
.tx-list li.insell input[type=checkbox], .day-head input[type=checkbox] { width: 20px; height: 20px; flex: none; }
.spill.new { background: #fff4e5; color: #b45309; }
.sell-bar { position: sticky; bottom: calc(66px + var(--safe-b)); z-index: 4; display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 8px 10px; margin: 8px 0; box-shadow: 0 4px 16px rgba(0,0,0,.12); }
.sell-bar span { flex: 1; }
@media (min-width: 900px) { .sell-bar { bottom: 12px; } }
/* 💡 제안함 */
.sug-btn { border: 0; background: rgba(255,255,255,.12); color: #fff; font-size: 18px; border-radius: 10px; padding: 4px 10px; margin-left: auto; margin-right: 8px; position: relative; cursor: pointer; }
.sug-badge { position: absolute; top: -4px; right: -4px; background: #e5484d; color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px; min-width: 18px; height: 18px; line-height: 18px; text-align: center; padding: 0 4px; }
.sug-list { list-style: none; margin: 6px 0 0; padding: 0; }
.sug-list li.sug { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; background: #fff; }
.sug-head { cursor: pointer; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sug-head .spill { margin-left: auto; }
.sug-meta { display: flex; align-items: center; gap: 4px; font-size: 12px; margin-top: 4px; }
.sug-meta .like { margin-left: auto; padding: 2px 10px; }
.sug-meta .like.on { background: #e8f0fe; color: #1a56db; }
.sug-body { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.sug-ai { background: #f6f8fb; border-radius: 10px; padding: 8px 10px; font-size: 13px; display: flex; flex-direction: column; gap: 3px; }
.sug-ai b { display: inline-block; min-width: 44px; color: var(--muted); font-weight: 600; }
.sug-orig { font-size: 14px; white-space: normal; }
.sug-photos { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.sug-photos img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); cursor: zoom-in; }
.sug-ph { position: relative; }
.sug-ph button { position: absolute; top: 2px; right: 2px; border: 0; border-radius: 999px; background: rgba(0,0,0,.6); color: #fff; width: 22px; height: 22px; font-size: 12px; }
.sug-act { display: flex; flex-wrap: wrap; gap: 6px; }
/* 🔁 외주 */
.btn.oc { background: #00796b; color: #fff; }
.oc-btn { margin-top: 8px; background: #e0f2f1; color: #00695c; }
.wh-row.oc-row { color: #00796b; cursor: pointer; }
.oc-sum { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.oc-sum > div { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.oc-sum b { display: block; font-size: 20px; } .oc-sum small { color: var(--muted); font-size: 12px; }
.oc-sum .late b { color: var(--warn); }
.oc-flow { font-size: 14px; margin: 4px 0; }
.oc-bar { height: 8px; background: #edf0f4; border-radius: 6px; overflow: hidden; display: flex; margin: 8px 0 4px; }
.oc-bar i { display: block; height: 100%; } .oc-bar .g { background: var(--ok); } .oc-bar .d { background: var(--warn); } .oc-bar .c { background: #9aa5b4; }
.oc-nums { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.oc-nums b { color: var(--text); } .oc-nums .ok, .oc-tl .ok { color: var(--ok); } .oc-nums .bad, .oc-tl .bad { color: var(--warn); }
.oc-money { background: #fffbea; border: 1px solid #f1e3a6; border-radius: 12px; padding: 10px 12px; margin-top: 12px; font-size: 14px; }
.oc-money .t { font-size: 12px; color: #8a6d00; font-weight: 700; margin-bottom: 4px; }
.oc-prev { background: #f6f8fb; border: 1px dashed #c6cfdb; border-radius: 12px; padding: 10px 12px; font-size: 13px; line-height: 1.7; margin-top: 12px; }
.oc-prev .m { color: var(--out); font-weight: 600; } .oc-prev .p { color: var(--in); font-weight: 600; }
.oc-tl { list-style: none; margin: 0; padding: 0; }
.oc-tl li { display: flex; gap: 8px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px; }
.oc-tl li .d { color: var(--muted); width: 58px; flex: none; } .oc-tl li .t { flex: 1; }
.oc-tl li.canceled .t { text-decoration: line-through; opacity: .6; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: end; }
/* v15.1 함께 보낼 재료 */
.oc-extra { background: #f3f8f5; border: 1px solid #cfe5d8; border-radius: 12px; padding: 10px 12px; margin-top: 12px; }
.oc-extra .t { font-size: 13px; font-weight: 700; color: #1f6b45; margin-bottom: 6px; }
.oc-ex { border-top: 1px dashed #cfe5d8; padding-top: 8px; margin-top: 8px; }
.oc-ex:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.oc-ex .row3 { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: end; }
.oc-ex .row3 label { margin: 0; }
.oc-exlist { background: #f3f8f5; border-radius: 10px; padding: 8px 10px; margin-top: 8px; font-size: 13px; line-height: 1.6; }
/* v15.1 말로 입력: 설정·외주·질문 */
.vcard { background: #f6f8fb; border-radius: 10px; padding: 8px 10px; margin: 6px 0; font-size: 14px; line-height: 1.6; }
.vcard .q { font-size: 18px; font-weight: 700; }
.bom-lines li.bom-new { background: #fff8e1; border-radius: 10px; }
/* v15.3 판매 내역 엑셀 올리기 */
.sg .vhead { flex-wrap: wrap; gap: 4px 8px; }
.sg .vhead b, .sg .vhead .muted { white-space: nowrap; }
.sg.off { opacity: .55; }
