/* ============================================
   WMS — Midnight Metal (Brushed Steel Edition)
   Design System v2.0 · Cool slate / gunmetal palette
============================================ */

@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable.min.css');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400..900&family=JetBrains+Mono:wght@500..800&display=swap');

/* Font Awesome SVG mode fix: SVG의 transform-origin 기본값이 (0,0)이라
   .fa-spin이 좌상단을 축으로 회전하는 문제 해결 */
.fa-spin,.svg-inline--fa.fa-spin,svg.fa-spin{
  transform-box: fill-box;
  transform-origin: center;
}

:root {
  /* Surfaces — 5 levels (cool slate) */
  --bg:           #0a0e14;
  --bg-elevated:  #11161e;
  --card:         #161c26;
  --card-hover:   #1d2532;
  --card-active:  #252e3e;
  --overlay:      rgba(10, 14, 20, 0.74);

  /* Metal System — brushed steel / gunmetal gradient
     (변수명은 'gold' 유지: 기존 클래스 .u-text-gold .c-btn--gold 등 재활용) */
  --gold:         #94a3b8;   /* slate-400 — brushed steel */
  --gold-light:   #cbd5e1;   /* slate-300 — polished silver */
  --gold-deep:    #475569;   /* slate-600 — gunmetal */
  --gold-grad:    linear-gradient(135deg, #e2e8f0 0%, #94a3b8 50%, #475569 100%);
  --gold-glow:    radial-gradient(ellipse at top, rgba(203,213,225,0.16), transparent 60%);
  --gold-soft:    rgba(148, 163, 184, 0.12);
  --gold-line:    rgba(148, 163, 184, 0.26);

  /* Text — cool ivory (off-white with slate undertone) */
  --text:         #e8edf2;
  --text-muted:   rgba(232, 237, 242, 0.64);
  --text-dim:     rgba(232, 237, 242, 0.40);
  --text-faint:   rgba(232, 237, 242, 0.20);

  /* Borders */
  --border:        rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.10);
  --border-gold:   rgba(148, 163, 184, 0.32);

  /* Semantic — slightly cooler */
  --green: #4ade80;  --green-soft: rgba(74,222,128,0.12);
  --red:   #ef4444;  --red-soft:   rgba(239,68,68,0.12);
  --amber: #f59e0b;  --amber-soft: rgba(245,158,11,0.12);
  --blue:  #60a5fa;  --blue-soft:  rgba(96,165,250,0.12);
  --violet:#a78bfa;  --violet-soft:rgba(167,139,250,0.12);

  /* Data Viz palette (8) — neutral metal-friendly */
  --viz-1:#cbd5e1; --viz-2:#94a3b8; --viz-3:#4ade80; --viz-4:#60a5fa;
  --viz-5:#a78bfa; --viz-6:#ef4444; --viz-7:#f59e0b; --viz-8:#22d3ee;

  /* Radii */
  --r-sm:6px; --r:11px; --r-md:14px; --r-lg:20px; --r-xl:28px; --r-pill:999px;

  /* Shadows */
  --shadow-xs:   0 1px 2px rgba(0,0,0,0.40);
  --shadow-sm:   0 2px 8px rgba(0,0,0,0.40);
  --shadow-md:   0 8px 24px rgba(0,0,0,0.50);
  --shadow-lg:   0 24px 64px rgba(0,0,0,0.60);
  --shadow-gold: 0 12px 40px rgba(148, 163, 184, 0.20);
  --ring-gold:   0 0 0 3px rgba(148, 163, 184, 0.22);

  /* Motion */
  --ease:     cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --spring:   cubic-bezier(0.34, 1.56, 0.64, 1);
  --t-fast: 120ms; --t-base: 200ms; --t-slow: 320ms;

  /* Type stacks */
  --kr:   'Pretendard Variable', -apple-system, sans-serif;
  --en:   'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', 'IBM Plex Mono', monospace;

  /* Layout */
  --side-w:        240px;
  --side-w-open:   240px;
  --topbar-h:      56px;
  --statusbar-h:   32px;
  --content-pad:   28px;
}

/* ===== Reset / Base ===== */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; padding: 0; }
body {
  font-family: var(--kr);
  font-size: 14px;
  font-weight: 400;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }

