/* ═══════════════════════════════════════════════════════
   nplace.io — 공통 스타일 v3.0
   다크/라이트 테마, CSS 변수 완전 통일
═══════════════════════════════════════════════════════ */

@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css');

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* ══ 다크 테마 (기본) ══════════════════════════════════ */
:root {
  /* 배경 */
  --bg:           #0a0a0f;
  --bg2:          #13131a;
  --bg3:          #1a1a24;
  --bg-sidebar:   #0e0e18;
  --bg-header:    rgba(13,13,26,0.95);
  --bg-card:      #13131a;
  --bg-input:     rgba(255,255,255,0.06);
  --bg-hover:     rgba(255,255,255,0.06);
  --bg-hover2:    rgba(255,255,255,0.04);
  --bg-active:    rgba(0,212,255,0.1);
  --bg-modal:     #13131a;
  --bg-dropdown:  #1a1a24;
  --bg-table-head:rgba(255,255,255,0.03);
  --bg-row-hover: rgba(255,255,255,0.03);
  --bg-tab:       rgba(255,255,255,0.04);
  --bg-overlay:   rgba(0,0,0,0.6);

  /* 테두리 */
  --border:       rgba(255,255,255,0.09);
  --border2:      rgba(0,212,255,0.2);
  --border-input: rgba(255,255,255,0.1);
  --border-focus: rgba(0,212,255,0.5);

  /* 텍스트 */
  --text:         #e2e8f0;
  --text1:        #e2e8f0;
  --text2:        rgba(226,232,240,0.6);
  --text3:        rgba(226,232,240,0.35);
  --text-title:   #ffffff;
  --text-inv:     #0f172a;

  /* 그림자 */
  --shadow-sm:    0 2px 8px rgba(0,0,0,0.3);
  --shadow-md:    0 8px 32px rgba(0,0,0,0.4);
  --shadow-lg:    0 20px 60px rgba(0,0,0,0.5);

  /* 액센트 */
  --cyan:         #00d4ff;
  --cyan-rgb:     0,212,255;
  --purple:       #7c3aed;
  --purple-rgb:   124,58,237;
  --green:        #22c55e;
  --green-rgb:    34,197,94;
  --yellow:       #fcd34d;
  --yellow-rgb:   252,211,77;
  --red:          #f87171;
  --red-rgb:      248,113,113;
  --orange:       #fb923c;
  --blue:         #60a5fa;

  /* 레이아웃 */
  --sidebar-w:    240px;
  --sidebar-col:  64px;
  --header-h:     60px;
  --radius:       12px;
  --radius-sm:    8px;
  --radius-lg:    16px;
  --radius-xl:    20px;
}

/* ══ 라이트 테마 ════════════════════════════════════════ */
body.light {
  --bg:           #f0f2f8;
  --bg2:          #ffffff;
  --bg3:          #f7f8fc;
  --bg-sidebar:   #1e1b4b;
  --bg-header:    rgba(255,255,255,0.96);
  --bg-card:      #ffffff;
  --bg-input:     #f7f8fc;
  --bg-hover:     rgba(0,0,0,0.04);
  --bg-hover2:    rgba(0,0,0,0.03);
  --bg-active:    rgba(0,185,220,0.1);
  --bg-modal:     #ffffff;
  --bg-dropdown:  #ffffff;
  --bg-table-head:#f7f8fc;
  --bg-row-hover: #f0f5ff;
  --bg-tab:       #eef0f6;
  --bg-overlay:   rgba(0,0,0,0.4);

  --border:       rgba(0,0,0,0.1);
  --border2:      rgba(0,153,194,0.3);
  --border-input: rgba(0,0,0,0.12);
  --border-focus: rgba(0,153,194,0.5);

  --text:         #1e293b;
  --text1:        #1e293b;
  --text2:        #64748b;
  --text3:        #94a3b8;
  --text-title:   #0f172a;
  --text-inv:     #ffffff;

  --shadow-sm:    0 2px 8px rgba(0,0,0,0.07);
  --shadow-md:    0 8px 32px rgba(0,0,0,0.1);
  --shadow-lg:    0 20px 60px rgba(0,0,0,0.15);

  --cyan:         #0099c2;
  --cyan-rgb:     0,153,194;
  --purple:       #6d28d9;
  --purple-rgb:   109,40,217;
  --green:        #16a34a;
  --green-rgb:    22,163,74;
  --yellow:       #d97706;
  --yellow-rgb:   217,119,6;
  --red:          #dc2626;
  --red-rgb:      220,38,38;
  --orange:       #ea580c;
  --blue:         #2563eb;
}

/* ── 부드러운 테마 전환 ── */
body, .sidebar, .header, .card, .modal, .dropdown,
.notif-dropdown, .user-dropdown, table, input, select, textarea, button {
  transition: background-color 0.25s ease, color 0.2s ease,
              border-color 0.2s ease, box-shadow 0.2s ease;
}

/* ═══════════════ 기본 ═══════════════ */
html { font-size: 14px; scroll-behavior: smooth; }
body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* 스크롤바 */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(var(--cyan-rgb),0.2); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(var(--cyan-rgb),0.4); }

/* ═══════════════ 레이아웃 ═══════════════ */
.app-shell { display: flex; min-height: 100vh; }

/* ── 사이드바 ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border2);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  overflow: hidden;
  transition: width 0.25s ease, transform 0.25s ease;
  flex-shrink: 0;
}
.sidebar.collapsed { width: var(--sidebar-col); }

.sidebar-logo {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
  text-decoration: none;
}
.logo-mark {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px; color: #000;
  flex-shrink: 0;
}
.logo-text { font-weight: 700; font-size: 15px; color: rgba(255,255,255,0.9); white-space: nowrap; }
.logo-admin { font-size: 10px; color: var(--red);    margin-left: 2px; font-weight: 700; letter-spacing: 0.05em; }
.logo-ops   { font-size: 10px; color: var(--orange); margin-left: 2px; font-weight: 700; letter-spacing: 0.05em; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 8px; }
.nav-group { margin-bottom: 20px; }
.nav-group-label {
  font-size: 10px; font-weight: 700;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase; letter-spacing: 0.1em;
  padding: 0 10px 8px;
  white-space: nowrap; overflow: hidden;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  font-size: 13px; font-weight: 500;
  transition: all 0.15s;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
}
.nav-item:hover { color: rgba(255,255,255,0.9); background: rgba(255,255,255,0.08); }
.nav-item.active {
  color: rgba(255,255,255,0.95);
  background: rgba(0,212,255,0.15);
  border-left: 2px solid var(--cyan);
  padding-left: 8px;
}
.nav-item.active .nav-icon { opacity: 1; }
.nav-icon { flex-shrink: 0; opacity: 0.7; }
.nav-label { flex: 1; }
.nav-badge {
  background: var(--red); color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 10px;
  min-width: 18px; text-align: center; flex-shrink: 0;
}
/* P1-1: NEW 뱃지 — 신규 기능 강조 */
.nav-new-badge {
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  color: #fff; font-size: 9px; font-weight: 800;
  padding: 1px 5px; border-radius: 6px;
  letter-spacing: 0.05em; flex-shrink: 0;
  animation: pulse-new 2s ease-in-out infinite;
}
@keyframes pulse-new {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.65; }
}

