/* erp.app.css — PRINTCANVAS ERP 실제 앱용 (자동 생성: make_app_css.py ← erp.css · 2026-11-13)
   시안 erp.css와 규칙·값이 같다. 다른 점 3가지만:
   1) @container erp (…) → @media (…)  — 앱은 창 전체가 화면이므로
   2) .erp-frame.is-m 레이어 규칙(탭바·시트·토스트) → @media (max-width: 734px) 안으로
   3) 시안 도구(.proto · 규칙 보기 · 모바일 미리보기 프레임) 뺌
   직접 고치지 말고 erp.css를 고친 뒤 다시 만든다. */
/* =====================================================================
   PRINTCANVAS ERP(신 ERP) — erp.css v1 (2026-11-13, Cowork)
   design/tokens.css(자사몰 애플 체계 tokens v1.1) 위에 얹는 ERP 전용 토큰 + 화면 부품.
   앱은 tokens.css → erp.css 순서로 불러 쓴다. 색·크기·간격·모션 값을 앱 코드에 직접 쓰지 않는다.
   출처 태그: [HIG] 애플 공식 · [KIT] 키트 실측 · [WEB] apple.com 실측 · [API] 개발자 문서
             [USER] 사용자 결정 · [JUDG] Cowork 판단(애플 규칙 아님)
   원칙: design/ERP_UI_원칙.md — 초직관, 감도 장치 없음(글라스·사진·등장 모션 미사용) [USER 2026-11-13]
   라이트 화면만 만든다 — 다크 미제작 [USER 2026-11-13]
   ===================================================================== */

:root {
  --erp-sidebar-w: 240px;   /* [JUDG] 사이드바 폭 (행 44 [HIG sidebars]) */
  --erp-row: 44px;          /* [HIG] 히트 44 — 데이터 표 행 */
  --erp-cell-w: 76px;       /* [JUDG] 재고 칸 — '3XL'·'1,234' 한 줄 */
  --erp-cell-in-w: 96px;    /* [JUDG] 입력 칸 — 캡션 '→ 1,220' */
  --erp-cell-h: 56px;       /* [KIT] 행 52 + 2줄 숫자 여유 [JUDG] */
  --erp-pad: 32px;          /* [JUDG] 화면 여백 (예외 WEB-SECTION-01: 업무 도구 밀도) */
  --erp-pad-m: 16px;        /* [KIT] iPhone 레이아웃 마진 16 */
  --erp-gap: 32px;          /* [JUDG] 블록 간격 */
  --erp-max: 1260px;        /* [WEB] --global-content-max-width */
  --erp-panel-w: 380px;     /* [JUDG] 오른쪽 패널(인스펙터) */
  --erp-tab-h: 56px;        /* [JUDG] 모바일 탭바 (탭 버튼 72×54 [KIT] ≈) */
  --erp-dialog-w: 340px;    /* [JUDG] 알림 창 (iOS 300 [KIT]보다 한국어 문장 여유) */
  --erp-elev: var(--bg);    /* [HIG dark-mode] 떠 있는 층 = elevated */
  --erp-seg-thumb: var(--bg);                  /* [KIT] 세그먼트 선택 필 */
  --erp-seg-shadow: 0 1px 4px rgba(0,0,0,.12); /* [JUDG] */
  --erp-panel-shadow: -12px 0 32px rgba(0,0,0,.08); /* [JUDG] --lift-shadow 방향 변형 */
  --erp-field-line: var(--label-3);            /* [JUDG] 입력칸 테두리 — 비텍스트 대비 3:1 (#86868B on #FFF ≈ 3.6) */
  --erp-toast-bg: var(--label);   /* [JUDG] 토스트 = 반전 */
  --erp-toast-fg: var(--bg);
  --erp-toast-warn: #FF9F0A;      /* [HIG] systemOrange(다크) — 반전 토스트 위 아이콘, #1D1D1F 대비 8.2 */
  --erp-toast-link: #2997FF;      /* [WEB] 다크 섹션 링크 */
}

/* ---------- 바탕 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--label);
  font-family: var(--font-sans); font-size: var(--fs-body); line-height: var(--lh-body); letter-spacing: var(--ls-body);
  -webkit-font-smoothing: antialiased; font-synthesis-weight: none;
}
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
svg { flex: none; }
.ico { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; } /* [JUDG-ICON-01] Lucide */
.ico--24 { width: 24px; height: 24px; }
.num { font-family: var(--font-latin); font-variant-numeric: tabular-nums; } /* [JUDG-FONT-01] 숫자 = Inter tabular */
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; } /* [HIG-A11Y-01] */
.skip { position: absolute; left: 16px; top: -100px; z-index: 100; background: var(--bg); color: var(--link); padding: 0 16px; min-height: 44px; display: inline-flex; align-items: center; border-radius: var(--r-form); }
.skip:focus { top: 16px; }

