
/* 레이아웃: 위 띠(공지·스팟) → 검색 → 거래처 탭 → [품목표 | 이번 주 발주 요약] 2단. 휴대폰은 1단 + 아래 고정 바 */
:root {
  --bg: #f4f3ef;
  --surface: #ffffff;
  --ink: #1c2420;
  --muted: #5f6a64;
  --line: #e2e0d8;
  --accent: #1d5c45;        /* 병 초록 */
  --accent-soft: #e5efe9;
  --brass: #9a6a12;         /* 태그·강조 */
  --brass-soft: #f6ecd8;
  --good: #1f7a4a; --good-soft: #e3f3e9;
  --warn: #a35a00; --warn-soft: #fdf0dc;
  --bad: #b3261e; --bad-soft: #fbe4e2;
  --row-on: #f1f7f3;
  --font: "IBM Plex Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141917; --surface: #1c2320; --ink: #e8ece9; --muted: #9aa69f; --line: #2e3833;
    --accent: #5fbf95; --accent-soft: #1f3a2f; --brass: #e0b45e; --brass-soft: #3a2f19;
    --good: #6fd09a; --good-soft: #1d3527; --warn: #f0b25a; --warn-soft: #3b2c14; --bad: #f08a80; --bad-soft: #3d1f1c;
    --row-on: #1f2f28; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141917; --surface: #1c2320; --ink: #e8ece9; --muted: #9aa69f; --line: #2e3833;
  --accent: #5fbf95; --accent-soft: #1f3a2f; --brass: #e0b45e; --brass-soft: #3a2f19;
  --good: #6fd09a; --good-soft: #1d3527; --warn: #f0b25a; --warn-soft: #3b2c14; --bad: #f08a80; --bad-soft: #3d1f1c;
  --row-on: #1f2f28; color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.5; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }

.proto { background: var(--ink); color: var(--bg); font-size: 13px; padding: 6px 20px; text-align: center; }
.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1440px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 16px; }
.brand { font-weight: 700; font-size: 19px; letter-spacing: -0.01em; }
.brand small { font-weight: 500; color: var(--muted); font-size: 14px; margin-left: 6px; }
.views { display: flex; gap: 4px; margin-left: 12px; flex-wrap: wrap; }
.vbtn { border: 0; background: none; padding: 8px 14px; border-radius: 8px; font-size: 16px; font-weight: 600; color: var(--muted); }
.vbtn:hover { background: var(--bg); }
.vbtn.on { background: var(--accent-soft); color: var(--accent); }
.vbtn.spot.on { background: var(--brass-soft); color: var(--brass); }
.vbtn .cnt { display: inline-block; min-width: 22px; padding: 0 6px; border-radius: 11px; background: var(--accent); color: #fff; font-size: 13px; text-align: center; }
.store { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.store b { font-size: 17px; }
.btn { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 8px 14px; font-size: 15px; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
:root[data-theme="dark"] .btn.primary { color: #0e1a14; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primary { color: #0e1a14; } }
.btn.big { padding: 14px 18px; font-size: 18px; width: 100%; border-radius: 10px; }
.btn.small { padding: 4px 10px; font-size: 14px; }
.bell { position: relative; }
.bell .dot { position: absolute; top: -6px; right: -6px; background: var(--bad); color: #fff; border-radius: 10px; font-size: 12px; padding: 0 6px; font-weight: 700; }

.bands { max-width: 1440px; margin: 12px auto 0; padding: 0 20px; display: grid; gap: 8px; }
.band { border-radius: 10px; padding: 10px 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 15px; }
.band.notice { background: var(--accent-soft); }
.band.spot { background: var(--brass-soft); border: 1px solid color-mix(in srgb, var(--brass) 35%, transparent); }
.band .label { font-weight: 700; font-size: 13px; padding: 2px 8px; border-radius: 6px; background: var(--surface); }
.band.spot .label { color: var(--brass); }
.band.notice .label { color: var(--accent); }
.band .go { margin-left: auto; }

.wrap { max-width: 1440px; margin: 0 auto; padding: 14px 20px 120px; display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.search { display: flex; gap: 8px; margin-bottom: 12px; }
.search input { flex: 1; font-size: 18px; padding: 12px 16px; border: 2px solid var(--line); border-radius: 10px; background: var(--surface); }
.search input:focus { border-color: var(--accent); outline: none; }

.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; border-bottom: 2px solid var(--line); }
.tab { border: 0; background: none; padding: 10px 12px; font-size: 16px; font-weight: 500; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; }
.tab .n { font-size: 13px; color: var(--muted); margin-left: 4px; }
.tab.on { color: var(--ink); font-weight: 700; border-bottom-color: var(--accent); }
.tab.spot.on { border-bottom-color: var(--brass); }
.tab.sep { margin-left: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 0; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 20px; padding: 5px 12px; font-size: 14px; }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chips.sub .chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 13px; font-weight: 600; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 1; white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 15px; }
tr.cat-row td { background: var(--bg); font-weight: 700; font-size: 14px; color: var(--muted); padding: 8px 12px; }
tr.on td { background: var(--row-on); }
td.r, th.r { text-align: right; }
.nm { font-weight: 600; font-size: 16px; }
.meta { color: var(--muted); font-size: 13px; margin-top: 2px; }
.meta .wine-info { color: #8a2c47; font-weight: 600; }
.tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 1px 6px; border-radius: 5px; margin-right: 5px; vertical-align: 1px; background: var(--brass-soft); color: var(--brass); }
.tag.NEW { background: var(--accent-soft); color: var(--accent); }
.tag.RE { background: var(--good-soft); color: var(--good); }
.tag.spot { background: var(--brass); color: #fff; }
.lim { font-size: 13px; line-height: 1.35; white-space: nowrap; }
.lim b { font-size: 15px; }
.lim .zero { color: var(--bad); }
.lim .lowc { color: var(--warn); }
.tag.low { background: var(--warn); color: #fff; }
.tag.out { background: var(--bad); color: #fff; }
.supnote { margin: 0 0 12px; padding: 12px 16px; border-radius: 10px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); font-size: 16px; font-weight: 600; color: var(--accent); }
.supnote.bad { background: var(--bad-soft); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
tr.cat-row.new td { background: var(--accent-soft); color: var(--accent); }
tr.cat-row.re td { background: var(--good-soft); color: var(--good); }
.gift { font-size: 14px; color: var(--brass); }
.link { white-space: nowrap; border: 0; background: none; color: var(--accent); text-decoration: underline; padding: 0; font-size: 14px; }
.comps { margin: 6px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--muted); }
.comps li { display: flex; gap: 8px; }
.comps li span:last-child { margin-left: auto; }

.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.qty button { width: 38px; height: 40px; border: 0; background: var(--bg); font-size: 20px; line-height: 1; }
.qty button:hover { background: var(--accent-soft); }
.qty input { width: 64px; height: 40px; border: 0; text-align: center; font-size: 17px; font-weight: 600; background: transparent; -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.hint { font-size: 13px; margin-top: 4px; color: var(--warn); max-width: 220px; }
.hint.bad { color: var(--bad); }
.hint button { margin-left: 4px; }

.empty { padding: 40px 20px; text-align: center; color: var(--muted); }

/* 오른쪽 요약 */
.side { position: sticky; top: 12px; display: grid; gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.card h3 { margin: 0 0 4px; font-size: 16px; }
.dl { color: var(--muted); font-size: 14px; }
.count { font-size: 26px; font-weight: 700; margin: 6px 0 2px; }
.pill { display: inline-block; font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 20px; }
.pill.unconfirmed { background: var(--warn-soft); color: var(--warn); }
.pill.confirmed { background: var(--good-soft); color: var(--good); }
.pill.modified { background: var(--bad-soft); color: var(--bad); }
.pill.locked { background: var(--accent-soft); color: var(--accent); }
.sum { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; margin: 12px 0; font-size: 15px; }
.sum .tot { font-size: 20px; font-weight: 700; }
.roundline { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; display: grid; gap: 4px; }

/* 장바구니 */
.cart-head { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 16px; border-bottom: 1px solid var(--line); }
.cart-head h2 { margin: 0; font-size: 20px; }
.status-msg { padding: 12px 16px; font-weight: 600; }
.status-msg.modified { background: var(--bad-soft); color: var(--bad); }
.status-msg.unconfirmed { background: var(--warn-soft); color: var(--warn); }
.status-msg.confirmed { background: var(--good-soft); color: var(--good); }
.group-h { display: flex; justify-content: space-between; padding: 10px 16px; background: var(--bg); font-weight: 700; }
.cart-foot { padding: 16px; display: grid; gap: 12px; }
.cart-total { display: flex; justify-content: space-between; align-items: baseline; font-size: 18px; }
.cart-total b { font-size: 26px; }
.rm { border: 0; background: none; color: var(--muted); font-size: 14px; text-decoration: underline; }

.req { padding: 16px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.req h3 { margin: 0; font-size: 16px; }
.req p { margin: 0; color: var(--muted); font-size: 14px; }
.req-form { display: flex; gap: 8px; flex-wrap: wrap; }
.req-form input { border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; background: var(--surface); }
.req-form input#req-name { flex: 1; min-width: 200px; }
.req-form input#req-qty { width: 90px; }
.req-list { display: grid; gap: 6px; }
.req-item { display: flex; gap: 10px; align-items: center; padding: 8px 12px; background: var(--bg); border-radius: 8px; }

.hist-item { border-bottom: 1px solid var(--line); }
.hist-row { display: grid; grid-template-columns: 1fr auto auto auto; gap: 16px; align-items: center; padding: 14px 16px; }
.hist-row .t { font-weight: 600; }
.hist-detail { padding: 0 16px 14px; }

/* 대화상자 */
.dim { position: fixed; inset: 0; background: rgb(0 0 0 / 0.45); display: none; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.dim.on { display: flex; }
.dlg { background: var(--surface); border-radius: 14px; max-width: 560px; width: 100%; max-height: 86vh; overflow: auto; padding: 22px; display: grid; gap: 14px; }
.dlg.wide { max-width: 760px; }
.dlg h2 { margin: 0; font-size: 20px; text-wrap: balance; }
.dlg p { margin: 0; }
.dlg .acts { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.err { border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: grid; gap: 6px; }
.err .why { color: var(--bad); font-weight: 600; }
.warn-box { background: var(--warn-soft); color: var(--warn); border-radius: 10px; padding: 12px; font-size: 15px; }
.note-text { white-space: pre-wrap; background: var(--bg); padding: 14px; border-radius: 10px; }
.done-mark { font-size: 22px; font-weight: 700; color: var(--good); }
.xl { font-size: 13px; border: 1px solid var(--line); }
.xl td, .xl th { padding: 6px 8px; border: 1px solid var(--line); position: static; }
.pop { position: absolute; right: 20px; top: 60px; width: 360px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 30px rgb(0 0 0 / 0.15); z-index: 40; display: none; }
.pop.on { display: block; }
.pop h3 { margin: 0; padding: 12px 14px; font-size: 15px; border-bottom: 1px solid var(--line); }
.pop .ni { padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
.pop .ni time { display: block; color: var(--muted); font-size: 12px; }

.login { min-height: 100%; display: grid; place-items: center; padding: 20px; }
.login form { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 28px; width: 100%; max-width: 380px; display: grid; gap: 14px; }
.login label { font-weight: 600; display: grid; gap: 6px; }
.login input { font-size: 18px; padding: 12px; border: 2px solid var(--line); border-radius: 10px; background: var(--surface); }

.mbar { display: none; }
@media (max-width: 1100px) {
  .wrap { grid-template-columns: minmax(0, 1fr); }
  .wrap > * { min-width: 0; }
  .side { display: none; }
  .mbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); padding: 10px 16px; gap: 12px; align-items: center; z-index: 30; }
  .mbar .t { flex: 1; font-size: 14px; }
  .mbar .t b { font-size: 17px; }
}
@media (max-width: 720px) {
  th.h-unit, td.h-unit, th.h-gift, td.h-gift { display: none; }
  .top-in { flex-wrap: wrap; }
  .hist-row { grid-template-columns: 1fr auto; }
  .pop { left: 16px; right: 16px; width: auto; }
}
@media (prefers-reduced-motion: no-preference) { .btn, .chip, .tab { transition: background .12s, border-color .12s; } }

.busy { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 8px 16px; border-radius: 20px; font-size: 14px; z-index: 70; display: none; }
.busy.on { display: block; }
.toast { position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 10px; z-index: 60; display: none; }
.toast.on { display: block; }
.login .err { color: var(--bad); font-size: 14px; }
.tag.chg { background: var(--warn-soft); color: var(--warn); }
.err:empty { display: none; }
.pwf { display: grid; gap: 12px; margin: 8px 0; }
.pwf label { font-weight: 600; display: grid; gap: 6px; }
.pwf input { font-size: 18px; padding: 12px; border: 2px solid var(--line); border-radius: 10px; background: var(--surface); }
.pwf .err { color: var(--bad); font-size: 14px; border: 0; padding: 0; }
/* 휴대폰: 표 대신 카드처럼 한 줄씩 (옆으로 밀지 않아도 되게) */
@media (max-width: 640px) {
  .tbl-wrap { overflow: visible; }
  .tbl-wrap table thead { display: none; }
  .tbl-wrap table, .tbl-wrap tbody { display: block; }
  .tbl-wrap tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; row-gap: 2px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .tbl-wrap tbody td { display: block; padding: 0 !important; border: 0 !important; text-align: left !important; font-size: 15px; }
  .tbl-wrap tbody td:first-child { grid-column: 1 / -1; margin-bottom: 4px; }
  .tbl-wrap tbody td:last-child { grid-column: 2; grid-row: 2 / span 5; align-self: center; text-align: right !important; }
  .tbl-wrap tbody td:empty { display: none; }
  .tbl-wrap tbody td:nth-child(2):not(:empty):not(:has(.pv))::after, .tbl-wrap tbody td:nth-child(2) .pv::after { content: '원'; }
  .tbl-wrap tbody td.h-unit, .tbl-wrap tbody td.h-gift { display: block; color: var(--muted); font-size: 14px; }
  .tbl-wrap tbody td.h-unit:empty, .tbl-wrap tbody td.h-gift:empty { display: none; }
  .tbl-wrap tbody td.h-gift:not(:empty)::before { content: '증정 '; }
  .tbl-wrap tbody tr.cat-row { display: block; padding: 8px 14px; background: var(--bg); }
  .tbl-wrap tbody tr.cat-row.new { background: var(--accent-soft); }
  .tbl-wrap tbody tr.cat-row.re { background: var(--good-soft); }
  .tbl-wrap tbody tr.cat-row td { font-size: 14px; text-align: left !important; background: transparent; }
  .tbl-wrap tbody tr.on { background: var(--row-on); }
  .tbl-wrap tbody tr.on td { background: transparent; }
  .qty button { width: 44px; height: 44px; }
  .qty input { width: 56px; height: 44px; }
}
.qty button:disabled, .qty input:disabled { opacity: .35; cursor: not-allowed; background: var(--bg); }
a.btn { text-decoration: none; display: inline-flex; align-items: center; }
.login .guide-link { text-align: center; font-weight: 700; color: var(--accent); font-size: 16px; padding: 10px; border: 2px dashed color-mix(in srgb, var(--accent) 40%, transparent); border-radius: 10px; text-decoration: none; }

/* =====================================================================
   디자인 2 (11/17): 더 차분하고 세련되게 · 중요한 것(마감·확정·이슈)만 눈에 띄게
   ===================================================================== */
:root {
  --bg: #f5f4f0; --surface: #ffffff; --ink: #15181b; --muted: #6a7078; --line: #e8e6e0; --line2: #f0eee9;
  --accent: #1e4d3a; --accent-soft: #e8f0eb;
  --brass: #a8701a; --brass-soft: #f8efdc;
  --row-on: #f2f7f3; --head: #f7f6f2;
  --topbar: #14191a; --topink: #f3f1ea; --gold: #e2b866;
  --shadow: 0 1px 2px rgb(20 24 27 / .04), 0 6px 20px rgb(20 24 27 / .05);
  --font: "Pretendard", "IBM Plex Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --line2: #26302b; --head: #222a26; --topbar: #0d1110; --shadow: none; } }
:root[data-theme="dark"] { --line2: #26302b; --head: #222a26; --topbar: #0d1110; --shadow: none; }
body { letter-spacing: -0.01em; -webkit-font-smoothing: antialiased; }

/* 위 막대: 어두운 바탕 */
.top { background: var(--topbar); border-bottom: 0; color: var(--topink); }
.top-in { padding: 10px 24px; }
.brand { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; display: flex; align-items: center; gap: 8px; }
.brand::before { content: ''; width: 8px; height: 22px; border-radius: 3px; background: var(--gold); }
.brand small { color: rgb(243 241 234 / .55); font-weight: 500; }
.vbtn { color: rgb(243 241 234 / .65); font-size: 15px; padding: 8px 14px; border-radius: 999px; }
.vbtn:hover { background: rgb(255 255 255 / .07); color: var(--topink); }
.vbtn.on { background: var(--topink); color: var(--topbar); }
.vbtn.spot.on { background: var(--gold); color: var(--topbar); }
.vbtn .cnt { background: var(--gold); color: var(--topbar); font-weight: 700; }
.top .store b { font-size: 15px; color: var(--topink); margin-right: 4px; }
.top .btn { background: transparent; border-color: rgb(255 255 255 / .16); color: rgb(243 241 234 / .85); font-size: 14px; padding: 6px 12px; border-radius: 999px; }
.top .btn:hover { border-color: rgb(255 255 255 / .4); color: #fff; }
.pop { color: var(--ink); }

/* 버튼 */
.btn { border-radius: 10px; }
.btn.primary { box-shadow: 0 2px 0 rgb(0 0 0 / .08); }
.btn.big { border-radius: 12px; font-weight: 700; letter-spacing: -0.02em; }

/* 공지 띠 */
.bands { margin-top: 16px; padding: 0 24px; }
.band { border-radius: 12px; padding: 11px 16px; box-shadow: var(--shadow); }
.band.notice { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); }
.band.notice .label { background: var(--accent-soft); }
.band.spot { border-left: 4px solid var(--brass); }

.wrap { padding: 16px 24px 120px; gap: 24px; }
@media (min-width: 1101px) { .wrap { grid-template-columns: minmax(0, 1fr) 330px; } }
.search input { border: 1px solid var(--line); border-radius: 14px; padding: 13px 18px 13px 46px; font-size: 17px; box-shadow: var(--shadow);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' stroke='%236a7078' stroke-width='2'%3E%3Ccircle cx='9' cy='9' r='6'/%3E%3Cpath d='m14 14 4 4'/%3E%3C/svg%3E") no-repeat 16px center; }
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

/* 거래처 탭: 둥근 알약 */
.tabs { border-bottom: 0; gap: 6px; padding: 2px 0 4px; }
.tab { border: 1px solid var(--line); border-radius: 999px; padding: 8px 15px; margin: 0; background: var(--surface); font-size: 15px; }
.tab:hover { border-color: var(--muted); }
.tab.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.tab.on .n { color: rgb(255 255 255 / .7); }
.chips { padding: 12px 0 14px; }
.chip { border-radius: 999px; font-size: 13.5px; color: var(--muted); }
.chip.on { color: var(--bg); }
.supnote { border-radius: 12px; font-size: 15px; }

/* 표 판 */
.panel { border-radius: 16px; border-color: var(--line); box-shadow: var(--shadow); overflow: clip; }
@media (min-width: 900px) { .tbl-wrap { overflow: visible; } }
thead { position: sticky; top: 0; z-index: 5; }
th { position: static; background: var(--head); color: var(--muted); font-size: 12.5px; font-weight: 700; letter-spacing: .01em; padding: 11px 14px; border-bottom: 1px solid var(--line); }
td { padding: 12px 14px; border-bottom: 1px solid var(--line2); }
tbody tr:not(.cat-row):hover td { background: color-mix(in srgb, var(--row-on) 60%, transparent); }
tr.on td { background: var(--row-on); }
tr.on td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
tr.cat-row td { background: var(--surface); color: var(--ink); font-size: 13px; letter-spacing: .02em; padding: 16px 14px 8px; border-bottom: 1px solid var(--line); }
tr.cat-row.new td { background: var(--surface); color: var(--accent); }
tr.cat-row.re td { background: var(--surface); color: var(--good); }
.nm { font-size: 15.5px; letter-spacing: -0.02em; }
td.r.num { font-weight: 600; }
.tag { border-radius: 999px; padding: 1px 8px; font-size: 11.5px; }

/* 이번 주 참고할 이슈 (머리 아래 고정) */
thead tr.issue th { background: var(--brass-soft); color: var(--ink); font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em; white-space: normal; line-height: 1.5;
  padding: 10px 14px; border-bottom: 1px solid color-mix(in srgb, var(--brass) 30%, transparent); box-shadow: inset 4px 0 0 var(--brass); }
.issue-label { display: inline-block; background: var(--brass); color: #fff; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; margin-right: 10px; vertical-align: 1px; }
.issue-text { white-space: pre-wrap; }

/* 수량 */
.qty { border-radius: 10px; border-color: var(--line); }
.qty button { background: var(--head); width: 36px; height: 38px; font-size: 18px; color: var(--muted); }
.qty button:hover { background: var(--accent); color: #fff; }
.qty input { width: 58px; height: 38px; font-size: 16px; }
tr.on .qty { border-color: var(--accent); }
tr.on .qty input { color: var(--accent); font-weight: 800; }

/* 오른쪽 */
.side { top: 16px; gap: 14px; }
.card { border-radius: 16px; box-shadow: var(--shadow); padding: 18px; }
.card h3 { font-size: 15px; letter-spacing: -0.02em; display: flex; justify-content: space-between; align-items: baseline; }
.side > .card:first-child { background: var(--topbar); color: var(--topink); border-color: var(--topbar); }
.side > .card:first-child .dl { color: rgb(243 241 234 / .6); }
.side > .card:first-child .count { color: var(--gold); font-size: 30px; letter-spacing: -0.03em; }
.side > .card:first-child .sum { border-top: 1px solid rgb(255 255 255 / .12); padding-top: 12px; }
.side > .card:first-child .sum .tot { color: #fff; }
.side > .card:first-child .btn.primary { background: var(--gold); border-color: var(--gold); color: var(--topbar); }
.side > .card:first-child .roundline { border-top-color: rgb(255 255 255 / .12); }
.pill { border-radius: 999px; }
.pill.unconfirmed { background: var(--warn); color: #fff; }
.pill.modified { background: var(--bad); color: #fff; }
.card.tip { background: var(--surface); }
.card.tip h3::before { content: 'i'; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 800; margin-right: 6px; }
.card.tip h3 { justify-content: flex-start; }

/* 담은 내역 (작게) */
.card.mini { padding: 14px 14px 10px; max-height: calc(100vh - 380px); min-height: 140px; overflow: auto; }
.mini-g { font-size: 11.5px; font-weight: 700; color: var(--muted); margin: 10px 0 4px; letter-spacing: .02em; }
.mini-r { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px; align-items: center; padding: 4px 0; border-bottom: 1px dashed var(--line2); font-size: 13px; }
.mini-n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-q { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.mini-q button { width: 22px; height: 24px; border: 0; background: var(--head); font-size: 13px; line-height: 1; color: var(--muted); padding: 0; }
.mini-q button:hover { background: var(--accent); color: #fff; }
.mini-q input { width: 34px; height: 24px; border: 0; text-align: center; font-size: 13px; font-weight: 700; background: transparent; -moz-appearance: textfield; padding: 0; }
.mini-q input::-webkit-outer-spin-button, .mini-q input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.mini-x { border: 0; background: none; color: var(--muted); font-size: 16px; width: 22px; height: 24px; border-radius: 6px; padding: 0; }
.mini-x:hover { background: var(--bad-soft); color: var(--bad); }
.mini-q button:disabled, .mini-q input:disabled, .mini-x:disabled { opacity: .35; cursor: not-allowed; }

/* 장바구니·요청 */
.cart-head h2 { letter-spacing: -0.03em; }
.status-msg { border-left: 4px solid currentColor; }
.group-h { background: var(--head); font-size: 14px; }
.req { background: var(--head); }
.req-form input { border-radius: 10px; }

/* 휴대폰: 이슈 줄은 보이게 */
@media (max-width: 640px) {
  .tbl-wrap table thead { display: block; position: sticky; top: 0; }
  .tbl-wrap table thead tr.hrow { display: none; }
  tr.on td:first-child { box-shadow: none; }
  .tbl-wrap tbody tr.on { box-shadow: inset 3px 0 0 var(--accent); }
  .tbl-wrap table thead tr.issue, .tbl-wrap table thead tr.issue th { display: block; }
  .top-in { padding: 10px 14px; }
  .bands, .wrap { padding-left: 14px; padding-right: 14px; }
}
@media (max-width: 1100px) { .mbar { background: var(--topbar); color: var(--topink); border-top: 0; } .mbar .btn.primary { background: var(--gold); border-color: var(--gold); color: var(--topbar); } }

/* 직영점: 입고/판매/재고 통합관리 바로가기 */
.stock-rail { display: none; }
.stock-band { text-decoration: none; color: var(--topink); background: var(--topbar); border-left: 4px solid var(--gold); }
.stock-band .label { background: var(--gold); color: var(--topbar); }
.stock-band b { font-size: 16px; }
.stock-band .go { margin-left: auto; color: var(--gold); font-weight: 700; }
.stock-band:hover { filter: brightness(1.15); }
.stock-bandwrap { margin-bottom: -4px; }
@media (min-width: 1760px) {
  .stock-bandwrap { display: none; }
  .stock-rail { display: grid; gap: 10px; position: fixed; top: 140px; left: max(20px, calc((100vw - 1440px) / 2 - 220px)); width: 190px; z-index: 6;
    padding: 20px 18px; border-radius: 16px; background: var(--topbar); color: var(--topink); text-decoration: none; box-shadow: 0 10px 30px rgb(0 0 0 / .18); border-top: 4px solid var(--gold); }
  .stock-rail .sr-k { font-size: 12px; font-weight: 700; color: var(--topbar); background: var(--gold); justify-self: start; padding: 2px 9px; border-radius: 999px; }
  .stock-rail b { font-size: 19px; line-height: 1.35; letter-spacing: -0.03em; }
  .stock-rail .sr-go { font-size: 14px; font-weight: 700; color: var(--gold); }
  .stock-rail:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgb(0 0 0 / .24); }
}
@media (prefers-reduced-motion: no-preference) { .stock-rail { transition: transform .15s, box-shadow .15s; } }

/* 상세보기: 설명 + 첨부 (이미지·PDF) */
.link .clip { display: inline-block; font-size: 11px; font-weight: 700; text-decoration: none; background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 0 6px; margin-left: 2px; }
.link .clip::before { content: '📎 '; }
.note-files { display: grid; gap: 12px; }
.nf-img { display: block; }
.nf-img img { width: 100%; border-radius: 12px; border: 1px solid var(--line); display: block; }
.nf-pdf { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--head); }
.nf-ico { font-size: 11px; font-weight: 800; color: #fff; background: var(--bad); border-radius: 6px; padding: 3px 7px; }
.nf-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
/* 노트북(1280px)에서 글자가 중간에 끊기지 않게 */
.tbl-wrap table { word-break: keep-all; }
th.h-unit, td.h-unit, .lim { white-space: nowrap; }
@media (min-width: 900px) { .tbl-wrap td:first-child { min-width: 180px; } .tbl-wrap td.h-gift { min-width: 70px; } }
.hint { max-width: none; min-width: 120px; }
/* 노트북·윈도우 화면 배율 125~150% (화면 폭 1100~1440px): 표가 칸 밖으로 안 나가게 조금씩 줄임 */
@media (min-width: 1101px) and (max-width: 1440px) {
  .wrap { grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; }
  .tbl-wrap th, .tbl-wrap td { padding-left: 10px; padding-right: 10px; }
  .tbl-wrap td:first-child { min-width: 160px; }
  .qty button { width: 32px; }
  .qty input { width: 48px; }
  .side .count { font-size: 26px; }
}
@media (min-width: 1101px) and (max-width: 1260px) {
  .wrap { grid-template-columns: minmax(0, 1fr) 280px; }
  .tbl-wrap td { font-size: 14px; }
  .tbl-wrap td:first-child { min-width: 140px; }
  .tbl-wrap td.h-gift { min-width: 0; }
  .nm { font-size: 14.5px; }
}
body { word-break: keep-all; overflow-wrap: anywhere; }
@media (min-width: 1101px) and (max-width: 1440px) { .side > .card:first-child .count { font-size: 24px; white-space: nowrap; } }
.late-box { background: var(--bad-soft); color: var(--bad); border: 2px solid var(--bad); border-radius: 12px; padding: 12px 14px; font-size: 15px; line-height: 1.6; }

/* 맨 위로 (11/19) */
.to-top { position: fixed; right: 20px; bottom: 24px; z-index: 35; display: none; align-items: center; gap: 6px; border: 0; border-radius: 999px; padding: 11px 16px; background: var(--ink); color: var(--bg); font-size: 15px; font-weight: 700; box-shadow: 0 4px 14px rgb(0 0 0 / .18); cursor: pointer; }
.to-top.show { display: inline-flex; }
.to-top span { font-size: 14px; font-weight: 600; }
@media (max-width: 1100px) { .to-top { bottom: 84px; right: 14px; padding: 10px 13px; } .to-top span { display: none; } }
/* 요청 품목 탭 (11/19) */
.vbtn.reqv { color: var(--brass); }
.vbtn.reqv.on { background: var(--brass-soft); color: var(--brass); }
.chip.req-chip { background: var(--brass-soft); border-color: var(--brass); color: var(--brass); font-weight: 700; }
.req-cta { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border-top: 1px solid var(--line); background: var(--brass-soft); font-weight: 600; }
.req-view .req { border-top: 0; padding: 22px; gap: 14px; }
.req-view .req h3 { font-size: 19px; }
.req-view .req p { font-size: 15px; }
.req-view .req-form input { padding: 12px 14px; font-size: 16px; }
.req-view .req-form .btn { padding: 12px 22px; font-size: 16px; }
/* 이전 입고가 (11/19) */
.prev { font-size: 12.5px; font-weight: 500; color: var(--muted); margin-top: 3px; white-space: nowrap; }
.prev b { font-weight: 700; margin-left: 2px; }
.prev.up b { color: var(--bad, #c0392b); }
.prev.down b { color: var(--good); }

/* 본사 발주 요청 (11/28) */
.band.hqreq { background: #fff1e6; border: 2px solid #f0a35e; } .band.hqreq .label { color: #c2410c; font-weight: 800; }
.dlg.hqr { padding-top: 0; overflow: hidden; } .hqr-h { margin: 0 -24px 12px; padding: 16px 24px; background: #c2410c; color: #fff; } .hqr-h .dl { color: #ffe3cf; } .hqr-h b { font-size: 19px; }
.hqr-msg { background: #f7f5f0; border-radius: 8px; padding: 9px 12px; margin: 4px 0 10px; }
.hqr-t { width: 100%; border-collapse: collapse; margin: 6px 0 8px; } .hqr-t th { text-align: left; font-size: 13px; color: #777; padding: 6px; border-bottom: 1px solid #eee; } .hqr-t th.r, .hqr-t td.r { text-align: right; }
.hqr-t td { padding: 8px 6px; border-bottom: 1px solid #f1efea; } .hqr-t .qty-in { width: 72px; text-align: right; padding: 6px 8px; border: 1px solid #d8d4cc; border-radius: 8px; font: inherit; }
.hqr-acts { display: flex; gap: 8px; }
.pill.ok { background: #e3f3e8; color: #1f6b3a; } .pill.bad { background: #fde8e8; color: #b42318; }

/* 내 판매량 (11/28) */
.sales-f { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 14px 18px 10px; }
.sales-f input { width: 240px; max-width: 100%; padding: 8px 12px; border: 1px solid var(--line, #ddd); border-radius: 8px; font-size: 15px; font-family: inherit; }
.sales-wrap { padding: 0 18px; }
.sales-foot { padding: 10px 18px 16px; }
table.sales-t th:first-child, table.sales-t td:first-child { width: 48px; text-align: center; }
table.sales-t { width: 100%; border-collapse: collapse; font-size: 15px; }
table.sales-t th, table.sales-t td { padding: 9px 8px; border-bottom: 1px solid var(--line, #eee); text-align: right; white-space: nowrap; }
table.sales-t th { font-size: 13px; color: var(--muted); font-weight: 600; }
table.sales-t .l { text-align: left; white-space: normal; }
.upd { display: inline-block; padding: 1px 7px; border-radius: 6px; background: #e5484d; color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .04em; vertical-align: 2px; }
.sales-upd { margin: 14px 18px 0; padding: 10px 14px; border-radius: 10px; background: #fff1f0; color: #b42318; font-weight: 600; font-size: 15px; }
.band.salesupd { background: #fff1f0; border: 1px solid #ffd5d2; color: #7a271a; display: flex; gap: 8px; align-items: center; }
.band.salesupd .go { margin-left: auto; }

/* 수요 조사 띠 (12/3) */
.band.survey { background: #eef4ff; border: 1px solid #c9dafc; border-left: 4px solid #3a6fd8; }
.band.survey .label { color: #2a5bc4; }
/* 수요 조사 팝업: 품목이 많으면 표만 위아래 스크롤 (제목·버튼은 그대로) (12/3) */
.dlg.svd { max-height: 90vh; display: flex; flex-direction: column; }
.dlg.svd .sv-scroll { flex: 1 1 auto; min-height: 120px; max-height: 52vh; overflow-y: auto; border: 1px solid #ece8df; border-radius: 10px; scrollbar-gutter: stable; }
.dlg.svd .sv-scroll::-webkit-scrollbar { width: 10px; }
.dlg.svd .sv-scroll::-webkit-scrollbar-thumb { background: #c9c3b6; border-radius: 6px; }
.dlg.svd .sv-scroll::-webkit-scrollbar-track { background: #f4f1ea; }
.dlg.svd .sv-scroll .hqr-t { margin: 0; }
.dlg.svd .sv-scroll thead th { position: sticky; top: 0; background: #faf8f3; z-index: 1; }
.dlg.svd .sv-more { margin-top: -6px; }
