:root{--ink:#1f1f1f;--muted:#6b6b6b;--line:#c8c8c8;--grid:#d4d4d4;--head:#f2f2f2;--head-hl:#d9d9d9;--xl:#217346;--xl-soft:#e2f0d9;--bad:#9c0006;--ok:#006100;--warn:#9c5700;--bg:#fff;--hover:#f5f5f5;--row-h:22px;--rn-w:44px}
[hidden]{display:none!important}
[data-density=compact]{--row-h:19px}
*{box-sizing:border-box}
html,body{height:100%}
body{margin:0;background:var(--bg);color:var(--ink);font:12px/1.4 "Malgun Gothic","맑은 고딕",Pretendard,system-ui,sans-serif}
button,input,select,textarea{font:inherit;color:inherit}
h2,h3{font-weight:600}

/* 상단 바 */
.top{display:flex;align-items:center;gap:8px;height:44px;padding:0 16px;border-bottom:1px solid var(--line)}
.brand{font-weight:700;font-size:16px;color:var(--xl);letter-spacing:-.2px}
.brand small{color:var(--muted);font-weight:400;font-size:11px;margin-left:6px}
.tabs{display:flex;margin-left:24px;align-self:stretch}
.tab{background:none;border:0;border-bottom:3px solid transparent;padding:0 14px;font-size:13px;cursor:pointer;color:var(--muted)}
.tab.is-on{color:var(--xl);border-bottom-color:var(--xl);font-weight:700}
.who{margin-left:auto;display:flex;align-items:center;gap:6px}
.who .name{margin-right:8px}
.who .name small{color:var(--muted);margin-left:6px}

/* 버튼 */
.btn{border:1px solid #adadad;background:#e1e1e1;border-radius:2px;padding:3px 12px;cursor:pointer;white-space:nowrap;line-height:1.5}
.btn:hover{background:#e5f1fb;border-color:#0078d7}
.btn.primary{background:var(--xl);border-color:#1a5c38;color:#fff}
.btn.primary:hover{background:#1a5c38}
.btn.is-on{background:var(--xl);border-color:#1a5c38;color:#fff} /* 켜고 끄는 단추. 종류 세그먼트의 켜진 칸과 같은 모양이라 도구줄 안에서 뜻이 한 가지다 */
.btn.is-on:hover{background:#1a5c38;border-color:#1a5c38}
.btn.danger{color:var(--bad)}
.btn:disabled{opacity:.45;cursor:not-allowed}
.btn.sm{padding:1px 8px}
/* 같은 선택자가 두 블록에 있던 것을 09-13 에 한 블록으로 접었다. is-on 은 첫 블록의 의도대로 --xl 녹색 바탕에 흰 글자다(접기 전에는 뒤 블록의 미정의 --accent 폴백 연파랑이 이기고 있었다) */
.seg{display:flex;gap:0}
.seg button{border:1px solid var(--line);background:var(--bg);padding:3px 10px;cursor:pointer;margin-left:-1px;line-height:1.5}
.seg button:first-child{margin-left:0;border-radius:2px 0 0 2px}
.seg button:last-child{border-radius:0 2px 2px 0}
.seg button+button{border-left:0}
.seg button:hover{background:#e5f1fb;border-color:#0078d7;position:relative;z-index:1}
.seg button.is-on{background:var(--xl);border-color:#1a5c38;color:#fff;font-weight:600;position:relative;z-index:1}

/* 입력 */
input,select,textarea{border:1px solid #adadad;border-radius:0;padding:2px 4px;background:#fff;height:22px}
textarea{height:auto}
input:focus,select:focus,textarea:focus{outline:2px solid var(--xl);outline-offset:-1px;border-color:var(--xl)}
input:disabled,select:disabled,textarea:disabled{background:#fff;color:var(--ink);border-color:#e0e0e0;opacity:1}
input[type=number]{width:80px;text-align:right}
input[type=date]{width:130px}
input[type=search]{width:300px} /* 문서 검색 안내문(문서번호, 수주번호, 거래처, 품목, 사양 검색)이 다 보이는 폭 */
input[type=color]{width:44px;padding:0 2px}
input[type=checkbox],input[type=radio]{height:auto;margin:0 3px 0 0;vertical-align:middle}
label.inline{display:inline-flex;align-items:center;gap:4px;margin-right:10px}

/* 탭 패널, 도구줄 */
.tab-panel{padding:8px 16px 8px;display:flex;flex-direction:column;height:calc(100vh - 44px)}
.toolbar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding-bottom:8px}
.toolbar .grow{flex:1}
.toolbar .count{color:var(--muted)}
.toolbar .tb-more{display:contents}
.m-only{display:none}
.sheet-wrap{flex:1;overflow:auto;min-height:0;border:1px solid var(--grid);outline:none;background:#fff}

/* 시트 */
table.sheet{border-collapse:separate;border-spacing:0;table-layout:fixed;width:100%;font-variant-numeric:tabular-nums} /* 고정 레이아웃: 지정 폭은 그대로, 남는 폭은 맨 끝 빈 열이 흡수 */
.sheet th,.sheet td{border-right:1px solid var(--grid);border-bottom:1px solid var(--grid);padding:0 5px;height:calc(var(--row-h) - 1px);line-height:calc(var(--row-h) - 1px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:left;font-weight:400}
.sheet td{scroll-margin-top:calc(var(--row-h) + 1px);scroll-margin-left:var(--rn-w)}
.sheet td>span,.sheet td>.chip{vertical-align:top}
.sheet td>.chip{line-height:calc(var(--row-h) - 7px);margin:1px 4px 0 0}
.sheet thead th{position:sticky;top:0;z-index:2;background:var(--head);color:#333;text-align:center;overflow:visible}
.sheet th.rn{position:sticky;left:0;z-index:1;background:var(--head);text-align:center;color:#444}
.sheet thead th.rn{z-index:3}
.sheet thead th.hl{background:var(--head-hl);color:var(--xl);box-shadow:inset 0 -2px 0 var(--xl)}
/* 묶음 머리. 윗줄이 이름을 덮고 아랫줄이 열 이름을 낸다. 둘 다 붙박이라 아랫줄은 한 칸 내려 붙인다 */
.sheet.has-gh thead tr.ghr th{top:0;z-index:4}
.sheet.has-gh thead tr.ghr th.rn{z-index:5}
.sheet.has-gh thead tr:not(.ghr) th{top:calc(var(--row-h) - 1px)}
.sheet th.gh{color:#555;letter-spacing:.06em;box-shadow:inset 0 -1px 0 var(--grid)}
.sheet th.rn.hl{background:var(--head-hl);color:var(--xl);box-shadow:inset -2px 0 0 var(--xl)}
.sheet td.num{text-align:right}
/* 「줄바꿈」(09-21). 표 위 단추로 켜면 칸이 내용대로 여러 줄이 되고 줄 높이가 칸마다 달라진다. 열 폭은 그대로. \n 은 줄이 된다(품목 요약 · 보관위치의 전부 나열) */
.sheet-wrap.wrap .sheet td{white-space:pre-line;height:auto;line-height:1.4;padding:2px 5px;vertical-align:top}
.sheet-wrap.wrap .sheet td>.chip{line-height:1.3;margin:0 4px 2px 0}
.sheet td.sel{box-shadow:inset 0 0 0 2px var(--xl)}
.sheet tr.filler td{color:transparent;user-select:none}
.sheet .af{float:right;border:1px solid #8a8a8a;background:#fff;width:16px;height:calc(var(--row-h) - 6px);padding:0;margin:2px -2px 0 4px;line-height:calc(var(--row-h) - 8px);font-size:8px;cursor:pointer;color:#333;border-radius:0;vertical-align:top}
.sheet .af.on{color:#fff;background:var(--xl);border-color:var(--xl)}
.sheet .rz{position:absolute;right:-4px;top:0;width:8px;height:100%;cursor:col-resize;z-index:4}
.sheet .btn.sm{padding:0 6px;line-height:16px;height:18px;vertical-align:middle}

/* 팝업 안 격자 표 */
table.grid{border-collapse:separate;border-spacing:0;width:100%;margin-bottom:6px;border-top:1px solid var(--grid);border-left:1px solid var(--grid);table-layout:fixed}
.grid th,.grid td{border-right:1px solid var(--grid);border-bottom:1px solid var(--grid);padding:0 5px;height:calc(var(--row-h) - 1px);line-height:calc(var(--row-h) - 1px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:left;font-weight:400}
.grid th{background:var(--head);color:#333;text-align:center}
.grid td.num,.grid th.num{text-align:right}
.grid td.rn{background:var(--head);text-align:center;color:#444}
.grid input,.grid select{border:0;height:calc(var(--row-h) - 3px);width:100%;padding:0 3px;background:transparent}
.grid input[type=number]{text-align:right}
.grid input[type=checkbox]{width:auto;height:auto}
.grid input:focus,.grid select:focus{outline:2px solid var(--xl);outline-offset:-2px}
.grid tr.sub td{color:var(--muted)}
.grid td.indent{padding-left:28px}
.grid .btn.sm{padding:0 6px;line-height:16px;height:18px;vertical-align:middle}
.grid tr.pick{cursor:pointer}
.grid tr.pick:hover td{background:var(--hover)}
.grid tr.pick.is-on td{background:var(--xl-soft)}
.grid tr.pick.is-on td.rn{background:var(--head-hl);color:var(--xl)}
.grid tr.faint td{color:var(--muted)} /* 넣은 칸이 그 제품에 비어 있어 맞는지 확실치 않은 후보. 빼지 않고 뒤에 둔다 */

/* 팝업 입력 시트 */
table.form{border-collapse:separate;border-spacing:0;width:100%;margin-bottom:10px;border-top:1px solid var(--grid);border-left:1px solid var(--grid);table-layout:fixed}
.form th,.form td{border-right:1px solid var(--grid);border-bottom:1px solid var(--grid);padding:0 5px;height:calc(var(--row-h) - 1px);line-height:calc(var(--row-h) - 1px);text-align:left;vertical-align:middle;font-weight:400}
.form th{background:var(--head);color:#333;white-space:nowrap}
.form td.tall{height:auto;line-height:1.4;padding:2px 5px}
.form td>input:not([type=radio]):not([type=checkbox]):not([type=color]),.form td>select,.form td>textarea{border:0;width:100%;background:transparent;padding:0 2px;height:calc(var(--row-h) - 3px)}
.form td>textarea{height:auto;line-height:1.4;padding:3px 2px;resize:vertical;display:block}
.form td>input:focus,.form td>select:focus,.form td>textarea:focus{outline:2px solid var(--xl);outline-offset:-2px}
.form td>input:disabled,.form td>textarea:disabled{border:0}
table.form.meta{table-layout:auto}
.form.meta th{width:auto}
#docMeta td{white-space:nowrap}#docMeta td.tall{white-space:normal} /* 상세 머리: 긴 근거 행(부품 준비)이 들어와도 날짜 같은 짧은 값이 두 줄로 꺾이지 않게. 실사·출고 머리는 폭이 좁아 감겨야 한다 */

/* 텍스트 */
.mono{font-family:Consolas,"Courier New",monospace}
.muted{color:var(--muted)}
.bad{color:var(--bad)}
.ok{color:var(--ok)}
.warn{color:var(--warn)}
.hint{color:var(--muted);margin:6px 0}
#itDim{display:flex;flex-wrap:wrap;gap:4px 14px;align-items:center} /* 유형별 규격 칸. 한 줄에 서다가 좁아지면 접힌다 */
#itDim input{width:110px}
#itDim>input:only-child{width:100%}
h3.sec{font-size:12px;margin:12px 0 4px;color:#333}
h3.sec:first-child{margin-top:0}

/* LOT 태그 */
.tags{display:flex;flex-wrap:wrap;align-items:center;gap:2px;min-height:calc(var(--row-h) - 4px)}
td.edited{background:#fff2cc}td.edited input{background:#fff2cc}
.dot{display:inline-block;width:12px;text-align:center;font-size:11px;color:#8a8a8a}.dot.on{color:var(--xl)}.dot.est{opacity:.7}
.chip{display:inline-flex;align-items:center;gap:2px;border:1px solid #8a8a8a;padding:0 2px 0 6px;font-size:11px;line-height:16px;margin:1px 4px 1px 0;font-family:Consolas,"Courier New",monospace;background:#fff}
.chip.plain{padding-right:6px}
.chip-x{border:0;background:none;padding:0 3px;cursor:pointer;color:var(--muted);font-size:13px;line-height:1}
.chip-x:hover{color:var(--bad)}
.tags input{width:130px;border:0;height:18px;padding:0 3px;background:transparent}
.tags input:focus{outline:2px solid var(--xl);outline-offset:-1px}

/* 대화상자 */
dialog{border:1px solid #767676;border-radius:0;padding:0;max-width:calc(100vw - 48px);max-height:calc(100vh - 48px);color:var(--ink);box-shadow:0 6px 20px rgba(0,0,0,.25)}
dialog::backdrop{background:rgba(0,0,0,.3)}
.dlg{display:flex;flex-direction:column;max-height:calc(100vh - 48px)}
.dlg-head{display:flex;align-items:center;gap:12px;padding:6px 12px;border-bottom:1px solid var(--line)}
.dlg-head h2{margin:0;font-size:13px}
.dlg-head .x{margin-left:auto;border:0;background:none;font-size:18px;cursor:pointer;color:#444;padding:0 4px;line-height:1}
.dlg-body{padding:12px;overflow:auto;flex:1;min-height:0}
.dlg-foot{display:flex;gap:6px;align-items:center;padding:8px 12px;border-top:1px solid var(--line)}
.dlg-foot .grow{flex:1}
.dlg-foot .status{color:var(--muted)}
#dlgDoc{width:1100px}
#dlgShip{width:calc(100vw - 48px)}
#dlgPlan{width:calc(100vw - 48px)} /* 반별 표 열 개가 1600 폭에서도 확정 열까지 보이게 */
#dlgAdmin{width:980px}
#dlgSettings{width:780px}
#setSafeWrap{max-height:280px;overflow:auto}
#dlgItem{width:600px}
#dlgCount{width:600px} /* 머리의 근거 넉 줄과 「불량 합계」 설명이 한 줄에 서려면 품목 팝업과 같은 폭이 필요하다 */
.type-label{font-weight:700}

/* 출고 팝업 */
.ship{display:grid;grid-template-columns:29% minmax(0,1fr) 32%;height:calc(100vh - 48px - 44px - 45px);min-height:480px} /* 비율 칸. 표가 칸보다 넓으면 그 칸이 가로 스크롤 */
.ship>*{overflow:auto;padding:10px 12px;min-height:0;min-width:0}
.ship>*+*{border-left:1px solid var(--line)}

/* 관리, 설정 */
.admin-seg{margin-bottom:12px}
.checks{display:flex;flex-wrap:wrap;gap:6px 14px;padding:4px 0}

/* 자동필터 */
#af{margin:0;inset:auto;border:1px solid #767676;background:#fff;padding:6px;width:250px;box-shadow:0 4px 12px rgba(0,0,0,.25);font-size:12px}
#af .af-sort{display:block;width:100%;text-align:left;border:0;background:none;padding:3px 6px;cursor:pointer}
#af .af-sort:hover{background:#e5f1fb}
#af hr{border:0;border-top:1px solid var(--grid);margin:4px 0}
#af input[type=search]{width:100%;margin:2px 0 4px;height:22px}
#af .af-list{max-height:220px;overflow:auto;border:1px solid var(--grid);padding:2px 4px}
#af .af-list label{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:20px}
#af .af-foot{display:flex;justify-content:flex-end;gap:6px;margin-top:6px}


.pick-row{display:flex;gap:10px;align-items:center;width:100%;text-align:left;border:0;border-bottom:1px solid var(--grid);background:none;padding:6px;cursor:pointer}
.pick-row:hover{background:var(--hover)}
/* 여러 개 고르는 줄(추가사양). 한 줄에 체크상자 하나, 목록 밖 값은 위에 「더하기」로 선다(09-21) */
.tag-row{display:flex;gap:10px;align-items:center;width:100%;border-bottom:1px solid var(--grid);padding:6px;cursor:pointer}
.tag-row:hover{background:var(--hover)}
.tag-new{display:flex;gap:10px;align-items:center;width:100%;text-align:left;border:0;border-bottom:1px solid var(--grid);background:none;padding:6px;cursor:pointer;font:inherit}
.tag-new:hover{background:var(--hover)}
.sp-tags{height:20px;line-height:18px;padding:0 5px;margin-left:3px}
#pickQ{width:100%;margin-bottom:6px}
#dlgPick{width:520px}
#dlgFind{width:1000px}
.gwrap{margin-bottom:6px;overflow-x:auto} /* 표가 상자보다 넓으면 눌리지 않고 가로 스크롤 */
.gwrap>.grid{margin-bottom:0}
/* 찾기 화면의 후보 표는 제 상자 안에서 구른다. 품목 찾기와 거래처 찾기가 같은 규칙을 쓴다.
   머리줄은 위에 붙어 있는다. 묶음이 둘일 때 상자도 둘이라 한 상자는 열 줄 남짓에서 끊는다 — 팝업 전체가 밀리지 않게.
   09-15 에 오른쪽 끝 선택 단추 열을 없애 붙여 둘 칸도 없어졌다 — 줄을 두 번 누르면 들어간다 */
.picks .gwrap{max-height:calc(var(--row-h) * 11);overflow:auto}
.picks .grid thead th{position:sticky;top:0;z-index:2}

/* ===== 모바일 배치 (폭 768px 미만) ===== */
@media (max-width:767px){
  :root{--row-h:36px;--rn-w:34px}
  [data-density=compact]{--row-h:36px}
  body{font-size:13px}
  input,select,textarea{font-size:16px;height:36px} /* iOS 자동 확대 방지, 터치 높이 */
  input[type=checkbox],input[type=radio]{width:20px;height:20px}
  textarea{height:auto}
  .m-only{display:initial}
  .btn{padding:6px 12px}
  .top{padding:0 10px}
  .top .tabs,.who .name small,#btnLogout{display:none}
  .tab-panel{height:calc(100vh - 44px - 92px);height:calc(100dvh - 44px - 92px);padding:6px 8px 0}
  body:has(#mActions[hidden]) .tab-panel{height:calc(100vh - 44px - 48px);height:calc(100dvh - 44px - 48px)}
  .toolbar{gap:6px;padding-bottom:6px}
  .toolbar .seg{display:flex;width:100%}
  .toolbar .seg button{flex:1;padding:8px 0}
  .toolbar .tb-more{display:none;width:100%;flex-wrap:wrap;gap:6px;align-items:center}
  .toolbar.open .tb-more{display:flex}
  .toolbar:has(#iQuery) .tb-more{display:flex}
  #mFilterInv{display:none} /* 모바일 2순위가 재고 조회라 검색은 접지 않는다(06-11) */
  .toolbar .tb-more input[type=search]{width:100%}
  .toolbar .tb-more label.inline{display:flex;width:100%;white-space:nowrap;gap:4px;margin:0}
  .toolbar .tb-more input[type=date]{width:auto;flex:1;min-width:0}
  /* 지시 확정과 수거는 사무실 책상에서 하루 한 번 도는 일이라 좁은 화면에 두지 않는다.
     모바일 1순위는 문서 조회, 2순위는 재고 조회다 */
  .toolbar .grow,.toolbar #btnShip,.toolbar #btnNew,.toolbar #btnNewItem,.toolbar #btnPlan,.toolbar .wrapbtn{display:none} /* 줄바꿈은 폰에 없다 — 폰 표는 열이 줄여져 가로로 구르는 표라 접으면 읽기가 나빠진다(09-21) */
  .mfilter.on::after{content:" ●";color:var(--xl)}
  #mActions{position:fixed;left:0;right:0;bottom:48px;height:44px;display:flex;gap:6px;padding:4px 8px;border-top:1px solid var(--line);background:#fff;z-index:5}
  #mActions .btn{flex:1;padding:0;height:36px;line-height:34px}
  #mTabs{position:fixed;left:0;right:0;bottom:0;height:48px;display:flex;border-top:1px solid var(--line);background:#fff;z-index:5}
  #mTabs .tab{flex:1;border-bottom:0;border-top:3px solid transparent;font-size:14px;padding:0}
  #mTabs .tab.is-on{border-top-color:var(--xl)}
  .sheet .rz{display:none}
  .sheet thead th{padding-right:34px}
  .sheet thead th:not(:has(.af)){padding-right:5px} /* 자동필터 없는 머리글(부품 준비, 단추 열)은 ▼ 자리를 비우지 않는다 */
  .sheet .af{float:none;position:absolute;right:2px;top:3px;margin:0;width:30px;height:30px;line-height:28px;font-size:10px}
  .sheet td>.chip{font-size:13px}
  .sheet td:nth-child(2),.sheet th:nth-child(2){position:sticky;left:var(--rn-w);z-index:1;background:#fff}
  .sheet thead th:nth-child(2){z-index:3;background:var(--head)}
  .sheet thead th:nth-child(2).hl{background:var(--head-hl)}
  dialog{width:100vw;max-width:100vw;height:100vh;height:100dvh;max-height:100vh;max-height:100dvh;margin:0;border:0;box-shadow:none}
  #dlgDoc,#dlgShip,#dlgAdmin,#dlgSettings,#dlgItem,#dlgCount,#dlgPick,#dlgPlan{width:100vw}
  #planWrap{grid-template-columns:1fr;overflow:auto}
  #planPickBox,#planBody{overflow:visible}
  .dlg{height:100vh;height:100dvh;max-height:100vh;max-height:100dvh}
  .dlg-head{flex-wrap:wrap;gap:8px;padding:8px 10px}
  .dlg-head h2{font-size:15px}
  .dlg-head .muted{display:none}
  .dlg-head .x{padding:6px 12px;font-size:22px}
  .dlg-head .seg button{padding:8px 12px}
  .dlg-body{padding:8px 10px;overflow-x:auto}
  .dlg-foot{padding:8px 10px;gap:8px;flex-wrap:wrap}
  .dlg-foot #shipHint{display:block;width:100%;text-align:center;font-size:12px}
  .dlg-foot .btn{flex:1;height:44px;line-height:32px;padding:0 6px}
  .dlg-foot .status,.dlg-foot .grow{display:none}
  .form colgroup{display:none}
  .form,.form tbody,.form tr,.form th,.form td{display:block;width:100%}
  .form th{border-bottom:0;height:auto;line-height:1.4;padding:6px 6px 2px;font-size:12px}
  .form td{height:auto;min-height:var(--row-h)}
  .form th:empty,.form td:empty{display:none}
  .form.meta tr{display:grid;grid-template-columns:90px 1fr}
  .form.meta th{border-bottom:1px solid var(--grid);padding:0 5px;line-height:calc(var(--row-h) - 1px)}
  #docMeta td{white-space:normal} /* 폰은 한 열 배치라 값이 감겨야 한다 */
  .form.meta td{line-height:1.4;padding:8px 5px} /* 여러 줄 근거(예약 목록, 산식)가 35px 행간으로 벌어지지 않게. 한 줄일 때 높이는 전과 같다 */
  #shipList .grid td small{display:block;width:0;min-width:100%;overflow:hidden;text-overflow:ellipsis;line-height:1.3} /* 품목 요약 줄이 거래처 열의 폭을 넓히지 않게(폰 표는 max-content) */
  table.grid{table-layout:auto;width:max-content;min-width:100%}
  .gwrap{overflow-x:auto}
  .gwrap .grid td.rn,.gwrap .grid th.rn{position:sticky;left:0;z-index:1}
  .grid .btn.sm,.sheet .btn.sm{height:30px;line-height:28px;padding:0 10px}
  .tags input{height:calc(var(--row-h) - 4px)}
  .chip-x{padding:0 8px;line-height:28px;font-size:16px}
  .ship{display:block;height:auto;flex:1;overflow:auto;min-height:0}
  .ship>*{display:none;border-left:0;padding:8px 10px;overflow-x:hidden}
  .ship[data-step="1"]>#shipList,.ship[data-step="2"]>#shipMain,.ship[data-step="3"]>#shipT{display:block}
  #af{left:0!important;right:0;top:auto!important;bottom:0;width:100%;max-height:70vh;max-height:70dvh;overflow:auto;border-radius:12px 12px 0 0}
  #af .af-list{max-height:40vh}
  #af .af-list label{line-height:36px}
  #af .af-sort{padding:8px 6px}
  #af input[type=search]{height:36px}
  #af .btn.sm{padding:0 16px;height:36px;line-height:34px}
  .pick-row{flex-direction:column;align-items:stretch;gap:2px;min-height:36px;padding:8px 6px}
  body #toast{bottom:104px}
}

/* 뒤에 붙은 규칙. 아래 순서가 캐스케이드를 정한다(#planWrap · #planPickBox 는 위 모바일 절과 특이도가 같아 뒤에 온 이쪽이 이긴다). 위 절로 옮기지 말 것 */
/* 안내 메시지 */
#toast{position:fixed;inset:auto;left:50%;bottom:28px;transform:translateX(-50%);margin:0;border:1px solid #767676;background:#fff;padding:6px 14px;max-width:70vw;box-shadow:0 4px 12px rgba(0,0,0,.2)}
/* 반별 작업지시서 시트. 반장이 손으로 적는 칸이 있어 A4 세로 한 장에 열두 줄이다(간단판 부록 C).
   서식은 매체가 아니라 내용이라 인쇄 안에 가두지 않는다. 쪽 나눔만 @media print 에 있다 */
.sh-page{margin-bottom:14px}
.sh-head{display:flex;justify-content:space-between;align-items:baseline;margin:0 0 4px;font-size:11px}
.sh-head b{font-size:15px}
table.sh{width:100%;border-collapse:collapse;table-layout:fixed;font-size:10px}
.sh th,.sh td{border:1px solid #000;padding:2px 4px;text-align:center;vertical-align:top}
.sh thead th{font-weight:bold;background:none}
.sh td.sh-c{text-align:left;line-height:1.35}
.sh td.num{text-align:right}
.sh tbody td{height:34px}
.sh small{font-size:8px;color:#000}
.sh td.sh-grp{text-align:left;font-weight:bold;height:18px;border-width:1px}
/* 지시 확정 · 수거 팝업의 반 이름. 배경 없이 밑줄 하나로 가른다 */
h3.grp{font-size:12px;font-weight:bold;margin:10px 0 4px;padding-bottom:2px;border-bottom:1px solid var(--grid)}
h3.grp:first-child{margin-top:0}
h3.grp .muted{font-weight:normal}
#dlgDash .dlg,#dlgWork .dlg{width:min(1100px,96vw)} /* #dlgPlan 은 대화상자 폭을 다 쓴다(확정 열까지 보이게) */
#workBody{overflow:auto;flex:1;min-height:0}
/* 작업 목록 표는 칸을 안 자른다(09-21). 품명 뒤에 붙는 「불출 모자람」 표시와 그 아래 수주 · 거래처 줄이 한 줄 높이에 갇혀 통째로 잘렸다.
   시트의 「줄바꿈」 단추와는 다른 표다 — 여기는 늘 접는다. 다른 대화상자 표는 그대로 한 줄이다 */
#workBody .grid td{white-space:normal;height:auto;line-height:1.35;padding:3px 5px;vertical-align:top}
#workBody .grid td .warn{display:inline-block}
.dlg-sub{display:flex;align-items:center;gap:8px;padding:0 14px 8px}
#dlgWork .dlg-sub{flex-wrap:wrap} /* 「지시 없음만」이 서면 375 폭에서 반 단추 줄이 넘친다. 이 대화상자만 접는다 */
.wk-big{font-size:15px;font-weight:600}
#dashBody{overflow:auto;flex:1;min-height:0}
#planWrap{display:grid;grid-template-columns:370px 1fr;gap:14px;flex:1;min-height:0}
#planPickBox,#planBody{overflow:auto;min-height:0}
#planPickBox .pk-foot{position:sticky;bottom:0;background:var(--bg);padding-top:6px}
/* 인쇄는 실물 수주서 서식이다(MES.xlsm ordRep). A4 가로, 오른쪽 위 결재란 넷, 아래에 코드 범례.
   화면 목록은 인쇄하지 않는다. 결재란은 종이에만 있다(09-08 회신 8·9번) */
.print-only{display:none}
@media print{
  @page{size:A4 landscape;margin:12mm 8mm 11mm}
  body>*:not(#tab-docs){display:none!important}
  #tab-docs>*:not(#printSheet){display:none!important}
  #tab-docs{height:auto!important;display:block!important;padding:0}
  .print-only{display:block}
  .prt-top{width:100%;border-collapse:collapse;margin:0 0 4px}
  .prt-top td{vertical-align:bottom;border:0;padding:0}
  .prt-day{font-size:11px;white-space:nowrap}
  .prt-title{text-align:center;font-size:20px;font-weight:bold;letter-spacing:6px}
  .prt-sign{width:290px}
  .prt-sign table{border-collapse:collapse;margin-left:auto}
  .prt-sign th,.prt-sign td{border:1px solid #000;width:68px;height:20px;font-size:10px;text-align:center;font-weight:normal}
  .prt{width:100%;border-collapse:collapse;table-layout:fixed;font-size:10px}
  .prt th,.prt td{border:1px solid #000;padding:1px 3px;text-align:center;overflow:hidden}
  .prt thead th{border-width:1px 1px 1px 1px;background:none;font-weight:bold}
  .prt tbody tr.prt-a td{border-bottom:0;height:17px}
  .prt tbody tr.prt-b td{border-top:0;height:17px;color:#000}
  .prt td:first-child{font-size:9px}
  .prt td:last-child,.prt th:last-child{text-align:left}
  .prt-leg{margin-top:5px;font-size:9px;display:flex;flex-wrap:wrap;gap:10px}
  /* 표 인쇄(09-21). 지금 보이는 열과 줄 그대로. 머리글은 쪽마다 다시 찍고 줄 중간에서 쪽이 안 갈린다 */
  .prt-head{display:flex;justify-content:space-between;align-items:baseline;gap:12px;margin:0 0 4px;font-size:10px}
  .prt-head b{font-size:14px}
  .prt-tbl{width:100%;border-collapse:collapse;table-layout:fixed;font-size:10px}
  .prt-tbl th,.prt-tbl td{border:1px solid #000;padding:2px 4px;text-align:left;vertical-align:top;overflow-wrap:anywhere;white-space:pre-line}
  .prt-tbl th{font-weight:bold;background:none}
  .prt-tbl .num{text-align:right}
  .prt-tbl thead{display:table-header-group}
  .prt-tbl tr{break-inside:avoid;page-break-inside:avoid}
  .sh-page{page-break-after:always;break-after:page}
  .sh-page:last-child{page-break-after:auto;break-after:auto}
}