.num, .u-num, .c-kpi__num {
  font-family: var(--en);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}
.mono, .wms-mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ===== Layout ===== */
.wms-wrap {
  display: grid;
  grid-template-columns: var(--side-w) 1fr;
  grid-template-rows: 1fr;
  min-height: 100vh;
  background: var(--bg);
}

/* ===== Sidebar ===== */
.wms-side {
  position: sticky;
  top: 0;
  height: calc(100vh - var(--statusbar-h));
  width: var(--side-w);
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 200;
  transition: width var(--t-base) var(--ease);
  overflow: hidden;
}
.wms-side:hover,
.wms-side.is-open { width: var(--side-w-open); }
.wms-side__logo {
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--topbar-h);
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.wms-side__logo i {
  font-size: 20px;
  background: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  flex-shrink: 0;
}
.wms-side__logo-text {
  font-family: var(--en);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--text);
  white-space: nowrap;
}
.wms-side__logo-badge {
  font-family: var(--en);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  padding: 2px 6px;
  border-radius: var(--r-sm);
  background: var(--gold-soft);
  color: var(--gold-light);
  border: 1px solid var(--gold-line);
  white-space: nowrap;
}

.wms-side__nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.06) transparent;
}
.wms-side__nav::-webkit-scrollbar { width: 4px; }
.wms-side__nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.06); border-radius: 2px; }

.wms-side__group {
  padding: 14px 18px 8px;
  font-family: var(--en);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  white-space: nowrap;
}

.wms-nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 22px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  position: relative;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
  border-left: 3px solid transparent;
}
.wms-nav-item i {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.wms-nav-item:hover {
  background: var(--card-hover);
  color: var(--text);
}
.wms-nav-item.is-active {
  background: var(--gold-soft);
  color: var(--gold-light);
  border-left-color: var(--gold);
}
.wms-nav-item.is-active i {
  background: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.wms-nav-item__badge {
  margin-left: auto;
  font-family: var(--en);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--r-pill);
  background: var(--red-soft);
  color: var(--red);
}

.wms-side__divider {
  height: 1px;
  background: var(--border);
  margin: 8px 18px;
}

/* 사이드바 하단 액션 — 알림 (topbar에서 이전) */
.wms-side__actions {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.wms-side__action-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--card-bg);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  transition: all var(--t-fast) var(--ease);
}
.wms-side__action-btn:hover {
  color: var(--gold-light);
  border-color: var(--gold);
  background: var(--gold-soft);
}
.wms-side__action-btn i {
  font-size: 14px;
  width: 16px;
  text-align: center;
  flex-shrink: 0;
}
.wms-side__action-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--r-pill);
  background: var(--red);
  color: #fff;
  font-family: var(--en);
  font-variant-numeric: tabular-nums;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-elevated);
}

/* ===== Main column ===== */
.wms-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

/* ===== Topbar ===== */
.wms-topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 var(--content-pad);
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.wms-topbar__hamburger {
  display: none;
  width: 36px; height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  color: var(--text-muted);
}
.wms-topbar__breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}
.wms-topbar__breadcrumb b { color: var(--text); font-weight: 600; }
.wms-topbar__breadcrumb i { font-size: 9px; color: var(--text-faint); }
.wms-topbar__spacer { flex: 1; }

.wms-topbar__search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 320px;
  height: 36px;
  padding: 0 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text-muted);
  font-size: 13px;
  cursor: text;
  transition: border-color var(--t-fast) var(--ease);
}
.wms-topbar__search:hover { border-color: var(--border-strong); }
.wms-topbar__search:focus-within {
  border-color: var(--gold);
  box-shadow: var(--ring-gold);
  background: var(--bg-elevated);
}
.wms-topbar__search i { color: var(--text-dim); }
.wms-topbar__search input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 13px;
}
.wms-topbar__search kbd {
  font-family: var(--mono);
  font-size: 10px;
  padding: 2px 5px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-dim);
  background: var(--bg);
}