/* 사이드바 접힘 */
.sidebar.collapsed .nav-group-label,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-badge,
.sidebar.collapsed .nav-new-badge,
.sidebar.collapsed .sidebar-footer,
.sidebar.collapsed .logo-text {
  display: none;
}
.sidebar.collapsed .nav-item { justify-content: center; padding: 10px; }
.sidebar.collapsed .logo-mark { margin: 0 auto; }
.sidebar.collapsed .nav-item.active { border-left: none; padding: 10px; }

.sidebar-footer { padding: 12px; border-top: 1px solid rgba(255,255,255,0.06); flex-shrink: 0; }
.workspace-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px; padding: 10px 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.ws-name {
  font-size: 12px; font-weight: 600;
  color: rgba(255,255,255,0.8);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px;
}
.ws-upgrade-btn { color: var(--cyan); flex-shrink: 0; }

.sidebar-toggle {
  position: absolute; top: 72px; right: -13px;
  width: 26px; height: 26px;
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text2); z-index: 201;
  transition: all 0.15s;
}
.sidebar-toggle:hover { color: var(--cyan); border-color: var(--cyan); }

/* ── 라이트 모드: 사이드바 색상 고정 ── */
body.light .sidebar .nav-group-label { color: rgba(255,255,255,0.4) !important; }
body.light .sidebar .nav-item { color: rgba(255,255,255,0.65) !important; }
body.light .sidebar .nav-item:hover { color: #fff !important; background: rgba(255,255,255,0.1) !important; }
body.light .sidebar .nav-item.active { color: #fff !important; background: rgba(0,212,255,0.2) !important; }
body.light .sidebar .ws-name { color: rgba(255,255,255,0.8) !important; }
body.light .sidebar-toggle { background: #1a1740; border-color: rgba(255,255,255,0.2); color: rgba(255,255,255,0.6); }
body.light .sidebar-toggle:hover { color: #fff; }

/* ── 메인 영역 ── */
.main-area {
  margin-left: var(--sidebar-w);
  flex: 1; display: flex; flex-direction: column;
  min-height: 100vh;
  transition: margin-left 0.25s ease;
}
.main-area.collapsed { margin-left: var(--sidebar-col); }

/* ── 헤더 ── */
.header {
  height: var(--header-h);
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 0 24px; gap: 16px;
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}
.header-left { display: flex; align-items: center; gap: 12px; }
.header-title { font-size: 16px; font-weight: 700; color: var(--text-title); }
.header-right { display: flex; align-items: center; gap: 8px; }

.mobile-menu-btn { display: none; }

.icon-btn {
  width: 36px; height: 36px;
  background: var(--bg-hover2); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text2);
  transition: all 0.15s;
  flex-shrink: 0;
}
.icon-btn:hover { color: var(--cyan); border-color: var(--border2); }

.notif-btn { position: relative; }
.notif-dot {
  position: absolute; top: 7px; right: 7px;
  width: 7px; height: 7px;
  background: var(--red); border-radius: 50%;
  border: 2px solid var(--bg-header);
}

.user-menu-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 10px;
  background: var(--bg-hover2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer;
  transition: all 0.15s; color: var(--text);
}
.user-menu-btn:hover { border-color: var(--border2); }
.avatar {
  width: 28px; height: 28px; border-radius: 6px;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #000; flex-shrink: 0;
}
.user-info .u-name { font-size: 12px; font-weight: 600; color: var(--text-title); }
.user-info .u-plan { font-size: 10px; }

/* ── 페이지 콘텐츠 ── */
.page-content {
  flex: 1; padding: 28px 24px;
  max-width: 1440px; width: 100%;
}

.page-header {
  display: flex; align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px; gap: 16px; flex-wrap: wrap;
}
.page-title { font-size: 22px; font-weight: 800; color: var(--text-title); }
.page-subtitle { font-size: 13px; color: var(--text2); margin-top: 3px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ═══════════════ 카드 ═══════════════ */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
  transition: border-color 0.2s;
}
.card:hover { border-color: var(--border2); }
.card-header {
  display: flex; align-items: center;
  justify-content: space-between; gap: 8px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.card-title {
  font-size: 14px; font-weight: 600; color: var(--text-title);
  display: flex; align-items: center; gap: 8px; margin: 0;
}
.card-subtitle { font-size: 12px; color: var(--text2); margin-top: 2px; }

/* ── KPI 카드 ── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.kpi-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
  transition: all 0.2s; position: relative; overflow: hidden;
}
.kpi-card:hover { border-color: var(--border2); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.kpi-label { font-size: 12px; color: var(--text2); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.kpi-value { font-size: 28px; font-weight: 800; color: var(--text-title); line-height: 1; }
.kpi-change { font-size: 12px; margin-top: 6px; display: flex; align-items: center; gap: 4px; }
.kpi-change.up   { color: var(--green); }
.kpi-change.down { color: var(--red); }
.kpi-change.flat { color: var(--text3); }

/* ── 그리드 ── */
.grid-2  { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3  { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4  { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.col-2 { grid-column: span 2; }
.col-3 { grid-column: span 3; }

/* ═══════════════ 버튼 ═══════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; cursor: pointer;
  border: none; transition: all 0.15s;
  text-decoration: none; white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  color: #000;
}
.btn-primary:hover { opacity: 0.88; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(var(--cyan-rgb),0.3); }
.btn-secondary {
  background: var(--bg-hover2); border: 1px solid var(--border);
  color: var(--text);
}
.btn-secondary:hover { background: var(--bg-hover); border-color: var(--border2); }
.btn-danger {
  background: rgba(var(--red-rgb),0.1); border: 1px solid rgba(var(--red-rgb),0.25);
  color: var(--red);
}
.btn-danger:hover { background: rgba(var(--red-rgb),0.2); }
.btn-ghost { background: transparent; border: none; color: var(--text2); padding: 6px 8px; }
.btn-ghost:hover { color: var(--cyan); }
.btn-sm  { padding: 6px 12px; font-size: 12px; }
.btn-lg  { padding: 13px 24px; font-size: 15px; }
.btn-full { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
.btn-link { background: none; border: none; color: var(--cyan); font-size: 12px; cursor: pointer; padding: 0; }
.btn-link:hover { opacity: 0.8; }

/* ═══════════════ 뱃지 ═══════════════ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 600;
}
.badge-green  { background: rgba(var(--green-rgb),0.12);  border: 1px solid rgba(var(--green-rgb),0.25);  color: var(--green); }
.badge-blue   { background: rgba(96,165,250,0.12);         border: 1px solid rgba(96,165,250,0.25);         color: #60a5fa; }
.badge-yellow { background: rgba(var(--yellow-rgb),0.12); border: 1px solid rgba(var(--yellow-rgb),0.25); color: var(--yellow); }
.badge-red    { background: rgba(var(--red-rgb),0.12);    border: 1px solid rgba(var(--red-rgb),0.25);    color: var(--red); }
.badge-gray   { background: rgba(148,163,184,0.12);        border: 1px solid rgba(148,163,184,0.2);         color: #94a3b8; }
.badge-purple { background: rgba(167,139,250,0.12);        border: 1px solid rgba(167,139,250,0.25);        color: #a78bfa; }
.badge-cyan   { background: rgba(var(--cyan-rgb),0.12);   border: 1px solid rgba(var(--cyan-rgb),0.2);     color: var(--cyan); }
.badge-orange { background: rgba(251,146,60,0.12);         border: 1px solid rgba(251,146,60,0.25);         color: var(--orange); }
/* 라이트모드 badge 색상 (진하게) */
body.light .badge-blue   { background: rgba(37,99,235,0.08);   border-color: rgba(37,99,235,0.2);   color: #1d4ed8; }
body.light .badge-purple { background: rgba(109,40,217,0.08);  border-color: rgba(109,40,217,0.2);  color: #6d28d9; }
body.light .badge-gray   { background: rgba(100,116,139,0.1);  border-color: rgba(100,116,139,0.2); color: #64748b; }

.plan-badge { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 20px; text-transform: uppercase; display: inline-block; margin-top: 2px; }
.plan-free       { background: rgba(148,163,184,0.15); color: #94a3b8; }
.plan-starter    { background: rgba(96,165,250,0.15);  color: #60a5fa; }
.plan-pro        { background: rgba(167,139,250,0.15); color: #a78bfa; }
.plan-enterprise { background: rgba(252,211,77,0.15);  color: #fcd34d; }
/* 라이트모드 plan-badge 가독성 */
body.light .plan-free       { background: rgba(100,116,139,0.12); color: #64748b; }
body.light .plan-starter    { background: rgba(37,99,235,0.1);    color: #1d4ed8; }
body.light .plan-pro        { background: rgba(109,40,217,0.1);   color: #6d28d9; }
body.light .plan-enterprise { background: rgba(161,98,7,0.1);     color: #92400e; }

/* ── 랭크 뱃지 ── */
.rank-badge { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 6px; font-size: 12px; font-weight: 800; flex-shrink: 0; }
.rank-1     { background: linear-gradient(135deg,#ffd700,#ffb300); color: #000; }
.rank-top3  { background: linear-gradient(135deg,#c0c0c0,#a0a0a0); color: #000; }
.rank-top10 { background: rgba(var(--cyan-rgb),0.15); color: var(--cyan); border: 1px solid rgba(var(--cyan-rgb),0.3); }
.rank-other { background: var(--bg-hover2); color: var(--text2); border: 1px solid var(--border); }

/* ═══════════════ 테이블 ═══════════════ */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; }
thead th {
  padding: 12px 16px; text-align: left;
  font-size: 11px; font-weight: 700; color: var(--text3);
  text-transform: uppercase; letter-spacing: 0.06em;
  background: var(--bg-table-head); border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td {
  padding: 13px 16px; font-size: 13px;
  color: var(--text); border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background 0.1s; }
tbody tr:hover { background: var(--bg-row-hover); }

/* ═══════════════ 입력 ═══════════════ */
.input {
  width: 100%; padding: 10px 12px;
  background: var(--bg-input); border: 1px solid var(--border-input);
  border-radius: var(--radius-sm); color: var(--text);
  font-size: 14px; font-family: inherit; outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.input:focus { border-color: var(--border-focus); background: rgba(var(--cyan-rgb),0.04); }
.input::placeholder { color: var(--text3); }
select.input { cursor: pointer; }
textarea.input { resize: vertical; min-height: 80px; line-height: 1.6; }
.input-group { margin-bottom: 14px; }
.input-label { display: block; font-size: 12px; font-weight: 600; color: var(--text2); margin-bottom: 6px; }
.input-hint  { font-size: 11px; color: var(--text3); margin-top: 5px; }
.input-wrap  { position: relative; }
.input-icon  { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text3); pointer-events: none; }
.input-wrap .input { padding-left: 34px; }

.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.form-section-title { font-size: 12px; font-weight: 700; color: var(--cyan); margin-bottom: 12px; letter-spacing: 0.5px; text-transform: uppercase; }
.section-sub { font-size: 10px; font-weight: 400; color: var(--text3); text-transform: none; letter-spacing: 0; }

/* ═══════════════ 구분선 ═══════════════ */
.divider { height: 1px; background: var(--border); margin: 20px 0; }

/* ═══════════════ 프로그레스 ═══════════════ */
.progress-wrap { margin-bottom: 14px; }
.progress-header { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 12px; }
.progress-label { color: var(--text2); }
.progress-val   { color: var(--text-title); font-weight: 600; }
.progress-bar   { height: 6px; background: var(--border); border-radius: 10px; overflow: hidden; }
.progress-fill  { height: 100%; border-radius: 10px; transition: width 0.6s ease; }
.pf-green  { background: linear-gradient(90deg,#22c55e,#16a34a); }
.pf-yellow { background: linear-gradient(90deg,#f59e0b,#d97706); }
.pf-red    { background: linear-gradient(90deg,#ef4444,#dc2626); }
.pf-cyan   { background: linear-gradient(90deg,var(--cyan),#0ea5e9); }
.pf-purple { background: linear-gradient(90deg,#a78bfa,#7c3aed); }

/* ═══════════════ 탭 ═══════════════ */
.tabs {
  display: flex; gap: 4px;
  background: var(--bg-tab); border: 1px solid var(--border);
  border-radius: 10px; padding: 4px;
  margin-bottom: 20px; width: fit-content;
  flex-wrap: wrap;
}
.tab-btn {
  padding: 7px 16px; border-radius: 7px; border: none;
  background: transparent; color: var(--text2);
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: all 0.15s; font-family: inherit;
}
.tab-btn.active { background: rgba(var(--cyan-rgb),0.15); color: var(--cyan); font-weight: 600; }
.tab-btn:hover:not(.active) { color: var(--text); }

/* ═══════════════ 모달 ═══════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: var(--bg-overlay);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 20px;
  backdrop-filter: blur(4px);
  opacity: 0; visibility: hidden;
  transition: all 0.2s;
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal {
  background: var(--bg-modal); border: 1px solid var(--border);
  border-radius: var(--radius-xl); width: 100%; max-width: 480px;
  max-height: 90vh; overflow-y: auto;
  transform: translateY(20px); transition: transform 0.2s;
  box-shadow: var(--shadow-lg);
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-lg { max-width: 680px; }
.modal-xl { max-width: 900px; }
.modal-header {
  padding: 20px 24px 16px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 16px; font-weight: 700; color: var(--text-title); display: flex; align-items: center; gap: 8px; }
.modal-close {
  width: 32px; height: 32px; background: var(--bg-hover2);
  border: none; border-radius: 6px; color: var(--text2);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.modal-close:hover { color: var(--red); background: rgba(var(--red-rgb),0.1); }
.modal-body { padding: 20px 24px; }
.modal-footer {
  padding: 16px 24px 20px;
  display: flex; gap: 10px; justify-content: flex-end;
  border-top: 1px solid var(--border);
}

/* ═══════════════ 드롭다운 ═══════════════ */
.dropdown-wrap { position: relative; }
.notif-dropdown, .user-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--bg-dropdown); border: 1px solid var(--border);
  border-radius: var(--radius-lg); z-index: 300;
  box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(-8px);
  transition: all 0.18s;
}
.notif-dropdown.open, .user-dropdown.open {
  opacity: 1; visibility: visible; transform: translateY(0);
}
/* 알림 드롭다운 */
.notif-dropdown { width: 360px; }
.notif-dd-header {
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.notif-dd-title { font-size: 14px; font-weight: 700; color: var(--text-title); }
.notif-count { font-size: 11px; color: var(--red); margin-left: 6px; }
.notif-list { max-height: 320px; overflow-y: auto; }
.notif-dd-item {
  padding: 12px 16px; display: flex; gap: 10px; align-items: flex-start;
  border-bottom: 1px solid var(--border); cursor: pointer;
  transition: background 0.1s;
}
.notif-dd-item:hover { background: var(--bg-hover2); }
.notif-dd-item.unread { background: rgba(var(--cyan-rgb),0.04); }
.notif-dd-item:last-child { border-bottom: none; }
.notif-dd-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 14px; }
.notif-dd-body { flex: 1; min-width: 0; }
.notif-dd-ttl  { font-size: 13px; font-weight: 600; color: var(--text-title); }
.notif-dd-msg  { font-size: 12px; color: var(--text2); margin-top: 2px; line-height: 1.4; }
.notif-dd-time { font-size: 11px; color: var(--text3); margin-top: 3px; }
.notif-dd-footer {
  display: block; padding: 10px 16px; text-align: center;
  font-size: 12px; color: var(--cyan); border-top: 1px solid var(--border);
  transition: background 0.1s;
}
.notif-dd-footer:hover { background: var(--bg-hover2); }
/* 유저 드롭다운 */
.user-dropdown { width: 230px; overflow: hidden; }
.user-dd-header { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.user-dd-name  { font-size: 13px; font-weight: 700; color: var(--text-title); }
.user-dd-email { font-size: 11px; color: var(--text3); margin-top: 2px; }
.dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; color: var(--text2);
  cursor: pointer; font-size: 13px;
  transition: all 0.1s; text-decoration: none;
}
.dropdown-item:hover { color: var(--text-title); background: var(--bg-hover2); }
.admin-item { color: var(--yellow) !important; }
.danger-item { color: var(--red) !important; }
.dd-divider { height: 1px; background: var(--border); }

/* ═══════════════ 토스트 ═══════════════ */
#toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 9999; display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 12px 16px; border-radius: 10px;
  font-size: 13px; font-weight: 500; color: #fff;
  min-width: 240px; max-width: 360px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: var(--shadow-md);
  animation: slideInRight 0.3s ease;
  pointer-events: all;
}
@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
.toast-icon { width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 12px; font-weight: 700; }
.toast-success { background: rgba(22,163,74,0.95); }
.toast-error   { background: rgba(220,38,38,0.95); }
.toast-info    { background: rgba(var(--cyan-rgb),0.9); color: #000; }
.toast-warning { background: rgba(217,119,6,0.95); }

/* ═══════════════ 알림·빈 상태 ═══════════════ */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text3); }
.empty-icon  { font-size: 40px; margin-bottom: 12px; }
.empty-title { font-size: 15px; font-weight: 600; color: var(--text2); margin-bottom: 6px; }
.empty-desc  { font-size: 13px; }

/* ═══════════════ 스피너 ═══════════════ */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(var(--cyan-rgb),0.2);
  border-top-color: var(--cyan);
  border-radius: 50%; animation: spin 0.8s linear infinite;
  display: inline-block;
}

/* ═══════════════ 차트 컨테이너 ═══════════════ */
.chart-wrap { position: relative; }
.chart-wrap canvas { display: block; }

/* ═══════════════ 로그인 페이지 ═══════════════ */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); padding: 20px;
  background-image:
    radial-gradient(ellipse 600px 400px at 15% 60%, rgba(var(--cyan-rgb),0.06) 0%, transparent 70%),
    radial-gradient(ellipse 500px 400px at 85% 20%, rgba(var(--purple-rgb),0.06) 0%, transparent 70%);
}
.login-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 40px; width: 100%; max-width: 420px;
  box-shadow: var(--shadow-lg);
}
.login-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; justify-content: center; }
.login-logo-text { font-size: 20px; font-weight: 800; color: var(--text-title); }
.login-title { font-size: 22px; font-weight: 800; color: var(--text-title); text-align: center; margin-bottom: 6px; }
.login-sub   { font-size: 13px; color: var(--text2); text-align: center; margin-bottom: 28px; }
.login-footer { text-align: center; font-size: 12px; color: var(--text3); margin-top: 20px; }
.login-footer a { color: var(--cyan); }

.demo-notice {
  background: rgba(var(--cyan-rgb),0.08);
  border: 1px solid rgba(var(--cyan-rgb),0.2);
  border-radius: 10px; padding: 12px 14px;
  font-size: 12px; color: var(--cyan);
  margin-bottom: 20px;
  display: flex; align-items: flex-start; gap: 8px;
  line-height: 1.6;
}

.social-btn {
  width: 100%; padding: 10px;
  background: var(--bg-hover2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text2);
  font-size: 13px; font-weight: 500; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  gap: 8px; transition: all 0.15s; margin-bottom: 10px;
}
.social-btn:hover { background: var(--bg-hover); border-color: var(--border2); }
.or-divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--text3); font-size: 12px; margin: 16px 0;
}
.or-divider::before, .or-divider::after { content:''; flex:1; height:1px; background: var(--border); }

.pw-toggle {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--text3); cursor: pointer; padding: 4px;
}
.pw-toggle:hover { color: var(--text2); }
.input-wrap { position: relative; }

/* 계정 전환 탭 */
.login-role-tabs { display: flex; gap: 4px; background: var(--bg-tab); border: 1px solid var(--border); border-radius: 10px; padding: 4px; margin-bottom: 20px; }
.login-role-tab { flex: 1; padding: 7px; border-radius: 7px; border: none; background: transparent; color: var(--text2); font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.15s; font-family: inherit; text-align: center; }
.login-role-tab.active { background: rgba(var(--cyan-rgb),0.15); color: var(--cyan); font-weight: 600; }

/* ═══════════════ 스텝 인디케이터 ═══════════════ */
.steps { display: flex; align-items: center; margin-bottom: 24px; }
.step  { display: flex; align-items: center; gap: 8px; flex: 1; }
.step-num {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
  border: 2px solid var(--border); color: var(--text3); background: transparent;
}
.step.done   .step-num { background: var(--green); border-color: var(--green); color: #000; }
.step.active .step-num { background: var(--cyan);  border-color: var(--cyan);  color: #000; }
.step-label { font-size: 11px; color: var(--text3); }
.step.done   .step-label { color: var(--green); }
.step.active .step-label { color: var(--cyan); }
.step-line   { flex: 1; height: 1px; background: var(--border); margin-bottom: 16px; }

/* ═══════════════ 타임라인 ═══════════════ */
.timeline { padding-left: 16px; border-left: 2px solid var(--border); }
.timeline-item { position: relative; padding: 0 0 16px 20px; }
.timeline-dot {
  position: absolute; left: -9px; top: 4px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--border); border: 2px solid var(--bg2);
}
.timeline-dot.done   { background: var(--green); }
.timeline-dot.active { background: var(--cyan); box-shadow: 0 0 8px rgba(var(--cyan-rgb),0.4); }
.timeline-time  { font-size: 11px; color: var(--text3); }
.timeline-title { font-size: 13px; font-weight: 600; color: var(--text-title); }
.timeline-desc  { font-size: 12px; color: var(--text2); margin-top: 2px; }

/* ═══════════════ 페이지네이션 ═══════════════ */
.pagination { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 20px; }
.page-btn {
  width: 32px; height: 32px;
  background: var(--bg-hover2); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text2); font-size: 13px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.page-btn:hover:not(:disabled) { border-color: var(--border2); color: var(--text-title); }
.page-btn.active { background: rgba(var(--cyan-rgb),0.15); border-color: rgba(var(--cyan-rgb),0.4); color: var(--cyan); font-weight: 700; }
.page-btn:disabled { opacity: 0.35; cursor: default; }

/* ═══════════════ 검색 바 ═══════════════ */
.search-bar {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-input); border: 1px solid var(--border-input);
  border-radius: var(--radius-sm); padding: 8px 12px;
  min-width: 240px;
  transition: border-color 0.15s;
}
.search-bar:focus-within { border-color: var(--border-focus); }
.search-bar input { flex: 1; background: none; border: none; outline: none; color: var(--text); font-size: 13px; }
.search-bar input::placeholder { color: var(--text3); }

/* ═══════════════ 순위 변동 ═══════════════ */
.rank-up   { color: var(--green); }
.rank-down { color: var(--red); }
.rank-same { color: var(--text3); }

/* ═══════════════ 반응형 ═══════════════ */
@media (max-width: 1024px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .col-2, .col-3 { grid-column: span 1; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); width: var(--sidebar-w) !important; }
  .sidebar.mobile-open { transform: translateX(0); }
  .main-area, .main-area.collapsed { margin-left: 0; }
  .mobile-menu-btn { display: flex !important; }
  .sidebar-toggle { display: none; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-row-2, .form-row-3 { grid-template-columns: 1fr; }
  .page-content { padding: 16px; }
  .header { padding: 0 16px; }
  .notif-dropdown { width: calc(100vw - 32px); right: -60px; }
  .user-dropdown { right: -10px; }
  .page-header { flex-direction: column; }
}

/* ═══════════════ 유틸리티 ═══════════════ */
.text-cyan   { color: var(--cyan); }
.text-green  { color: var(--green); }
.text-red    { color: var(--red); }
.text-yellow { color: var(--yellow); }
.text-purple { color: var(--purple); }
.text-muted  { color: var(--text2); }
.text-3      { color: var(--text3); }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }
.fs-11  { font-size: 11px; }
.fs-12  { font-size: 12px; }
.fs-13  { font-size: 13px; }
.mt-4   { margin-top: 4px; }
.mt-8   { margin-top: 8px; }
.mt-12  { margin-top: 12px; }
.mt-16  { margin-top: 16px; }
.mb-4   { margin-bottom: 4px; }
.mb-8   { margin-bottom: 8px; }
.mb-12  { margin-bottom: 12px; }
.mb-16  { margin-bottom: 16px; }
.flex   { display: flex; align-items: center; gap: 8px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.flex-wrap { flex-wrap: wrap; }
.gap-4  { gap: 4px; }
.gap-6  { gap: 6px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.w-full { width: 100%; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.monospace { font-family: 'Courier New', monospace; }

/* ── 모바일 오버레이 ── */
.mobile-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.5); z-index: 199;
}
@media (max-width: 768px) {
  .sidebar.mobile-open ~ .mobile-overlay { display: block; }
}

/* ═══════════════ 폼 공통 ═══════════════ */
.form-label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--text2); margin-bottom: 6px;
}
.form-select {
  width: 100%; padding: 10px 12px;
  background: var(--bg-input); border: 1px solid var(--border-input);
  border-radius: var(--radius-sm); color: var(--text);
  font-size: 14px; font-family: inherit; outline: none; cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
.form-select:focus { border-color: var(--border-focus); }
.form-textarea {
  width: 100%; padding: 10px 12px;
  background: var(--bg-input); border: 1px solid var(--border-input);
  border-radius: var(--radius-sm); color: var(--text);
  font-size: 14px; font-family: inherit; outline: none;
  resize: vertical; min-height: 80px; line-height: 1.6;
  transition: border-color 0.15s;
}
.form-textarea:focus { border-color: var(--border-focus); }
.form-textarea::placeholder,
.form-select option { color: var(--text3); }

/* 라이트모드 폼 */
body.light .form-select { color: var(--text1); background-color: var(--bg-input); }
body.light .form-select option { background: #fff; color: #1e293b; }
body.light .form-textarea { color: var(--text1); }

/* ═══════════════ 라이트모드 전반 보완 ═══════════════ */
/* 헤더 타이틀 */
body.light .header-title { color: #0f172a; }
/* 카드 */
body.light .card { background: #ffffff; border-color: rgba(0,0,0,0.1); }
body.light .kpi-card { background: #ffffff; }
/* 테이블 */
body.light tbody td { color: #1e293b; }
body.light thead th { color: #64748b; background: #f7f8fc; }
/* 버튼 보조 */
body.light .btn-secondary { background: #f0f2f8; border-color: rgba(0,0,0,0.12); color: #1e293b; }
body.light .btn-secondary:hover { background: #e4e8f0; }
body.light .btn-ghost { color: #64748b; }
body.light .btn-ghost:hover { color: #0099c2; }
/* 드롭다운 */
body.light .dropdown-item { color: #64748b; }
body.light .dropdown-item:hover { color: #0f172a; background: #f0f5ff; }
/* 스크롤바 */
body.light ::-webkit-scrollbar-thumb { background: rgba(0,153,194,0.25); }
/* 탭 */
body.light .tab-btn { color: #64748b; }
body.light .tab-btn.active { background: rgba(0,153,194,0.12); color: #0099c2; }
body.light .tab-btn:hover:not(.active) { color: #1e293b; }
/* 입력 placeholder */
body.light .input::placeholder,
body.light .search-bar input::placeholder { color: #94a3b8; }
/* 순위 뱃지 */
body.light .rank-other { background: #f0f2f8; color: #64748b; border-color: rgba(0,0,0,0.1); }
/* 빈 상태 */
body.light .empty-title { color: #64748b; }
body.light .empty-state  { color: #94a3b8; }
/* 페이지 네이션 */
body.light .page-btn { background: #f0f2f8; border-color: rgba(0,0,0,0.1); color: #64748b; }
body.light .page-btn.active { background: rgba(0,153,194,0.12); color: #0099c2; }
/* 모달 */
body.light .modal-close { background: #f0f2f8; color: #64748b; }
/* 워크스페이스 카드 (라이트 - 사이드바는 다크 유지) */
body.light .workspace-card { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.15); }
/* btn-primary 라이트모드도 동일 */
body.light .btn-primary { color: #000; }

/* ═══════════════════════════════════════════════════════
   P1-2 — UI 강화 패치
   사이드바 glass, 카드 accent, 버튼 glow, 등급 뱃지,
   KPI 대형 카드, 칸반보드, 주문 타임라인
═══════════════════════════════════════════════════════ */

/* ── 1. 사이드바 Glass-morphism 강화 ───────────────── */
.sidebar {
  background: linear-gradient(
    180deg,
    rgba(10, 8, 22, 0.97) 0%,
    rgba(14, 10, 28, 0.95) 100%
  );
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  border-right: 1px solid rgba(124, 58, 237, 0.18);
  box-shadow: 4px 0 32px rgba(0, 0, 0, 0.45);
}
/* 사이드바 내 nav-item 호버 — 좌측 보더 슬라이드 효과 */
.nav-item {
  border-left: 2px solid transparent;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-item:hover {
  border-left-color: rgba(0, 212, 255, 0.4);
  background: rgba(0, 212, 255, 0.07);
  color: rgba(255, 255, 255, 0.95);
  transform: translateX(2px);
}
.nav-item.active {
  border-left-color: var(--cyan);
  background: linear-gradient(90deg, rgba(0,212,255,0.14), rgba(0,212,255,0.04));
  color: #fff;
}
/* 로고 영역 미세 구분선 */
.sidebar-logo {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(0, 0, 0, 0.15);
}

/* ── 2. 카드 Top-accent 라인 (::before) ─────────────── */
.card {
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  opacity: 0;
  transition: opacity 0.25s ease;
}
.card:hover::before   { opacity: 1; }
.card:hover {
  border-color: rgba(var(--cyan-rgb), 0.3);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(var(--cyan-rgb), 0.08);
  transform: translateY(-1px);
}
/* KPI 카드도 동일 적용 */
.kpi-card {
  position: relative;
  overflow: hidden;
}
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  opacity: 0;
  transition: opacity 0.25s ease;
}
.kpi-card:hover::before { opacity: 1; }

/* ── 3. .btn-primary Glow Shadow 강화 ───────────────── */
.btn-primary {
  background: linear-gradient(135deg, #00d4ff 0%, #7c3aed 100%);
  box-shadow: 0 4px 15px rgba(0, 212, 255, 0.25);
  color: #000;
  font-weight: 700;
  letter-spacing: 0.01em;
  position: relative;
  overflow: hidden;
}
.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 60%);
  pointer-events: none;
}
.btn-primary:hover {
  box-shadow: 0 6px 24px rgba(0, 212, 255, 0.45), 0 2px 8px rgba(124, 58, 237, 0.3);
  transform: translateY(-2px);
  opacity: 1;
}
.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 212, 255, 0.3);
}
/* secondary 버튼도 subtle hover 개선 */
.btn-secondary:hover {
  border-color: rgba(var(--cyan-rgb), 0.35);
  background: rgba(var(--cyan-rgb), 0.06);
  color: var(--text-title);
}

/* ── 4. 등급 뱃지 (S/A/B/C/탈락) ───────────────────── */
/* 공통 기반 */
.grade-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 28px; height: 22px;
  padding: 0 7px; border-radius: 6px;
  font-size: 11px; font-weight: 800;
  letter-spacing: 0.04em; flex-shrink: 0;
}
/* S급 — 금색 (메인키 직접 포함 + A급 조건 모두 충족) */
.grade-s {
  background: linear-gradient(135deg, rgba(252,211,77,0.2), rgba(251,146,60,0.15));
  border: 1px solid rgba(252, 211, 77, 0.45);
  color: #fcd34d;
  box-shadow: 0 0 8px rgba(252, 211, 77, 0.2);
}
/* A급 — 청록 (5위이내 + CPC없음 + 플레이스 상단) */
.grade-a {
  background: rgba(var(--cyan-rgb), 0.12);
  border: 1px solid rgba(var(--cyan-rgb), 0.35);
  color: var(--cyan);
}
/* B급 — 파랑 (5위이내 + CPC없음) */
.grade-b {
  background: rgba(96, 165, 250, 0.12);
  border: 1px solid rgba(96, 165, 250, 0.3);
  color: #60a5fa;
}
/* C급 — 회색 (5위이내) */
.grade-c {
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: #94a3b8;
}
/* 탈락 — 빨강 */
.grade-fail {
  background: rgba(var(--red-rgb), 0.1);
  border: 1px solid rgba(var(--red-rgb), 0.3);
  color: var(--red);
}
/* 판정 전 (미측정) */
.grade-pending {
  background: rgba(167, 139, 250, 0.1);
  border: 1px solid rgba(167, 139, 250, 0.25);
  color: #a78bfa;
}
/* 라이트모드 등급 뱃지 */
body.light .grade-s    { background: rgba(217,119,6,0.1);  border-color: rgba(217,119,6,0.3);    color: #b45309; }
body.light .grade-a    { background: rgba(0,153,194,0.1);  border-color: rgba(0,153,194,0.3);    color: #0369a1; }
body.light .grade-b    { background: rgba(37,99,235,0.08); border-color: rgba(37,99,235,0.25);   color: #1d4ed8; }
body.light .grade-c    { background: rgba(71,85,105,0.08); border-color: rgba(71,85,105,0.2);    color: #475569; }
body.light .grade-fail { background: rgba(220,38,38,0.08); border-color: rgba(220,38,38,0.25);   color: #b91c1c; }

/* ── 5. .stat-card-lg — 대형 KPI 카드 ───────────────── */
.stat-card-lg {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  position: relative;
  overflow: hidden;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: default;
}
.stat-card-lg::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  opacity: 0;
  transition: opacity 0.25s;
}
.stat-card-lg:hover::before { opacity: 1; }
.stat-card-lg:hover {
  border-color: rgba(var(--cyan-rgb), 0.3);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  transform: translateY(-2px);
}
/* 색상 테마별 accent */
.stat-card-lg.cyan::before   { background: linear-gradient(90deg, var(--cyan), #00a8cc); }
.stat-card-lg.purple::before { background: linear-gradient(90deg, var(--purple), #9333ea); }
.stat-card-lg.green::before  { background: linear-gradient(90deg, var(--green), #16a34a); }
.stat-card-lg.yellow::before { background: linear-gradient(90deg, var(--yellow), #f59e0b); }
.stat-card-lg.red::before    { background: linear-gradient(90deg, var(--red), #dc2626); }
.stat-card-lg.orange::before { background: linear-gradient(90deg, var(--orange), #ea580c); }
/* 배경 글로우 orb */
.stat-card-lg::after {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 120px; height: 120px;
  border-radius: 50%;
  opacity: 0.04;
  pointer-events: none;
  transition: opacity 0.25s;
}
.stat-card-lg:hover::after   { opacity: 0.08; }
.stat-card-lg.cyan::after    { background: var(--cyan); }
.stat-card-lg.purple::after  { background: var(--purple); }
.stat-card-lg.green::after   { background: var(--green); }
.stat-card-lg.yellow::after  { background: var(--yellow); }
.stat-card-lg.red::after     { background: var(--red); }
.stat-card-lg.orange::after  { background: var(--orange); }

/* 내부 요소 */
.stat-card-lg .scl-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px; flex-shrink: 0;
}
.stat-card-lg.cyan   .scl-icon { background: rgba(var(--cyan-rgb),0.12);   color: var(--cyan); }
.stat-card-lg.purple .scl-icon { background: rgba(var(--purple-rgb),0.12); color: var(--purple); }
.stat-card-lg.green  .scl-icon { background: rgba(var(--green-rgb),0.12);  color: var(--green); }
.stat-card-lg.yellow .scl-icon { background: rgba(var(--yellow-rgb),0.12); color: var(--yellow); }
.stat-card-lg.red    .scl-icon { background: rgba(var(--red-rgb),0.12);    color: var(--red); }
.stat-card-lg.orange .scl-icon { background: rgba(251,146,60,0.12);        color: var(--orange); }
.stat-card-lg .scl-label {
  font-size: 12px; font-weight: 500; color: var(--text2);
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px;
}
.stat-card-lg .scl-value {
  font-size: 36px; font-weight: 900; color: var(--text-title);
  line-height: 1; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stat-card-lg .scl-sub {
  font-size: 12px; color: var(--text3); margin-top: 8px;
  display: flex; align-items: center; gap: 5px;
}
.stat-card-lg .scl-sub.up   { color: var(--green); }
.stat-card-lg .scl-sub.down { color: var(--red); }
/* 라이트모드 */
body.light .stat-card-lg { background: #fff; border-color: rgba(0,0,0,0.09); }
body.light .stat-card-lg:hover { border-color: rgba(0,153,194,0.3); }

/* ── 6. 칸반 보드 ─────────────────────────────────── */
.kanban-board {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 8px;
  align-items: flex-start;
  min-height: 400px;
}
.kanban-board::-webkit-scrollbar { height: 5px; }
.kanban-col {
  flex: 0 0 260px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 220px);
}
.kanban-col-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
  background: var(--bg3);
}
.kanban-col-title {
  font-size: 13px; font-weight: 700; color: var(--text-title);
  display: flex; align-items: center; gap: 8px;
}
.kanban-col-count {
  font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 12px;
  background: var(--bg-hover2); color: var(--text3);
}
/* 컬럼별 헤더 색상 */
.kanban-col.pending   .kanban-col-header { border-top: 3px solid var(--yellow); }
.kanban-col.progress  .kanban-col-header { border-top: 3px solid var(--cyan); }
.kanban-col.completed .kanban-col-header { border-top: 3px solid var(--green); }
.kanban-col.cancelled .kanban-col-header { border-top: 3px solid var(--text3); }
.kanban-col.pending   .kanban-col-count  { background: rgba(var(--yellow-rgb),0.12); color: var(--yellow); }
.kanban-col.progress  .kanban-col-count  { background: rgba(var(--cyan-rgb),0.12);   color: var(--cyan); }
.kanban-col.completed .kanban-col-count  { background: rgba(var(--green-rgb),0.12);  color: var(--green); }

.kanban-col-body {
  padding: 12px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.kanban-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}
.kanban-card:hover {
  border-color: rgba(var(--cyan-rgb), 0.35);
  background: rgba(var(--cyan-rgb), 0.03);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.kanban-card-title {
  font-size: 12px; font-weight: 700; color: var(--text-title);
  margin-bottom: 4px; line-height: 1.4;
}
.kanban-card-sub {
  font-size: 11px; color: var(--text3); margin-bottom: 8px;
}
.kanban-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 8px;
}
.kanban-card-price {
  font-size: 12px; font-weight: 700; color: var(--cyan);
}
.kanban-dday {
  font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 4px;
}
.kanban-dday.urgent { background: rgba(var(--red-rgb),0.15);    color: var(--red); }
.kanban-dday.soon   { background: rgba(var(--yellow-rgb),0.15); color: var(--yellow); }
.kanban-dday.ok     { background: rgba(var(--green-rgb),0.12);  color: var(--green); }
/* 라이트모드 칸반 */
body.light .kanban-col   { background: #f7f8fc; border-color: rgba(0,0,0,0.08); }
body.light .kanban-col-header { background: #f0f2f8; }
body.light .kanban-card  { background: #fff; border-color: rgba(0,0,0,0.08); }
body.light .kanban-card:hover { border-color: rgba(0,153,194,0.3); }

/* ── 7. 주문 타임라인 ────────────────────────────── */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  padding-left: 20px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 7px; top: 8px; bottom: 8px;
  width: 2px;
  background: var(--border);
}
.timeline-step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 0 0 20px 0;
  position: relative;
}
.timeline-step:last-child { padding-bottom: 0; }
.timeline-dot {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg2);
  flex-shrink: 0;
  margin-left: -20px;
  margin-top: 2px;
  position: relative; z-index: 1;
  transition: all 0.2s;
}
/* 상태별 dot 색상 */
.timeline-step.done   .timeline-dot { background: var(--green);  border-color: var(--green);  box-shadow: 0 0 6px rgba(var(--green-rgb),0.4); }
.timeline-step.active .timeline-dot { background: var(--cyan);   border-color: var(--cyan);   box-shadow: 0 0 8px rgba(var(--cyan-rgb),0.5); animation: pulse-dot 1.5s ease-in-out infinite; }
.timeline-step.future .timeline-dot { background: var(--bg3);    border-color: var(--border); }
.timeline-step.error  .timeline-dot { background: var(--red);    border-color: var(--red);    box-shadow: 0 0 6px rgba(var(--red-rgb),0.4); }
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 8px rgba(0,212,255,0.5); }
  50%       { box-shadow: 0 0 16px rgba(0,212,255,0.8); }
}
.timeline-content { flex: 1; padding-top: 0; }
.timeline-title {
  font-size: 13px; font-weight: 700; color: var(--text-title);
  line-height: 1.4;
}
.timeline-step.future .timeline-title { color: var(--text3); font-weight: 500; }
.timeline-desc {
  font-size: 11px; color: var(--text3); margin-top: 3px; line-height: 1.5;
}
.timeline-time {
  font-size: 10px; color: var(--text3); margin-top: 4px;
}
/* 라이트모드 타임라인 */
body.light .timeline::before     { background: rgba(0,0,0,0.1); }
body.light .timeline-step.future .timeline-title { color: #94a3b8; }

/* ── 추가 유틸리티 ─────────────────────────────── */
/* 섹션 구분선 with 텍스트 */
.divider-label {
  display: flex; align-items: center; gap: 12px;
  color: var(--text3); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  margin: 20px 0;
}
.divider-label::before, .divider-label::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* 빠른 액션 카드 */
.quick-action-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 20px 16px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); cursor: pointer;
  text-decoration: none; color: var(--text2);
  transition: all 0.2s; text-align: center;
  position: relative; overflow: hidden;
}
.quick-action-card::before {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  opacity: 0; transition: opacity 0.2s;
}
.quick-action-card:hover::before { opacity: 1; }
.quick-action-card:hover {
  border-color: rgba(var(--cyan-rgb), 0.35);
  color: var(--text-title);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}
.quick-action-card .qa-icon {
  width: 40px; height: 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(var(--cyan-rgb), 0.1); color: var(--cyan);
  transition: background 0.2s;
}
.quick-action-card:hover .qa-icon { background: rgba(var(--cyan-rgb), 0.18); }
.quick-action-card .qa-label { font-size: 12px; font-weight: 600; }
.quick-action-card .qa-sub   { font-size: 10px; color: var(--text3); }

/* 온보딩 가이드 카드 */
.onboarding-card {
  background: linear-gradient(135deg, rgba(0,212,255,0.06), rgba(124,58,237,0.06));
  border: 1px solid rgba(var(--cyan-rgb), 0.2);
  border-radius: var(--radius-lg); padding: 32px;
  text-align: center;
}
.onboarding-card .ob-icon { font-size: 40px; margin-bottom: 12px; }
.onboarding-card .ob-title { font-size: 18px; font-weight: 800; color: var(--text-title); margin-bottom: 8px; }
.onboarding-card .ob-desc  { font-size: 13px; color: var(--text2); margin-bottom: 20px; line-height: 1.7; }

/* 숫자 카운트업 애니메이션 */
.count-up { font-variant-numeric: tabular-nums; transition: all 0.3s; }

/* 스켈레톤 로딩 */
.skeleton {
  background: linear-gradient(90deg, var(--bg3) 25%, var(--bg-hover) 50%, var(--bg3) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton-loading {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-text  { height: 14px; margin-bottom: 8px; }
.skeleton-title { height: 24px; width: 60%; margin-bottom: 12px; }
.skeleton-value { height: 36px; width: 40%; }

/* 플로팅 액션 힌트 */
.float-hint {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--bg2); border: 1px solid rgba(var(--cyan-rgb),0.25);
  border-radius: 12px; padding: 12px 16px;
  font-size: 12px; color: var(--text2);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  display: flex; align-items: center; gap: 8px;
  z-index: 100; animation: float-in 0.3s ease;
}
@keyframes float-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── 라이트모드 P1-2 보완 ─────────────────────────── */
body.light .quick-action-card { background: #fff; border-color: rgba(0,0,0,0.08); }
body.light .quick-action-card:hover { border-color: rgba(0,153,194,0.3); box-shadow: 0 8px 24px rgba(0,0,0,0.1); }
body.light .onboarding-card   { background: linear-gradient(135deg, rgba(0,153,194,0.05), rgba(109,40,217,0.05)); border-color: rgba(0,153,194,0.2); }
body.light .float-hint        { background: #fff; border-color: rgba(0,153,194,0.2); box-shadow: 0 8px 32px rgba(0,0,0,0.12); }
body.light .skeleton          { background: linear-gradient(90deg, #f0f2f8 25%, #e8eaf0 50%, #f0f2f8 75%); background-size: 200% 100%; }