/* 타입 [WEB]·[HIG] — 스케일 안에서만 */
.t-h1 { font-size: var(--fs-eyebrow); line-height: var(--lh-eyebrow); font-weight: var(--fw-semibold); letter-spacing: var(--ls-eyebrow); }
.t-title { font-size: var(--fs-title); line-height: var(--lh-title); font-weight: var(--fw-semibold); letter-spacing: var(--ls-title); }
.t-body { font-size: var(--fs-body); line-height: var(--lh-body); }
.t-callout { font-size: var(--fs-callout); line-height: var(--lh-callout); letter-spacing: var(--ls-callout); }
.t-sub { font-size: var(--fs-subhead); line-height: var(--lh-subhead); letter-spacing: var(--ls-subhead); }
.t-foot { font-size: var(--fs-footnote); line-height: var(--lh-footnote); letter-spacing: var(--ls-footnote); }
.c2 { color: var(--label-2); }
.c-red { color: var(--red); } .c-orange { color: var(--orange); } .c-green { color: var(--green); }
.w6 { font-weight: var(--fw-semibold); }

/* ---------- 프레임 · 셸 ---------- */
/* .erp-scroll = 컨테이너 쿼리 기준, 734 이하 = 모바일 [WEB 브레이크포인트] [JUDG-CQ-01]
   탭바·패널·토스트는 .erp-scroll 밖(고정 위치가 화면 기준이 되도록) — 프레임 폭에 따라 런타임이 .erp-frame.is-m을 붙인다.
   실제 앱(전체 화면)에서는 @container·.is-m 대신 @media (max-width: 734px) 하나로 바꿔도 같다. */
.erp-frame { position: relative; }
.erp-scroll { container: erp / inline-size; min-height: 100dvh; }
.erp { display: grid; grid-template-columns: var(--erp-sidebar-w) minmax(0, 1fr); min-height: 100dvh; }

.erp-side {
  position: sticky; top: 0; height: 100dvh; overflow: auto;
  display: flex; flex-direction: column; gap: 2px; padding: 20px 12px 16px;
  background: var(--bg-2); border-right: 1px solid var(--sep);
}
.brand { padding: 4px 12px 20px; }
.brand__name { font-family: var(--font-latin); font-size: var(--fs-body); line-height: var(--lh-body-tight); font-weight: var(--fw-semibold); white-space: nowrap; } /* 이름 PRINTCANVAS ERP [USER 2026-11-13] — 한 줄(17 semibold ≈156px) [JUDG] */
.brand__en { font-family: var(--font-latin); font-size: var(--fs-footnote); line-height: var(--lh-footnote); color: var(--label-2); letter-spacing: 0; }
.nav-i {
  display: flex; align-items: center; gap: 12px; min-height: var(--erp-row); padding: 0 12px;
  border-radius: var(--r-form); color: var(--label); text-decoration: none;
  font-size: var(--fs-body); line-height: var(--lh-body-tight); font-weight: var(--fw-medium);
  transition: background-color var(--dur-fast) var(--ease-standard);
  -webkit-tap-highlight-color: transparent;
}
.nav-i .ico { color: var(--label-2); }
.nav-i[aria-current="page"] { background: var(--bg); box-shadow: 0 0 0 1px var(--sep); font-weight: var(--fw-semibold); } /* [JUDG] 회색 사이드바 위 흰 선택 — 배지·보조 글자 대비 4.5 유지 */
.nav-i[aria-current="page"] .ico { color: var(--accent); }
.nav-i__n { margin-left: auto; font-size: var(--fs-subhead); color: var(--label-2); font-weight: var(--fw-medium); }
.nav-i__n.is-warn { color: var(--orange); }
.side-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--sep); display: flex; flex-direction: column; gap: 2px; }
.me { display: flex; align-items: center; gap: 8px; padding: 8px 12px 0; }
.me__name { font-size: var(--fs-subhead); line-height: var(--lh-subhead); font-weight: var(--fw-semibold); }
.me__role { font-size: var(--fs-footnote); line-height: var(--lh-footnote); color: var(--label-2); }

.erp-main { min-width: 0; padding: var(--erp-pad); display: flex; flex-direction: column; }
.erp-main > .wrap { flex: 1 0 auto; display: flex; flex-direction: column; width: 100%; }
.wrap { max-width: var(--erp-max); margin: 0 auto; }
.bar-sp { flex: 1 0 24px; } /* [JUDG] 내용이 짧아도 요약 바는 화면 아래에 */