.wms-topbar__actions {
  display: flex;
  gap: 6px;
  align-items: center;
}
.wms-topbar__btn {
  position: relative;
  width: 36px; height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r);
  color: var(--text-muted);
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.wms-topbar__btn:hover { background: var(--card); color: var(--text); }
.wms-topbar__badge {
  position: absolute;
  top: 4px; right: 4px;
  min-width: 16px; height: 16px;
  padding: 0 4px;
  border-radius: var(--r-pill);
  background: var(--red);
  color: #fff;
  font-family: var(--en);
  font-size: 9px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== Content ===== */
.wms-content {
  flex: 1;
  padding: var(--content-pad);
  min-width: 0;
}

.wms-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.wms-page-head__title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0;
  line-height: 1.2;
}
.wms-page-head__sub { display: none; }
.wms-page-head__actions { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }

/* 대시보드 외 페이지 — 버튼을 제목 옆이 아닌 다음 줄로 분리 */
.wms-page-head--stack { flex-direction: column; align-items: stretch; gap: 14px; }
.wms-page-head--stack .wms-page-head__actions { justify-content: flex-start; }

/* ===== Scrollbar — Midnight Metal ===== */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.22) transparent;
}
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(148, 163, 184, 0.30) 0%, rgba(71, 85, 105, 0.40) 100%);
  border: 2px solid transparent;
  background-clip: padding-box;
  border-radius: 999px;
}
*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(203, 213, 225, 0.50) 0%, rgba(100, 116, 139, 0.60) 100%);
  background-clip: padding-box;
}
*::-webkit-scrollbar-corner { background: transparent; }
.wms-side__nav { scrollbar-width: thin; scrollbar-color: rgba(148, 163, 184, 0.20) transparent; }
.wms-side__nav::-webkit-scrollbar { width: 4px; }
.wms-side__nav::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.20); border: 0; border-radius: 2px; }

/* ===== PO/SO Card list (입고·출고 전용) ===== */
.po-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 14px;
  padding: 16px;
}
.po-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
  transition: transform var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.po-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--text-faint);
}
.po-card:hover { transform: translateY(-2px); border-color: var(--gold-line); box-shadow: var(--shadow-md); }
.po-card--rush::before, .po-card--pending::before { background: var(--amber); }
.po-card--checking::before, .po-card--picking::before, .po-card--packing::before, .po-card--putaway::before { background: var(--green); }
.po-card--shipped::before, .po-card--completed::before { background: var(--text-dim); }
.po-card--received::before { background: var(--blue); }

.po-card__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.po-card__id {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 800;
  color: var(--gold-light);
  letter-spacing: 0.02em;
}
.po-card__partner {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  margin-top: 2px;
}
.po-card__meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 10px 0 0;
  border-top: 1px dashed var(--border);
}
.po-card__meta > div { display: flex; flex-direction: column; gap: 3px; }
.po-card__meta-lbl {
  font-family: var(--en);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.po-card__meta-val {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.po-card__foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.po-card__time {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
}
.po-card__time i { color: var(--text-dim); margin-right: 3px; }

/* ===== Status bar ===== */
.wms-statusbar {
  height: var(--statusbar-h);
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 var(--content-pad);
  gap: 18px;
  font-family: var(--kr);
  font-size: 11px;
  color: var(--text-dim);
  position: sticky;
  bottom: 0;
  z-index: 90;
}
.wms-statusbar__group { display: flex; align-items: center; gap: 8px; }
.wms-statusbar__group--right { margin-left: auto; }
.wms-statusbar__sep { width: 1px; height: 12px; background: var(--border); }
.wms-statusbar__clock { font-family: var(--en); color: var(--text-muted); font-weight: 600; }
.wms-statusbar__led {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.wms-statusbar__led-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px rgba(92,194,141,0.6);
}
.wms-statusbar__led-dot--warn { background: var(--amber); box-shadow: 0 0 6px rgba(240,183,90,0.6); }
.wms-statusbar__led-dot--crit { background: var(--red); box-shadow: 0 0 6px rgba(232,112,113,0.6); animation: led-pulse 1.4s ease-in-out infinite; }
@keyframes led-pulse { 50% { opacity: 0.3; } }
@media (max-width: 768px) {
  .wms-statusbar { gap: 10px; padding: 0 12px; font-size: 10px; }
  .wms-statusbar__hide-mobile { display: none !important; }
}

/* ===== Buttons ===== */
.c-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 16px;
  border-radius: var(--r);
  font-family: var(--kr);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: all var(--t-fast) var(--ease);
  border: 1px solid transparent;
}
.c-btn--sm { height: 30px; padding: 0 12px; font-size: 12px; }
.c-btn--lg { height: 42px; padding: 0 20px; font-size: 14px; }

.c-btn--primary {
  background: var(--gold-grad);
  color: #1a1006;
  font-weight: 700;
}
.c-btn--primary:hover {
  box-shadow: var(--shadow-gold);
  transform: translateY(-1px);
}
.c-btn--ghost {
  background: var(--card);
  border-color: var(--border);
  color: var(--text-muted);
}
.c-btn--ghost:hover {
  background: var(--card-hover);
  color: var(--text);
  border-color: var(--border-strong);
}
.c-btn--gold {
  background: var(--gold-soft);
  border-color: var(--gold-line);
  color: var(--gold-light);
}
.c-btn--gold:hover {
  background: rgba(148,163,184,0.18);
  border-color: var(--gold);
}
.c-btn--danger {
  background: var(--red-soft);
  border-color: rgba(232,112,113,0.28);
  color: var(--red);
}
.c-btn--danger:hover { background: rgba(232,112,113,0.18); }

/* 모바일에서 라벨 숨기고 아이콘만 (정사각형) */
@media (max-width: 768px) {
  .c-btn--icon-mobile {
    width: 36px;
    padding: 0;
    justify-content: center;
  }
  .c-btn--icon-mobile .c-btn__label { display: none; }
}

/* ===== Card ===== */
.c-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 18px;
}
.c-card--interactive {
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.c-card--interactive:hover {
  background: var(--card-hover);
  border-color: var(--border-strong);
}
.c-card__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  margin: -18px -18px 14px -18px;
}
.c-card__title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.c-card__title i { color: var(--gold-light); font-size: 13px; }

