:root {
  --navy-950: #071126;
  --navy-900: #0b1633;
  --navy-800: #132347;
  --blue-600: #2d6cdf;
  --blue-100: #eaf1ff;
  --teal-500: #13a99b;
  --amber-500: #e9a23b;
  --violet-500: #7c61d9;
  --ink-900: #172033;
  --ink-600: #637087;
  --ink-400: #929db0;
  --line: #e4e9f2;
  --surface: #ffffff;
  --canvas: #f4f7fb;
  --shadow: 0 12px 30px rgba(22, 39, 76, .08);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; color: var(--ink-900); background: var(--canvas); font-family: Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", Arial, sans-serif; }
button, input { font: inherit; }
a { color: inherit; text-decoration: none; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; z-index: 30; inset: 0 auto 0 0; width: 276px; display: flex; flex-direction: column; color: #dbe6ff; background: linear-gradient(180deg, var(--navy-950), #0d1a39 64%, #102041); box-shadow: 8px 0 30px rgba(2, 11, 31, .16); }
.brand { min-height: 84px; display: flex; align-items: center; gap: 12px; padding: 0 24px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-mark { position: relative; width: 36px; height: 36px; display: grid; place-items: center; transform: rotate(-8deg); }
.brand-mark i { position: absolute; display: block; width: 26px; height: 8px; border-radius: 8px; background: linear-gradient(90deg, #52a1ff, #60d5c8); }
.brand-mark i:nth-child(1) { transform: translateY(-9px); width: 19px; }
.brand-mark i:nth-child(3) { transform: translateY(9px); width: 32px; }
.brand-copy { display: flex; flex-direction: column; min-width: 0; }
.brand-copy strong { color: #fff; font-size: 20px; letter-spacing: .03em; }
.brand-copy small { margin-top: 2px; color: #8091b6; font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.icon-button { border: 0; background: transparent; cursor: pointer; }
.sidebar-close { display: none; margin-left: auto; color: white; font-size: 28px; }
.menu-search { display: flex; align-items: center; gap: 8px; margin: 18px 18px 10px; padding: 0 12px; height: 40px; border: 1px solid rgba(255,255,255,.1); border-radius: 10px; background: rgba(255,255,255,.055); }
.menu-search span { color: #7185ac; font-size: 22px; transform: rotate(-12deg); }
.menu-search input { width: 100%; color: #fff; border: 0; outline: 0; background: transparent; font-size: 13px; }
.menu-search input::placeholder { color: #7185ac; }
.navigation { flex: 1; overflow-y: auto; padding: 5px 14px 30px; scrollbar-width: thin; scrollbar-color: #2a3b61 transparent; }
.nav-home, .nav-group summary { min-height: 46px; display: flex; align-items: center; gap: 10px; padding: 0 12px; border-radius: 10px; font-size: 14px; font-weight: 700; cursor: pointer; }
.nav-home.active { color: #fff; background: linear-gradient(90deg, #2763cc, #367ce7); box-shadow: 0 8px 20px rgba(29, 90, 197, .25); }
.nav-symbol { width: 25px; text-align: center; color: #a8b9db; font-size: 19px; }
.nav-symbol.letter { width: 26px; height: 26px; display: grid; place-items: center; color: #9bb3e1; border: 1px solid #30446d; border-radius: 8px; font-size: 11px; }
.nav-label { margin: 24px 12px 10px; color: #60749d; font-size: 10px; font-weight: 800; letter-spacing: .13em; }
.nav-group { margin: 3px 0; }
.nav-group summary { list-style: none; color: #aebdde; }
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group summary:hover { color: #fff; background: rgba(255,255,255,.05); }
.nav-group-name { flex: 1; }
.nav-count { min-width: 24px; padding: 3px 7px; border-radius: 999px; color: #7f94bb; background: rgba(255,255,255,.06); font-size: 10px; text-align: center; }
.chevron { color: #687da6; font-size: 18px; transition: transform .2s; }
.nav-group[open] .chevron { transform: rotate(90deg); }
.nav-programs { margin: 0 0 8px 39px; border-left: 1px solid #273a61; }
.nav-programs a { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 35px; margin-left: 8px; padding: 5px 10px; color: #8294b8; border-radius: 7px; font-size: 12px; }
.nav-programs a:hover { color: #fff; background: rgba(255,255,255,.055); }
.nav-programs small { max-width: 72px; overflow: hidden; color: #53698f; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.nav-group.menu-hidden, .nav-programs a.menu-hidden { display: none; }
.sidebar-foot { display: flex; align-items: center; gap: 10px; min-height: 72px; padding: 14px 24px; border-top: 1px solid rgba(255,255,255,.08); background: rgba(0,0,0,.08); }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #36d2a8; box-shadow: 0 0 0 5px rgba(54,210,168,.1); }
.sidebar-foot div { display: flex; flex-direction: column; }
.sidebar-foot strong { color: #bcd0ef; font-size: 11px; }
.sidebar-foot small { margin-top: 2px; color: #60759f; font-size: 10px; }
.sidebar-scrim { display: none; }

.main-content { min-height: 100vh; margin-left: 276px; }
.topbar { position: sticky; z-index: 20; top: 0; min-height: 84px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 34px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(14px); }
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-left h1 { margin: 3px 0 0; font-size: 21px; letter-spacing: -.04em; }
.eyebrow, .section-kicker, .hero-kicker { color: var(--blue-600); font-size: 9px; font-weight: 900; letter-spacing: .14em; }
.menu-toggle { display: none; color: var(--navy-900); font-size: 23px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.today { display: flex; flex-direction: column; padding-right: 16px; border-right: 1px solid var(--line); text-align: right; }
.today span { color: var(--ink-400); font-size: 10px; }
.today strong { margin-top: 3px; font-size: 12px; }
.refresh-button { height: 38px; display: flex; align-items: center; gap: 7px; padding: 0 14px; color: #37506f; border: 1px solid #dbe3ef; border-radius: 9px; background: #fff; cursor: pointer; font-size: 12px; font-weight: 700; }
.refresh-button:hover { border-color: #b9c8df; background: #f8faff; }
.refresh-button.loading span { animation: spin .8s linear infinite; }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 5px 10px 5px 5px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.user-chip > span { width: 34px; height: 34px; display: grid; place-items: center; color: white; border-radius: 9px; background: linear-gradient(145deg, #18386d, #347bea); font-size: 11px; font-weight: 900; }
.user-chip div { display: flex; flex-direction: column; }
.user-chip strong { font-size: 11px; }
.user-chip small { margin-top: 2px; color: var(--ink-400); font-size: 9px; }

.content-wrap { max-width: 1600px; margin: 0 auto; padding: 28px 34px 22px; }
.hero-panel { position: relative; min-height: 168px; display: flex; align-items: center; overflow: hidden; padding: 28px 34px; color: #fff; border-radius: 18px; background: linear-gradient(112deg, #10264f 0%, #174d8f 62%, #1a70a4 100%); box-shadow: 0 16px 36px rgba(17,55,107,.16); }
.hero-panel:after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px); background-size: 28px 28px; mask-image: linear-gradient(90deg, transparent 20%, black); }
.hero-panel > div:first-child { position: relative; z-index: 2; }
.hero-kicker { color: #65d7d0; }
.hero-panel h2 { margin: 9px 0 8px; font-size: clamp(22px, 2.3vw, 31px); letter-spacing: -.05em; }
.hero-panel p { margin: 0; color: #bbcae3; font-size: 13px; }
.hero-panel p strong { color: #fff; }
.hero-visual { position: absolute; z-index: 1; right: 5%; width: 270px; height: 180px; }
.orbit { position: absolute; border: 1px solid rgba(118,219,229,.25); border-radius: 50%; }
.orbit-one { width: 240px; height: 110px; top: 30px; transform: rotate(-15deg); }
.orbit-two { width: 180px; height: 180px; left: 36px; border-style: dashed; }
.factory-node { position: absolute; width: 12px; height: 12px; border: 3px solid #89e4df; border-radius: 50%; background: #174979; box-shadow: 0 0 0 8px rgba(93,211,210,.08); }
.node-one { left: 22px; top: 72px; }.node-two { right: 24px; top: 42px; }.node-three { left: 130px; bottom: 18px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
.metric-card { position: relative; min-height: 128px; display: flex; align-items: center; gap: 16px; overflow: hidden; padding: 22px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); box-shadow: 0 8px 25px rgba(31,49,85,.045); }
.metric-icon { flex: 0 0 47px; height: 47px; display: grid; place-items: center; border-radius: 13px; font-size: 12px; font-weight: 900; }
.metric-copy { display: flex; flex-direction: column; min-width: 0; }
.metric-copy > span { color: var(--ink-600); font-size: 12px; font-weight: 700; }
.metric-copy strong { margin: 4px 0 2px; color: var(--ink-900); font-size: 28px; letter-spacing: -.04em; line-height: 1; }
.metric-copy small { color: var(--ink-400); font-size: 9px; }
.metric-accent { position: absolute; right: -22px; bottom: -38px; width: 90px; height: 90px; border: 17px solid currentColor; border-radius: 50%; opacity: .035; }
.tone-blue .metric-icon { color: #2865ca; background: #e9f1ff; }.tone-violet .metric-icon { color: #7556cb; background: #f0ebff; }.tone-amber .metric-icon { color: #bd781d; background: #fff3df; }.tone-teal .metric-icon { color: #138f85; background: #e3f8f4; }
.tone-blue { color: var(--blue-600); }.tone-violet { color: var(--violet-500); }.tone-amber { color: var(--amber-500); }.tone-teal { color: var(--teal-500); }

.dashboard-grid { display: grid; grid-template-columns: 1.45fr .8fr; gap: 16px; margin-top: 16px; }
.panel { min-width: 0; padding: 23px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: 0 8px 25px rgba(31,49,85,.045); }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 22px; }
.panel-head h3 { margin: 4px 0 0; font-size: 16px; letter-spacing: -.03em; }
.live-badge, .muted-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 999px; color: #168d70; background: #e8f8f2; font-size: 9px; font-weight: 900; letter-spacing: .05em; }
.live-badge i { width: 6px; height: 6px; border-radius: 50%; background: #1eb889; animation: pulse 1.8s infinite; }
.muted-badge { color: #7b8799; background: #f1f4f8; }
.panel-icon { width: 36px; height: 36px; display: grid; place-items: center; color: #3972c8; border-radius: 10px; background: #eaf2ff; font-size: 10px; font-weight: 900; }
.process-list { display: grid; gap: 19px; }
.process-meta { display: flex; justify-content: space-between; margin-bottom: 7px; }
.process-meta strong { font-size: 12px; }.process-meta span { color: var(--ink-600); font-size: 11px; font-weight: 700; }
.progress-track { width: 100%; height: 8px; display: block; overflow: hidden; border: 0; border-radius: 999px; background: #edf1f7; appearance: none; }
.progress-track::-webkit-progress-bar { border-radius: 999px; background: #edf1f7; }
.progress-track::-webkit-progress-value { border-radius: 999px; transition: width .45s ease; }
.progress-track::-moz-progress-bar { border-radius: 999px; transition: width .45s ease; }
.progress-track.tone-blue::-webkit-progress-value { background: var(--blue-600); }
.progress-track.tone-violet::-webkit-progress-value { background: var(--violet-500); }
.progress-track.tone-amber::-webkit-progress-value { background: var(--amber-500); }
.progress-track.tone-teal::-webkit-progress-value { background: var(--teal-500); }
.progress-track.tone-blue::-moz-progress-bar { background: var(--blue-600); }
.progress-track.tone-violet::-moz-progress-bar { background: var(--violet-500); }
.progress-track.tone-amber::-moz-progress-bar { background: var(--amber-500); }
.progress-track.tone-teal::-moz-progress-bar { background: var(--teal-500); }
.panel-note { margin: 22px 0 0; padding-top: 14px; color: var(--ink-400); border-top: 1px solid #edf0f5; font-size: 9px; }
.stock-total { display: flex; flex-direction: column; padding: 18px; border-radius: 13px; background: linear-gradient(135deg, #f1f6ff, #f7fbff); }
.stock-total span { color: #60708c; font-size: 11px; font-weight: 700; }.stock-total strong { margin: 6px 0 3px; color: #1c4d93; font-size: 30px; letter-spacing: -.04em; }.stock-total small { color: #92a0b4; font-size: 9px; }
.stock-split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.stock-split > div { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid #edf0f5; border-radius: 11px; }
.arrow { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 8px; font-weight: 900; }.arrow.inbound { color: #148c77; background: #e7f8f3; }.arrow.outbound { color: #c47a1d; background: #fff3e3; }
.stock-split p { display: flex; flex-direction: column; margin: 0; color: var(--ink-400); font-size: 9px; }.stock-split strong { margin-top: 2px; color: var(--ink-900); font-size: 15px; }
.master-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.master-item { padding: 16px; border: 1px solid #edf0f5; border-radius: 12px; background: #fbfcfe; }
.master-item span { color: var(--ink-600); font-size: 11px; }.master-item strong { display: block; margin: 7px 0 2px; font-size: 23px; }.master-item small { color: var(--ink-400); font-size: 9px; }
.module-list { max-height: 190px; overflow: auto; padding-right: 5px; }
.module-list > div { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 8px; min-height: 34px; border-bottom: 1px solid #f0f2f6; }
.module-dot { width: 6px; height: 6px; border-radius: 50%; background: #3d75d3; }.module-list strong { font-size: 11px; }.module-list div > span:last-child { color: var(--ink-400); font-size: 10px; }
.footer { display: flex; justify-content: space-between; padding: 19px 3px 0; color: var(--ink-400); font-size: 9px; }
.toast { position: fixed; z-index: 60; right: 24px; bottom: 24px; max-width: 320px; padding: 13px 16px; color: #fff; border-radius: 10px; background: #152541; box-shadow: var(--shadow); font-size: 12px; opacity: 0; pointer-events: none; transform: translateY(10px); transition: .2s; }.toast.show { opacity: 1; transform: translateY(0); }

.state-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at top, #f6f9ff, #eaf0f9); }
.state-card { width: min(100%, 520px); display: flex; flex-direction: column; align-items: center; padding: 48px 36px; border: 1px solid var(--line); border-radius: 22px; background: #fff; box-shadow: var(--shadow); text-align: center; }
.state-symbol { width: 58px; height: 58px; display: grid; place-items: center; margin-bottom: 20px; color: #fff; border-radius: 17px; background: linear-gradient(145deg, #17386e, #3281ef); font-weight: 900; }
.state-card h1 { margin: 10px 0; font-size: 25px; }.state-card p { max-width: 390px; margin: 0; color: var(--ink-600); font-size: 13px; line-height: 1.7; }.state-card code { margin: 20px 0; padding: 7px 10px; border-radius: 7px; color: #54627b; background: #f1f4f8; font-size: 11px; }.state-card small { color: var(--ink-400); }
.primary-link { margin-top: 22px; padding: 11px 17px; color: #fff; border-radius: 9px; background: var(--blue-600); font-size: 12px; font-weight: 800; }.error-code { color: var(--blue-600); font-size: 45px; font-weight: 900; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(30,184,137,0); } }

@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .master-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 880px) {
  .sidebar { transform: translateX(-105%); transition: transform .24s ease; }
  body.sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-close, .menu-toggle { display: block; }
  .sidebar-scrim { position: fixed; z-index: 25; inset: 0; width: 100%; height: 100%; border: 0; background: rgba(4,12,28,.46); }
  body.sidebar-open .sidebar-scrim { display: block; }
  .main-content { margin-left: 0; }
  .topbar { padding: 0 20px; }
  .content-wrap { padding: 20px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .user-chip div, .today { display: none; }
}

@media (max-width: 580px) {
  .topbar { min-height: 72px; }.topbar-left h1 { font-size: 18px; }.eyebrow { display: none; }
  .refresh-button { width: 38px; padding: 0; justify-content: center; }.refresh-button:not(.loading) { font-size: 0; }.refresh-button span { font-size: 17px; }
  .user-chip { display: none; }
  .content-wrap { padding: 14px; }
  .hero-panel { min-height: 150px; padding: 23px; }.hero-panel p { max-width: 270px; line-height: 1.55; }.hero-visual { right: -100px; opacity: .6; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 10px; }.metric-card { min-height: 116px; flex-direction: column; align-items: flex-start; gap: 9px; padding: 16px; }.metric-icon { width: 36px; flex-basis: 36px; height: 36px; }.metric-copy strong { font-size: 23px; }.metric-copy small { display: none; }
  .panel { padding: 18px; }.master-grid { grid-template-columns: repeat(2, 1fr); }.footer { flex-direction: column; gap: 5px; }
}