/* 머리: 제목(할 일) + 설명 + 주 버튼 1개 [ERP-01] */
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.head__desc { margin-top: 4px; font-size: var(--fs-subhead); line-height: var(--lh-subhead); color: var(--label-2); }
.head h1:focus { outline: none; }
.back { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; margin: -8px 0 4px -6px; padding: 0 6px; color: var(--link); text-decoration: none; font-size: var(--fs-callout); border-radius: var(--r-form); }
.sec { margin-top: var(--erp-gap); }
.sec__t { font-size: var(--fs-title); line-height: var(--lh-title); font-weight: var(--fw-semibold); margin-bottom: 12px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }

/* ---------- 버튼 [HIG buttons] [WEB-BTN-01] ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--h-btn); min-width: 44px; padding: 0 20px; border: 0; border-radius: var(--r-capsule);
  font-size: var(--fs-body); line-height: var(--lh-body-tight); font-weight: var(--fw-medium);
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color var(--dur-instant) var(--ease-standard), color var(--dur-instant) var(--ease-standard), transform var(--dur-spring) var(--spring-snappy);
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.btn:active { transform: scale(var(--press-scale)); transition-duration: var(--dur-instant); } /* [JUDG-MOTION-03] */
.btn--prominent { background: var(--accent); color: var(--accent-fg); }
.btn--bordered { background: var(--fill-3); color: var(--label); }
.btn--borderless { background: transparent; color: var(--link); padding: 0 12px; }
.btn--danger { background: var(--red-bg); color: var(--red); } /* [HIG-ALERT-01] 파괴 = 빨강 글자 + 빨강 틴트(대비 4.5) */
.btn--lg { min-height: var(--h-btn-lg); }
.btn--block { width: 100%; }
.btn--start { justify-content: flex-start; }
.btn--icon { padding: 0; width: 44px; }
.btn .ico { width: 20px; height: 20px; }
.btn--busy { pointer-events: none; }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: erp-spin .8s linear infinite; } /* [JUDG-MOTION-04] reduce에서도 유지 */
@keyframes erp-spin { to { transform: rotate(360deg); } }
@media (hover: hover) {
  .btn--prominent:hover { filter: brightness(1.08); }
  .btn--bordered:hover { background: var(--fill-2); }
  .btn--borderless:hover { background: var(--fill-4); }
  .btn--danger:hover { background: var(--fill-3); }
  .nav-i:hover { background: var(--fill-4); }
  .nav-i[aria-current="page"]:hover { background: var(--bg); }
}

/* ---------- 입력 [HIG text-fields] [HIG-FORM-01] ---------- */
.fld { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fld__l { font-size: var(--fs-subhead); line-height: var(--lh-subhead); font-weight: var(--fw-semibold); }
.fld__h { font-size: var(--fs-footnote); line-height: var(--lh-footnote); color: var(--label-2); }
.fld__e { font-size: var(--fs-subhead); line-height: var(--lh-subhead); color: var(--red); display: flex; gap: 6px; align-items: flex-start; }
.inp {
  min-height: var(--erp-row); width: 100%; padding: 0 14px; border-radius: var(--r-field);
  border: 1px solid var(--erp-field-line); background: var(--bg); color: var(--label);
  font-size: var(--fs-body); line-height: var(--lh-body-tight);
  transition: border-color var(--dur-fast) var(--ease-standard);
}
.inp::placeholder { color: var(--placeholder); }
.inp:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 1px var(--accent); }
.inp[aria-invalid="true"] { border-color: var(--red); }
select.inp { padding-right: 8px; cursor: pointer; }
.inp--num { width: 120px; text-align: right; }
.search { position: relative; flex: 1 1 260px; max-width: 420px; }
.search .ico { position: absolute; left: 14px; top: 12px; color: var(--label-2); pointer-events: none; }
.search .inp { padding-left: 42px; border-radius: var(--r-capsule); background: var(--fill-3); border-color: transparent; } /* [KIT] 검색 44 캡슐 */
.search .inp:focus { background: var(--bg); border-color: var(--accent); }
.row-flds { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-end; }
.row-flds > .fld { flex: 1 1 200px; }

/* ---------- 칩 · 세그먼트 [HIG-FILTER-01] [HIG-SEG-01] ---------- */
.tools { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 20px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: var(--erp-row); padding: 0 16px;
  border: 0; border-radius: var(--r-capsule); background: var(--fill-3); color: var(--label);
  font-size: var(--fs-subhead); line-height: var(--lh-subhead); font-weight: var(--fw-medium); cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-standard), color var(--dur-fast) var(--ease-standard);
}
.chip[aria-pressed="true"] { background: var(--label); color: var(--bg); }
.chip__n { font-family: var(--font-latin); font-variant-numeric: tabular-nums; }
@media (hover: hover) { .chip:hover { background: var(--fill-2); } .chip[aria-pressed="true"]:hover { background: var(--label); } }