/* ===== Chips ===== */
.c-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-family: var(--en);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.c-chip--run     { background: var(--green-soft);  color: var(--green); }
.c-chip--warn    { background: var(--amber-soft);  color: var(--amber); }
.c-chip--crit    { background: var(--red-soft);    color: var(--red); }
.c-chip--info    { background: var(--blue-soft);   color: var(--blue); }
.c-chip--idle    { background: rgba(255,255,255,0.04); color: var(--text-dim); }
.c-chip--hold    { background: var(--violet-soft); color: var(--violet); }
.c-chip--gold    { background: var(--gold-soft);   color: var(--gold-light); border: 1px solid var(--gold-line); }

/* D-day badge */
.c-d-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: var(--r-sm);
  font-family: var(--en);
  font-size: 10px;
  font-weight: 800;
  background: rgba(255,255,255,0.04);
  color: var(--text-dim);
}
.c-d-badge--warn { background: var(--amber-soft); color: var(--amber); }
.c-d-badge--crit { background: var(--red-soft); color: var(--red); }
.c-d-badge--good { background: var(--green-soft); color: var(--green); }

/* ===== KPI ===== */
.c-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
.c-kpi {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
}
.c-kpi::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gold-glow);
  opacity: 0;
  transition: opacity var(--t-base) var(--ease);
  pointer-events: none;
}
.c-kpi:hover::before { opacity: 1; }
.c-kpi__row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}
.c-kpi__label {
  font-family: var(--kr);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}
.c-kpi__num {
  font-family: var(--en);
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.c-kpi__unit {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 500;
  margin-left: 4px;
}
.c-kpi__sub {
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-dim);
}
.c-kpi__delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: var(--en);
  font-size: 11px;
  font-weight: 700;
  margin-left: 6px;
}
.c-kpi__delta--up { color: var(--green); }
.c-kpi__delta--down { color: var(--red); }
.c-kpi--gold .c-kpi__num {
  background: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.c-kpi--gold { border-color: var(--border-gold); }
.c-kpi--crit { border-left: 3px solid var(--red); }
.c-kpi--warn { border-left: 3px solid var(--amber); }
.c-kpi--good { border-left: 3px solid var(--green); }

/* ===== Form / Input ===== */
.c-input, .c-textarea {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--card);
  color: var(--text);
  font-family: var(--kr);
  font-size: 13px;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.c-input:focus, .c-textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: var(--ring-gold);
  background: var(--bg-elevated);
}
.c-input::placeholder { color: var(--text-faint); }
.c-input--sm { height: 28px; padding: 0 8px; font-size: 12px; }
.c-textarea { height: auto; padding: 10px 12px; resize: vertical; }

