/* ── 디자인 토큰 (레드 & 화이트) ── */
:root {
  --bg: #fafafa;
  --panel: #ffffff;
  --panel2: #f5f5f7;
  --line: #e5e7eb;
  --line-strong: #d4d4d8;
  --text: #18181b;
  --text-soft: #3f3f46;
  --muted: #71717a;
  --side: #ffffff;
  --side-active-bg: #fef2f2;
  --side-active-text: #b91c1c;
  --side-hover: #f4f4f5;

  /* 브랜드 레드 */
  --red: #dc2626;
  --red-strong: #991b1b;
  --red-soft: #fee2e2;
  --red-softer: #fef2f2;

  --green: #059669;
  --green-soft: #d1fae5;
  --amber: #d97706;
  --amber-soft: #fef3c7;
  --blue-soft: #dbeafe;
  --blue-text: #1d4ed8;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 12px 28px rgba(0,0,0,0.08);
  --radius: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg); color: var(--text); font-size: 13px; line-height: 1.5;
  font-family: 'Noto Sans KR', -apple-system, 'Apple SD Gothic Neo', sans-serif;
  -webkit-font-smoothing: antialiased;
}
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #d4d4d8; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #a1a1aa; }
.hidden { display: none !important; }
.muted { color: var(--muted); }

/* ── 글로벌 토스트 (화면 가운데 상단) ── */
.global-toast {
  position: fixed; top: 24px; left: 50%; transform: translateX(-50%);
  min-width: 220px; max-width: 80vw;
  padding: 12px 22px; border-radius: 10px;
  font-size: 13px; font-weight: 700; text-align: center; line-height: 1.4;
  background: var(--panel); color: var(--text);
  border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  z-index: 9999;
  animation: globalToastIn 0.18s ease-out;
}
.global-toast.ok  { background: var(--green-soft); color: #065f46; border-color: #a7f3d0; }
.global-toast.err { background: var(--red-soft);   color: var(--red-strong); border-color: #fecaca; }
.global-toast.info{ background: var(--blue-soft);  color: var(--blue-text);  border-color: #bfdbfe; }
@keyframes globalToastIn {
  from { opacity: 0; transform: translate(-50%, -8px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ── 로그인 게이트 ── */
.auth-gate {
  position: fixed; inset: 0;
  overflow-y: auto;                  /* 일반 블록 스크롤 — flex 중앙정렬의 상단 클립 버그 회피 */
  padding: 32px 16px; box-sizing: border-box;
  background: radial-gradient(circle at 30% 20%, var(--red-softer) 0%, var(--bg) 60%);
  z-index: 100;
}
.auth-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  padding: 36px 32px; width: 380px; max-width: 90vw;
  box-shadow: var(--shadow-lg);
  margin: 0 auto;   /* 가로 중앙(블록 흐름) · 세로는 위에서부터 → 길면 자연스레 스크롤 */
}
.brand-mark {
  margin-bottom: 14px; width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.auth-card h1 { font-size: 21px; margin-bottom: 6px; font-weight: 800; letter-spacing: -0.4px; }
.auth-card .sub { color: var(--muted); font-size: 12.5px; margin-bottom: 24px; }
.auth-card form { display: flex; flex-direction: column; gap: 10px; }
.auth-card input {
  background: #fff; border: 1.5px solid var(--line); color: var(--text);
  border-radius: 9px; padding: 11px 13px; font-size: 13.5px; font-family: inherit;
  transition: border-color .15s;
}
.auth-card input:focus {
  outline: 0; border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-soft);
}
.auth-card button {
  background: var(--red); color: #fff; border: 0; border-radius: 9px;
  padding: 11px 13px; font-size: 13.5px; font-weight: 700; cursor: pointer;
  font-family: inherit; transition: background .15s; margin-top: 4px;
  justify-content: center;   /* 전역 button inline-flex 라 텍스트 가운데 정렬 */
}
.auth-card button:hover { background: var(--red-strong); }
.auth-msg { font-size: 12px; margin-top: 14px; min-height: 18px; }
.auth-msg.ok { color: var(--green); }
.auth-msg.err { color: var(--red); }
.auth-hint { font-size: 11.5px; color: var(--muted); margin-top: 18px; line-height: 1.6; }
.auth-label {
  font-size: 11px; color: var(--text-soft); font-weight: 700;
  margin-top: 6px; margin-bottom: -4px; padding-left: 2px;
}
.auth-label-sub { color: var(--muted); font-weight: 400; font-size: 10.5px; }

/* 로그인 옵션 (아이디 저장 / 자동 로그인 유지) */
.login-opts { display: flex; gap: 16px; margin: 2px 2px 2px; flex-wrap: wrap; }
.login-opt { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-soft); cursor: pointer; user-select: none; }
.login-opt input { width: 15px; height: 15px; padding: 0; border: 0; border-radius: 0; box-shadow: none; accent-color: var(--red); cursor: pointer; }
.login-opt input:focus { outline: 0; box-shadow: none; }

.auth-form-grid select, .auth-form-grid input { font-family: inherit; }
.auth-submit { margin-top: 12px; }

/* 부서 라디오 */
.dept-radio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 2px; }
.dept-radio label {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--panel); border: 1.5px solid var(--line); border-radius: 9px;
  padding: 10px 4px; cursor: pointer; transition: all .12s;
  font-size: 12px; font-weight: 600; color: var(--text-soft);
}
.dept-radio label:hover { border-color: var(--red); }
.dept-radio input { display: none; }
.dept-radio input:checked + span { color: var(--red); font-weight: 700; }
.dept-radio label:has(input:checked) { background: var(--red-softer); border-color: var(--red); }
.dept-radio span { display: inline-flex; flex-direction: column; align-items: center; gap: 5px; }
.dept-radio span svg { width: 18px; height: 18px; stroke-width: 1.9; color: var(--muted); }
.dept-radio input:checked + span svg { color: var(--red); }

/* 모달 */
.modal {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.35);
  display: flex; align-items: center; justify-content: center;
}
.modal-card {
  background: var(--panel); border-radius: 14px;
  width: 420px; max-width: 92vw;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.modal-head {
  padding: 16px 20px; border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
}
.modal-title { font-size: 14px; font-weight: 800; }
.modal-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; }
.modal-label { font-size: 11.5px; font-weight: 700; color: var(--text-soft); margin-top: 6px; }
.modal-label-sub { color: var(--muted); font-weight: 400; font-size: 11px; }
.modal-actions {
  display: flex; gap: 8px; justify-content: flex-end;
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line);
}
.auth-toggle {
  margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line);
  font-size: 12px; color: var(--muted); text-align: center;
}
.auth-toggle a {
  color: var(--red); font-weight: 700; text-decoration: none; margin-left: 4px;
}
.auth-toggle a:hover { text-decoration: underline; }

/* 썸네일 */
.thumb {
  width: 36px; height: 36px; border-radius: 6px;
  background: var(--panel2) center/cover no-repeat;
  border: 1px solid var(--line); flex-shrink: 0;
}
.thumb.lg { width: 56px; height: 56px; border-radius: 8px; }
.thumb.sm { width: 28px; height: 28px; border-radius: 5px; }
.thumb.empty { background-image: none; }
.thumb-clickable { cursor: zoom-in; transition: transform 0.1s, box-shadow 0.1s; }
.thumb-clickable:hover { transform: scale(1.06); box-shadow: 0 2px 8px rgba(0,0,0,0.2); }

/* 라이트박스 — 어디서든 썸네일 클릭 시 확대 */
.img-lightbox {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.85);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; cursor: zoom-out;
  animation: lbFade 0.15s ease;
}
.img-lightbox img {
  max-width: 90vw; max-height: 90vh; object-fit: contain;
  border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.img-lightbox-close {
  position: absolute; top: 16px; right: 20px;
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,0.15); color: #fff; border: 0;
  font-size: 22px; cursor: pointer;
}
.img-lightbox-close:hover { background: rgba(255,255,255,0.3); }
@keyframes lbFade { from { opacity: 0; } to { opacity: 1; } }

.prod-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.prod-cell .pn {
  flex: 1; min-width: 0;
  font-size: 12px; line-height: 1.45; color: var(--text);
  word-break: keep-all; overflow-wrap: anywhere;
}
.prod-cell .pn .opt {
  display: block; color: var(--muted); font-size: 11px; margin-top: 2px;
}