.seg { position: relative; display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 3px; min-height: 50px; border-radius: var(--r-capsule); background: var(--fill-3); }
.seg__opt {
  position: relative; z-index: 1; min-height: var(--erp-row); padding: 0 22px; border: 0; border-radius: var(--r-capsule);
  background: transparent; color: var(--label); font-size: var(--fs-body); line-height: var(--lh-body-tight); font-weight: var(--fw-medium);
  cursor: pointer; white-space: nowrap; -webkit-tap-highlight-color: transparent;
}
.seg__opt[aria-checked="true"] { font-weight: var(--fw-semibold); }
.seg__ind {
  position: absolute; z-index: 0; top: 3px; bottom: 3px; left: 0; width: 0; border-radius: var(--r-capsule);
  background: var(--erp-seg-thumb); box-shadow: var(--erp-seg-shadow);
  transition: transform var(--dur-base) var(--spring-smooth), width var(--dur-base) var(--spring-smooth); /* [JUDG-MOTION-02] 240ms */
}
.seg-desc { margin-top: 8px; font-size: var(--fs-subhead); line-height: var(--lh-subhead); color: var(--label-2); }

/* ---------- 상태 글자 [JUDG-STATUS-01] — 점 + 글자, 색만으로 전달 금지 [HIG-COLOR-06] ---------- */
.st { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-subhead); line-height: var(--lh-subhead); font-weight: var(--fw-semibold); white-space: nowrap; }
.st::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.st--hold { color: var(--orange); }
.st--paid { color: var(--link); } /* [WEB] #0066CC — 작은 글자 대비 5.6 */
.st--done { color: var(--green); }
.st--cancel { color: var(--label-2); }

/* ---------- 홈: 숫자 카드 · 자주 하는 일 · 연결 상태 ---------- */
.conn { display: flex; align-items: center; gap: 8px; font-size: var(--fs-subhead); line-height: var(--lh-subhead); color: var(--label-2); margin-bottom: 20px; }
.conn > .ico { color: var(--green); }
.conn.is-off > .ico { color: var(--red); }
.conn .link { display: inline-flex; align-items: center; min-height: 44px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-height: 140px; padding: 20px;
  border: 0; border-radius: var(--r-card); background: var(--bg-2); color: var(--label); text-align: left; cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-standard), transform var(--dur-spring) var(--spring-snappy);
  -webkit-tap-highlight-color: transparent;
}
.stat:active { transform: scale(var(--press-scale)); transition-duration: var(--dur-instant); }
@media (hover: hover) { .stat:hover { background: var(--fill-3); } }
.stat__l { font-size: var(--fs-subhead); line-height: var(--lh-subhead); color: var(--label-2); font-weight: var(--fw-medium); }
.stat__n { font-size: var(--fs-sub); line-height: var(--lh-sub); font-weight: var(--fw-semibold); }
.stat__u { font-size: var(--fs-body); font-weight: var(--fw-medium); color: var(--label-2); margin-left: 2px; }
.stat__h { margin-top: auto; font-size: var(--fs-footnote); line-height: var(--lh-footnote); color: var(--label-2); }
.stat__h2 { display: block; } /* 둘째 줄 — 카카오 카드: 출고 기다림 [⑧] */
.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }

/* 기록 줄 */
.recs { border-top: 1px solid var(--sep); }
.rec { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; gap: 16px; align-items: center; min-height: var(--h-row); padding: 8px 0; border-bottom: 1px solid var(--sep); }
.rec__t { font-size: var(--fs-subhead); color: var(--label-2); }
.rec__d { min-width: 0; }
.rec__s { display: block; font-size: var(--fs-footnote); line-height: var(--lh-footnote); color: var(--label-2); }
.rec__q { font-weight: var(--fw-semibold); text-align: right; }
.link { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; color: var(--link); text-decoration: none; font-size: var(--fs-callout); font-weight: var(--fw-medium); border-radius: var(--r-form); }