/* ===== Info row (label/value pair) ===== */
.c-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
  gap: 10px;
}
.c-info-row:last-child { border-bottom: none; }
.c-info-row__label {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.c-info-row__val {
  font-size: 12px;
  color: var(--text);
  text-align: right;
  font-weight: 500;
  word-break: break-all;
}

/* ===== Timeline ===== */
.c-timeline {
  list-style: none;
  margin: 0;
  padding: 6px 0 0 0;
  position: relative;
}
.c-timeline::before {
  content: '';
  position: absolute;
  left: 5px; top: 12px; bottom: 12px;
  width: 1px;
  background: var(--border);
}
.c-timeline__item {
  position: relative;
  padding: 0 0 14px 22px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.c-timeline__item:last-child { padding-bottom: 0; }
.c-timeline__dot {
  position: absolute;
  left: 0; top: 4px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 2px solid var(--border-strong);
  z-index: 1;
}
.c-timeline__dot--active {
  border-color: var(--gold);
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(148,163,184,0.15);
  animation: c-timeline-pulse 1.6s ease-in-out infinite;
}
.c-timeline__dot--done {
  border-color: var(--green);
  background: var(--green);
}
@keyframes c-timeline-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(148,163,184,0.15); }
  50%      { box-shadow: 0 0 0 5px rgba(148,163,184,0.30); }
}
.c-timeline__title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
.c-timeline__time {
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--mono);
}

/* ===== Filter bar (drag-drop / toggle group) ===== */
.c-filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 18px;
}
.c-filter-bar__toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 0 12px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--card);
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--t-fast) var(--ease);
}
.c-filter-bar__toggle input { margin: 0; }
.c-filter-bar__toggle:hover { border-color: var(--border-strong); color: var(--text); }
.c-filter-bar__toggle--warn:has(input:checked),
.c-filter-bar__toggle--warn.is-active {
  border-color: rgba(240,183,90,0.5); background: var(--amber-soft); color: var(--amber);
}
.c-filter-bar__toggle--crit:has(input:checked),
.c-filter-bar__toggle--crit.is-active {
  border-color: rgba(232,112,113,0.5); background: var(--red-soft); color: var(--red);
}

