:root {
  --blue: #1a5fd0; --blue-l: #e8f0fd; --line: #d9dde3; --head: #f3f5f8; --text: #222; --muted: #7a818c;
  --pink: #f7d9dc; --teal: #cdeef0; --green: #c4e8d3; --purple: #dccbe0; --yellow: #fbf1c7; --rblue: #d6e6fa; --gray: #e6e6e6; --red: #f4b9b9;
  --orange: #f07a12;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif; font-size: 13px; color: var(--text); background: #fff; }
a { color: inherit; text-decoration: none; }
[x-cloak] { display: none !important; }

/* ---------- 상단 ---------- */
.topbar { display: flex; align-items: center; gap: 24px; height: 46px; padding: 0 18px; border-bottom: 1px solid var(--line); }
.logo { font-weight: 800; font-size: 20px; letter-spacing: -1px; }
.logo small { font-size: 11px; font-weight: 600; margin-left: 2px; color: var(--muted); }
.topmenu { display: flex; gap: 4px; flex: 1; }
.topmenu a { padding: 5px 12px; border-radius: 4px; color: #444; }
.topmenu a.on { background: var(--blue-l); color: var(--blue); font-weight: 700; }
.userbox { color: var(--muted); display: flex; gap: 12px; align-items: center; }
.userbox a { color: var(--blue); }

.layout { display: flex; height: calc(100% - 46px); }
.sidebar { width: 190px; flex-shrink: 0; border-right: 1px solid var(--line); padding: 10px 8px; overflow-y: auto; background: #fbfbfc; }
.sidebar .grp { font-weight: 700; padding: 8px 8px 4px; color: #333; }
/* 외부사이트 연결: 기본은 접어 두고, 제목을 누르면 펼친다 */
.sidebar details.ext-links > summary { cursor: pointer; list-style: none; user-select: none; display: flex; justify-content: space-between; align-items: center; }
.sidebar details.ext-links > summary::-webkit-details-marker { display: none; }
.sidebar details.ext-links > summary::after { content: '▸'; color: #8a93a3; font-weight: 400; font-size: 12px; }
.sidebar details.ext-links[open] > summary::after { content: '▾'; }
.sidebar details.ext-links > summary:hover { background: #eef1f5; border-radius: 4px; }
.sidebar a { display: block; padding: 5px 8px 5px 18px; color: #666; border-radius: 4px; }
.sidebar a:hover { background: #eef1f5; }
.sidebar a.on { color: var(--blue); font-weight: 700; background: var(--blue-l); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.page { flex: 1; overflow: auto; padding: 12px 16px 70px; }

/* ---------- 공통 ---------- */
.title-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.title-row h1 { font-size: 16px; margin: 0 12px 0 0; }
.btn { border: 1px solid #c8cdd4; background: #fff; border-radius: 4px; padding: 5px 11px; font-size: 12.5px; cursor: pointer; color: #333; white-space: nowrap; font-family: inherit; }
.btn:hover { background: #f4f6f9; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: #154fae; }
.btn.danger { color: #c0392b; border-color: #e3b4ae; }
.btn:disabled { opacity: .5; cursor: default; }
input.inp, select.inp, textarea.inp { border: 1px solid #c8cdd4; border-radius: 4px; padding: 5px 8px; font-size: 12.5px; font-family: inherit; background: #fff; }
input.inp:focus, select.inp:focus, textarea.inp:focus { outline: 2px solid #b9cff5; border-color: var(--blue); }
.muted { color: var(--muted); }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }

.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.tab { border: 1px solid #cfd8e6; background: #f4f7fc; color: #4a6aa0; border-radius: 14px; padding: 3px 11px; font-size: 12px; cursor: pointer; }
.tab b { margin-left: 3px; font-weight: 600; }
.tab.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.tab.warn { border-color: #f0b27a; background: #fff4ea; color: #c0560f; }
.tab.warn.on { background: var(--orange); color: #fff; }

.pager { display: flex; gap: 4px; align-items: center; margin: 4px 0 8px; font-size: 12px; }
.pager button { border: none; background: none; cursor: pointer; padding: 2px 6px; border-radius: 10px; color: #666; }
.pager button.on { background: var(--blue); color: #fff; }

/* ---------- 이카운트형 그리드 ---------- */
.grid-wrap { border: 1px solid var(--line); overflow: auto; max-height: calc(100vh - 250px); }
table.grid { border-collapse: collapse; width: 100%; font-size: 12px; }
.grid th { background: var(--head); position: sticky; top: 0; z-index: 2; font-weight: 600; color: #444; border: 1px solid var(--line); padding: 7px 5px; white-space: nowrap; }
.grid td { border: 1px solid var(--line); padding: 6px 6px; vertical-align: middle; }
.grid tbody tr:hover td { filter: brightness(0.97); }
.grid td.no { color: #aaa; font-size: 11px; text-align: center; width: 30px; }
.grid td.doc { font-weight: 700; font-size: 13px; white-space: nowrap; cursor: pointer; }
.grid td.doc:hover { text-decoration: underline; }
.grid td.shop { font-weight: 700; text-align: center; white-space: nowrap; }
.grid td.prod { font-weight: 600; min-width: 230px; max-width: 320px; line-height: 1.35; text-transform: uppercase; }
.grid td.prod b.pn { font-weight: 800; }        /* 품목명은 한 단계 더 굵게, 옵션명은 그대로 */
.grid td.thumbbtn { padding: 0 2px; width: 22px; }
.grid .tbtn { border: 1px solid #bbb; background: #f6f6f6; border-radius: 3px; font-size: 11px; line-height: 1; padding: 1px 3px; cursor: default; }
.grid .tbtn:hover { background: #e3edff; border-color: #0b4fd8; }
/* 주문서조회 썸네일 팝업: 위치(left/top)만 스크립트가 넣고 나머지 모양은 여기서 정한다 (스타일 속성을 덮어써도 fixed 가 유지되도록) */
.btn.orange { background: var(--orange); border-color: var(--orange); color: #fff; font-weight: 700; }
.btn.orange:hover { filter: brightness(.92); }
.sku-pop { position: fixed; z-index: 10000; display: flex; gap: 4px; padding: 4px; background: #fff; border: 1px solid #888; border-radius: 6px; box-shadow: 0 4px 14px rgba(0,0,0,.3); }
.thumb-pop { position: fixed; z-index: 9999; display: flex; min-height: 40px; background: #fff; border: 1px solid #888; border-radius: 6px;
             box-shadow: 0 6px 20px rgba(0,0,0,.35); padding: 4px; pointer-events: none; text-align: center; }
.grid tr.lz td { color: #0b4fd8; }               /* Shopee 가 아닌 판매처(MOMO·Lazada·Qoo10 등) 주문은 파란 글씨 */
.grid td.sku .btn.adj { display: table; margin: 2px 0 0; padding: 0 5px; font-size: 11px; color: #b3261e; }
.grid td.num { text-align: right; white-space: nowrap; }
.grid td.sm { font-size: 11px; white-space: nowrap; }
.grid td.qty-multi { background: var(--orange) !important; color: #fff; font-weight: 800; font-size: 15px; text-align: center; }
.grid td.qty { text-align: center; font-size: 14px; }
.grid tbody.ord-group tr:last-of-type td, .grid tbody.ord-group td[rowspan] { border-bottom: 1px solid #6b7785; }      /* 주문마다 아래쪽에 가는 구분선 (품목이 여러 줄인 주문은 마지막 줄 아래) */
.grid tr.sel td { box-shadow: inset 0 0 0 9999px rgba(26, 95, 208, .10); }
.row-pink td { background: var(--pink); }
.row-green td { background: var(--green); }
.row-purple td { background: var(--purple); }
.row-yellow td { background: var(--yellow); }
.row-orange td { background: #fddcb8; }
.row-blue td { background: var(--rblue); }
.row-gray td { background: var(--gray); }
.row-red td { background: var(--red); }
.row-teal td { background: var(--teal); }
.txt-orange { color: var(--orange); }
.txt-blue { color: var(--blue); }
.txt-teal { color: #0b7d86; font-weight: 700; }
.txt-gray { color: #888; }
.txt-strike { color: #888; text-decoration: line-through; }
.alert-dot { display: inline-block; background: #e53935; color: #fff; border-radius: 9px; font-size: 10px; padding: 1px 6px; margin-left: 4px; }
.badge { display: inline-block; border-radius: 3px; padding: 1px 5px; font-size: 10.5px; background: #eef1f5; color: #555; }
.badge.ok { background: #dff3e6; color: #1e7b45; }
.badge.err { background: #fde3e1; color: #b3261e; }
a.polink { display: inline-block; margin-right: 6px; color: var(--blue); text-decoration: underline dotted; cursor: pointer; }   /* 주문서조회의 발주번호: 누르면 새 탭에서 발주서조회 */
a.polink:hover { text-decoration: underline; }
.mk { display: inline-block; margin-left: 5px; padding: 0 5px; border-radius: 3px; font-size: 10.5px; font-weight: 800; white-space: nowrap; vertical-align: 1px; }   /* 상품 표식(고가품·배터리포함) */
.mk.hv { background: #d9302c; color: #fff; }
.mk.bt { background: #f5b301; color: #3d2b00; }
.mk.fc { background: #6d28d9; color: #fff; }      /* SKU강제변경건 */
/* 내부 증정(증정 설정): 함께 출하할 증정품 안내 — 주황은 Shopee 외 플랫폼(송장에 안 찍히므로 눈에 띄게) */
.gf { display: block; margin-top: 2px; padding: 1px 6px; border-radius: 4px; background: #e6f4ea; color: #14602c; font-size: 11px; font-weight: 700; white-space: normal; }
.gf.ext { background: #fff0d9; color: #8a4a00; border: 1px solid #e8710a; }
.gf.big { font-size: 13px; padding: 6px 10px; margin: 6px 0; grid-column: 1 / -1; }
.f-재고, .f-입고완료 { background: #d5f2e0; color: #17733f; }
.f-발주진행 { background: #dbe8fb; color: #1a5fd0; }
.f-발주필요 { background: #fde3e1; color: #b3261e; }
.f-부분환불 { background: #ffe8cc; color: #8a4b00; font-weight: 700; }
.f-SKU미등록 { background: #fff0d6; color: #a15c00; }
.fbadges { display: flex; gap: 3px; flex-wrap: wrap; }
.fbadges .badge { white-space: nowrap; }
.sku { font-family: Consolas, "Courier New", monospace; font-size: 11.5px; }

/* ---------- 하단 고정 툴바 ---------- */
.bottombar { position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--line); padding: 8px 16px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.bottombar .sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }

/* ---------- 폼 ---------- */
.form-box { border: 1px solid var(--line); border-radius: 6px; padding: 14px 18px; background: #fff; margin-bottom: 14px; }
.form-grid { display: grid; grid-template-columns: 100px 1fr 100px 1fr; gap: 8px 12px; align-items: center; max-width: 900px; }
.form-grid label { color: #555; font-size: 12.5px; }
.section-title { font-weight: 700; margin: 18px 0 8px; font-size: 14px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.card { border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; }
.card .k { color: var(--muted); font-size: 12px; }
.card .v { font-size: 20px; font-weight: 800; margin-top: 4px; }
.bar { height: 8px; background: #8fb1ea; border-radius: 4px; }

/* ---------- 팝업(iframe)으로 띄운 화면 (?embed=1): 상단바·메뉴 없이 본문만 ---------- */
body.embed .layout { height: 100%; }
body.embed .main { overflow: auto; }

/* ---------- 모달 ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(20, 30, 50, .35); z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding-top: 40px; }
.modal { background: #fff; border-radius: 6px; width: min(1300px, 95vw); max-height: calc(100vh - 80px); display: flex; flex-direction: column; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.modal.sm { width: min(820px, 95vw); }
.modal-head { background: var(--blue); color: #fff; padding: 9px 14px; display: flex; justify-content: space-between; align-items: center; border-radius: 6px 6px 0 0; font-weight: 700; }
.modal-head button { background: none; border: none; color: #fff; font-size: 18px; cursor: pointer; }
.modal-body { padding: 12px 14px; overflow: auto; flex: 1; }
.modal-foot { padding: 8px 14px; border-top: 1px solid var(--line); display: flex; gap: 6px; }
.kv { display: grid; grid-template-columns: 110px 1fr 110px 1fr; gap: 6px 10px; margin-bottom: 12px; }
.kv .k { color: var(--muted); }

#toast { position: fixed; right: 20px; bottom: 70px; z-index: 100; display: flex; flex-direction: column; gap: 6px; }
#toast div { background: #263238; color: #fff; padding: 10px 14px; border-radius: 6px; max-width: 460px; white-space: pre-line; box-shadow: 0 4px 14px rgba(0,0,0,.2); }
#toast div.err { background: #b3261e; }

/* ---------- 로그인 ---------- */
.login-wrap { display: flex; align-items: center; justify-content: center; height: 100%; background: #f2f5f9; }
.login-box { background: #fff; padding: 34px 36px; border-radius: 10px; width: 340px; box-shadow: 0 6px 30px rgba(0,0,0,.08); }
.login-box h1 { margin: 0 0 20px; font-size: 20px; }
.login-box input { width: 100%; margin-bottom: 10px; padding: 9px 10px; }
.login-box .btn { width: 100%; padding: 9px; font-size: 14px; }
.error { color: #c0392b; margin-bottom: 10px; }

.menu-btn { display: none; border: 0; background: none; font-size: 22px; line-height: 1; padding: 4px 8px; cursor: pointer; color: #333; }
.menu-backdrop { display: none; }

@media (max-width: 800px) {
  .grid input.qty-inp { font-size: 16px; padding: 7px 6px; text-align: right; }   /* 숫자칸이 좁아 값이 안 보이던 문제: 크게 + 16px 이면 iOS 가 확대하지 않는다 */
  .topbar { gap: 8px; padding: 0 10px; }
  .topbar .logo { flex: 1; }
  .menu-btn { display: block; }
  .userbox { gap: 8px; font-size: 12px; }
  /* 왼쪽 메뉴는 햄버거 버튼을 누르면 위에서 덮어 나온다 */
  .sidebar { display: none; position: fixed; top: 46px; left: 0; bottom: 0; width: min(260px, 80vw); z-index: 150; box-shadow: 4px 0 18px rgba(0,0,0,.2); }
  .sidebar a { padding: 10px 8px 10px 18px; font-size: 14px; }
  body.menu-open .sidebar { display: block; }
  body.menu-open .menu-backdrop { display: block; position: fixed; inset: 46px 0 0 0; z-index: 140; background: rgba(0,0,0,.35); }
  .topmenu { display: none; }
  .form-grid, .kv { grid-template-columns: 90px minmax(0, 1fr); }
  .kv > [style*="grid-column"] { grid-column: 1 / -1 !important; }      /* 품목 창처럼 가로로 길게 잡은 칸은 폰에서 한 줄을 다 쓴다 */
  .kv .inp, .kv select { min-width: 0; max-width: 100%; box-sizing: border-box; }
  .page { padding: 10px 10px 80px; }
}

/* 가격 재확인 알림 팝업 */
.remind-bg { z-index: 200; align-items: center; padding-top: 0; }
.remind-card { border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; margin-bottom: 8px; }
.remind-sku { font-size: 16px; }
.remind-memo { margin: 4px 0; white-space: pre-line; }
.remind-act { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.remind-act a.btn { text-decoration: none; }
.remind-again { margin-top: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: #fffbe6; }
.remind-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-bottom: 6px; }
.remind-row > b { min-width: 62px; }
.remind-row > .inp[type="text"], .remind-row > .inp:not([type]) { flex: 1; min-width: 200px; }
.remind-picks { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0 0 6px 76px; }
.remind-picks[hidden], .remind-again .inp[hidden] { display: none; }

/* 프로모션 이력 묶음 펼치기 */
.icon-btn { padding: 1px 5px; margin-right: 4px; line-height: 1; vertical-align: middle; }
.log-child td { background: #f7f9fc; }
.err-text { color: #c0392b; }

.inp.price-diff { background: #fff4c2; }

/* 출하 중지 경고 팝업 */
.stop-bg { z-index: 300; background: rgba(120, 0, 0, .45); }
.stop-head { background: #b3261e; }
.stop-msg { background: #fdecea; border: 1px solid #f1b0aa; color: #8c1d18; border-radius: 6px; padding: 8px 10px; margin-bottom: 8px; font-weight: 700; white-space: pre-line; }
.stop-card { border-color: #e3b4ae; }
.stop-items { margin: 6px 0 0; font-weight: 700; }

/* 검색 상품 합계 / 출하대기 요약 */
.prodtotal { background: #fff8e1; border: 1px solid #f0d58a; border-radius: 6px; padding: 7px 12px; margin: 6px 0; }
.prodtotal .big { font-size: 18px; color: #b26a00; }
.pick-sum { background: #eef6ff; border: 1px solid #b9d4f2; border-radius: 6px; padding: 8px 12px; margin-bottom: 8px; font-size: 14px; }
.pick-sum .big { font-size: 18px; color: #0b57a4; }

/* 게시판 알림: 종 아이콘·숫자·풍선·목록 */
.bell-wrap { position: relative; }
.bell { position: relative; background: none; border: none; font-size: 18px; cursor: pointer; padding: 2px 6px; line-height: 1; }
.bell.on { animation: bell-ring 2.4s ease-in-out infinite; transform-origin: 50% 12%; }
@keyframes bell-ring { 0%, 70%, 100% { transform: rotate(0); } 74% { transform: rotate(14deg); } 78% { transform: rotate(-12deg); } 82% { transform: rotate(8deg); } 86% { transform: rotate(-5deg); } 90% { transform: rotate(0); } }
.bell-badge { position: absolute; top: -4px; right: -4px; min-width: 16px; height: 16px; padding: 0 4px; box-sizing: border-box; border-radius: 8px; background: #e53935; color: #fff; font-size: 10.5px; font-weight: 700; line-height: 16px; text-align: center; }
.bell-balloon { position: absolute; top: 38px; right: -6px; width: 270px; background: #1f2a44; color: #fff; border-radius: 10px; padding: 10px 28px 10px 12px; box-shadow: 0 6px 22px rgba(0,0,0,.28); z-index: 70; cursor: pointer; font-size: 12.5px; }
.bell-balloon::before { content: ""; position: absolute; top: -7px; right: 18px; border: 7px solid transparent; border-top: 0; border-bottom-color: #1f2a44; }
.bell-balloon .bb-head { font-weight: 700; margin-bottom: 3px; }
.bell-balloon .bb-body { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bell-balloon .bb-sub { color: #aeb9d2; font-size: 11.5px; margin: 2px 0 6px; }
.bell-balloon .bb-go { color: #8fb8ff; font-weight: 700; }
.bell-balloon .bb-x { position: absolute; top: 4px; right: 6px; background: none; border: none; color: #aeb9d2; font-size: 16px; cursor: pointer; }
.bell-panel { position: absolute; top: 34px; right: -4px; width: 320px; max-height: 420px; overflow: auto; background: #fff; border: 1px solid #cfd5dd; border-radius: 8px; box-shadow: 0 8px 26px rgba(0,0,0,.2); z-index: 70; }
.bell-head { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; border-bottom: 1px solid #eef0f3; position: sticky; top: 0; background: #fff; }
.bell-all { background: none; border: none; color: var(--blue); cursor: pointer; font-size: 12px; }
.bell-item { display: block; padding: 9px 12px; border-bottom: 1px solid #f1f3f6; color: #222 !important; }
.bell-item:hover { background: #f5f8ff; }
.bell-tag { font-size: 11px; color: #1a5fb4; font-weight: 700; }
.bell-title { font-size: 13px; font-weight: 600; margin: 1px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bell-sub { font-size: 11.5px; color: #8a94a4; }
.bell-empty { padding: 16px 12px; color: #8a94a4; font-size: 12.5px; text-align: center; }
.sidebar .m-only { display: none; }
@media (max-width: 800px) { .sidebar .m-only { display: block; } }
/* 상단 메뉴의 '게시판' 드롭다운 */
.topmenu .dd { position: relative; display: flex; }
.topmenu .dd-head { display: block; }      /* 다른 메뉴 링크와 같은 높이·세로 위치가 되도록 (인라인이면 글자가 위로 치우침) */
.topmenu .dd-caret { font-size: 10px; margin-left: 4px; opacity: .6; }
.topmenu .dd-list { display: none; position: absolute; top: calc(100% - 2px); left: 0; min-width: 176px; background: #fff; border: 1px solid #cfd5dd; border-radius: 8px; box-shadow: 0 8px 26px rgba(0,0,0,.18); padding: 5px; z-index: 80; }
.topmenu .dd:hover .dd-list, .topmenu .dd:focus-within .dd-list { display: block; }
.topmenu .dd-list a { display: block; padding: 7px 10px; border-radius: 6px; white-space: nowrap; }
.topmenu .dd-list a:hover { background: #eef1f5; }
.topmenu .dd-head .menu-count, .topmenu .dd-list a .menu-count { background: #e53935; color: #fff; border-radius: 9px; min-width: 16px; padding: 0 5px; font-size: 10.5px; font-weight: 700; line-height: 16px; text-align: center; box-sizing: border-box; display: inline-block; margin-left: 6px; }
.topmenu .dd-list a .menu-count { float: right; margin-top: 2px; }
.sidebar a .menu-count { float: right; background: #e53935; color: #fff; border-radius: 9px; min-width: 16px; padding: 0 5px; font-size: 10.5px; font-weight: 700; line-height: 16px; text-align: center; box-sizing: border-box; }
@media (max-width: 800px) { .bell-balloon, .bell-panel { right: -40px; } .bell-balloon { width: 240px; } .bell-panel { width: 280px; } }

/* ---- 모바일 앱(홈 화면 추가)·카메라 바코드 스캔 ---- */
body { padding-bottom: env(safe-area-inset-bottom); }
input.has-scan { padding-right: 38px !important; }
.scan-layer { position: fixed; inset: 0; z-index: 2147; pointer-events: none; }
.scan-btn { position: fixed; pointer-events: auto; border: 1px solid #b9cff5; background: #eef4ff; border-radius: 6px; padding: 0; font-size: 16px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.scan-ov { position: fixed; inset: 0; z-index: 3000; background: #000; display: flex; flex-direction: column; color: #fff; }
.scan-ov[hidden] { display: none; }
.scan-top { display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 14px 10px; background: #111; }
.scan-top b { font-size: 16px; } .scan-for { color: #9db6e8; font-size: 12px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scan-x { background: #2b2f36; color: #fff; border: 0; border-radius: 8px; padding: 9px 16px; font-size: 14px; }
#scanReader { flex: 1; min-height: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; }
#scanReader video { width: 100% !important; height: auto !important; max-height: 100%; object-fit: cover; }
.scan-msg { text-align: center; padding: 10px 14px; font-size: 14px; background: #111; }
.scan-bot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px calc(14px + env(safe-area-inset-bottom)); background: #111; font-size: 14px; }
.scan-bot label { display: flex; align-items: center; gap: 8px; } .scan-bot input { width: 20px; height: 20px; } .scan-last { color: #8fe5a4; font-size: 13px; max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scan-ov.hit #scanReader { box-shadow: inset 0 0 0 6px #22c55e; }
body.scanning { overflow: hidden; }
.pwa-hint { position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 2500; background: #1a2b4d; color: #fff; border-radius: 12px; padding: 12px 14px; font-size: 14px; line-height: 1.5; box-shadow: 0 6px 20px rgba(0,0,0,.35); }
.pwa-hint button { margin-left: 8px; background: #2d4a85; color: #fff; border: 0; border-radius: 8px; padding: 5px 12px; font-size: 13px; } .pwa-ico { display: inline-block; border: 1px solid #fff; border-radius: 4px; padding: 0 4px; }

/* 팝업창 제목줄을 잡고 끌어서 옮길 수 있다 (erp.js) */
.modal-head { cursor: move; user-select: none; -webkit-user-select: none; touch-action: none; }
.modal-head button, .modal-head a, .modal-head input, .modal-head select { cursor: pointer; }
.modal-head.dragging { cursor: grabbing; }
.modal.dragging-now { box-shadow: 0 14px 50px rgba(0,0,0,.35); }

/* 사이드바 하위메뉴 (발주인사이트 > 제품가격추적): 평소에는 접혀 있고, 화살표로 펼친다 */
.sidebar .sub-row { position: relative; }
.sidebar .sub-row > a { padding-right: 30px; }
.sidebar .sub-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: #8a93a3; width: 24px; height: 24px; border-radius: 5px; cursor: pointer; font-size: 12px; padding: 0; }
.sidebar .sub-toggle:hover { background: #e4e9f1; color: #333; }
.sidebar .sub-toggle[aria-expanded="true"] { transform: translateY(-50%) rotate(90deg); }
.sidebar .sub-list[hidden] { display: none; }
.sidebar .sub-list a { padding-left: 30px; font-size: 13px; }