/* ---------- 재고: 상품 목록 + 색상 × 사이즈 표 [ERP-03] ---------- */
.stock { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px; align-items: start; }
.stock > * { min-width: 0; }
.stock.has-panel { grid-template-columns: minmax(0, 1fr); padding-right: calc(var(--erp-panel-w) - var(--erp-pad) + 8px); } /* [JUDG] 패널을 열면 상품 목록을 접어 표가 가려지지 않게 */
.stock.has-panel .plist { display: none; }
.stock.has-panel .psel { display: flex; margin-bottom: 16px; max-width: 420px; }
.plist { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 2px; }
.plist__cat { padding: 16px 12px 4px; font-size: var(--fs-footnote); line-height: var(--lh-footnote); font-weight: var(--fw-semibold); color: var(--label-2); }
.plist__cat:first-child { padding-top: 0; }
.pitem {
  display: flex; flex-direction: column; justify-content: center; gap: 2px; width: 100%; min-height: var(--h-row); padding: 6px 12px;
  border: 0; border-radius: var(--r-form); background: transparent; color: var(--label); text-align: left; cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-standard); -webkit-tap-highlight-color: transparent;
}
.pitem[aria-current="true"] { background: var(--bg-2); } /* [JUDG] 보조 글자 대비 4.6 */
.pitem[aria-current="true"] .pitem__n { font-weight: var(--fw-semibold); }
@media (hover: hover) { .pitem:hover { background: var(--fill-4); } .pitem[aria-current="true"]:hover { background: var(--bg-2); } }
.pitem__n { font-size: var(--fs-body); line-height: var(--lh-body-tight); font-weight: var(--fw-medium); }
.pitem__s { font-size: var(--fs-footnote); line-height: var(--lh-footnote); color: var(--label-2); }
.psel { display: none; }

.mx-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.legend { margin-top: 12px; font-size: var(--fs-footnote); line-height: var(--lh-footnote); color: var(--label-2); }
.mx-wrap { overflow-x: auto; border: 1px solid var(--sep); border-radius: var(--r-card); background: var(--bg); -webkit-overflow-scrolling: touch; }
.mx { width: 100%; border-collapse: separate; border-spacing: 0; }
.mx th { height: var(--erp-row); padding: 0 8px; font-size: var(--fs-subhead); font-weight: var(--fw-semibold); color: var(--label-2); text-align: center; border-bottom: 1px solid var(--sep); background: var(--bg); white-space: nowrap; }
.mx td { height: var(--erp-cell-h); padding: 0; text-align: center; border-bottom: 1px solid var(--sep); }
.mx tbody tr:last-child td { border-bottom: 0; }
.mx tfoot td { border-top: 1px solid var(--sep); border-bottom: 0; font-weight: var(--fw-semibold); }
.mx tbody .mx__c, .mx tbody .mx__tot { padding-bottom: var(--lh-footnote) !important; } /* [JUDG] 숫자 줄과 색상 이름·합계를 같은 높이에 */
.mx__c { position: sticky; left: 0; z-index: 1; min-width: 150px; padding: 0 16px !important; text-align: left !important; background: var(--bg); border-right: 1px solid var(--sep); }
.mx__cn { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.sw { width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--sep); display: inline-block; flex: none; }
.mx__tot { border-left: 1px solid var(--sep); font-weight: var(--fw-semibold); min-width: 88px; padding: 0 12px !important; }
.mx__cell {
  width: 100%; min-width: var(--erp-cell-w); height: var(--erp-cell-h); padding: 0 6px; border: 0; background: transparent; color: var(--label);
  display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-standard); -webkit-tap-highlight-color: transparent;
}
.mx__cell.is-sel { box-shadow: inset 0 0 0 2px var(--accent); }
@media (hover: hover) { .mx__cell:hover { background: var(--fill-4); } }
.mx__num { font-size: var(--fs-title); line-height: var(--lh-title); font-weight: var(--fw-semibold); } /* [ERP-02] */
.mx__sub { font-size: var(--fs-footnote); line-height: var(--lh-footnote); color: var(--label-2); white-space: nowrap; }
.is-soldOut .mx__num { color: var(--red); font-size: var(--fs-body); }   /* [ERP-04] '품절' 글자 */
.is-low .mx__num { color: var(--orange); }
.is-low .mx__sub { color: var(--orange); }

/* 입력 표 [ERP-09] */
.mx--in .mx__in-td { padding: 6px 6px 4px; }
.mx__in {
  width: var(--erp-cell-in-w); min-height: var(--erp-row); padding: 0 10px; border-radius: var(--r-field);
  border: 1px solid var(--erp-field-line); background: var(--bg); color: var(--label); text-align: right;
  font-family: var(--font-latin); font-variant-numeric: tabular-nums; font-size: var(--fs-title); font-weight: var(--fw-semibold);
  transition: border-color var(--dur-fast) var(--ease-standard);
}
.mx__in:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.mx__in::placeholder { color: var(--label-4); font-weight: var(--fw-regular); }
.has-val .mx__in { border-color: var(--accent); }
.mx__cap { display: block; margin-top: 2px; font-size: var(--fs-footnote); line-height: var(--lh-footnote); color: var(--label-2); white-space: nowrap; }
.mx__cap.is-neg { color: var(--red); font-weight: var(--fw-semibold); }