/* ===== Custom Dropdown ===== */
.c-dropdown {
  position: relative;
  display: inline-flex;
  font-family: var(--kr);
}
.c-dropdown__toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 34px;
  padding: 0 12px;
  min-width: 180px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--t-fast) var(--ease);
}
.c-dropdown__toggle:hover {
  border-color: var(--border-strong);
  background: var(--card-hover);
}
.c-dropdown.is-open .c-dropdown__toggle {
  border-color: var(--gold);
  background: var(--bg-elevated);
  box-shadow: var(--ring-gold);
}
.c-dropdown__label {
  flex: 1;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.c-dropdown__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 18px;
  padding: 0 7px;
  border-radius: 9px;
  background: var(--gold-soft);
  color: var(--gold-light);
  border: 1px solid var(--gold-line);
  font-family: var(--en);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.c-dropdown__caret {
  font-size: 10px;
  color: var(--text-dim);
  transition: transform var(--t-fast) var(--ease);
}
.c-dropdown.is-open .c-dropdown__caret {
  transform: rotate(180deg);
  color: var(--gold-light);
}

.c-dropdown__menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 100%;
  width: max-content;
  max-width: 360px;
  max-height: 360px;
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border-gold);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md), var(--shadow-gold);
  padding: 4px;
  z-index: 100;
  list-style: none;
  margin: 0;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.c-dropdown.is-open .c-dropdown__menu {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.c-dropdown__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease);
  user-select: none;
}
.c-dropdown__item:hover,
.c-dropdown__item.is-active {
  background: var(--gold-soft);
  color: var(--gold-light);
}
.c-dropdown__item.is-selected {
  background: var(--gold-soft);
  color: var(--gold-light);
  font-weight: 600;
}
.c-dropdown__item-label {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.c-dropdown__item-label i {
  font-size: 11px;
  width: 14px;
  color: var(--text-dim);
}
.c-dropdown__item.is-selected .c-dropdown__item-label i,
.c-dropdown__item:hover .c-dropdown__item-label i,
.c-dropdown__item.is-active .c-dropdown__item-label i { color: var(--gold-light); }
.c-dropdown__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 20px;
  padding: 0 8px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  color: var(--text-muted);
  font-family: var(--en);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.c-dropdown__item:hover .c-dropdown__badge,
.c-dropdown__item.is-selected .c-dropdown__badge,
.c-dropdown__item.is-active .c-dropdown__badge {
  background: var(--gold-grad);
  color: #1a1006;
  border: none;
}
.c-dropdown__item-check {
  width: 14px;
  font-size: 11px;
  color: var(--gold-light);
  opacity: 0;
}
.c-dropdown__item.is-selected .c-dropdown__item-check { opacity: 1; }

/* ===== AJAX Search Box ===== */
.c-search-box {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 380px;
  height: 38px;
  padding: 0 12px 0 36px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  transition: all var(--t-fast) var(--ease);
}
.c-search-box:hover { border-color: var(--border-strong); }
.c-search-box:focus-within {
  border-color: var(--gold);
  box-shadow: var(--ring-gold);
  background: var(--bg-elevated);
}
.c-search-box__icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 13px;
  pointer-events: none;
}
.c-search-box__input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--kr);
  font-size: 13px;
  min-width: 0;
}
.c-search-box__input::placeholder { color: var(--text-faint); }
.c-search-box__loading,
.c-search-box__clear {
  width: 20px; height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 12px;
  flex-shrink: 0;
  border-radius: var(--r-sm);
  display: none;
}
.c-search-box.is-loading .c-search-box__loading { display: flex; color: var(--gold-light); }
.c-search-box.has-value .c-search-box__clear { display: flex; cursor: pointer; }
.c-search-box__clear:hover { background: var(--card-hover); color: var(--text); }

/* ===== Table ===== */
.c-table-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.c-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.c-table thead th {
  position: sticky;
  top: 0;
  background: var(--bg-elevated);
  padding: 12px 14px;
  text-align: left;
  font-family: var(--kr);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  z-index: 10;
}
.c-table tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.c-table tbody tr:hover td { background: var(--card-hover); }
.c-table tbody tr:last-child td { border-bottom: none; }

.c-table th.c-cell--end, .c-table td.c-cell--end { text-align: right; white-space: nowrap; }
.c-table th.c-cell--center, .c-table td.c-cell--center { text-align: center; white-space: nowrap; }
.c-table th.c-cell--num, .c-table td.c-cell--num {
  font-family: var(--en);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.c-table td.c-cell--code { font-family: var(--mono); font-size: 12px; color: var(--gold-light); }
.c-table th.c-cell--main, .c-table td.c-cell--main { width: auto; }

.c-table__id {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--gold-light);
  letter-spacing: 0.02em;
}

/* ===== Progress ===== */
.c-progress {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.04);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.c-progress__fill {
  height: 100%;
  background: var(--gold-grad);
  border-radius: var(--r-pill);
  transition: width var(--t-slow) var(--ease);
}
.c-progress__fill--run { background: var(--green); }
.c-progress__fill--warn { background: var(--amber); }
.c-progress__fill--crit { background: var(--red); }

/* ===== Empty state ===== */
.c-empty {
  text-align: center;
  padding: 56px 24px;
  color: var(--text-dim);
}
.c-empty i {
  font-size: 32px;
  color: var(--text-faint);
  margin-bottom: 14px;
  display: block;
}
.c-empty__msg {
  font-size: 13px;
  color: var(--text-muted);
}
.c-empty__sub { font-size: 11px; color: var(--text-dim); margin-top: 4px; }