/* 상품별 TOP 15 — 풀폭 카드 행 */
.prow {
  display: grid;
  grid-template-columns: 56px 1.4fr auto;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  margin: 7px 0;
  background: var(--panel);
  transition: border-color .12s, box-shadow .12s;
}
.prow:hover { border-color: var(--red); box-shadow: 0 2px 8px rgba(220,38,38,0.06); }
.prow .pn {
  font-size: 13px; font-weight: 700; color: var(--text);
  word-break: keep-all; overflow-wrap: anywhere; line-height: 1.4;
  margin-bottom: 6px;
}
.prow .sizes { display: flex; gap: 5px; flex-wrap: wrap; }
.size-pill {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--panel2); color: var(--text-soft);
  padding: 3px 9px; border-radius: 99px;
  font-size: 10.5px; font-weight: 600; border: 1px solid var(--line);
}
.size-pill .sz { color: var(--muted); font-weight: 500; }
.size-pill .sq { color: var(--text); }
.size-pill.scr { background: var(--red-softer); border-color: #fecaca; color: var(--red-strong); }
.size-pill.warn-pill { background: var(--amber-soft); border-color: #fde68a; color: #92400e; }
.size-pill.pre { background: #ede9fe; border-color: #ddd6fe; color: #6d28d9; }

/* TOP 15 카테고리 분해 행 (사이즈 줄 아래) */
.prow-catrow { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-top: 4px; }
.prow-catlabel {
  font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 4px;
  margin-right: 2px;
}
.prow-catlabel.scr { background: var(--red-soft); color: var(--red-strong); }
.prow-catlabel.warn-pill { background: var(--amber-soft); color: #92400e; }
.prow-catlabel.pre { background: #ede9fe; color: #6d28d9; }
.prow-catlabel.norm { background: var(--panel2); color: var(--text-soft); }
.size-pill.norm { background: var(--panel2); color: var(--text); border-color: var(--line-strong); }
.prow-cats { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }

/* TOP 15 미니 카테고리 표식 (상품명 옆) */
.mix-wrap { display: inline-flex; gap: 3px; margin-left: 5px; vertical-align: 1px; }
.mix-tag {
  display: inline-block; width: 16px; height: 16px;
  border-radius: 4px; font-size: 9.5px; font-weight: 800; line-height: 16px;
  text-align: center; cursor: help;
}
.mix-tag.scr { background: var(--red-soft); color: var(--red-strong); }
.mix-tag.warn { background: var(--amber-soft); color: #92400e; }
.mix-tag.pre { background: #ede9fe; color: #6d28d9; }
.prow .qty-block { display: flex; align-items: center; gap: 10px; }
.prow .qbar { width: 80px; background: var(--panel2); border-radius: 5px; height: 8px; overflow: hidden; }
.prow .qbar .qf { height: 100%; background: linear-gradient(90deg, var(--red), #f87171); border-radius: 5px; }
.prow .qtotal { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; min-width: 38px; text-align: right; color: var(--text); }
.prow .qsub { font-size: 10px; color: var(--muted); text-align: right; }

@media (max-width: 768px) {
  .prow { grid-template-columns: 44px 1fr auto; gap: 10px; padding: 9px 10px; }
  .prow .qbar { display: none; }
  .prow .qtotal { font-size: 16px; }
}

/* 사용자 관리 섹션 */
.admin-section { margin-bottom: 14px; }
.add-user-form {
  display: grid; gap: 8px; align-items: center;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}
.add-user-form .search {
  width: auto; min-width: 0; max-width: 100%;
}
.add-user-form button {
  white-space: nowrap; min-width: 80px;
}
@media (max-width: 540px) {
  .add-user-form { grid-template-columns: 1fr; }
  .add-user-form button { width: 100%; }
}
.user-list-table th { white-space: nowrap; }
.user-list-table td { white-space: normal; word-break: keep-all; max-width: none; }
.badge-pending { background: var(--amber-soft); color: #92400e; padding: 2px 8px; border-radius: 99px; font-size: 10.5px; font-weight: 700; }
.badge-approved { background: var(--green-soft); color: #065f46; padding: 2px 8px; border-radius: 99px; font-size: 10.5px; font-weight: 700; }
.badge-staff { background: #e0e7ff; color: #3730a3; padding: 2px 8px; border-radius: 99px; font-size: 10.5px; font-weight: 700; }
.badge-admin { background: var(--red-soft); color: var(--red-strong); padding: 2px 8px; border-radius: 99px; font-size: 10.5px; font-weight: 700; }

.dept-pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 10.5px; font-weight: 700; }
.dept-pill.office { background: #dbeafe; color: #1d4ed8; }
.dept-pill.delivery { background: #fef3c7; color: #92400e; }
.dept-pill { background: #f3f4f6; color: var(--text-soft); }
.dept-pill.office { background: #dbeafe; color: #1d4ed8; }
.dept-pill.delivery { background: #fef3c7; color: #92400e; }
/* 짧은 라벨 뱃지·pill 은 절대 줄바꿈(한글 글자당 세로 쪼갬) 금지 */
.badge-pending, .badge-approved, .badge-staff, .badge-admin, .dept-pill, .pill { white-space: nowrap; }

/* 검색·선택 상품종류 뱃지 (스크래치/B급/PIECE 구분) */
.kind-badge { display: inline-block; font-size: 9.5px; font-weight: 800; padding: 1px 5px; border-radius: 4px; vertical-align: middle; white-space: nowrap; }
.kind-badge.scratch { background: var(--amber-soft); color: #92400e; }
.kind-badge.bgrade { background: var(--red-soft); color: var(--red-strong); }
.kind-badge.piece { background: #dbeafe; color: #1d4ed8; }

/* 개요: 모바일 프로필 (데스크탑은 사이드바에 동일 정보 → 숨김) */
.ov-profile { display: none; }
@media (max-width: 768px) {
  .ov-profile { display: flex; align-items: center; gap: 10px; width: 100%; }
}
.ov-profile-logo { width: 40px; height: 40px; flex-shrink: 0; }
.ov-profile-logo img { width: 100%; height: 100%; object-fit: contain; }
.ov-profile-info { min-width: 0; }
.ov-profile .t { font-size: 15px; font-weight: 800; letter-spacing: -0.3px; }
.ov-profile .s { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 3px; }
.ov-profile .s > span { white-space: nowrap; }
.ov-profile .s .bname  { color: var(--text); font-weight: 700; font-size: 12px; margin-right: 2px; }
.ov-profile .s .bdept  { color: var(--text-soft); font-size: 10px; padding: 1px 6px; border-radius: 99px; background: var(--panel2); }
.ov-profile .s .badm   { color: var(--red); font-weight: 700; font-size: 10px; padding: 1px 6px; border-radius: 99px; background: var(--red-softer); }
.ov-profile .s .bdplus { color: #065f46; font-weight: 700; font-size: 10px; padding: 1px 6px; border-radius: 99px; background: var(--green-soft); }

/* 개요: 공지사항 (연빨강 배너 — 옛 인사 배너와 동일 톤, 블록 클릭 → 등록 팝업) */
.ov-notice {
  background: linear-gradient(135deg, var(--red-softer) 0%, #fff 80%);
  border-color: var(--red-soft);
  cursor: pointer;
  transition: border-color .12s, box-shadow .12s;
}
.ov-notice:hover { border-color: var(--red); box-shadow: var(--shadow-md); }
/* 아이콘 + '공지사항' 을 왼쪽에 붙임 (.panel h2 의 space-between 을 특이도로 이김) */
.panel.ov-notice h2 { color: var(--red-strong); justify-content: flex-start; gap: 7px; }
.ov-notice-row { padding: 11px 2px; border-bottom: 1px solid var(--red-soft); }
.ov-notice-row:last-child { border-bottom: 0; padding-bottom: 4px; }
.ov-notice-txt { font-size: 14.5px; font-weight: 600; line-height: 1.55; white-space: pre-wrap; word-break: keep-all; color: var(--text); text-align: center; }
.ov-notice-sub { font-size: 11.5px; color: var(--muted); margin-top: 4px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.ov-notice-del { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 1px 6px; border-radius: 5px; font-size: 12px; min-height: 0; }
.ov-notice-del:hover { background: var(--red-soft); color: var(--red); }

/* 사이드바 헤더 정보 */
#side .brand .s {
  display: flex; flex-wrap: wrap; gap: 4px; align-items: center;
  margin-top: 4px;
}
#side .brand .s > span { white-space: nowrap; }
#side .brand .s .bid    { font-weight: 700; color: var(--text); }
#side .brand .s .bname  { color: var(--text); font-weight: 700; font-size: 12px; margin-right: 2px; }
#side .brand .s .bdept  {
  color: var(--text-soft); font-size: 10px;
  padding: 1px 6px; border-radius: 99px; background: var(--panel2);
}
#side .brand .s .badm   {
  color: var(--red); font-weight: 700; font-size: 10px;
  padding: 1px 6px; border-radius: 99px; background: var(--red-softer);
}
#side .brand .s .bdplus {
  color: #065f46; font-weight: 700; font-size: 10px;
  padding: 1px 6px; border-radius: 99px; background: var(--green-soft);
}

/* 연차 페이지 */
.leave-form { display: flex; flex-direction: column; gap: 8px; }
.leave-form select { font-family: inherit; }
.leave-type-hint {
  font-size: 12px; color: var(--blue-text); background: var(--blue-soft);
  padding: 7px 11px; border-radius: 7px; margin-top: -2px;
}
.leave-date-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.leave-date-row > div { display: flex; flex-direction: column; gap: 4px; }
.leave-date-row .disabled { opacity: 0.5; }
.leave-days-preview { font-size: 13px; color: var(--text-soft); padding: 10px 13px; background: var(--panel2); border-radius: 8px; margin-top: 6px; font-weight: 600; }
.leave-days-preview b { color: var(--red); font-size: 15px; }
.leave-days-preview.err { background: var(--red-soft); color: var(--red-strong); }

/* 캘린더 [연차] 이벤트 색 */
.cal-ev.leave { background: #ccff33; color: #365314; border-left: 2px solid #84cc16; padding-left: 4px; }
.cal-ev.leave .cal-ev-ttl { font-weight: 800; }

/* 판매 TOP 5 */
.sales-panel { padding: 18px; }
.sales-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.sales-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sales-controls .status { font-size: 11px; }
.sales-body { min-height: 100px; }
.sales-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.sales-card {
  background: var(--panel2); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 8px; display: flex; flex-direction: column; align-items: center; gap: 5px;
  position: relative; min-height: 200px;
  min-width: 0;
}
.sales-card.bgrade { border-color: #fecaca; background: var(--red-softer); }
.sales-card.scratch { border-color: #fde68a; background: var(--amber-soft); }
.sales-card .thumb.lg {
  width: clamp(54px, 7vw, 84px); height: clamp(54px, 7vw, 84px);
  background-size: contain;
  background-color: transparent;
  border: 0;
  border-radius: 0;
}
.sales-rank {
  position: absolute; top: 6px; left: 6px;
  background: var(--red); color: #fff; font-weight: 800;
  padding: 1px 7px; border-radius: 99px; font-size: 10.5px;
}
.sales-name {
  font-size: clamp(10.5px, 0.9vw, 12.5px); font-weight: 700; color: var(--text);
  text-align: center; line-height: 1.35;
  word-break: keep-all; overflow-wrap: anywhere;
  max-width: 100%;
}
.sales-qty { font-size: clamp(18px, 1.8vw, 22px); font-weight: 800; font-variant-numeric: tabular-nums; color: var(--red); line-height: 1; }
.sales-qty-unit { font-size: 10.5px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.sales-sizes { display: flex; gap: 2px; flex-wrap: wrap; justify-content: center; margin-top: auto; }
.sales-sizes .size-pill { font-size: 9.5px; padding: 1px 5px; }
/* 모바일: 5칸으로 욱여넣으면 긴 상품명이 세로로 늘어짐 → 옆으로 스와이프(가로 스크롤) */
@media (max-width: 640px) {
  .sales-grid { display: flex; overflow-x: auto; scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch; gap: 8px; padding-bottom: 8px; }
  .sales-card { flex: 0 0 46%; scroll-snap-align: start; }
}

/* 연차 잔여 인라인 조정 */
.leave-adjust { display: inline-flex; align-items: center; gap: 4px; }
.leave-adjust .rem-input { width: 60px; text-align: center; padding: 5px 6px; }
.leave-adjust button { padding: 5px 9px; font-size: 11px; }

/* 메뉴 접근 권한 체크박스 */
.menu-access-wrap { border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.menu-access-actions { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.menu-access-list {
  max-height: 220px; overflow-y: auto;
  display: grid; grid-template-columns: 1fr 1fr; gap: 3px;
  background: var(--panel2); border-radius: 6px; padding: 6px;
}
.ma-item {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 7px; border-radius: 5px;
  font-size: 11.5px; cursor: pointer;
  transition: background .1s;
}
.ma-item:hover { background: var(--panel); }
.ma-item.unrestricted { opacity: 0.5; cursor: not-allowed; }
.ma-item input { margin: 0; }
.ma-item .ma-ic { font-size: 12px; display: inline-flex; align-items: center; color: var(--text-soft); }
.ma-item .ma-ic svg { width: 14px; height: 14px; }
#pageTitle { display: inline-flex; align-items: center; gap: 8px; }
#pageTitle svg { width: 22px; height: 22px; stroke-width: 1.75; color: var(--red); }
.ovcard .oi svg { width: 22px; height: 22px; stroke-width: 1.75; }
.ma-item .ma-name { flex: 1; color: var(--text); }
.ma-item .ma-group { color: var(--muted); font-size: 10px; }
@media (max-width: 540px) { .menu-access-list { grid-template-columns: 1fr; } }

/* 모바일 — 상품명 안 잘리도록 */
@media (max-width: 768px) {
  #main { padding: 18px 14px 60px; }
  .head h1 { font-size: 19px; }
  .toolbar { gap: 6px; }
  table { font-size: 12px; }
  td, th { padding: 7px 8px; }
  td {
    max-width: none;
    white-space: normal;
    word-break: keep-all;   /* 상품명 등은 단어 단위 줄바꿈 (글자당 세로 쪼갬 금지 — overflow-wrap:anywhere 제거) */
  }
  /* 컬럼 많은 표(사용자·연차)는 좁은 화면에서 뭉개지 말고 가로 스크롤 */
  .user-list-table td, .user-list-table th,
  #myLeaveTable td, #myLeaveTable th,
  #pendTable td, #pendTable th,
  #leaveApproveTable td, #leaveApproveTable th { white-space: nowrap; }
  .tablewrap { max-height: 70vh; }
  .kpi .value { font-size: 21px; }
  .actions-bar { padding: 10px 12px; }
  .actions-bar .action-result { max-width: 100%; margin-left: 0; flex-basis: 100%; }
  .brow .bn { width: 36%; }
  /* .chat-panel / .chat-fab 모바일 크기는 1742행(데스크탑 기본 규칙 뒤) 미디어쿼리에서 처리 */
  .auth-card { padding: 28px 24px; }
}

/* ── 앱 레이아웃 ── */
.app { display: flex; height: 100vh; }
#side {
  width: 248px; flex-shrink: 0; background: var(--side);
  border-right: 1px solid var(--line); height: 100vh;
  display: flex; flex-direction: column; overflow: hidden;
}
#nav { flex: 1; overflow-y: auto; min-height: 0; }
#side .brand {
  padding: 18px 18px 14px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}
button.brand-home {
  background: transparent; border: 0; box-shadow: none;
  width: 100%; text-align: left; padding: 18px 18px 14px;
  font-family: inherit; cursor: pointer; color: var(--text);
  border-radius: 0;
  transition: background .12s;
}
button.brand-home:hover { background: var(--side-hover); }

.nav-search {
  padding: 10px 14px 6px; flex-shrink: 0;
  border-bottom: 1px solid var(--line);
}
.nav-search-box { position: relative; display: block; }
.nav-search-box svg {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; color: var(--muted); pointer-events: none;
}
.nav-search input {
  width: 100%;
  background: var(--panel2); border: 1px solid var(--line); color: var(--text);
  border-radius: 7px; padding: 7px 10px 7px 31px; font-size: 12.5px; font-family: inherit;
}
.nav-search input:focus {
  outline: 0; border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-softer);
}
#side .brand.foot {
  border-bottom: 0; border-top: 1px solid var(--line);
  padding: 14px 18px; flex-shrink: 0;
  display: flex; justify-content: space-between; align-items: center;
  background: var(--side);
}
#side .brand .logo {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
#side .brand .logo img { width: 100%; height: 100%; object-fit: contain; }
#side .brand .info { flex: 1; min-width: 0; }
#side .brand .t { font-size: 14px; font-weight: 800; letter-spacing: -0.3px; }
#side .brand .s { font-size: 11px; color: var(--muted); margin-top: 1px; word-break: break-all; }

.nav-group { padding: 12px 0 4px; }
.nav-group .gl {
  padding: 6px 18px 4px; font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.8px; color: var(--muted); text-transform: uppercase;
}
.navitem {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  padding: 9px 18px; cursor: pointer; color: var(--text-soft);
  transition: background .12s, color .12s;
  margin: 1px 8px; border-radius: 8px;
}
.navitem:hover { background: var(--side-hover); color: var(--text); }
.navitem.active {
  background: var(--side-active-bg);
  color: var(--side-active-text);
  font-weight: 700;
}
.navitem.active::before {
  content: ""; position: absolute; left: -8px; top: 6px; bottom: 6px;
  width: 3px; background: var(--red); border-radius: 0 3px 3px 0;
}
.navitem .ic {
  width: 20px; display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-soft);
}
.navitem .ic svg { width: 16px; height: 16px; stroke-width: 1.75; }
.navitem.active .ic { color: var(--red); }
.navitem:hover .ic { color: var(--text); }
.navitem .nm { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12.5px; }
.navitem .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); }
.navitem .dot.loaded { background: var(--green); }
.navitem .dot.err { background: var(--red); }
/* 준비중(미오픈) 잠금 */
.navitem.locked { opacity: 0.5; cursor: default; }
.navitem.locked:hover { background: transparent; color: inherit; }
.navitem.locked:hover .ic { color: inherit; }
.nav-soon { margin-left: auto; font-size: 9px; font-weight: 700; color: var(--muted); background: var(--panel2); padding: 1px 6px; border-radius: 999px; white-space: nowrap; }
/* 관리자용: 직원에게 아직 미오픈(미작업) 마커 — RELEASED_GIDS에 추가되면 자동으로 사라짐 */
.nav-x { font-size: 9.5px; font-weight: 800; color: var(--red); opacity: 0.5; white-space: nowrap; }
.ovcard.locked { opacity: 0.5; cursor: default; }
.ovcard.locked:hover { transform: none; box-shadow: var(--shadow-sm); border-color: var(--line); }

.fav-star {
  display: inline-flex; align-items: center;
  color: var(--line-strong); cursor: pointer;
  opacity: 0; transition: color .12s, opacity .12s;
  padding: 2px 4px;
}
.fav-star svg { width: 13px; height: 13px; }
.navitem:hover .fav-star { opacity: 1; }
.fav-star.on { opacity: 1; color: var(--amber); }
.fav-star.on svg { fill: var(--amber); }
.fav-star:hover { color: var(--amber); }

.nav-group.nav-fav { background: linear-gradient(180deg, #fffaf0 0%, transparent 100%); border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.nav-group.nav-fav .gl { color: var(--amber); display: flex; align-items: center; gap: 5px; }
.nav-group.nav-fav .gl svg { width: 11px; height: 11px; fill: var(--amber); }

#main { flex: 1; height: 100vh; overflow-y: auto; padding: 24px 30px 60px; background: var(--bg); }
.head { display: flex; align-items: center; justify-content: flex-start; flex-wrap: wrap; gap: 12px; margin-bottom: 4px; }
.home-btn {
  background: var(--panel); color: var(--text); border: 1px solid var(--line);
  padding: 6px 12px; font-size: 12px; font-weight: 600;
  box-shadow: var(--shadow-sm); flex-shrink: 0;
}
.home-btn:hover { background: var(--side-hover); border-color: var(--red); color: var(--red); }
.head h1 { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; }
.head .sub { color: var(--muted); font-size: 12.5px; }
/* 헤더 우상단 바로가기 드롭다운 (네모 버튼) */
.qlink { position: relative; margin-left: auto; flex-shrink: 0; }
.qlink-btn {
  width: 36px; height: 36px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--panel); color: var(--text-soft);
  border: 1px solid var(--line); border-radius: 8px;
  box-shadow: var(--shadow-sm); cursor: pointer; transition: all .12s;
}
.qlink-btn:hover { border-color: var(--red); color: var(--red); background: var(--red-softer); }
.qlink-pop {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 60;
  min-width: 190px; padding: 5px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow-md);
}
.qlink-pop a {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 10px; border-radius: 7px;
  color: var(--text); font-size: 12.5px; font-weight: 600;
  text-decoration: none; white-space: nowrap;
}
.qlink-pop a:hover { background: var(--side-hover); color: var(--red); }
.qlink-ext { margin-left: auto; opacity: .45; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 16px 0 18px; }

button {
  background: var(--red); color: #fff; border: 0; border-radius: 8px;
  padding: 8px 16px; font-size: 12.5px; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: background .12s, box-shadow .12s;
  box-shadow: var(--shadow-sm);
  display: inline-flex; align-items: center; gap: 6px;
}
button > svg { width: 14px; height: 14px; flex-shrink: 0; }
button.sm > svg { width: 13px; height: 13px; }
button:hover { background: var(--red-strong); }
button:disabled { background: var(--line-strong); cursor: not-allowed; }
button.ghost { background: var(--panel); color: var(--text); border: 1px solid var(--line); box-shadow: none; }
button.ghost:hover { background: var(--side-hover); border-color: var(--line-strong); }
button.sm { padding: 6px 11px; font-size: 11.5px; }
button.action {
  background: var(--green); box-shadow: 0 1px 2px rgba(5,150,105,0.2);
}
button.action:hover { background: #047857; }
button.btn-dark { background: #18181b; box-shadow: 0 1px 2px rgba(0,0,0,0.25); }
button.btn-dark:hover { background: #000; }
.status { color: var(--muted); font-size: 11px; }

input.search, select.filter {
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
  border-radius: 7px; padding: 7px 11px; font-size: 12.5px; font-family: inherit;
}
input.search:focus, select.filter:focus { outline: 0; border-color: var(--red); box-shadow: 0 0 0 3px var(--red-softer); }
input.search { width: 240px; }

/* display:flex+gap 금지 — <b>/<span> 앞뒤 텍스트가 flex 아이템으로 쪼개져 띄어쓰기가 깨짐 */
.banner { padding: 12px 14px; border-radius: var(--radius); font-size: 12.5px; margin-bottom: 16px; line-height: 1.6; }
.banner.info { background: var(--blue-soft); color: var(--blue-text); border: 1px solid #bfdbfe; }
.banner.auto { background: var(--amber-soft); color: #92400e; border: 1px solid #fde68a; }
.banner.err { background: var(--red-soft); color: var(--red-strong); border: 1px solid #fecaca; }
.banner.ok { background: var(--green-soft); color: #065f46; border: 1px solid #a7f3d0; }

.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin-bottom: 12px; }
.kpi {
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 11px; box-shadow: var(--shadow-sm);
}
.kpi .label { color: var(--muted); font-size: 10.5px; margin-bottom: 3px; font-weight: 500; }
.kpi .value { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.3px; }
.kpi .sub { font-size: 10px; color: var(--muted); margin-top: 2px; }

/* 헤드라인 KPI — 총 주문 수량 강조 (컴팩트, 가로 2칸: 좌측 라벨/값/sub + 우측 사이즈) */
.kpi-hero {
  grid-column: span 2;
  background: linear-gradient(135deg, var(--red) 0%, #b91c1c 100%);
  border-color: var(--red);
  color: #fff;
  display: grid;
  grid-template-columns: minmax(110px, auto) 1fr;
  grid-template-rows: auto auto auto;
  column-gap: 12px;
  row-gap: 0;
  align-items: start;
}
.kpi-hero .label { color: rgba(255,255,255,0.85); font-weight: 600; grid-column: 1; grid-row: 1; }
.kpi-hero .value { font-size: 22px; color: #fff !important; grid-column: 1; grid-row: 2; }
.kpi-hero .sub { color: rgba(255,255,255,0.78); grid-column: 1; grid-row: 3; }
.kpi-hero .hero-sizes { grid-column: 2; grid-row: 1 / -1; align-self: center; }
.hero-sizes {
  display: flex; gap: 4px; flex-wrap: wrap;
  margin-top: 0; padding-top: 0;
  border-top: 0;
  border-left: 1px solid rgba(255,255,255,0.22);
  padding-left: 12px;
  justify-content: flex-start;
}
.hero-sizes .hs {
  display: inline-flex; gap: 3px; align-items: baseline;
  background: rgba(255,255,255,0.18); color: #fff;
  padding: 2px 6px; border-radius: 99px;
  font-size: 10px; font-weight: 600;
}
.hero-sizes .hs b { font-weight: 800; font-size: 10.5px; }
.hero-sizes .hs .hq { opacity: 0.88; }
@media (max-width: 600px) {
  .kpi-hero {
    grid-column: span 1;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto;
  }
  .kpi-hero .value { font-size: 19px; }
  .kpi-hero .hero-sizes {
    grid-column: 1; grid-row: 4; align-self: stretch;
    border-left: 0; padding-left: 0;
    border-top: 1px solid rgba(255,255,255,0.22);
    margin-top: 6px; padding-top: 6px;
  }
}

/* 전체 주문 내역 테이블 — 체크박스 컬럼 + 옵션 컬럼 좁히기 */
#oqTable th.oq-check-h { width: 32px; text-align: center; padding: 6px 2px; }
#oqTable td.oq-check { width: 32px; text-align: center; padding: 4px 2px; }
#oqTable td.oq-check input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--green); }
#oqTable th.opt-narrow,
#oqTable td.opt-narrow { padding: 6px 8px; max-width: 90px; white-space: nowrap; font-weight: 600; }
#oqTable .oq-row.packed { background: #ecfdf5; }
#oqTable .oq-row.packed td { color: #047857; }
#oqTable .oq-row.packed td .pn { color: #065f46; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow-sm); }
.panel h2 { font-size: 13.5px; font-weight: 700; margin-bottom: 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.panel h2 .tag { color: var(--muted); font-weight: 500; font-size: 11.5px; }
/* 아이콘·제목·설명이 space-between으로 3등분돼 제목이 가운데 붕 뜨는 것 방지 —
   설명(sub)이 마지막이면 오른쪽으로 보내고 아이콘+제목은 왼쪽에 밀착 */
.panel h2 > .modal-label-sub:last-child { margin-left: auto; }
.twocol { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; }
@media(max-width:900px){
  .twocol { grid-template-columns: 1fr; }
  #side { width: 64px; }
  /* 라벨·이름 숨김 (즐겨찾기 라벨은 특이도가 높아 명시적으로 함께 숨김) */
  #side .brand .info,
  .navitem .nm,
  .nav-group .gl,
  .nav-group.nav-fav .gl { display: none; }
  /* 아이콘만 남기고 가운데 정렬, 좁은 폭에서 넘치는 마커류 숨김 */
  .navitem { justify-content: center; padding: 9px 0; gap: 0; margin: 1px 6px; }
  .navitem .fav-star, .navitem .dot, .nav-soon, .nav-x { display: none; }
  .navitem.active::before { left: -6px; }
  .nav-group { padding: 8px 0 2px; }
  .nav-group.nav-fav { padding-bottom: 6px; }
  /* 검색: 돋보기 아이콘만 가운데 (placeholder 텍스트 숨김) */
  .nav-search { padding: 10px 8px 6px; }
  .nav-search-box svg { left: 50%; transform: translate(-50%, -50%); }
  .nav-search input { padding-left: 10px; text-align: center; }
  .nav-search input::placeholder { color: transparent; }
}

.brow { display: flex; align-items: center; gap: 9px; margin: 7px 0; }
.brow .bn { width: 44%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; color: var(--text-soft); }
.brow .bt { flex: 1; background: var(--panel2); border-radius: 5px; height: 14px; overflow: hidden; }
.brow .bf { height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--red), #f87171); }
.brow .bq { width: 48px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; font-size: 12px; }

.sgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(94px, 1fr)); gap: 10px; }
.sbox { background: var(--panel2); border-radius: 9px; padding: 11px; text-align: center; }
.sbox .s { font-size: 11px; color: var(--muted); font-weight: 600; }
.sbox .q { font-size: 19px; font-weight: 800; margin-top: 2px; color: var(--text); }
.sbox .p { font-size: 10px; color: var(--red); margin-top: 1px; font-weight: 600; }

.tablewrap { overflow: auto; max-height: 62vh; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); }
table { width: 100%; border-collapse: collapse; font-size: 11.5px; white-space: nowrap; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
th { background: var(--panel2); color: var(--text-soft); font-weight: 700; cursor: pointer; user-select: none; position: sticky; top: 0; z-index: 1; }
th:hover { color: var(--red); }
td { max-width: 280px; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr:hover td { background: var(--side-hover); }
.pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 10.5px; font-weight: 700; }
.pill.ok { background: var(--green-soft); color: #065f46; }
.pill.warn { background: var(--amber-soft); color: #92400e; }
.pill.err { background: var(--red-soft); color: var(--red-strong); }
.pill.pre { background: #ede9fe; color: #6d28d9; }
.pill.purple { background: #ede9fe !important; color: #6d28d9 !important; }
.pill.blue   { background: var(--blue-soft) !important; color: var(--blue-text) !important; }
.pill.err    { background: var(--red-soft) !important; color: var(--red-strong) !important; }

.empty { color: var(--muted); text-align: center; padding: 40px; font-size: 12.5px; }
.spin { display: inline-block; width: 13px; height: 13px; border: 2px solid var(--line); border-top-color: var(--red); border-radius: 50%; animation: sp .7s linear infinite; vertical-align: -2px; }
@keyframes sp { to { transform: rotate(360deg); } }

.ovgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.ovcard {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; cursor: pointer; transition: border-color .12s, box-shadow .12s, transform .12s;
}
.ovcard:hover { border-color: var(--red); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.ovcard .oi { font-size: 20px; }
.ovcard .on { font-size: 13.5px; font-weight: 700; margin-top: 7px; color: var(--text); }
.ovcard .od { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.ovcard .om { font-size: 11px; color: var(--green); margin-top: 9px; font-weight: 600; }
.ovcard .om.err { color: var(--red); }

/* ── 액션 패널 (자동화 실행) ── */
.actions-bar {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 14px;
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.actions-bar .al {
  font-size: 12px; font-weight: 700; color: var(--text-soft);
  display: flex; align-items: center; gap: 6px;
}
.actions-bar .al::before { content: "▶"; color: var(--green); font-size: 10px; }
.action-group {
  display: inline-flex; align-items: center; gap: 0;
  border-radius: 8px; overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.action-group .action-input {
  background: var(--panel); border: 1px solid var(--line); border-right: 0;
  color: var(--text); padding: 7px 10px; font-size: 12.5px; font-family: inherit;
  border-top-left-radius: 8px; border-bottom-left-radius: 8px;
  outline: 0;
}
.action-group .action-input:focus { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-softer); }
.action-group button.action {
  border-top-left-radius: 0; border-bottom-left-radius: 0;
  box-shadow: none;
}
.action-group:not(:has(.action-input)) button.action {
  border-radius: 8px;
}

/* 카테고리 KPI 카드의 사이즈 알약 */
.cat-sizes {
  display: flex; gap: 4px; flex-wrap: wrap;
  margin-top: 9px; padding-top: 9px;
  border-top: 1px solid var(--line);
}
.cat-sizes .cs {
  display: inline-flex; gap: 3px; align-items: baseline;
  background: var(--panel2); color: var(--text-soft);
  padding: 2px 7px; border-radius: 99px;
  font-size: 10.5px; font-weight: 600;
  border: 1px solid var(--line);
}
.cat-sizes .cs b { font-weight: 800; color: var(--text); }
.action-result {
  font-size: 11.5px; padding: 8px 12px; border-radius: 7px; margin-left: auto;
  max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.action-result.ok { background: var(--green-soft); color: #065f46; }
.action-result.err { background: var(--red-soft); color: var(--red-strong); }
.action-result.run { background: var(--blue-soft); color: var(--blue-text); }

/* ── 캘린더 ── */
.cal-panel { padding: 16px 18px; }
.cal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.cal-title { font-size: 16px; font-weight: 800; letter-spacing: -0.4px; }
.cal-controls { display: flex; gap: 6px; }

.cal-grid {
  /* 주 수(5~6)는 JS 가 인라인 grid-template-rows 로 정한다. 행 높이만 여기서 관리(모바일 재정의 유지) */
  --cal-row-h: 96px;
  display: grid; grid-template-columns: repeat(7, 1fr);
  grid-template-rows: auto repeat(6, var(--cal-row-h));   /* JS 미적용 시 폴백 */
  gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
}
/* 캘린더 밑 월간 일정 요약 — 칸이 좁아 못 보여준 일정을 텍스트로 한눈에 */
.cal-summary { margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--line); }
.cal-sum-head { font-size: 12px; font-weight: 700; color: var(--text-soft); margin-bottom: 8px; display: flex; align-items: center; gap: 7px; }
.cal-sum-head .tag { color: var(--muted); font-weight: 500; font-size: 11.5px; }
.cal-sum-list { display: flex; flex-wrap: wrap; gap: 6px; }
.cal-sum-item {
  display: inline-flex; align-items: baseline; gap: 5px;
  padding: 5px 9px; border-radius: 7px;
  background: var(--red-softer); border: 1px solid #fecaca; color: var(--red-strong);
  font-size: 11.5px; line-height: 1.4; cursor: pointer;
  white-space: nowrap;                 /* 좁은 칩 안에서 한글이 글자당 세로로 깨지는 것 방지 */
  max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.cal-sum-item:hover { background: var(--red); color: #fff; border-color: var(--red); }
.cal-sum-item:hover i { color: #fff; }
.cal-sum-item b { font-weight: 800; font-variant-numeric: tabular-nums; }
.cal-sum-item i { font-style: normal; color: var(--muted); font-size: 11px; }
.cal-sum-item.leave { background: #f7ffe0; border-color: #d9f99d; color: #365314; }
.cal-sum-item.leave:hover { background: #ccff33; color: #365314; }
.cal-sum-empty { font-size: 12px; color: var(--muted); }

.cal-dow {
  background: var(--panel2); padding: 7px 0; text-align: center;
  font-size: 12px; font-weight: 700; color: var(--text-soft); letter-spacing: 0.4px;
}
.cal-dow.sun { color: var(--red); }
.cal-dow.sat { color: #2563eb; }
.cal-cell {
  background: var(--panel); padding: 6px;
  cursor: pointer; display: flex; flex-direction: column; gap: 2px;
  transition: background .1s;
  position: relative; overflow: hidden;   /* 고정 높이 초과분은 클립 (+N 으로 표시) */
}
.cal-cell:hover { background: var(--side-hover); }
.cal-cell.dim .cal-day { color: #c7c9d0; }
.cal-cell.dim { background: #fafbfc; }
.cal-cell.today .cal-day {
  background: var(--red); color: #fff;
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; margin: 0;
}
.cal-cell.sel { outline: 2px solid var(--red); outline-offset: -2px; z-index: 1; }
.cal-cell.sun .cal-day { color: var(--red); }
.cal-cell.sat .cal-day { color: #2563eb; }
.cal-cell.today.sun .cal-day, .cal-cell.today.sat .cal-day { color: #fff; }
.cal-day { font-size: 13.5px; font-weight: 700; padding: 1px 4px; }
.cal-day-header { display: flex; align-items: center; gap: 3px; height: 22px; }
.cal-day-mark {
  width: 14px; height: 14px;
  opacity: 0.9;
  flex-shrink: 0;
}
@media (max-width: 768px) {
  .cal-day-mark { width: 11px; height: 11px; }
}
.cal-ev {
  background: var(--red-soft); color: var(--red-strong);
  padding: 2px 5px; border-radius: 3px;
  font-size: 12px; font-weight: 600; line-height: 1.3; cursor: pointer;
}
.cal-ev-ttl { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-ev-name { font-weight: 500; font-size: 11px; opacity: 0.92; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 멀티데이 연속 바 — 셀 패딩(-6px) 상쇄해 좌우 끝까지, 같은 레인은 가로로 연결 */
/* 멀티데이 바 — grid-column 으로 여러 칸을 하나가 가로지름(제목 전체 폭 흐름). margin-top 은 인라인(레인 위치) */
.cal-span {
  background: var(--red-soft); color: var(--red-strong);
  height: 18px; line-height: 18px; font-size: 11.5px; font-weight: 700;
  margin: 0; padding: 0 6px; border-radius: 0;
  align-self: start; z-index: 2; cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cal-span-att { font-weight: 500; opacity: 0.8; }
.cal-span.is-start { margin-left: 3px; border-top-left-radius: 4px; border-bottom-left-radius: 4px; }
.cal-span.is-end { margin-right: 3px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; }
.cal-span.leave { background: #ccff33; color: #365314; font-weight: 800; }
.cal-lane-space { flex-shrink: 0; }
.cal-more { font-size: 11px; color: var(--muted); padding-left: 4px; font-weight: 600; }

/* 공휴일 — 셀 배경 살짝 + 라벨 */
.cal-cell.holiday { background: #fff5f5; }
.cal-cell.holiday.dim { background: #fff8f8; }
.cal-cell.holiday .cal-day { color: var(--red); }
.cal-cell.holiday.today .cal-day { color: #fff; }
.cal-holiday {
  background: var(--red); color: #fff;
  padding: 1px 5px; border-radius: 3px;
  font-size: 10px; font-weight: 700;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cal-holiday-banner {
  background: var(--red); color: #fff;
  padding: 7px 12px; border-radius: 7px;
  font-size: 12px; margin-bottom: 10px;
}

.cal-detail {
  margin-top: 14px; padding-top: 14px;
  border-top: 1px solid var(--line);
}
.cal-detail-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.cal-detail-title { font-size: 13px; font-weight: 700; }
.cal-detail-title .tag { color: var(--muted); font-weight: 500; font-size: 11.5px; margin-left: 6px; }
.cal-detail-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.cal-ev-row {
  background: var(--panel2); border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 12px; display: flex; gap: 10px; align-items: flex-start; justify-content: space-between;
}
.cal-ev-body { flex: 1; min-width: 0; }
.cal-ev-btns { display: flex; flex-direction: column; gap: 4px; flex-shrink: 0; }
.cal-ev-title { font-size: 13px; font-weight: 700; color: var(--text); }
.cal-ev-desc { font-size: 11.5px; color: var(--text-soft); margin-top: 2px; word-break: keep-all; }
.cal-ev-meta { font-size: 10.5px; color: var(--muted); margin-top: 4px; }
.cal-ev-range { font-size: 11px; font-weight: 600; color: var(--blue-text); background: var(--blue-soft); padding: 1px 6px; border-radius: 5px; margin-left: 4px; }
.cal-ev-time { font-size: 11px; color: var(--muted); margin-left: 4px; display: inline-flex; align-items: center; gap: 2px; }
.cal-ev-time svg { width: 11px; height: 11px; }
.cal-ev-atts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.cal-ev-att { font-size: 10.5px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--side-active-bg); color: var(--text-soft); }

/* 일정 등록 모달 */
#evtModal .modal-body { max-height: 82vh; overflow-y: auto; }
#evtModal .search { width: 100%; box-sizing: border-box; }
.evt-row { display: flex; gap: 10px; }
.evt-col { flex: 1; min-width: 0; }
.evt-att { border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; max-height: 168px; overflow-y: auto; display: flex; flex-direction: column; gap: 9px; }
.evt-att-dept { font-size: 11px; font-weight: 700; color: var(--muted); margin-bottom: 5px; }
.evt-att-people { display: flex; flex-wrap: wrap; gap: 6px; }
.evt-att-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 3px 9px 3px 7px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; user-select: none; transition: all .12s; }
.evt-att-chip:hover { border-color: var(--red); }
.evt-att-chip:has(input:checked) { background: var(--red); border-color: var(--red); color: #fff; }
.evt-att-chip input { margin: 0; }

@media (max-width: 768px) {
  /* 셀 패딩·헤더·바 높이는 데스크탑과 동일 유지 → JS 바 위치(BAR_TOP/BAR_H)와 정렬. 행 높이·폰트만 조정 */
  .cal-grid { --cal-row-h: 80px; }
  .cal-day { font-size: 11px; padding: 0 2px; }
  .cal-ev { font-size: 9.5px; padding: 1px 3px; }
  /* 참석자 이름은 35px 폭에선 어차피 안 읽히는데 한 줄(≈11px)을 통째로 먹어 일정이 잘린다 → 셀에선 숨김
     (이름은 일정을 탭하면 뜨는 수정 모달에서 확인) */
  .cal-ev-name { display: none; }
  .cal-span { font-size: 10px; }
  /* +N 은 셀의 마지막 자식이라 넘치면 제일 먼저 잘렸다 → 우하단에 고정해 항상 보이게 */
  .cal-more {
    position: absolute; right: 2px; bottom: 1px; z-index: 3;
    padding: 0 3px; border-radius: 3px;
    background: var(--panel); color: var(--text-soft);
    font-size: 9.5px; line-height: 1.5;
  }
  .cal-cell.dim .cal-more { background: #fafbfc; }
  /* 설명문이 '폐기 등록' 버튼을 다음 줄로 밀어내서, 좁은 화면에선 설명문을 숨긴다 */
  .disp-panel h2 .modal-label-sub { display: none; }
  .evt-row { flex-wrap: wrap; }
}

/* ── 챗봇 플로팅 ── */
.chat-fab {
  position: fixed; right: 24px; bottom: 24px;
  width: 50px; height: 50px; border-radius: 50%;
  background: transparent; border: 0; padding: 0;
  cursor: pointer;
  box-shadow:
    0 0 22px rgba(220, 38, 38, 0.5),
    0 6px 18px rgba(0, 0, 0, 0.12);
  z-index: 50; transition: transform 0.15s, box-shadow .15s;
  overflow: hidden;
}
.chat-fab img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chat-fab:hover {
  transform: scale(1.06);
  box-shadow:
    0 0 32px rgba(220, 38, 38, 0.65),
    0 8px 22px rgba(0, 0, 0, 0.15);
}
.chat-badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--red); color: #fff;
  min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 99px; font-size: 11px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  font-family: inherit;
}
.chat-badge.hidden { display: none; }
.chat-fab.nudge { animation: nudge 0.7s ease-in-out; }
@keyframes nudge {
  0%, 100% { transform: rotate(0); }
  15%, 45%, 75% { transform: rotate(-7deg); }
  30%, 60%, 90% { transform: rotate(7deg); }
}

/* 챗 안의 메뉴 이동 링크 */
.chat-link {
  display: inline-block;
  background: var(--red-softer); color: var(--red-strong);
  padding: 3px 9px; border-radius: 6px;
  font-size: 11.5px; font-weight: 600; cursor: pointer;
  border: 1px solid #fecaca; transition: background .12s;
  margin-top: 2px;
}
.chat-link:hover { background: var(--red); color: #fff; }
/* ── 폐기 등록 (스크래치 탭) ── */
.disp-panel { padding: 14px 18px; }
.disp-panel h2 { margin-bottom: 10px; }
/* 가로 슬라이드 스트립 — 카드가 줄바꿈되지 않고 오른쪽으로 스크롤 */
.disp-strip {
  display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px;
  -webkit-overflow-scrolling: touch; scrollbar-width: thin;
}
.disp-card {
  flex: 0 0 118px; width: 118px;
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  background: var(--panel); min-width: 0;
}
.disp-card img, .disp-noimg {
  display: block; width: 100%; height: 86px; object-fit: cover; background: var(--panel2);
}
/* 좁은 카드 안 한글이 글자당 세로로 깨지지 않게 nowrap + ellipsis */
.disp-name { font-size: 11.5px; font-weight: 700; padding: 5px 7px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.disp-meta { font-size: 10.5px; color: var(--text-soft); padding: 1px 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.disp-meta2 { font-size: 10px; color: var(--muted); padding: 0 7px 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.disp-empty { padding: 10px 2px; color: var(--muted); font-size: 12px; }
/* ⚠️ .scr-form 은 `.scr-reg .scr-form` 으로 스코프되어 있어 모달 안에서는 안 먹는다 → 여기서 직접 준다 */
#dispModal .scr-form { display: flex; flex-direction: column; gap: 12px; }
#dispModal .ops-pick { flex: 0 0 auto; }        /* flex:1 이면 세로로 늘어나 간격이 틀어짐 */
#dispModal .ops-mode { margin-bottom: 0; }
/* 3분할 세그먼트 — 버튼 폭 균등 (가운데 정렬·활성 빨강은 .ops-mode-btn 전역 규칙에서) */
#dispPartBar { display: flex; gap: 6px; }
#dispPartBar .ops-mode-btn { flex: 1; padding: 8px 6px; }

/* 촬영 버튼 = 등록 버튼과 완전히 같은 크기·색 (.scr-submit 과 동일 메트릭) */
.disp-cam {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px; border: 0; border-radius: 8px;
  background: var(--red); color: #fff;
  font-family: inherit; font-size: 13.5px; font-weight: 700;
  box-shadow: var(--shadow-sm);
  cursor: pointer; user-select: none; white-space: nowrap;
  transition: background .12s;
}
.disp-cam:hover { background: var(--red-strong); }
.disp-cam > svg { width: 16px; height: 16px; }
.disp-preview { display: flex; gap: 6px; flex-wrap: wrap; }
.disp-preview:empty { display: none; }
.disp-preview img { width: 58px; height: 58px; object-fit: cover; border-radius: 7px; border: 1px solid var(--line); }
.disp-effect {
  font-size: 12px; color: var(--text-soft); line-height: 1.5;
  background: var(--panel2); border-radius: 8px; padding: 9px 11px; word-break: keep-all;
}

/* 챗봇 안내문 안의 예시 명령어 */
.msg code {
  background: var(--panel); border: 1px solid var(--line); border-radius: 5px;
  padding: 1px 5px; font-size: 11px; word-break: keep-all; white-space: nowrap;
}
/* 챗봇 품절처리 선택지 (상품/사이즈) — 말풍선이 좁아 한글이 글자당 줄바꿈되지 않게 keep-all + min-width:0 */
.chat-pick {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  margin-top: 6px; padding: 7px 9px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 9px;
  cursor: pointer; transition: border-color .12s, background .12s;
}
.chat-pick:hover { border-color: var(--red); background: var(--red-softer); }
.chat-pick img, .chat-pick-noimg {
  width: 30px; height: 30px; flex: none;
  border-radius: 6px; object-fit: cover; background: var(--line);
}
.chat-pick-name { min-width: 0; word-break: keep-all; overflow-wrap: anywhere; line-height: 1.35; }
.chat-pick.sz {
  display: inline-flex; justify-content: center;
  margin: 6px 6px 0 0; padding: 6px 14px;
  font-weight: 600; white-space: nowrap;
}
.chat-pick.disabled { opacity: .45; pointer-events: none; }
.chat-pick.chosen { border-color: var(--red); background: var(--red-soft); opacity: 1; }
.chat-panel {
  position: fixed; right: 24px; bottom: 24px;
  width: 400px; height: 580px; max-height: calc(100vh - 48px);
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: var(--shadow-lg); z-index: 51;
}
.chat-head {
  padding: 14px 16px; border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
  background: linear-gradient(180deg, var(--red-softer) 0%, var(--panel) 100%);
}
.chat-head-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.chat-avatar {
  width: 36px; height: 36px; border-radius: 50%; object-fit: cover;
  background: transparent; border: 0; flex-shrink: 0;
  box-shadow: 0 0 12px rgba(220, 38, 38, 0.4);
}
.chat-head .ct { font-size: 13.5px; font-weight: 700; color: var(--text); }
.chat-head .cs { font-size: 11px; color: var(--muted); margin-top: 2px; }
.chat-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.msg { padding: 10px 13px; border-radius: 12px; font-size: 12.5px; line-height: 1.55; max-width: 86%; }
.msg.bot { background: var(--panel2); color: var(--text); align-self: flex-start; border-top-left-radius: 4px; }
.msg.me { background: var(--red); color: #fff; align-self: flex-end; border-top-right-radius: 4px; }
.msg.sys { background: transparent; color: var(--muted); font-size: 11px; text-align: center; align-self: center; }
.chat-input { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line); background: var(--panel); }
.chat-input input {
  flex: 1; background: var(--panel2); border: 1px solid var(--line); color: var(--text);
  border-radius: 9px; padding: 9px 12px; font-size: 12.5px; font-family: inherit;
}
.chat-input input:focus { outline: 0; border-color: var(--red); }
.chat-input button {
  background: var(--red); color: #fff; border: 0; border-radius: 9px;
  width: 38px; font-size: 14px; cursor: pointer; padding: 0;
}
.chat-input button:hover { background: var(--red-strong); }

/* ── 포장리스트 갱신시간 신선도 pill (toolbar 우상단 안) ── */
.pack-meta-fresh { color: #065f46; font-weight: 700; margin-left: 4px; }
.pack-meta-stale { color: #92400e; font-weight: 700; margin-left: 4px; }
.pack-meta-warn  { color: var(--red-strong); font-weight: 700; margin-left: 4px; }

/* ── 입고예정 B/L 테이블 ── */
.bl-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.bl-table thead th { text-align: left; padding: 6px 8px; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); }
.bl-table tbody td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.bl-row.final td:nth-child(2) { background: #00ff0033; color: #064e3b; font-weight: 700; }
.bl-row.notify1 td:nth-child(2) { background: #d9ead3; color: #14532d; font-weight: 600; }
.bl-err { color: var(--red-strong); font-weight: 600; }
.bl-table button.sm { padding: 4px 7px; }
.bl-items-btn {
  margin-top: 4px; font-size: 10.5px; padding: 2px 7px;
  background: var(--panel2); color: var(--text-soft); border: 1px solid var(--line);
  border-radius: 99px; cursor: pointer; font-family: inherit; font-weight: 600;
  display: inline-flex; align-items: center; gap: 4px;
}
.bl-items-btn:hover { background: var(--side-hover); border-color: var(--line-strong); color: var(--text); }

/* ── 누적 프리오더 모달 ── */
.pre-total {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
  margin-bottom: 14px;
}
.pre-total-num { font-size: 26px; font-weight: 900; color: #4c1d95; letter-spacing: -0.5px; }
.pre-size-pills { display: flex; gap: 5px; flex-wrap: wrap; }
.pre-size-pill {
  display: inline-flex; gap: 4px; align-items: baseline;
  background: rgba(76,29,149,0.12); color: #4c1d95;
  padding: 3px 9px; border-radius: 99px;
  font-size: 11.5px; font-weight: 600;
}
.pre-size-pill b { font-weight: 800; font-size: 12px; }
.pre-prod-list { display: flex; flex-direction: column; gap: 6px; }
.pre-prod {
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px;
}
.pre-prod-head { display: flex; gap: 8px; align-items: center; margin-bottom: 5px; }
.pre-prod-name { flex: 1; min-width: 0; }
.pre-prod-name .pn { font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pre-prod-sub { font-size: 10.5px; color: var(--muted); margin-top: 1px; }
.pre-prod-grid { display: flex; flex-wrap: wrap; gap: 5px; }
.pre-size-cell {
  display: inline-flex; gap: 5px; align-items: baseline;
  padding: 4px 9px; border-radius: 6px;
  background: var(--panel2); border: 1px solid var(--line);
  font-size: 12px;
}
.pre-sc-size { font-weight: 800; color: var(--text); }
.pre-sc-qty { color: var(--text-soft); font-weight: 700; }

/* ── 포장리스트 체크 (상품별 섹션) — 컴팩트 ── */
.prow-group {
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  margin-bottom: 5px; padding: 7px 10px;
}
.prow-head { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; }
.prow-head-name { flex: 1; min-width: 0; }
.prow-head-name .pn {
  font-size: 12.5px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.prow-head-sub { font-size: 10.5px; color: var(--muted); margin-top: 1px; }
.prow-grid {
  display: flex; flex-wrap: wrap; gap: 5px;
  padding-left: 0;
}
.size-cell {
  display: flex; flex-direction: column; gap: 2px;
  padding: 4px 7px; border-radius: 6px;
  background: var(--panel2); border: 1.5px solid var(--line);
  cursor: pointer; text-align: left;
  font-family: inherit; transition: background 0.12s, border-color 0.12s;
  min-width: 78px;
}
.size-cell:hover { background: var(--side-hover); border-color: var(--line-strong); }
.size-cell.packed {
  background: var(--green-soft); border-color: #6ee7b7;
}
.size-cell.packed:hover { background: #b9f5d3; }
.size-cell.packed .sc-size { color: #065f46; }
.sc-top { display: flex; justify-content: space-between; align-items: center; gap: 4px; }
.sc-size { font-size: 12px; font-weight: 800; color: var(--text); }
.sc-cat {
  font-size: 9px; font-weight: 700; padding: 0 5px; border-radius: 99px;
}
.size-cell.scr .sc-cat       { background: var(--red-soft); color: var(--red-strong); }
.size-cell.warn-pill .sc-cat { background: var(--amber-soft); color: #92400e; }
.size-cell.pre .sc-cat       { background: #ede9fe; color: #6d28d9; }
.sc-bottom { display: flex; justify-content: space-between; align-items: baseline; gap: 4px; }
.sc-qty { color: var(--text); font-weight: 800; font-size: 14px; }
.sc-check { color: #065f46; font-weight: 700; font-size: 10.5px; }
.size-cell.packed .sc-qty { color: #065f46; }
@media (max-width: 720px) {
  .prow-grid { padding-left: 0; gap: 4px; }
  .size-cell { min-width: 56px; padding: 3px 6px; gap: 1px; }
  .sc-size { font-size: 11px; }
  .sc-cat { font-size: 8.5px; padding: 0 4px; }
  .sc-bottom { font-size: 10px; }
  .sc-qty { font-size: 12px; }
  .sc-check { font-size: 10px; }
  .prow-head .pn { font-size: 12px; }
  .prow-head-sub { font-size: 10px; }
}

/* ── 맞교환 리스트 ── */
.exchange-page { display: flex; flex-direction: column; gap: 20px; position: relative; }
.exchange-section {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px;
  overflow-x: auto;
}
.exchange-section > .ex-tabs,
.exchange-section > .ex-section-head { position: sticky; left: 0; }
.ex-section-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
}

/* 운영이슈 보드 (시작 화면) */
.ops-empty { text-align: center; padding: 56px 24px; }
.ops-empty-ic { display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 64px; border-radius: 16px; background: var(--red-soft); color: var(--red); margin-bottom: 16px; }
.ops-empty-ic svg { width: 30px; height: 30px; }
.ops-empty h2 { justify-content: center; border: 0; margin: 0 0 8px; }
.ops-empty .status { line-height: 1.7; }

/* 차액환불금 계산기 */
.rcalc-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.rcalc-table th, .rcalc-table td { border: 1px solid var(--line); text-align: center; padding: 0; }
.rcalc-table th { font-size: 12.5px; font-weight: 800; padding: 8px 4px; }
.rcalc-table th.rc-in { background: #fef9c3; color: #713f12; }
.rcalc-table th.rc-out30 { background: #fed7aa; color: #7c2d12; }
.rcalc-table th.rc-out50 { background: #fdba74; color: #7c2d12; }
.rcalc-table td input {
  width: 100%; box-sizing: border-box; border: 0; background: transparent;
  text-align: center; padding: 12px 8px; font-size: 16px; font-weight: 700; font-family: inherit;
  font-variant-numeric: tabular-nums; color: var(--text);
}
.rcalc-table td input:focus { outline: 0; background: var(--red-softer); }
.rcalc-table td.rc-result { font-size: 17px; font-weight: 800; color: var(--red); font-variant-numeric: tabular-nums; padding: 12px 8px; }
.rcalc-note { margin-top: 8px; font-size: 11.5px; color: var(--muted); }

/* 환불양식 생성기 */
.refund-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.refund-out-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; font-size: 12px; font-weight: 700; color: var(--text-soft); }
.refund-form {
  margin: 0; padding: 12px 14px; min-height: 230px;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 9px;
  font-family: inherit; font-size: 12.5px; line-height: 1.85;
  white-space: pre-wrap; word-break: break-all; color: var(--text);
}
.refund-form.muted { color: var(--muted); font-family: inherit; font-size: 12.5px; }
.refund-staff { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12px; font-weight: 700; color: var(--text-soft); }
.refund-staff input { flex: 1; padding: 6px 10px; border: 1px solid var(--line); border-radius: 7px; font-size: 12.5px; font-family: inherit; }
.refund-in { display: flex; flex-direction: column; }
.refund-in-label { font-size: 12px; font-weight: 700; color: var(--text-soft); margin-bottom: 6px; }
.refund-in textarea {
  width: 100%; box-sizing: border-box; resize: vertical; min-height: 270px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px;
  font-size: 12px; font-family: inherit; line-height: 1.5;
}
.refund-in textarea:focus, .refund-staff input:focus { outline: 0; border-color: var(--red); box-shadow: 0 0 0 3px var(--red-softer); }
@media (max-width: 768px) { .refund-grid { grid-template-columns: 1fr; } }
.ex-section-title { font-size: 13.5px; font-weight: 800; color: var(--text); }
.ex-add-btn {
  background: var(--red); color: #fff; border: 0; border-radius: 7px;
  padding: 6px 14px; font-size: 12px; font-weight: 700; cursor: pointer;
}
.ex-add-btn:hover { background: var(--red-strong); }
.ex-tabs { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.ex-tab {
  background: var(--panel); color: var(--text-soft); border: 1px solid var(--line);
  border-radius: 99px; padding: 6px 14px; font-size: 11.5px; font-weight: 700; cursor: pointer;
}
.ex-tab:hover { border-color: var(--red); }
.ex-tab.on { background: var(--red); color: #fff; border-color: var(--red); }
.ex-tab .cnt {
  display: inline-block; min-width: 18px; padding: 0 6px; margin-left: 4px;
  background: rgba(255,255,255,0.25); border-radius: 99px; font-size: 11px;
}
.ex-tab:not(.on) .cnt { background: var(--red-softer); color: var(--red); }
.exchange-toast {
  position: absolute; right: 0; top: 0;
  padding: 7px 12px; border-radius: 7px; font-size: 12px; font-weight: 600;
  background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow-md);
}
.exchange-toast.ok  { background: var(--green-soft); color: #065f46; border-color: #a7f3d0; }
.exchange-toast.err { background: var(--red-soft); color: var(--red-strong); border-color: #fecaca; }

/* 테이블 (한 행 = 한 케이스) */
.ex-table {
  width: auto; border-collapse: separate; border-spacing: 0;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  font-size: 12px;
}
.ex-table thead th {
  background: var(--panel2); color: var(--text-soft); font-weight: 700;
  text-align: left; padding: 9px 10px; font-size: 11px;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
.ex-table tbody td {
  padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle;
}
.ex-table tbody tr:last-child td { border-bottom: 0; }
.ex-table tbody tr:hover { background: var(--side-active-bg); }
.ex-tr.done { opacity: 0.55; }
.ex-tr.done td { background: var(--panel2); }

.ex-table .c-date     { white-space: nowrap; color: var(--text-soft); }
.ex-table .c-people   { white-space: nowrap; }
.ex-table .c-people-row { display: flex; gap: 6px; align-items: center; font-size: 12.5px; }
.ex-table .c-sep      { color: var(--muted); font-size: 13px; font-weight: 400; }
.ex-table .c-content  {
  max-width: 260px; color: var(--text-soft);
  white-space: normal; word-break: keep-all; line-height: 1.4;
}
.ex-table .c-content .pill { vertical-align: middle; margin-right: 2px; }
.ex-table .c-content-text { font-size: 11.5px; }
.ex-table .c-tracking { white-space: nowrap; }
.ex-table .c-status   { white-space: nowrap; }
.ex-tr-saved, .ex-tr-edit { display: flex; gap: 5px; align-items: center; }
.ex-tr-no { font-family: inherit; font-size: 12px; letter-spacing: 0.2px; }
.ex-table .ex-tracking { width: 130px; }
button.ex-save {
  background: var(--red); color: #fff; border: 0; border-radius: 5px;
  padding: 5px 11px; font-size: 11.5px; font-weight: 700; cursor: pointer;
}
button.ex-save:hover { background: var(--red-strong); }
.ex-table .c-photos   { white-space: nowrap; }
.ex-table .c-author   { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.ex-table .c-actions  { white-space: nowrap; text-align: right; }
.ex-table .c-phone    { font-size: 11px; color: var(--muted); margin-top: 2px; }

.ex-table .ex-carrier {
  padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--panel); font-size: 11.5px; color: var(--text);
  max-width: 88px;
}
.ex-table .ex-tracking {
  width: 130px; padding: 4px 8px;
  border: 1px solid var(--line); border-radius: 6px; font-size: 11.5px; font-family: inherit;
}
.ex-table .ex-tracking:focus, .ex-table .ex-carrier:focus {
  outline: 0; border-color: var(--red); box-shadow: 0 0 0 2px var(--red-soft);
}
.ex-link {
  display: inline-block; padding: 3px 6px; font-size: 11px; color: var(--text-soft);
  text-decoration: none; border: 1px solid var(--line); border-radius: 5px; background: var(--panel);
}
.ex-link:hover { border-color: var(--red); color: var(--red); }
.ex-icon {
  background: var(--panel); border: 1px solid var(--line); border-radius: 5px;
  padding: 3px 6px; font-size: 11px; color: var(--text-soft); cursor: pointer;
}
.ex-icon:hover { border-color: var(--red); color: var(--red); background: var(--red-softer); }

.ex-status-msg {
  font-size: 11px; color: var(--text-soft); margin-top: 4px;
  line-height: 1.35; word-break: break-all;
  background: var(--panel2); border-radius: 4px; padding: 3px 6px;
}
.ex-checked-mini { font-size: 10px; color: var(--muted); margin-top: 3px; }

.ex-thumb {
  display: inline-block; width: 32px; height: 32px; border-radius: 5px; overflow: hidden;
  border: 1px solid var(--line); margin-right: 3px; vertical-align: middle;
}
.ex-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.ex-complete-btn {
  background: var(--red); color: #fff; border: 0; border-radius: 6px;
  padding: 5px 10px; font-size: 11px; font-weight: 700; cursor: pointer;
}
.ex-complete-btn:hover { background: var(--red-strong); }

/* 폼 모달 */
#exchangeFormModal .modal-card.ex-modal-card { max-width: 540px; width: 100%; padding: 24px 26px; max-height: 90vh; overflow-y: auto; }
#exchangeFormModal h3 { font-size: 15px; margin-bottom: 14px; }
.exchange-form {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.exchange-form label {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 11px; font-weight: 700; color: var(--text-soft);
}
.exchange-form label.full { grid-column: 1 / -1; }
.exchange-form input, .exchange-form textarea, .exchange-form select {
  padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px;
  font-size: 12px; font-family: inherit; background: var(--panel); color: var(--text);
}
.exchange-form select {
  -webkit-appearance: none; appearance: none;
  padding-right: 28px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%23999' d='M0 0l5 6 5-6z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
}
.exchange-form input:focus, .exchange-form textarea:focus, .exchange-form select:focus {
  outline: 0; border-color: var(--red); box-shadow: 0 0 0 2px var(--red-soft);
}
.ex-paste-label textarea {
  background: var(--panel2);
  font-family: inherit; font-size: 11.5px;
}
.ex-parse-status {
  font-size: 11px; font-weight: 600; margin-top: 4px;
  min-height: 14px; color: var(--green);
}
.ex-parse-status:empty { display: none; }
.ex-form-preview { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.ex-form-preview img {
  width: 56px; height: 56px; object-fit: cover; border-radius: 5px; border: 1px solid var(--line);
}
.ex-source-radio {
  display: flex; gap: 8px; margin-bottom: 4px;
}
.ex-rd {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 8px 10px; border: 1.5px solid var(--line); border-radius: 7px;
  cursor: pointer; font-size: 12px; font-weight: 600;
  background: var(--panel); color: var(--text-soft);
  flex-direction: row !important;
}
.ex-rd input { display: none; }
.ex-rd:has(input:checked) { background: var(--red-softer); border-color: var(--red); color: var(--red-strong); }
.ex-rd:hover { border-color: var(--red); }
.ex-source-badge {
  display: inline-block; padding: 1px 7px; border-radius: 4px;
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.2px;
  margin-left: 6px; vertical-align: middle;
}
.ex-source-naver { background: #d1fae5; color: #065f46; }
.ex-source-talk  { background: #fef3c7; color: #92400e; }

/* ── 스크래치 등록 ── */
.scr-reg .scr-form { display: flex; flex-direction: column; gap: 12px; }
.scr-field { display: flex; flex-direction: column; gap: 5px; position: relative; }
.scr-lbl { font-size: 11.5px; font-weight: 700; color: var(--text-soft); }
.scr-input {
  padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: 8px;
  font-size: 13px; background: var(--panel); color: var(--text); width: 100%;
}
.scr-input:focus { outline: none; border-color: var(--red); }
.scr-input-err { border-color: var(--red) !important; background: var(--red-softer); }
.scr-stock-warn { font-size: 12px; color: var(--red); font-weight: 600; min-height: 0; }
.scr-stock-warn:empty { display: none; }
.scr-row { display: flex; gap: 12px; align-items: flex-end; }
.scr-row .scr-field { flex: 1; }

/* 자동완성 드롭다운 */
.scr-search-wrap { position: relative; }
.scr-suggest {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 30; margin-top: 4px;
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: 8px;
  box-shadow: var(--shadow-lg); max-height: 300px; overflow-y: auto;
}
.scr-sg-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 11px; cursor: pointer;
  border-bottom: 1px solid var(--line); font-size: 13px;
}
.scr-sg-item:last-child { border-bottom: none; }
.scr-sg-item:hover, .scr-sg-item.active { background: var(--side-active-bg); }
.scr-sg-item img { width: 36px; height: 36px; border-radius: 6px; object-fit: cover; background: var(--panel2); }
.scr-sg-noimg { width: 36px; height: 36px; border-radius: 6px; background: var(--panel2); }
.scr-sg-empty { padding: 12px; font-size: 12.5px; color: var(--muted); text-align: center; }

/* 선택된 상품 */
.scr-selected {
  display: flex; align-items: center; gap: 12px; padding: 10px;
  background: var(--panel2); border-radius: 8px;
}
.scr-selected img { width: 48px; height: 48px; border-radius: 6px; object-fit: cover; }
.scr-sel-noimg { width: 48px; height: 48px; border-radius: 6px; background: var(--line); }
/* 전역 로딩 인디케이터 */
.global-loading {
  position: fixed; top: 22px; right: 22px; z-index: 9999;
  display: none; align-items: center; gap: 8px;
  background: var(--text); color: #fff;
  padding: 10px 16px; border-radius: 10px; font-size: 13px; font-weight: 600;
  box-shadow: var(--shadow-lg);
}
.global-loading .spin { border-top-color: #fff; border-right-color: rgba(255,255,255,0.3); }

.scr-sel-info { display: flex; flex-direction: column; gap: 3px; }
.scr-sel-name { font-size: 13.5px; font-weight: 700; }
.scr-sel-loss { font-size: 12px; color: var(--text-soft); }
.scr-sel-loss b { color: var(--red); font-size: 13px; }

/* 로스율 순위 */
.loss-row {
  display: flex; align-items: center; gap: 12px; padding: 9px 2px;
  border-bottom: 1px solid var(--line); font-size: 13px;
}
.loss-row:last-child { border-bottom: none; }
.loss-rank { width: 24px; text-align: center; font-weight: 700; color: var(--muted); font-size: 12px; }
.loss-name { flex: 1; font-weight: 600; min-width: 120px; }
.loss-meta { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.loss-pct { font-weight: 800; font-size: 14px; min-width: 56px; text-align: right; font-variant-numeric: tabular-nums; }
.loss-high { color: var(--red); }
.loss-mid { color: var(--amber); }
.loss-low { color: var(--green); }

.scr-submit {
  margin-top: 4px; padding: 11px; font-size: 13.5px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.scr-submit:disabled { opacity: 0.45; cursor: not-allowed; }
.scr-submit > svg { width: 16px; height: 16px; }

/* 확인 모달 카드 */
.scr-cf-card { display: flex; gap: 14px; align-items: center; }
.scr-cf-card img { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.scr-cf-noimg { width: 64px; height: 64px; border-radius: 8px; background: var(--panel2); flex-shrink: 0; }
.scr-cf-name { font-size: 14px; font-weight: 800; line-height: 1.35; }
.scr-cf-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.scr-cf-chip { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--panel2); color: var(--text-soft); }
.scr-cf-chip.blue { background: var(--blue-soft); color: var(--blue-text); }
.scr-cf-chip.amber { background: var(--amber-soft); color: #92400e; }
/* 처리 내용 (일반 재고 / 스크래치·PIECE) */
.scr-cf-rows { margin-top: 14px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.scr-cf-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 13px; font-size: 13px; }
.scr-cf-row + .scr-cf-row { border-top: 1px solid var(--line); }
.scr-cf-k { color: var(--muted); font-weight: 600; }
.scr-cf-v { font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; gap: 7px; }
.scr-cf-arrow { color: var(--muted); }
.scr-cf-v b.neg { color: var(--red); }
.scr-cf-plus { font-weight: 800; color: #065f46; }
.scr-cf-pend { font-weight: 700; color: #92400e; background: var(--amber-soft); padding: 1px 8px; border-radius: 999px; font-size: 12px; }
.scr-cf-sub { color: var(--muted); font-size: 11.5px; }

/* 보류 / 로그 행 */
.scr-prow, .scr-lrow {
  display: flex; align-items: center; gap: 10px; padding: 9px 2px;
  border-bottom: 1px solid var(--line); font-size: 13px; flex-wrap: wrap;
}
.scr-prow:last-child, .scr-lrow:last-child { border-bottom: none; }
.scr-thumb { width: 40px; height: 53px; border-radius: 5px; object-fit: cover; background: var(--panel2); flex-shrink: 0; }
.scr-thumb-no { background: var(--line); }
.scr-pinfo, .scr-linfo { flex: 1; min-width: 200px; }
.scr-pmeta, .scr-lmeta { font-size: 11.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.scr-sz { display: inline-block; padding: 1px 7px; background: var(--panel2); border-radius: 4px; font-size: 11px; font-weight: 700; }
.scr-note { color: var(--amber); font-size: 11.5px; margin-left: 4px; }
.scr-stock { font-size: 11px; color: var(--muted); margin-top: 3px; font-variant-numeric: tabular-nums; }
.scr-code { font-size: 10.5px; color: var(--muted); margin-top: 2px; opacity: 0.8; font-family: inherit; }
.scr-restored { opacity: 0.5; }
.scr-prow button > svg, .scr-lrow button > svg { width: 13px; height: 13px; }

/* 최근 입고 내역 (원복) */
.in-lrow { display: flex; align-items: center; gap: 10px; padding: 10px 2px;
  border-bottom: 1px solid var(--line); font-size: 13px; flex-wrap: wrap; }
.in-lrow:last-child { border-bottom: none; }
.in-linfo { flex: 1; min-width: 200px; }
.in-lname { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.in-lsizes { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.in-lmeta { font-size: 11.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.in-undone { opacity: 0.5; }
.in-lrow button > svg { width: 13px; height: 13px; }

/* ── 운영이슈 보드 ───────────────────────────────────── */
/* 상단 종합 대시보드: 전일 · 주간 두 섹션 (넓은 화면 풀폭 2열) */
.ops-dash-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.ops-dash-sec { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow-sm); }
.ops-dash-h { display: flex; align-items: baseline; gap: 9px; margin-bottom: 13px; flex-wrap: wrap; }
.ops-dash-title { font-size: 14.5px; font-weight: 800; color: var(--text); white-space: nowrap; }
.ops-dash-sub { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.ops-dash-total { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }
.ops-dash-total b { color: var(--text); font-size: 14.5px; font-weight: 800; }
.ops-dash-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ops-dash-card { display: flex; align-items: center; gap: 10px; min-width: 0; overflow: hidden;
  padding: 12px 13px; border-radius: 12px; background: var(--panel2); border: 1px solid var(--line); }
.ops-dash-card[data-sub] { cursor: pointer; transition: border-color .12s, transform .12s, box-shadow .12s; }
.ops-dash-card[data-sub]:hover { border-color: var(--line-strong); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.ops-dash-card[data-sub]:focus-visible { outline: 2px solid var(--red); outline-offset: 1px; }
.ops-dash-ic { width: 36px; height: 36px; border-radius: 10px; flex: none;
  display: flex; align-items: center; justify-content: center; }
.ops-dash-ic svg { width: 18px; height: 18px; }
.ops-dash-card.sold .ops-dash-ic { background: var(--amber-soft); color: var(--amber); }
.ops-dash-card.mis  .ops-dash-ic { background: var(--blue-soft);  color: var(--blue-text); }
.ops-dash-card.def  .ops-dash-ic { background: var(--red-soft);   color: var(--red); }
.ops-dash-meta { min-width: 0; }
.ops-dash-n { font-size: 22px; font-weight: 800; color: var(--text); line-height: 1; white-space: nowrap; }
.ops-dash-u { font-size: 12px; font-weight: 700; color: var(--muted); margin-left: 2px; }
.ops-dash-l { font-size: 11.5px; color: var(--muted); margin-top: 4px; white-space: nowrap; }
.ops-dash-card.zero { opacity: .58; }
.ops-dash-card.zero .ops-dash-ic { background: var(--panel2); color: var(--muted); }
@media (max-width: 960px) {
  .ops-dash-wrap { grid-template-columns: 1fr; }   /* 좁은 폭에선 전일·주간 세로 스택 → 카드에 여유 */
}

.ops-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.ops-tab { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 10px;
  background: var(--panel); border: 1.5px solid var(--line); color: var(--text-soft); cursor: pointer; font-weight: 600; }
.ops-tab svg { width: 15px; height: 15px; }
.ops-tab:hover { border-color: var(--line-strong); }
.ops-tab.active { background: var(--red); border-color: var(--red); color: #fff; }
.ops-stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ops-stat { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; text-align: center; }
.ops-stat-n { font-size: 22px; font-weight: 800; color: var(--text); }
.ops-stat-l { font-size: 12px; color: var(--muted); margin-top: 3px; }
.ops-up { color: var(--red); font-weight: 800; } .ops-down { color: var(--green); font-weight: 800; }
.ops-repeat { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.ops-repeat-t { font-weight: 700; font-size: 13px; margin-bottom: 8px; }
.ops-repeat-chip { display: inline-block; background: var(--red-softer); color: var(--red-strong);
  border: 1px solid var(--red-soft); border-radius: 8px; padding: 4px 9px; font-size: 12px; margin: 0 6px 6px 0; }
.ops-row { padding: 11px 2px; border-bottom: 1px solid var(--line); }
.ops-row:last-child { border-bottom: none; }
.ops-row-flex { display: flex; align-items: flex-start; gap: 11px; }
.ops-row-flex .ops-row-body { flex: 1; min-width: 0; }
.ops-thumb { width: 42px; height: 55px; border-radius: 6px; object-fit: cover; background: var(--panel2); flex-shrink: 0; border: 1px solid var(--line); }
.ops-thumb-no { background: var(--panel2); }
.ops-row-main { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ops-row-name { font-weight: 600; }
.ops-row-qty { color: var(--red); font-weight: 700; font-size: 13px; }
.ops-row-sub { font-size: 12px; color: var(--muted); margin-top: 4px; display: flex; align-items: center; gap: 8px; }
.ops-del { margin-left: auto; border: none; background: none; color: var(--muted); cursor: pointer; font-size: 13px; padding: 2px 6px; border-radius: 6px; }
.ops-del:hover { background: var(--red-soft); color: var(--red); }
.scr-submit.danger { background: var(--red-strong); }
.ops-df-preview { display: flex; flex-wrap: wrap; gap: 6px; }
.ops-df-chip { background: var(--panel2); border: 1px solid var(--line); border-radius: 7px; padding: 3px 8px; font-size: 11.5px; color: var(--muted); }
/* 검색된 사진 전체가 한 줄로 오른쪽 슬라이드 (기록 단위로 아래에 쌓지 않는다) */
.ops-df-strip {
  display: flex; flex-wrap: nowrap; gap: 10px; align-items: stretch;
  overflow-x: auto; padding-bottom: 6px;
  -webkit-overflow-scrolling: touch; scrollbar-width: thin;
}
.ops-df-card {
  position: relative; flex: 0 0 132px; width: 132px; min-width: 0;
  display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel);
}
.ops-df-thumb { position: relative; display: block; }
.ops-df-thumb img { display: block; width: 100%; height: 110px; object-fit: cover; background: var(--panel2); cursor: zoom-in; }
.ops-df-badge {
  position: absolute; right: 5px; bottom: 5px; padding: 1px 5px; border-radius: 6px;
  background: rgba(0, 0, 0, .62); color: #fff; font-size: 10px; font-weight: 700;
}
/* 좁은 카드 안 한글이 글자당 세로로 깨지지 않게 nowrap + ellipsis */
.ops-df-name { font-size: 11.5px; font-weight: 700; padding: 6px 7px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ops-df-meta { font-size: 10.5px; color: var(--text-soft); padding: 1px 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ops-df-memo { font-size: 10px; color: var(--muted); padding: 0 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 마지막 자식은 삭제 버튼이므로 :last-child 로 잡으면 안 된다. 캡션(div) 중 마지막에 여백을 준다 */
.ops-df-card > div:last-of-type { padding-bottom: 7px; }
/* .ops-del 의 margin-left:auto / 투명 배경을 덮어써야 하므로 반드시 그 뒤에 온다 */
.ops-df-del {
  position: absolute; top: 5px; right: 5px; margin: 0; padding: 0;
  width: 20px; height: 20px; display: flex; align-items: center; justify-content: center;
  border-radius: 6px; background: rgba(0, 0, 0, .5); color: #fff;
  font-size: 11px; line-height: 1; opacity: .85;
}
.ops-df-del:hover { opacity: 1; background: var(--red); color: #fff; }
.ops-df-count { margin-top: 8px; font-size: 11.5px; color: var(--muted); }

/* 최근 품절처리 내역 */
.ops-so-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.ops-so-row:last-child { border-bottom: none; }
.ops-so-info { flex: 1; min-width: 0; }
.ops-so-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.ops-so-meta { flex: none; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
@media (max-width: 640px) {
  .ops-stat-grid { grid-template-columns: 1fr; }
  .ops-df-card { flex: 0 0 116px; width: 116px; }
  .ops-df-thumb img { height: 96px; }
}

/* ── 로그 보드 ───────────────────────────────────────── */
.log-count { margin-bottom: 8px; }
.log-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.log-table { border-collapse: collapse; font-size: 12px; width: max-content; min-width: 100%; }
.log-table th, .log-table td { border-bottom: 1px solid var(--line); padding: 7px 10px; text-align: left; white-space: nowrap; max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.log-table th { background: var(--panel2); color: var(--text-soft); font-weight: 700; position: sticky; top: 0; }
.log-table tbody tr:hover { background: var(--panel2); }

/* ── 오배송 상품 피커 / 모드 ─────────────────────────── */
.ops-mode { display: flex; gap: 6px; margin-bottom: 4px; }
/* 전역 button 이 inline-flex 라 text-align 은 무시된다 → 가운데 정렬은 justify-content 로 */
.ops-mode-btn { padding: 6px 13px; border-radius: 8px; border: 1.5px solid var(--line); background: var(--panel); color: var(--text-soft); font-weight: 600; font-size: 13px; cursor: pointer; justify-content: center; }
.ops-mode-btn.active { background: var(--red); border-color: var(--red); color: #fff; }
.ops-pick { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.ops-pick-sel { display: flex; align-items: center; gap: 9px; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 7px 9px; }
.ops-pick-sel img { width: 40px; height: 40px; object-fit: cover; border-radius: 7px; }
.ops-pick-size { margin-top: 2px; }
.ops-mis-form { display: flex; align-items: flex-start; gap: 12px; }
.ops-mis-sizes { display: flex; align-items: flex-end; gap: 10px; margin-top: 8px; }
.ops-mis-arrow { font-size: 20px; color: var(--muted); font-weight: 800; align-self: center; flex: none; }
.ops-mis-row { padding: 12px 2px; border-bottom: 1px solid var(--line); }
.ops-mis-row:last-child { border-bottom: none; }
.ops-mis-pair { display: flex; align-items: center; gap: 14px; }
.ops-mis-side { display: flex; flex-direction: column; align-items: center; gap: 5px; text-align: center; width: 130px; }
.ops-mis-side img, .ops-mis-noimg { width: 74px; height: 74px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.ops-mis-noimg { background: var(--panel2); }
.ops-mis-tag { font-size: 11px; font-weight: 800; padding: 2px 9px; border-radius: 999px; }
.ops-mis-tag.ok { background: var(--green-soft); color: #065f46; }
.ops-mis-tag.bad { background: var(--red-soft); color: var(--red-strong); }
.ops-mis-nm { font-size: 12px; line-height: 1.35; word-break: keep-all; }
.ex-mis-wrap { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.ex-mis-title { font-weight: 700; font-size: 13px; margin-bottom: 10px; }
@media (max-width: 640px) {
  .ops-mis-form { flex-direction: column; }
  .ops-mis-form .ops-mis-arrow { align-self: flex-start; transform: rotate(90deg); }
}

/* 오배송 상세 박스: 맞교환 폼 2단 전체폭으로 (div라 label.full 규칙 미적용 보정) */
.exchange-form .ex-mis-wrap { grid-column: 1 / -1; }
/* 검색 드롭다운: 좁은 피커 안에서 상품명이 글자당 줄바꿈되지 않도록 */
.ops-pick .scr-suggest { min-width: 220px; }
.scr-sg-item span { min-width: 0; word-break: keep-all; }

/* ── 환불양식 생성기: 메타(담당자·특이사항) ─────────────── */
.refund-meta { display: flex; gap: 10px; flex-wrap: wrap; }
.refund-meta .refund-staff { flex: 1; min-width: 160px; white-space: nowrap; }
.refund-meta .refund-staff > input { min-width: 0; }
#refundSave { display: inline-flex; align-items: center; gap: 5px; background: var(--red); color: #fff; border: none; padding: 5px 11px; border-radius: 7px; font-size: 12px; font-weight: 600; cursor: pointer; }
#refundSave:hover { background: var(--red-strong); }
#refundSave svg { width: 13px; height: 13px; }

/* ── 환불기록 보드 ───────────────────────────────────── */
.rl-group { margin-bottom: 18px; }
.rl-group-h { font-size: 13px; font-weight: 800; color: var(--text-soft); padding: 6px 2px; border-bottom: 2px solid var(--line); margin-bottom: 6px; }
.rl-group-n { display: inline-block; background: var(--panel2); color: var(--muted); border-radius: 999px; padding: 1px 8px; font-size: 11px; margin-left: 4px; }
.rl-row { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; overflow: hidden; background: var(--panel); }
.rl-sum { display: flex; align-items: center; gap: 10px; padding: 11px 13px; cursor: pointer; }
.rl-sum:hover { background: var(--panel2); }
.rl-buyer { font-weight: 700; min-width: 70px; white-space: nowrap; flex: none; }
.rl-chip { font-family: inherit; font-size: 11.5px; color: var(--text-soft); background: var(--panel2); border-radius: 6px; padding: 2px 7px; white-space: nowrap; flex: none; }
.rl-amt { font-weight: 800; color: var(--red); white-space: nowrap; flex: none; }
.rl-sub { font-size: 12px; color: var(--muted); margin-left: auto; white-space: nowrap; }
.rl-caret { width: 15px; height: 15px; color: var(--muted); transition: transform 0.15s; flex: none; }
.rl-row.open .rl-caret { transform: rotate(180deg); }
.rl-detail { display: none; padding: 4px 14px 14px; border-top: 1px solid var(--line); }
.rl-row.open .rl-detail { display: block; }
.rl-f { display: flex; gap: 10px; padding: 5px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.rl-f:last-of-type { border-bottom: none; }
.rl-k { color: var(--muted); min-width: 96px; flex: none; }
.rl-v { color: var(--text); word-break: break-all; }
.rl-actions { display: flex; gap: 8px; margin-top: 12px; }
@media (max-width: 640px) {
  .rl-sum { flex-wrap: wrap; }
  .rl-sub { margin-left: 0; width: 100%; }
}

/* 환불 완료 처리 버튼 (계좌건) */
.rl-refund { display: inline-flex; align-items: center; gap: 5px; background: var(--green); color: #fff; border: none; padding: 5px 11px; border-radius: 7px; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.rl-refund:hover { filter: brightness(0.95); }
.rl-refund svg { width: 13px; height: 13px; }

/* 환불기록: 상태 배지·요약·미처리 강조 */
.rl-summary { padding: 10px 14px; border-radius: 10px; background: var(--red-softer); color: var(--red-strong); border: 1px solid var(--red-soft); font-size: 13px; margin-bottom: 14px; }
.rl-summary.ok { background: var(--green-soft); color: #065f46; border-color: #a7f3d0; }
.rl-badge { font-size: 11px; font-weight: 800; padding: 2px 9px; border-radius: 999px; flex: none; white-space: nowrap; }
.rl-badge.pending { background: var(--red-soft); color: var(--red-strong); }
.rl-badge.done { background: var(--green-soft); color: #065f46; }
.rl-badge.auto { background: var(--panel2); color: var(--muted); }
.rl-row.is-pending { border-color: var(--red-soft); }
.rl-row.is-pending .rl-sum { background: var(--red-softer); }
.rl-sum .rl-refund { margin-left: 8px; padding: 4px 9px; }

/* ── 배송보류 해제 ───────────────────────────────────── */
.hr-input { display: flex; flex-direction: column; gap: 10px; }
.hr-input textarea { width: 100%; box-sizing: border-box; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 10px; font-size: 13px; font-family: inherit; resize: vertical; }
.hr-input textarea:focus { outline: 0; border-color: var(--red); box-shadow: 0 0 0 3px var(--red-softer); }
.hr-run { background: var(--red); color: #fff; }
.hr-run:hover { background: var(--red-strong); }
.hr-row { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.hr-row.nomatch { border-color: var(--red-soft); background: var(--red-softer); }
.hr-row-head { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.hr-col-match { flex: 1 1 260px; min-width: 0; }
.hr-col-sizes { flex: 2 1 320px; display: flex; flex-wrap: wrap; gap: 6px; align-content: flex-start; }
.hr-col-safety { flex: none; }
.hr-col-safety input { width: 84px; }
.hr-matched { display: flex; align-items: center; gap: 10px; }
.hr-matched img, .hr-matched .scr-sel-noimg { width: 46px; height: 46px; border-radius: 8px; object-fit: cover; }
.hr-mname { font-weight: 700; font-size: 13px; word-break: keep-all; }
.hr-ok { font-size: 11.5px; color: var(--green); font-weight: 700; }
.hr-input-name { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.hr-warn { color: var(--red); font-size: 11.5px; font-weight: 700; margin-left: 4px; }
.hr-sz { background: var(--panel2); border: 1px solid var(--line); border-radius: 7px; padding: 3px 9px; font-size: 12.5px; white-space: nowrap; }
.hr-sz b { color: var(--red); }
.hr-prev-wrap:not(:empty) { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.hr-prev { display: flex; flex-wrap: wrap; gap: 6px; }
.hr-pv { font-size: 12px; background: var(--green-soft); color: #065f46; border-radius: 7px; padding: 3px 9px; white-space: nowrap; }
.hr-pv.zero { background: var(--panel2); color: var(--muted); }
.hr-done { display: inline-block; font-size: 11px; font-weight: 700; color: #065f46;
  background: var(--green-soft); border-radius: 6px; padding: 1px 7px; white-space: nowrap; }
.hr-fail { color: var(--red); font-weight: 700; }
.hr-runlog { margin-top: 12px; max-height: 240px; overflow-y: auto; font-size: 12.5px; }
.hr-runlog:not(:empty) { border-top: 1px solid var(--line); padding-top: 10px; }
.hr-log-line { padding: 3px 0; color: var(--text-soft); }
.hr-log-line.ok { color: var(--green); } .hr-log-line.err { color: var(--red); }
.hr-log-line.done { font-weight: 800; margin-top: 4px; }

/* 배송보류 해제 결과 테이블 (보류해제/보류잔여/입고잔여) */
.hr-pv-table { border-collapse: collapse; font-size: 12.5px; margin-top: 4px; }
.hr-pv-table th, .hr-pv-table td { border: 1px solid var(--line); padding: 4px 12px; text-align: center; }
.hr-pv-table th { background: var(--panel2); color: var(--text-soft); font-weight: 700; }
.hr-pv-table td:first-child, .hr-pv-table th:first-child { font-weight: 700; }
.hr-pv-table tbody tr.hr-pv-zero td,
.hr-pv-table tbody tr.hr-pv-muted td { color: var(--muted); }
.hr-pv-table tbody tr.hr-pv-warn td { background: var(--amber-soft); }
.hr-pv-table tbody tr.hr-pv-bad td { background: var(--red-softer); }
.hr-pv-table tfoot td { background: var(--panel2); font-weight: 800; }
.hr-pv-table .hr-fail { color: var(--red); font-size: 11px; }

/* 입고처리 진열 토글 */
.pr-toggle { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--text-soft); cursor: pointer; user-select: none; }
.pr-toggle input { width: 16px; height: 16px; accent-color: var(--red); }

/* ── 다건송장검수 ── */
.wb-upload { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.wb-file-btn { display: inline-flex; align-items: center; gap: 7px; background: var(--red); color: #fff; padding: 9px 15px; border-radius: 9px; font-size: 13px; font-weight: 700; cursor: pointer; box-shadow: var(--shadow-sm); }
.wb-file-btn:hover { background: var(--red-strong); }
.wb-file-btn svg { width: 15px; height: 15px; }
.wb-search { position: relative; display: flex; align-items: center; }
.wb-search svg { position: absolute; left: 11px; width: 15px; height: 15px; color: var(--muted); pointer-events: none; }
.wb-search input { flex: 1; padding-left: 33px; }
.wb-legend { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; color: var(--text-soft); }
.wb-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.wb-dot.qty { background: #f87171; } .wb-dot.manual { background: #60a5fa; }
.wb-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.wb-table thead th { text-align: left; padding: 8px 10px; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; background: var(--panel); z-index: 1; }
.wb-table tbody td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.wb-table .wb-sun { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wb-table .wb-ord { color: var(--text-soft); white-space: nowrap; font-variant-numeric: tabular-nums; }
.wb-table .wb-recv { white-space: nowrap; }
.wb-recv-in { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.wb-recv-nm { font-weight: 600; }
.wb-mark-btn { padding: 2px 9px; font-size: 11px; white-space: nowrap; }
.wb-mark-btn.on { background: var(--blue-soft); border-color: var(--blue-soft); color: var(--blue-text); }
.wb-table .wb-status { white-space: nowrap; }
/* 2장 = 붉은 톤, 특이요청 = 파란 톤, 둘 다 = 보라 톤 + 좌측 강조선 */
.wb-table tr.wb-qty td { background: #fff1f2; }
.wb-table tr.wb-manual td { background: #eff6ff; }
.wb-table tr.wb-qty.wb-manual td { background: #faf5ff; }
.wb-table tr.wb-qty td:first-child { box-shadow: inset 3px 0 0 var(--red); }
/* 표시 대상 송장순번 정리 섹션 */
.wb-flagged { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px;
  padding: 12px 14px; background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; }
.wb-fgrp { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.wb-fgrp-t { font-size: 12px; font-weight: 700; color: var(--text-soft); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.wb-fchips { display: flex; flex-wrap: wrap; gap: 6px; }
.wb-fchip { font-size: 12px; padding: 3px 10px; border-radius: 999px; cursor: pointer;
  background: #fff; border: 1px solid var(--line); color: var(--text-soft); white-space: nowrap; }
.wb-fchip b { font-variant-numeric: tabular-nums; color: var(--text); }
.wb-fchip:hover { border-color: var(--line-strong); }
.wb-fchip.qty { background: #fff1f2; border-color: #fecdd3; }
.wb-fchip.manual { background: #eff6ff; border-color: #bfdbfe; }
.wb-fchip.qty.manual { background: #faf5ff; border-color: #e9d5ff; }
.wb-table tr.wb-flash td { animation: wbFlash 1.2s ease-out; }
@keyframes wbFlash { 0%, 40% { background: #fde68a; } 100% { background: transparent; } }
.wb-table tr.wb-manual td:first-child { box-shadow: inset 3px 0 0 #3b82f6; }
/* td엔 display:flex 주면 table-cell 깨져 행 배경이 끊김 → td는 일반 셀 유지(배경 정상),
   전역 td{max-width:280;overflow:hidden} 무력화 후 안쪽 div에서 flex 줄바꿈 */
.wb-prods { max-width: none; overflow: visible; white-space: normal; min-width: 240px; }
.wb-prods-in { display: flex; flex-wrap: wrap; gap: 5px; }
.wb-prod { display: inline-flex; align-items: center; gap: 3px; background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px; font-size: 11.5px; white-space: nowrap; }
.wb-track { font-variant-numeric: tabular-nums; color: var(--text-soft); white-space: nowrap; font-size: 11.5px; max-width: none; overflow: visible; }
.wb-memo { width: 22%; min-width: 150px; max-width: none; overflow: visible; }
.wb-memo-input { width: 100%; box-sizing: border-box; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; font-size: 11.5px; font-family: inherit; background: var(--panel); color: var(--text); }
.wb-memo-input:focus { outline: 0; border-color: var(--red); box-shadow: 0 0 0 2px var(--red-softer); }
.wb-prod.hi { background: var(--red-softer); border-color: #fecaca; color: var(--red-strong); font-weight: 700; }
.wb-hidtag { font-size: 9px; font-weight: 800; background: var(--red); color: #fff; padding: 0 4px; border-radius: 4px; }
.wb-more { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); }
.wb-badge { display: inline-block; font-size: 10.5px; font-weight: 800; padding: 2px 7px; border-radius: 999px; white-space: nowrap; }
.wb-badge.qty { background: var(--red); color: #fff; }
.wb-badge.manual { background: #3b82f6; color: #fff; }
.wb-badge.pend { background: var(--panel2); color: var(--muted); }
.wb-badge.warn { background: var(--amber-soft); color: #92400e; }
.wb-badge.ok { background: var(--green-soft); color: #065f46; }

/* ══════════ 모바일 셸 (≤768px) — 디스코드식 하단 탭바 + 풀시트 ══════════ */
/* 데스크탑에선 하단바·시트 완전 숨김 (렌더는 항상 되지만 표시는 모바일만) */
.mnav, .mnav-sheet { display: none; }

@media (max-width: 768px) {
  /* ── 레이아웃: 사이드바 숨기고 하단 탭바로 전환 ── */
  #side { display: none; }
  .app { display: block; height: auto; }
  #main {
    height: auto; min-height: 100vh; min-height: 100dvh;
    padding: 14px 12px calc(78px + env(safe-area-inset-bottom));
  }
  .head h1 { font-size: 18px; }
  .head h1 svg { width: 18px; height: 18px; }

  /* ── 하단 탭바 (아이콘 + 메뉴명) ── */
  .mnav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: var(--panel); border-top: 1px solid var(--line);
    padding: 5px 4px calc(5px + env(safe-area-inset-bottom));
    box-shadow: 0 -4px 16px rgba(0,0,0,0.07);
  }
  .mnav-item {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    background: transparent; border: 0; box-shadow: none; border-radius: 10px;
    padding: 6px 2px; color: var(--muted);
    font-size: 10px; font-weight: 700; font-family: inherit; line-height: 1.2;
  }
  .mnav-item:hover, .mnav-item:active { background: var(--side-hover); }
  .mnav-item svg { width: 21px; height: 21px; stroke-width: 1.9; }
  .mnav-item span {
    max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    word-break: keep-all;
  }
  .mnav-item.active { color: var(--red); }
  .mnav-item.active svg { stroke-width: 2.4; }

  /* ── 전체 메뉴 시트 ── */
  .mnav-sheet {
    display: flex; position: fixed; inset: 0; z-index: 70;
    background: rgba(0,0,0,0.4); align-items: flex-end;
  }
  .mnav-sheet-card {
    background: var(--panel); width: 100%; max-height: 80vh; max-height: 80dvh;
    border-radius: 18px 18px 0 0; display: flex; flex-direction: column;
    animation: mnavUp .18s ease-out;
  }
  @keyframes mnavUp { from { transform: translateY(28px); opacity: .5; } to { transform: none; opacity: 1; } }
  .mnav-sheet-head {
    display: flex; justify-content: space-between; align-items: center; flex-shrink: 0;
    padding: 14px 16px 10px; border-bottom: 1px solid var(--line); font-size: 14px;
  }
  .mnav-sheet-body { overflow-y: auto; padding: 4px 14px calc(18px + env(safe-area-inset-bottom)); }
  .mnav-gl {
    font-size: 10.5px; font-weight: 700; color: var(--muted);
    letter-spacing: 0.8px; margin: 14px 2px 6px; text-transform: uppercase;
  }
  .mnav-g-items { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
  .mnav-chip {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    background: var(--panel2); border: 1px solid var(--line); color: var(--text-soft);
    box-shadow: none; border-radius: 11px; padding: 11px 4px;
    font-size: 11px; font-weight: 600; font-family: inherit; min-width: 0;
  }
  .mnav-chip:hover { background: var(--side-hover); }
  .mnav-chip svg { width: 18px; height: 18px; }
  .mnav-chip span { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; word-break: keep-all; }
  .mnav-chip.active { background: var(--side-active-bg); color: var(--side-active-text); border-color: var(--red-soft); }
  .mnav-chip.locked { opacity: 0.45; }
  .mnav-chip em { font-style: normal; font-size: 9px; color: var(--muted); }
  .mnav-signout { width: 100%; margin-top: 18px; justify-content: center; }

  /* ── 공통: 모달 → 바닥 시트 (인라인 max-width 무시하고 전체폭) ── */
  .modal { align-items: flex-end; }
  .modal-card {
    width: 100%; max-width: none !important;
    max-height: 92vh; max-height: 92dvh; overflow-y: auto;
    border-radius: 18px 18px 0 0;
  }

  /* ── 공통: 폼 컨트롤 — iOS 포커스 줌 방지(16px) + 터치 타겟 ── */
  input, select, textarea { font-size: 16px !important; }
  button { min-height: 36px; }
  .toolbar input, .toolbar select { flex: 1 1 160px; min-width: 0; }
  .tablewrap, .log-scroll { -webkit-overflow-scrolling: touch; }

  /* ── 챗봇: 모바일 전체화면 (데스크탑 400px/right:24px 규칙보다 뒤라 여기가 우선) ── */
  .chat-fab { right: 16px; bottom: calc(70px + env(safe-area-inset-bottom)); }
  .chat-panel {
    z-index: 80;
    left: 8px; right: 8px; width: auto;
    top: calc(8px + env(safe-area-inset-top));
    bottom: calc(8px + env(safe-area-inset-bottom));
    height: auto; max-height: none; border-radius: 14px;
  }

  /* ── 우선 섹션: 포장리스트 · 스크래치 · 운영이슈 · 내 연차 ── */
  #oqTable td.oq-check input[type="checkbox"] { width: 20px; height: 20px; }
  .scr-reg .scr-form, .leave-form { max-width: none; }
  .scr-row { flex-wrap: wrap; }
  .scr-row .scr-field { min-width: 130px; }
  .ops-tabs { overflow-x: auto; padding-bottom: 2px; }
  .ops-tab { white-space: nowrap; flex: none; }
  .ops-stat-n { font-size: 19px; }
  .panel { padding: 14px 12px; }
  .panel h2 { flex-wrap: wrap; }
}

/* ── 모바일 잘림·오버플로 수정 (360px 전수 감사 결과) ── */
@media (max-width: 768px) {
  /* 자동화 입력(HHMM 등): 인라인 고정폭 해제 + 그룹 한 줄 전체 사용 */
  .actions-bar .action-group { display: flex; flex: 1 1 100%; }
  .actions-bar .action-input { width: auto !important; flex: 1; min-width: 0; }
  .actions-bar .action-group button { flex-shrink: 0; }
  /* 툴바 검색: 한 줄 전체 사용 (placeholder 잘림 방지) */
  .toolbar > input { flex: 1 1 100%; width: auto !important; }
  /* 맞교환 등록 모달: 2열 → 1열 (16px 폰트에서 카드 밖 넘침 방지) */
  .exchange-form { grid-template-columns: 1fr; }
  .exchange-form label, .exchange-form .ex-mis-wrap { min-width: 0; }
  .exchange-form input, .exchange-form textarea, .exchange-form select { min-width: 0; width: 100%; }
  /* 연차 시작/종료일: date 입력 고유폭이 그리드 칸보다 커서 화면 밖으로 삐지는 것 방지 */
  .leave-date-row > div { min-width: 0; }
  .leave-date-row input { width: 100%; min-width: 0; }
  /* 스크래치 로스율 행: 좁은 화면 줄바꿈 허용 */
  .loss-row { flex-wrap: wrap; }
  .loss-meta { white-space: normal; word-break: keep-all; }
}

/* ── 품절 안내 (nf) — 주문검색 → 상품선택 → 채널톡/복사 ── */
.nf-search { display: flex; align-items: center; gap: 8px; background: var(--panel2); border: 1px solid var(--line-strong); border-radius: 10px; padding: 4px 4px 4px 12px; }
.nf-search i { width: 18px; height: 18px; color: var(--muted); flex: none; }
.nf-search input { flex: 1; border: none; background: transparent; outline: none; font-size: 15px; padding: 10px 0; color: var(--text); }
.nf-search button { border: none; background: var(--red); color: #fff; font-weight: 700; font-size: 14px; padding: 9px 18px; border-radius: 8px; cursor: pointer; flex: none; }
.nf-search button:hover { opacity: .9; }
.nf-hint { font-size: 12px; color: var(--muted); margin-top: 8px; line-height: 1.5; }
.nf-result { margin-top: 14px; }
.nf-loading, .nf-empty { padding: 18px; text-align: center; color: var(--muted); font-size: 14px; }
.nf-empty.err { color: var(--red-strong); }
.nf-list { display: flex; flex-direction: column; gap: 8px; }
.nf-card { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; cursor: pointer; box-shadow: none; transition: border-color .12s, background .12s; }
.nf-card:hover { border-color: var(--text-soft); background: var(--side-hover); }
.nf-card-l { flex: 1; min-width: 0; }
.nf-card-top { display: flex; align-items: center; gap: 6px; }
.nf-card-name { font-weight: 700; font-size: 15px; }
.nf-card-sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.nf-card-arrow { width: 18px; height: 18px; color: var(--muted); flex: none; }
.nf-badge { font-size: 10.5px; font-weight: 800; padding: 1px 8px; border-radius: 20px; white-space: nowrap; }
.nf-badge.member { background: var(--blue-soft); color: var(--blue-text); }
.nf-badge.guest { background: var(--panel2); color: var(--muted); }
.nf-back { display: inline-flex; align-items: center; gap: 4px; background: none; border: none; color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; padding: 4px 0; margin-bottom: 8px; }
.nf-back:hover { color: var(--text); }
.nf-back i { width: 15px; height: 15px; }
.nf-buyer { display: flex; align-items: center; gap: 12px; background: var(--panel2); border-radius: 12px; padding: 12px 14px; }
.nf-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--text); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 17px; flex: none; }
.nf-buyer-name { font-weight: 700; font-size: 15.5px; display: flex; align-items: center; gap: 6px; }
.nf-buyer-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.nf-warn { background: var(--red-softer); color: var(--red-strong); font-size: 13px; padding: 9px 12px; border-radius: 8px; margin-top: 10px; }
.nf-field { margin-top: 16px; }
.nf-label { display: block; font-size: 13px; font-weight: 700; color: var(--text-soft); margin-bottom: 8px; }
.nf-items { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.nf-item { display: flex; align-items: center; gap: 10px; padding: 11px 13px; cursor: pointer; border-bottom: 1px solid var(--line); transition: background .1s; }
.nf-item:last-child { border-bottom: none; }
.nf-item:hover { background: var(--side-hover); }
.nf-item input { width: 17px; height: 17px; accent-color: var(--blue-text); flex: none; }
.nf-item-img { width: 42px; height: 42px; border-radius: 8px; object-fit: cover; background: var(--panel2); border: 1px solid var(--line); flex: none; }
.nf-item-name { flex: 1; font-size: 14px; }
.nf-item-name em { color: var(--muted); font-style: normal; font-size: 13px; }
.nf-item-qty { font-size: 12.5px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.nf-muted { padding: 12px; color: var(--muted); font-size: 13px; }
.nf-seg { display: inline-flex; background: var(--panel2); border-radius: 9px; padding: 3px; gap: 2px; }
.nf-seg-opt { position: relative; cursor: pointer; }
.nf-seg-opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.nf-seg-opt span { display: block; padding: 7px 18px; border-radius: 7px; font-size: 13.5px; font-weight: 600; color: var(--text-soft); transition: background .1s, color .1s; }
.nf-seg-opt input:checked + span { background: var(--panel); color: var(--text); box-shadow: var(--shadow-sm); }
.nf-msg { width: 100%; box-sizing: border-box; border: 1px solid var(--line-strong); border-radius: 10px; padding: 12px 14px; font-family: inherit; font-size: 14px; line-height: 1.6; resize: vertical; color: var(--text); background: var(--panel); }
.nf-msg:focus { outline: none; border-color: var(--text-soft); }
.nf-actions { display: flex; gap: 8px; margin-top: 14px; }
.nf-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 9px; font-weight: 700; font-size: 14px; padding: 11px 18px; cursor: pointer; border: 1px solid transparent; }
.nf-btn i { width: 16px; height: 16px; }
.nf-btn.ghost { background: var(--panel); border-color: var(--line-strong); color: var(--text); }
.nf-btn.ghost:hover { background: var(--side-hover); }
.nf-btn.channel { flex: 1; background: #6f4cff; color: #fff; box-shadow: 0 2px 8px rgba(111, 76, 255, .3); }
.nf-btn.channel:hover { background: #5c39f0; }
.nf-btn.channel:disabled { box-shadow: none; }
.nf-btn.channel svg { width: 17px; height: 17px; }
.nf-btn:disabled { opacity: .5; cursor: default; }
.nf-status { margin-top: 12px; }
.nf-status:empty { margin: 0; }
.nf-status-ok { background: var(--green-soft); color: #14532d; font-size: 13.5px; padding: 10px 13px; border-radius: 9px; line-height: 1.5; }
.nf-status-err { background: var(--red-softer); color: var(--red-strong); font-size: 13.5px; padding: 10px 13px; border-radius: 9px; line-height: 1.5; }