/* 하단 고정 요약 바 — 불투명 + 헤어라인(글라스 아님) [ERP 원칙 §4] */
.bar {
  position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin: 0 calc(var(--erp-pad) * -1) calc(var(--erp-pad) * -1); padding: 12px var(--erp-pad);
  background: var(--bg); border-top: 1px solid var(--sep);
}
.bar__sum { min-width: 0; font-size: var(--fs-subhead); line-height: var(--lh-subhead); color: var(--label-2); }
.bar__sum strong { display: block; font-size: var(--fs-body); line-height: var(--lh-body-tight); color: var(--label); font-weight: var(--fw-semibold); }
.bar__msg { display: flex; gap: 6px; align-items: flex-start; margin-top: 4px; color: var(--red); font-size: var(--fs-subhead); line-height: var(--lh-subhead); }

/* ---------- 일반 표 ---------- */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { height: var(--erp-row); padding: 0 12px; font-size: var(--fs-subhead); font-weight: var(--fw-semibold); color: var(--label-2); text-align: left; border-bottom: 1px solid var(--sep); white-space: nowrap; }
.tbl td { height: var(--h-row); padding: 4px 12px; border-bottom: 1px solid var(--sep); vertical-align: middle; } /* [KIT] 행 52 고정 */
.tbl .r { text-align: right; }
.tbl .nowrap { white-space: nowrap; }
.tbl tr.is-child td { background: var(--bg-3); font-size: var(--fs-subhead); }
.tbl tr.is-undone td { color: var(--label-2); }
.cell-btn { display: inline-flex; align-items: center; min-height: 44px; padding: 0; border: 0; background: transparent; color: var(--label); font-weight: var(--fw-semibold); text-align: left; cursor: pointer; border-radius: var(--r-form); }
@media (hover: hover) { .cell-btn:hover { color: var(--link); } }
.chk { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; cursor: pointer; }
.chk input { width: 20px; height: 20px; accent-color: var(--accent); cursor: pointer; margin: 0; }
.disc { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 44px; height: 44px; border: 0; background: transparent; color: var(--label-2); border-radius: var(--r-form); cursor: pointer; }
.disc .ico { transition: transform var(--dur-base) var(--ease-out); }
.disc[aria-expanded="true"] .ico { transform: rotate(90deg); }

/* ---------- 단계 [HIG-PROGRESS-01] · 드롭존 [HIG-DND-01] ---------- */
.steps { display: flex; gap: 8px 20px; flex-wrap: wrap; margin-bottom: 24px; }
.step { display: flex; align-items: center; gap: 8px; font-size: var(--fs-subhead); line-height: var(--lh-subhead); color: var(--label-2); }
.step__n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--fill-3); color: var(--label); font-family: var(--font-latin); font-size: var(--fs-footnote); font-weight: var(--fw-semibold); }
.step[aria-current="step"] { color: var(--label); font-weight: var(--fw-semibold); }
.step[aria-current="step"] .step__n { background: var(--accent); color: var(--accent-fg); }
.step.is-done .step__n { background: var(--green); color: #FFFFFF; } /* [WEB] 흰 글자 on #008009 = 5.1:1 */
.drop { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 48px 24px; border: 2px dashed var(--erp-field-line); border-radius: var(--r-card); background: var(--bg-2); text-align: center; transition: border-color var(--dur-fast) var(--ease-standard), background-color var(--dur-fast) var(--ease-standard); }
.drop.is-over { border-style: solid; border-color: var(--accent); background: var(--fill-4); }
.drop .ico--24 { color: var(--label-2); }

/* ---------- 그룹 리스트 (설정) [HIG-LIST-01] ---------- */
.grp__t { margin: 28px 0 8px 16px; font-size: var(--fs-footnote); line-height: var(--lh-footnote); font-weight: var(--fw-semibold); color: var(--label-2); }
.grp__t:first-of-type { margin-top: 0; }
.grp { background: var(--bg-2); border-radius: var(--r-card); overflow: hidden; }
.grp__row { display: flex; align-items: center; gap: 12px; min-height: var(--h-row); padding: 8px 16px; border-bottom: 1px solid var(--sep); }
.grp__row:last-child { border-bottom: 0; }
.grp__main { flex: 1; min-width: 0; }
.grp__sub { display: block; font-size: var(--fs-footnote); line-height: var(--lh-footnote); color: var(--label-2); }
.grp__foot { margin: 8px 16px 0; font-size: var(--fs-footnote); line-height: var(--lh-footnote); color: var(--label-2); }
/* 설정 하위 화면으로 가는 줄 [HIG-LIST-01] 줄 전체가 누르는 곳 — 44 이상 */
.grp__link { color: var(--label); text-decoration: none; }
.grp__link > .ico:last-child { color: var(--label-3); flex: none; }
@media (hover: hover) { .grp__link:hover { background: var(--fill-4); } }
.grp__link:active { background: var(--fill-3); }
.grp__link:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
/* 이름-값 묶음 (dl) */
.kv-grp { margin: 0; }
.kv-grp dt { font-weight: var(--fw-regular); }
.kv-grp dd { margin: 0; text-align: right; }

/* ---------- 빈 상태 · 안내 · 경고 띠 ---------- */
.empty { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 48px 24px; border-radius: var(--r-card); background: var(--bg-2); text-align: center; color: var(--label-2); } /* [HIG-EMPTY-01] */
.note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: var(--r-form); background: var(--bg-2); font-size: var(--fs-subhead); line-height: var(--lh-subhead); color: var(--label-2); }
.banner { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 8px 8px 8px 16px; border-radius: var(--r-form); background: var(--red-bg); color: var(--label); font-size: var(--fs-subhead); line-height: var(--lh-subhead); margin-bottom: 20px; }
.banner > .ico { color: var(--red); }
.banner__t { flex: 1; min-width: 200px; }