/* ===== Toast ===== */
.c-toast-wrap {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
  pointer-events: none;
}
.c-toast {
  pointer-events: auto;
  min-width: 280px;
  max-width: 380px;
  padding: 14px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-gold);
  border-radius: var(--r);
  box-shadow: var(--shadow-lg), var(--shadow-gold);
  color: var(--text);
  font-size: 13px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  transform: translateX(20px);
  opacity: 0;
  animation: toast-in 380ms var(--spring) forwards;
}
@keyframes toast-in { to { transform: translateX(0); opacity: 1; } }
.c-toast i { color: var(--gold-light); margin-top: 2px; }
.c-toast--good i { color: var(--green); }
.c-toast--warn i { color: var(--amber); }
.c-toast--crit i { color: var(--red); }

/* ===== Utilities ===== */
.u-flex { display: flex; }
.u-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.u-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.u-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.u-gap-4 { gap: 4px; } .u-gap-8 { gap: 8px; } .u-gap-12 { gap: 12px; } .u-gap-16 { gap: 16px; }
.u-mt-4 { margin-top: 4px; } .u-mt-8 { margin-top: 8px; } .u-mt-12 { margin-top: 12px; } .u-mt-16 { margin-top: 16px; }
.u-mb-4 { margin-bottom: 4px; } .u-mb-8 { margin-bottom: 8px; } .u-mb-12 { margin-bottom: 12px; } .u-mb-16 { margin-bottom: 16px; }
.u-text-dim   { color: var(--text-dim); }
.u-text-muted { color: var(--text-muted); }
.u-text-faint { color: var(--text-faint); }
.u-text-gold  { color: var(--gold-light); }
.u-text-run   { color: var(--green); }
.u-text-warn  { color: var(--amber); }
.u-text-crit  { color: var(--red); }
.u-num {
  font-family: var(--en);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

/* ===== Mobile ===== */
@media (max-width: 1024px) {
  :root { --content-pad: 16px; }
  .wms-wrap { grid-template-columns: 1fr; }
  .wms-side {
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    width: var(--side-w-open);
    transform: translateX(-100%);
    transition: transform var(--t-base) var(--ease);
    box-shadow: var(--shadow-lg);
  }
  .wms-side.is-open { transform: translateX(0); }
  .wms-side .wms-side__logo-text,
  .wms-side .wms-side__logo-badge,
  .wms-side .wms-side__group,
  .wms-side .wms-nav-item span,
  .wms-side .wms-nav-item__badge { opacity: 1; }
  .wms-topbar__hamburger { display: flex; }
  .wms-topbar__breadcrumb { display: none; }
  .wms-topbar__search { display: none; }
  .c-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .u-grid-3, .u-grid-4 { grid-template-columns: 1fr; }
  .c-input, .c-textarea, .c-search-box__input { font-size: 16px; }
}
@media (max-width: 768px) {
  .c-kpi-grid { grid-template-columns: 1fr; }
  .u-grid-2 { grid-template-columns: 1fr; }
  .c-search-box { max-width: 100%; }
  .c-dropdown { width: 100%; }
  .c-dropdown__toggle { width: 100%; min-width: 0; }
  /* 테이블 컬럼 모바일에서 숨김 */
  .u-hide-mobile { display: none !important; }
}

/* Side backdrop on mobile */
.wms-side__backdrop {
  display: none;
  position: fixed; inset: 0;
  background: var(--overlay);
  backdrop-filter: blur(4px);
  z-index: 199;
  opacity: 0;
  transition: opacity var(--t-base) var(--ease);
}
@media (max-width: 1024px) {
  body.side-open .wms-side__backdrop { display: block; opacity: 1; }
}

/* ===== Mobile bottom tab bar ===== */
.wms-bottombar {
  display: none;
  height: 56px;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  position: sticky;
  bottom: 0;
  z-index: 95;
}
.wms-bottombar__tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-dim);
  font-size: 10.5px;
  font-weight: 600;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  position: relative;
}
.wms-bottombar__tab i { font-size: 16px; }
.wms-bottombar__tab.is-active { color: var(--gold-light); }
.wms-bottombar__tab.is-active i { color: var(--gold); }
.wms-bottombar__badge {
  position: absolute;
  top: 6px;
  left: 50%;
  margin-left: 6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--r-pill);
  background: var(--red);
  color: #fff;
  font-family: var(--en);
  font-variant-numeric: tabular-nums;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
@media (max-width: 1024px) {
  .wms-bottombar { display: flex; }
  .wms-statusbar { display: none; }
}
