/* ── CSS 변수 & 리셋 & 공통 컴포넌트 ── */
:root {
  --bg: #f7f8ff;
  --surface: #ffffff;
  --line: #e7eaf7;
  --text: #13204a;
  --muted: #7180a4;
  --primary: #5856f5;
  --primary-dark: #3533c7;
  --primary-soft: #ecebff;
  --radius: 8px;
  --shadow: 0 18px 50px rgba(50,65,135,.09);
  --sidebar-w: 260px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", "Malgun Gothic", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font: inherit; }
img { display: block; max-width: 100%; }
input, textarea, select {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
  transition: border-color .15s;
}
input:focus, textarea:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(88,86,245,.12); }
textarea { resize: vertical; }

/* ── 버튼 ── */
.primary-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 26px;
  background: var(--primary); color: #fff;
  border: none; border-radius: var(--radius);
  font-weight: 700; font-size: 14px;
  box-shadow: 0 8px 20px rgba(88,86,245,.22);
  transition: background .15s, box-shadow .15s;
}
.primary-button:hover { background: var(--primary-dark); }
.primary-button.full { width: 100%; }

.secondary-button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 0 22px;
  background: transparent; color: var(--muted);
  border: 1px solid var(--line); border-radius: var(--radius);
  font-weight: 600; font-size: 14px;
  transition: border-color .15s, color .15s;
}
.secondary-button:hover { border-color: var(--primary); color: var(--primary); }

/* ── 배지 ── */
.category-badge {
  display: inline-flex; align-items: center;
  height: 22px; padding: 0 10px;
  border-radius: 999px; font-size: 11px; font-weight: 700;
  background: var(--primary-soft); color: var(--primary);
}
.category-badge.blue  { background: #e8f0fe; color: #1a56c8; }
.category-badge.yellow{ background: #fef9e7; color: #b45309; }
.category-badge.green { background: #e6f4ea; color: #1a7f37; }
.category-badge.purple{ background: #f3e8fd; color: #6d28d9; }
.category-badge.gray  { background: #f3f4f6; color: #6b7280; }
.category-badge.pink  { background: #fde8f0; color: #be185d; }

.status-badge {
  display: inline-flex; align-items: center;
  height: 26px; padding: 0 12px;
  border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap;
  background: var(--primary-soft); color: var(--primary);
}
.status-badge.green  { background: #e6f4ea; color: #166534; }
.status-badge.orange { background: #fff3e0; color: #c2410c; }
.status-badge.gray   { background: #f3f4f6; color: #6b7280; }

.pill {
  display: inline-flex; align-items: center;
  height: 22px; padding: 0 10px;
  border-radius: 999px; background: var(--primary-soft); color: var(--primary);
  font-size: 12px; font-weight: 700;
}

/* ── 탭 ── */
.tabs {
  display: flex; gap: 4px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--line);
}
.tab {
  padding: 10px 20px;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  color: var(--muted); font-size: 14px; font-weight: 600;
  transition: color .15s, border-color .15s;
}
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab:hover { color: var(--primary); }

/* ── 페이지 헤더 ── */
.page-header { margin-bottom: 20px; }
.page-header h1 { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.page-header p { color: var(--muted); font-size: 13px; }

/* ── 페이지네이션 ── */
.pagination {
  display: flex; justify-content: center; gap: 4px;
  margin-top: 24px;
}
.pagination a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--muted); font-size: 14px;
  transition: background .15s, color .15s;
}
.pagination a:hover { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }
.pagination a.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── 토스트 ── */
.toast-wrap {
  position: fixed; bottom: 24px; right: 24px; z-index: 200;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  padding: 12px 20px;
  background: #13204a; color: #fff;
  border-radius: var(--radius);
  font-size: 14px; font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
  animation: slideIn .25s ease;
}
@keyframes slideIn { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }

/* ── 빈 상태 ── */
.empty-state {
  list-style: none;
  text-align: center; padding: 48px 24px;
  color: var(--muted); font-size: 14px;
}

/* ── 사이트 푸터 ── */
.site-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-top: 20px; padding: 18px 24px;
  border-top: 1px solid var(--line);
  color: var(--muted); font-size: 13px; font-weight: 600;
}
.site-footer a { color: var(--primary); font-weight: 700; }

/* ── 사이드바 기본 ── */
.sidebar {
  position: sticky; top: 0;
  width: var(--sidebar-w);
  height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column;
  padding: 24px 18px;
  border-right: 1px solid var(--line);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(18px);
}
.brand {
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 28px;
}
.brand img { width: 130px; height: auto; }
.nav-list { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  min-height: 44px; padding: 0 14px;
  border-radius: var(--radius);
  color: #4d5b84; font-size: 14px; font-weight: 700;
  border: none; background: transparent; text-align: left; width: 100%;
  transition: background .13s, color .13s;
}
.nav-item:hover, .nav-item.active {
  background: var(--primary-soft); color: var(--primary);
}
.nav-item.logout-item { margin-top: auto; color: var(--muted); }
.nav-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; flex-shrink: 0;
}
.nav-icon svg { display: block; }

/* ── 모바일 바 기본 (숨김) ── */
.mobile-bar { display: none; }
.scrim { display: none; }