/* ---------- 오른쪽 패널(인스펙터) — PC 비모달 / 모바일 하단 시트 ---------- */
.panel {
  position: fixed; z-index: 40; top: 0; right: 0; bottom: 0; width: var(--erp-panel-w); max-width: 100%;
  display: flex; flex-direction: column; background: var(--erp-elev); border-left: 1px solid var(--sep); box-shadow: var(--erp-panel-shadow);
  opacity: 0; transform: translateX(16px);
  transition: opacity var(--dur-nav) var(--ease-enter), transform var(--dur-nav) var(--ease-enter); /* [JUDG-MOTION-02] 320ms */
}
.panel.is-open { opacity: 1; transform: none; }
.panel__head { display: flex; align-items: center; gap: 8px; min-height: 60px; padding: 8px 8px 8px 20px; border-bottom: 1px solid var(--sep); }
.panel__head h2 { flex: 1; min-width: 0; }
.panel__grab { display: none; }
.panel__body { flex: 1; overflow: auto; padding: 20px; overscroll-behavior: contain; }
.kv { display: grid; grid-template-columns: 1fr auto; }
.kv dt { padding-right: 12px; }
.kv > div { display: contents; }
.kv dt, .kv dd { margin: 0; min-height: 44px; display: flex; align-items: center; border-bottom: 1px solid var(--sep); }
.kv dd { justify-content: flex-end; font-weight: var(--fw-semibold); }
.kv .is-big dd { font-size: var(--fs-sub); line-height: var(--lh-sub); }
.scrim { position: fixed; inset: 0; z-index: 39; background: var(--overlay); opacity: 0; transition: opacity var(--dur-nav) var(--ease-standard); }
.scrim.is-open { opacity: 1; }

/* 알림 창 [HIG-ALERT-01] [HIG-MODAL-01] */
.dialog {
  position: fixed; z-index: 61; left: 50%; top: 50%; width: var(--erp-dialog-w); max-width: calc(100% - 32px);
  padding: 24px 20px 20px; border-radius: var(--r-modal); background: var(--erp-elev); box-shadow: var(--lift-shadow); text-align: center;
  opacity: 0; transform: translate(-50%, -50%) scale(.96);
  transition: opacity var(--dur-nav) var(--ease-enter), transform var(--dur-nav) var(--ease-enter);
}
.dialog.is-open { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.dialog__b { margin-top: 8px; font-size: var(--fs-subhead); line-height: var(--lh-subhead); color: var(--label-2); }
.dialog__acts { display: flex; flex-direction: column; gap: 8px; margin-top: 20px; }
.scrim--dialog { z-index: 60; }

/* 토스트 [HIG-FEEDBACK-01] [JUDG-MOTION-04] */
.toasts { position: fixed; z-index: 70; left: 0; right: 0; bottom: 24px; display: flex; justify-content: center; padding: 0 16px; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 4px; min-height: 50px; max-width: 560px; padding: 3px 3px 3px 20px;
  border-radius: var(--r-toast); background: var(--erp-toast-bg); color: var(--erp-toast-fg); box-shadow: var(--lift-shadow);
  font-size: var(--fs-subhead); line-height: var(--lh-subhead);
  opacity: 0; transform: translateY(16px); transition: opacity var(--dur-nav) var(--ease-enter), transform var(--dur-nav) var(--ease-enter);
}
.toast.is-on { opacity: 1; transform: none; }
.toast__m { padding-right: 8px; }
.toast__w { display: flex; gap: 6px; align-items: flex-start; margin-top: 6px; font-weight: var(--fw-semibold); } /* 저장은 됐지만 알려야 할 것 [약속서 warnings[]] */
.toast__w .ico { flex: none; margin-top: 2px; color: var(--erp-toast-warn); }
.toast__act { min-height: 44px; padding: 0 12px; border: 0; border-radius: var(--r-capsule); background: transparent; color: var(--erp-toast-link); font-weight: var(--fw-semibold); cursor: pointer; white-space: nowrap; }
.toast__x { width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--erp-toast-fg); display: grid; place-items: center; cursor: pointer; }

