/* v1.7.0 B 공구 관리(가공, M4) 화면 — js/tools.js. 색은 app.css 변수(라이트·다크 함께)만 쓴다. 누르는 곳 44px 이상 */
.tl-wrap{min-width:0}
.tl-subt{margin:2px 0 12px}
.tl-subt .chip{min-height:40px}
.tl-subt .c.red,.tl-t .red,.tl-big.red,b.red,.red{color:var(--red)}
.orange{color:var(--orange)}
.tl-mono{font-family:ui-monospace,Consolas,"D2Coding",monospace;font-weight:600;letter-spacing:-.2px}
.tl-code{font-family:ui-monospace,Consolas,monospace;font-size:24px;font-weight:800;color:var(--pri);letter-spacing:.5px}
.tl-c{padding:14px}
.tl-sh{display:flex;align-items:center;gap:8px;margin-bottom:10px;flex-wrap:wrap}
.tl-sh h3{font-size:15px}
.tl-sh .n{font-size:13px;color:var(--text3)}
.tl-no{display:inline-grid;place-items:center;width:24px;height:24px;border-radius:50%;background:var(--pri);color:var(--on-pri);font-size:13px;font-weight:800;flex:none}
.tl-no.off{background:var(--line);color:var(--text2)}
.tl-f{display:flex;flex-direction:column;gap:4px;min-width:0}
.tl-f label{font-size:12.5px;font-weight:700;color:var(--text2)}
.tl-f em{font-style:normal;font-weight:500;color:var(--text3)}
.tl-ug{position:relative;display:flex;align-items:center;min-width:0}
.tl-ug .inp{width:100%;padding-right:40px}
.tl-ug .u{position:absolute;right:12px;color:var(--text3);font-size:13px;pointer-events:none;display:flex}
.tl-ug .u svg{width:18px;height:18px}
.inp.empty{background:var(--orange-soft)}
.tl-g2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.tl-g3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.tl-g4{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.phone .tl-g3,.phone .tl-g4{grid-template-columns:repeat(2,minmax(0,1fr))}
.tl-two{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:16px;align-items:start}
.tl-two.r400{grid-template-columns:minmax(0,1fr) 400px}
.tl-two.r12{grid-template-columns:minmax(0,1.25fr) minmax(0,1fr)}
.tl-btns{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}
.tl-ok{display:flex;align-items:center;gap:8px;background:var(--pri-soft);color:var(--text);border-radius:12px;padding:10px 12px;font-size:14px;font-weight:600;margin:8px 0}
.tl-ok svg{width:18px;height:18px;color:var(--pri);flex:none}
.tl-warn{display:flex;gap:10px;align-items:flex-start;border:1px solid var(--orange);background:var(--orange-soft);border-radius:12px;padding:10px 12px;margin-top:10px;font-size:14px}
.tl-warn.red{border-color:var(--red);background:var(--red-soft)}
.tl-warn.ok{border-color:var(--pri);background:var(--pri-soft)}
.tl-warn>svg{width:20px;height:20px;flex:none;margin-top:1px;color:var(--orange)}
.tl-warn.red>svg{color:var(--red)}
.tl-warn>div{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.tl-warn .th,.tl-warn img.tl-ph{width:56px;height:56px}
/* 조사 */
.tl-svtop{display:flex;flex-direction:column;gap:6px;margin-bottom:8px}
.tl-svtop:empty{display:none}
.tl-warnbar,.tl-okbar{display:flex;gap:8px;align-items:center;flex-wrap:wrap;border-radius:10px;padding:8px 12px;font-size:13.5px;font-weight:600}
.tl-warnbar{background:var(--orange-soft);color:var(--orange)}
.tl-okbar{background:var(--pri-soft);color:var(--text)}
.tl-warnbar svg,.tl-okbar svg{width:18px;height:18px}
.tl-sv3{display:grid;grid-template-columns:minmax(260px,1fr) minmax(0,1.25fr) minmax(0,1fr);gap:14px;align-items:start}
.tl-col,.tl-sv1{display:grid;gap:14px;min-width:0}
.tl-slots{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.tl-slot{position:relative;aspect-ratio:4/3;border-radius:14px;border:2px dashed var(--line);background:var(--surface);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;font-size:13px;font-weight:700;color:var(--text2);cursor:pointer;overflow:hidden;text-align:center;padding:6px}
.tl-slot svg{width:28px;height:28px;color:var(--pri)}
.tl-slot .sm{font-weight:500;font-size:12px}
.tl-slot.on{border:2px solid var(--line);padding:0}
.tl-slot img{width:100%;height:100%;object-fit:cover;display:block}
.tl-slot .lb{position:absolute;left:6px;bottom:6px;background:rgba(0,0,0,.6);color:#fff;border-radius:6px;padding:1px 6px;font-size:12px}
.tl-slot .star{position:absolute;left:6px;top:6px;background:var(--pri);color:var(--on-pri);border-radius:6px;padding:1px 6px;font-size:12px}
.tl-slot .new{position:absolute;right:46px;top:8px;background:var(--orange);color:#fff;border-radius:6px;padding:1px 6px;font-size:11px}
.tl-slot .del{position:absolute;right:4px;top:4px;width:36px;height:36px;border-radius:50%;background:rgba(0,0,0,.6);color:#fff;font-size:16px;display:grid;place-items:center;text-align:center}
.tl-drop{display:flex;flex-direction:column;align-items:center;gap:6px;border:2px dashed var(--line);border-radius:14px;padding:14px;text-align:center;font-size:14px;font-weight:600;color:var(--text2);margin-top:10px;cursor:pointer}
.tl-drop svg{width:26px;height:26px;color:var(--pri)}
.tl-drop.over,body.dragging .tl-drop{border-color:var(--pri);background:var(--pri-soft)}
kbd{font-family:inherit;font-size:12px;border:1px solid var(--line);border-bottom-width:2px;border-radius:5px;padding:0 5px;background:var(--surface)}
.tl-rule{margin-top:10px;font-size:12.5px;color:var(--text2);background:var(--line2);border-radius:10px;padding:8px 10px;line-height:1.5}
.tl-codeline{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap;margin-top:10px}
.tl-prev{font-family:ui-monospace,Consolas,monospace;font-size:17px;font-weight:700;background:var(--line2);border-radius:10px;padding:10px 12px;word-break:break-all}
.tl-prev .q{color:var(--orange)}
.tl-biz{display:flex;flex-wrap:wrap;gap:10px;align-items:flex-end;margin-top:10px}
.tl-biz>.tl-f{flex:1 1 140px}
.tl-more{margin-top:10px}
.tl-more summary{cursor:pointer;font-size:14px;font-weight:700;color:var(--pri);min-height:40px;display:flex;align-items:center}
.tl-save{position:sticky;bottom:0;z-index:3;display:flex;align-items:center;gap:10px;flex-wrap:wrap;background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:10px 12px;margin-top:14px;box-shadow:0 -4px 16px rgba(0,0,0,.06)}
.tl-save .tl-miss{flex:1 1 200px;font-size:13.5px;font-weight:700;color:var(--pri);min-width:0}
.tl-save .tl-miss.orange{color:var(--orange)}
.tl-save .btn{width:auto;flex:none}
.tl-save .btn.pri{min-width:170px}
.phone .tl-save .btn{flex:1 1 40%}
.tl-btns .btn{width:auto}
.tl-slot .del{width:36px}
.tl-rec,.tl-recs{display:flex;align-items:center;gap:10px;padding:8px 0;border-top:1px solid var(--line2);width:100%;text-align:left;min-height:52px}
.tl-rec:first-of-type,.tl-recs:first-of-type{border-top:0}
.tl-rec .m2 .tt,.tl-recs .m2 .tt{display:block;font-size:14px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tl-rec .m2 .s,.tl-recs .m2 .s{display:block;font-size:12.5px;color:var(--text3);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tl-ph{display:block;background:var(--line2);object-fit:cover}
.tl-ph.none{display:grid;place-items:center;text-align:center;font-size:11px;color:var(--text3);line-height:1.3}
.tl-ph.th{width:46px;height:46px;border-radius:10px;flex:none}
.tl-ph.th.sm{width:36px;height:36px;border-radius:8px}
.tl-ph.wide{width:100%;aspect-ratio:4/3;border-radius:0}
/* 폰 연결 · 모달 */
.tl-modal,.tl-ov{position:fixed;inset:0;z-index:60;background:var(--scrim);display:grid;place-items:center;padding:16px}
.tl-box{background:var(--surface);color:var(--text);border-radius:18px;padding:20px;width:min(440px,100%);max-height:calc(100% - 32px);overflow:auto;box-shadow:var(--shadow)}
.tl-box.wide{width:min(760px,100%)}
.tl-box h3{font-size:18px;margin-bottom:6px}
.tl-qrbig{margin:12px auto;width:max-content;max-width:100%;background:#fff;padding:6px;border-radius:8px}
.tl-qrbig svg{display:block;max-width:100%;height:auto}
.tl-steps4{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;margin-top:12px;font-size:12px;color:var(--text2)}
.tl-steps4>div{background:var(--line2);border-radius:10px;padding:8px 4px;display:flex;flex-direction:column;align-items:center;gap:4px}
.tl-steps4 b{display:grid;place-items:center;width:22px;height:22px;border-radius:50%;background:var(--pri);color:var(--on-pri)}
.phone .tl-steps4,.tl-box .tl-steps4{grid-template-columns:repeat(2,1fr)}
@media (min-width:480px){.tl-box .tl-steps4{grid-template-columns:repeat(4,1fr)}}
.tl-scan .tl-video{position:relative;margin:10px 0;border-radius:12px;overflow:hidden;background:#000;aspect-ratio:1}
.tl-scan video{width:100%;height:100%;object-fit:cover;display:block}
.tl-aim{position:absolute;inset:18%;border:3px solid #fff;border-radius:14px;box-shadow:0 0 0 999px rgba(0,0,0,.35)}
/* 폰 사진만 찍기 · QR 출고 */
.tl-cam{display:flex;flex-direction:column;gap:12px}
.tl-shutter{display:grid;place-items:center;width:92px;height:92px;border-radius:50%;background:var(--pri);color:var(--on-pri);margin:6px auto 0;cursor:pointer;box-shadow:0 0 0 6px var(--pri-soft)}
.tl-shutter svg{width:42px;height:42px}
.tl-shutter.busy{opacity:.5}
.tl-center{display:grid;place-items:center;min-height:200px}
.tl-qo{display:flex;flex-direction:column;gap:10px;max-width:560px;margin:0 auto}
.tl-qo>.btn.plain{align-self:flex-start;width:auto}
.tl-t td.tl-mono,.tl-t .tl-mono{white-space:nowrap}
.tl-t .pill{white-space:nowrap}
.tl-h2{font-size:20px;font-weight:800;margin:6px 0}
.tl-vf{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;aspect-ratio:1;max-height:320px;border-radius:18px;background:#111;color:#fff;font-weight:700;width:100%;border:3px solid var(--pri)}
.tl-vf svg{width:64px;height:64px}
.tl-vf .sm{color:#ccc;font-weight:500}
.tl-qcard{padding:0;overflow:hidden}
.tl-dn{font-size:19px;font-weight:800;margin-top:2px}
.tl-big{font-size:20px;font-weight:800}
.tl-bigbtn{width:100%;min-height:56px;font-size:17px;justify-content:center;margin-top:6px}
.tl-wbtn{width:100%;justify-content:center;margin-top:2px}
.btn.red{color:var(--red)}
.tl-stepper{display:flex;align-items:center;justify-content:center;gap:22px;margin-top:20px}
.tl-stepper button{width:64px;height:64px;border-radius:50%;border:1px solid var(--line);background:var(--surface);font-size:30px;font-weight:700;text-align:center}
.tl-stepper .v{font-size:44px;font-weight:800;min-width:70px;text-align:center}
.tl-done{text-align:center;padding:20px 0 6px}
.tl-okc{width:84px;height:84px;border-radius:50%;background:var(--pri);color:var(--on-pri);display:grid;place-items:center;margin:0 auto 10px}
.tl-okc svg{width:44px;height:44px}
.tl-rcvt{display:flex;gap:12px;align-items:center;margin:10px 0}
/* 목록·상세 */
.tl-lhead{display:flex;gap:8px;align-items:center;flex-wrap:wrap;justify-content:space-between}
.tl-find{flex:1 1 220px}
.tl-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px;margin-top:10px}
.phone .tl-grid{grid-template-columns:1fr 1fr}
.tl-card{display:flex;flex-direction:column;background:var(--surface);border:1px solid var(--line);border-radius:14px;overflow:hidden;text-align:left;min-width:0}
.tl-card.sel{border-color:var(--pri);box-shadow:0 0 0 2px var(--pri)}
.tl-card>.tl-ph{width:100%;aspect-ratio:4/3;height:auto}
.tl-card .b{display:flex;flex-direction:column;gap:1px;padding:8px 10px 10px;min-width:0}
.tl-card .nm{font-size:14px;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tl-card .sp{font-size:12.5px;color:var(--text2);font-family:ui-monospace,Consolas,monospace;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tl-card .pl{display:flex;gap:4px;flex-wrap:wrap;margin-top:4px}
.tl-tw{padding:0;overflow-x:auto}
.tl-t{width:100%;border-collapse:collapse;font-size:13.5px}
.tl-t th{text-align:left;font-size:12px;color:var(--text3);font-weight:700;padding:8px 10px;border-bottom:1px solid var(--line);white-space:nowrap}
.tl-t td{padding:8px 10px;border-top:1px solid var(--line2);vertical-align:middle}
.tl-t .n{text-align:right;white-space:nowrap}
.tl-t tr.click{cursor:pointer}
.tl-t tr.click:hover,.tl-t tr.sel{background:var(--pri-soft)}
.tl-t tr.tot td{font-weight:800;border-top:1px solid var(--line)}
.tl-t .tl-b{font-weight:800}
.phone .tl-t{font-size:13px}
.phone .tl-t th,.phone .tl-t td{padding:7px 6px}
.tl-det .tl-dh{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-bottom:8px}
.tl-dhb{margin-left:auto;display:flex;gap:6px;flex-wrap:wrap}
.tl-ph2{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:8px}
.tl-ph2>.tl-ph.none{aspect-ratio:4/3;border-radius:12px}
.tl-phb{position:relative;border-radius:12px;overflow:hidden;aspect-ratio:4/3;padding:0}
.tl-phb img{width:100%;height:100%;object-fit:cover}
.tl-phb .lb{position:absolute;left:6px;bottom:6px;background:rgba(0,0,0,.6);color:#fff;border-radius:6px;padding:1px 6px;font-size:12px}
.tl-phw{display:flex;flex-direction:column;gap:2px;min-width:0}
.tl-phw .lnk{min-height:32px;text-align:left;font-size:13px}
.tl-cx td,.row.tl-cx .m2{opacity:.55;text-decoration:line-through}
.tl-phadd{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;border:2px dashed var(--line);border-radius:12px;aspect-ratio:4/3;font-size:13px;font-weight:700;color:var(--text2);cursor:pointer}
.tl-phadd svg{width:24px;height:24px;color:var(--pri)}
.tl-kv{display:grid;grid-template-columns:max-content 1fr;gap:6px 14px;margin-top:12px;font-size:14px}
.tl-kv dt{color:var(--text3);font-weight:600}
.tl-kv dd{min-width:0;word-break:break-all}
.tl-ro{display:flex;align-items:center;font-weight:800;background:var(--line2)}
.tl-bars{display:flex;align-items:flex-end;gap:8px;height:130px;padding:8px 4px 0}
.tl-bars>div{flex:1;display:flex;flex-direction:column;align-items:center;gap:4px;min-width:0}
.tl-bars i{display:block;width:100%;max-width:34px;background:var(--pri);border-radius:6px 6px 0 0;opacity:.75}
.tl-bars .v,.tl-bars .d{font-size:11px;color:var(--text3);white-space:nowrap}
/* 재고 */
.tl-nums{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.phone .tl-nums,.tabp .tl-nums{grid-template-columns:repeat(2,minmax(0,1fr))}
.tl-num{background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:12px 14px;display:flex;flex-direction:column;gap:2px;min-width:0}
.tl-num .l{font-size:12.5px;color:var(--text2);font-weight:600}
.tl-num b{font-size:24px;font-weight:800}
.tl-num small{font-size:13px;font-weight:600;color:var(--text3);margin-left:2px}
.tl-num.red b{color:var(--red)}
.tl-num.orange b{color:var(--orange)}
.tl-bar{height:8px;border-radius:5px;background:var(--line2);overflow:hidden}
.tl-bar i{display:block;height:100%;background:var(--pri);border-radius:5px}
.tl-bar.low i{background:var(--red)}
.tl-chk{display:flex;gap:10px;align-items:center;font-weight:700;cursor:pointer;min-height:44px}
.tl-chk input{width:22px;height:22px;accent-color:var(--pri)}
/* QR 태그 견본 (40×30mm 비율) */
.tl-labs{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:8px;margin:10px 0}
.tl-lab{display:flex;gap:8px;align-items:center;background:#fff;color:#111;border:1px dashed #999;border-radius:4px;padding:6px;aspect-ratio:4/3;overflow:hidden;font-size:11px;line-height:1.25}
.tl-lab .q svg{width:92px;height:92px;display:block}
.tl-lab .t{display:flex;flex-direction:column;min-width:0;gap:1px}
.tl-lab .t b{font-size:13px}
.tl-lab .m{font-family:Consolas,monospace;word-break:break-all}
.vh{position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip:rect(0 0 0 0)!important;white-space:nowrap!important}
/* 좁은 화면 */
@media (max-width:1180px){.pc .tl-sv3{grid-template-columns:minmax(240px,1fr) minmax(0,1.3fr)}.pc .tl-sv3>.tl-col:last-child{grid-column:1/-1}}
.tabl .tl-sv3{grid-template-columns:minmax(240px,1fr) minmax(0,1.3fr)}
.tabl .tl-sv3>.tl-col:last-child{grid-column:1/-1}
.tabl .tl-two.r400,.tabl .tl-two.r12{grid-template-columns:1fr}
/* 탭 권한(사람별) 칩 — 여러 줄로 감싸서 전부 보이게 (반영목록 2-1e) */
.tuchips{flex:1 1 260px;min-width:0;flex-wrap:wrap;overflow:visible}
/* 검수 L7: 이관 대조표 첫 칸 줄바꿈 안 함 · M2 조정 폼 · M4 확인 필요 */
#tlMigT td:first-child,#tlMigT th:first-child{white-space:nowrap}
.tl-adj{margin:10px 0;border:1px solid var(--pri)}
.tl-held{display:flex;flex-direction:column;gap:2px;padding:8px 0;border-top:1px solid var(--line2)}