/* 모바일 탭바 — 불투명(글라스 아님) [HIG tab-bars] [HIG-SIDEBAR-01 좁으면 적응] */
.erp-tabbar { display: none; position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; height: calc(var(--erp-tab-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--bg); border-top: 1px solid var(--sep); } /* [JUDG] 흰 바탕 — 선택 탭 파란 글자 대비 4.7 */
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 44px; border: 0; background: transparent; color: var(--label-2); text-decoration: none; font-size: var(--fs-footnote); line-height: var(--lh-footnote); font-weight: var(--fw-semibold); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.tab[aria-current="page"] { color: var(--accent); }
.more-list { display: flex; flex-direction: column; }
.more-list .btn { justify-content: flex-start; }

/* ---------- 1068 이하: 사이드바 좁게 ---------- */
@media (max-width: 1068px) {
  .erp { grid-template-columns: 200px minmax(0, 1fr); }
  .brand__name { font-size: var(--fs-callout); } /* 좁은 사이드바(200) 안에 한 줄 */
  .stats, .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stock { grid-template-columns: 1fr; }
  .plist { display: none; }
  .psel { display: flex; margin-bottom: 16px; max-width: 420px; }
}

/* ---------- 734 이하: 모바일 [WEB-BREAK-01] ---------- */
@media (max-width: 734px) {
  .erp { grid-template-columns: 1fr; }
  .erp-side { display: none; }
  .erp-main { padding: 20px var(--erp-pad-m) calc(var(--erp-tab-h) + 24px); }
  .head { margin-bottom: 16px; }
  .head__act { width: 100%; }
  .head__act .btn { width: 100%; }
  .stats { gap: 12px; }
  .stat { min-height: 120px; padding: 16px; }
  .quick { grid-template-columns: 1fr 1fr; }
  .rec { grid-template-columns: 1fr auto; gap: 4px 12px; }
  .rec__t { grid-column: 1 / -1; font-size: var(--fs-footnote); }
  .seg { display: grid; width: 100%; }
  .seg__opt { padding: 0 8px; }
  .bar { bottom: var(--erp-tab-h); margin: 0 calc(var(--erp-pad-m) * -1); padding: 12px var(--erp-pad-m); }
  .bar .btn { width: 100%; }
  /* 표 → 쌓기 */
  .tbl--stack thead { display: none; }
  .tbl--stack tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 12px 0; border-bottom: 1px solid var(--sep); }
  .tbl--stack td { display: block; padding: 0; border: 0; }
  .tbl--stack td[data-l]::before { content: attr(data-l) " · "; color: var(--label-2); font-size: var(--fs-footnote); }
  .tbl--stack .wide { grid-column: 1 / -1; }
  .tbl--stack .r { text-align: right; }
  .tbl--stack td { height: auto; }
  /* 카카오 주문 줄: 거래처·수량 / 품목 / 상태·경과 + 다음 단계 */
  .tbl--stack tr.k-row { grid-template-columns: 1fr auto; grid-template-areas: "cust qty" "items items" "st act" "el act"; align-items: center; }
  .k-cust { grid-area: cust; } .k-qty { grid-area: qty; } .k-items { grid-area: items; } .k-st { grid-area: st; } .k-el { grid-area: el; } .k-act { grid-area: act; align-self: center; }
  .erp-main:has(.bar) { padding-bottom: var(--erp-tab-h); }
}
/* 레이어 — 모바일 [HIG-SHEET-01] */
@media (max-width: 734px) {
  .erp-tabbar { display: flex; }
  .toasts { bottom: calc(var(--erp-tab-h) + 16px); }
  .panel { top: auto; left: 0; right: 0; width: auto; max-height: 85%; border-left: 0; border-radius: var(--r-sheet) var(--r-sheet) 0 0; padding-bottom: env(safe-area-inset-bottom); transform: translateY(100%); opacity: 1;
    transition: transform var(--dur-sheet) var(--spring-smooth); } /* [API] smooth 500ms */
  .panel.is-open { transform: none; }
  .panel__grab { display: block; width: 36px; height: 5px; border-radius: 3px; background: var(--label-4); margin: 8px auto 0; }
  .panel__head { border-bottom: 0; padding-top: 0; }
}
