@import url('https://fonts.googleapis.com/css2?family=Pretendard:wght@300;400;500;600;700;800;900&display=swap');
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --toss-blue: #3182F6;
  --toss-blue-dark: #1B64DA;
  --toss-blue-light: #EBF3FF;
  --toss-blue-mid: #C9DEFF;
  --navy: #191F28;
  --gray-900: #191F28;
  --gray-800: #333D4B;
  --gray-700: #4E5968;
  --gray-600: #6B7684;
  --gray-500: #8B95A1;
  --gray-400: #B0B8C1;
  --gray-300: #D1D6DB;
  --gray-200: #E5E8EB;
  --gray-100: #F2F4F6;
  --gray-50: #F9FAFB;
  --white: #FFFFFF;
  --success: #0DA674;
  --success-bg: #E8F8F3;
  --danger: #F04452;
  --danger-bg: #FFF0F2;
  --warning: #F5A623;
  --warning-bg: #FFF8EC;
  --radius-xl: 20px;
  --radius-lg: 16px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --transition: 0.15s cubic-bezier(0.4,0,0.2,1);
}

html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', sans-serif;
  background: var(--gray-50);
  color: var(--gray-900);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 20px; border-radius: var(--radius); font-size: 15px;
  font-weight: 600; cursor: pointer; border: none; transition: all var(--transition);
  font-family: inherit; line-height: 1; white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--toss-blue); color: white; }
.btn-primary:hover { background: var(--toss-blue-dark); }
.btn-secondary { background: var(--gray-100); color: var(--gray-800); }
.btn-secondary:hover { background: var(--gray-200); }
.btn-ghost { background: transparent; color: var(--gray-700); }
.btn-ghost:hover { background: var(--gray-100); }
.btn-danger { background: var(--danger-bg); color: var(--danger); }
.btn-danger:hover { background: #FFE0E3; }
.btn-full { width: 100%; }
.btn-xl { padding: 18px 28px; font-size: 17px; border-radius: var(--radius-lg); }
.btn-lg { padding: 15px 24px; font-size: 16px; border-radius: var(--radius-lg); }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: var(--radius-sm); }
.btn-xs { padding: 5px 10px; font-size: 12px; border-radius: var(--radius-xs); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* Toss Blue Button */
.btn-toss {
  background: var(--toss-blue); color: white;
  font-size: 17px; font-weight: 700;
  padding: 18px; border-radius: var(--radius-lg);
  width: 100%; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-family: inherit; transition: background var(--transition);
}
.btn-toss:hover { background: var(--toss-blue-dark); }
.btn-toss:active { transform: scale(0.99); }

/* ── Card ── */
.card {
  background: var(--white); border-radius: var(--radius-xl);
  border: 1px solid var(--gray-200); padding: 24px;
  box-shadow: var(--shadow-sm);
}
.card-lg { padding: 32px; }

/* ── Forms ── */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 14px; font-weight: 600; color: var(--gray-800); margin-bottom: 8px; }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 14px 16px; border: 1.5px solid var(--gray-200);
  border-radius: var(--radius); font-size: 15px; font-family: inherit;
  color: var(--gray-900); background: var(--white); transition: border var(--transition);
  outline: none; appearance: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--toss-blue); box-shadow: 0 0 0 3px rgba(49,130,246,0.12);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--gray-400); }
.form-textarea { resize: vertical; min-height: 100px; line-height: 1.6; }
.form-hint { font-size: 13px; color: var(--gray-500); margin-top: 6px; }
.form-error { font-size: 13px; color: var(--danger); margin-top: 6px; }

/* ── Badge ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px;
  border-radius: 99px; font-size: 12px; font-weight: 600; letter-spacing: -0.2px;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger  { background: var(--danger-bg); color: var(--danger); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-blue    { background: var(--toss-blue-light); color: var(--toss-blue); }
.badge-gray    { background: var(--gray-100); color: var(--gray-600); }
/* legacy aliases */
.badge-active   { background: var(--success-bg); color: var(--success); }
.badge-inactive { background: var(--gray-100); color: var(--gray-500); }
.badge-new      { background: var(--toss-blue-light); color: var(--toss-blue); }

/* ── Nav ── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(255,255,255,0.92); backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--gray-200); height: 60px;
  display: flex; align-items: center; padding: 0 24px;
}
.nav-inner { max-width: 1200px; width: 100%; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; }
.nav-logo { font-size: 20px; font-weight: 800; color: var(--toss-blue); letter-spacing: -0.5px; }
.nav-links { display: flex; align-items: center; gap: 8px; }
.nav-link { padding: 8px 14px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 500; color: var(--gray-600); transition: all var(--transition); }
.nav-link:hover { background: var(--gray-100); color: var(--gray-900); }

/* ── Sidebar layout ── */
.app-layout { display: flex; min-height: 100vh; padding-top: 60px; }
.sidebar {
  width: 220px; flex-shrink: 0; background: var(--white);
  border-right: 1px solid var(--gray-200); padding: 20px 12px;
  position: fixed; top: 60px; bottom: 0; overflow-y: auto;
}
.sidebar-section { font-size: 11px; font-weight: 700; color: var(--gray-400); letter-spacing: 0.06em; text-transform: uppercase; padding: 16px 12px 8px; }
.sidebar-menu { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.sidebar-item a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: var(--radius-sm); font-size: 14px; font-weight: 500;
  color: var(--gray-700); transition: all var(--transition);
}
.sidebar-item a:hover { background: var(--gray-100); color: var(--gray-900); }
.sidebar-item a.active { background: var(--toss-blue-light); color: var(--toss-blue); font-weight: 600; }
.sidebar-item a .icon { font-size: 17px; flex-shrink: 0; width: 20px; text-align: center; }
.main-content { flex: 1; margin-left: 220px; padding: 36px 40px; max-width: 1200px; }

/* ── Page header ── */
.page-header { margin-bottom: 28px; }
.page-title { font-size: 24px; font-weight: 800; letter-spacing: -0.5px; color: var(--gray-900); }
.page-sub { font-size: 14px; color: var(--gray-500); margin-top: 4px; }
.page-header-row { display: flex; align-items: center; justify-content: space-between; }

/* ── Stats grid ── */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
.stat-card { background: var(--white); border-radius: var(--radius-lg); border: 1px solid var(--gray-200); padding: 20px; }
.stat-label { font-size: 13px; font-weight: 500; color: var(--gray-500); }
.stat-value { font-size: 28px; font-weight: 800; letter-spacing: -1px; margin: 6px 0 4px; color: var(--gray-900); }
.stat-change { font-size: 12px; color: var(--success); font-weight: 600; }

/* ── Table ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th { text-align: left; padding: 12px 16px; font-size: 12px; font-weight: 700; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid var(--gray-200); background: var(--gray-50); }
tbody td { padding: 15px 16px; font-size: 14px; border-bottom: 1px solid var(--gray-100); color: var(--gray-800); }
tbody tr:hover td { background: var(--gray-50); }
tbody tr:last-child td { border-bottom: none; }

/* ── Divider ── */
.divider { border: none; border-top: 1px solid var(--gray-200); margin: 24px 0; }

/* ── Toast ── */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(100px);
  z-index: 9999; background: var(--gray-900); color: white; padding: 14px 22px;
  border-radius: var(--radius-lg); font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-lg); opacity: 0; transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
  white-space: nowrap; pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

/* ── Animations ── */
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }
.fade-up   { animation: fadeUp 0.4s ease both; }
.fade-up-2 { animation: fadeUp 0.4s 0.08s ease both; }
.fade-up-3 { animation: fadeUp 0.4s 0.16s ease both; }
.fade-up-4 { animation: fadeUp 0.4s 0.24s ease both; }

/* ── Spinner ── */
.spinner { width: 20px; height: 20px; border: 2px solid rgba(255,255,255,0.3); border-top-color: white; border-radius: 50%; animation: spin 0.7s linear infinite; }
.spinner-dark { border-color: var(--gray-200); border-top-color: var(--toss-blue); }

/* ── Empty state ── */
.empty-state { padding: 60px 24px; text-align: center; color: var(--gray-500); }
.empty-state .empty-icon { font-size: 44px; margin-bottom: 14px; }
.empty-state h3 { font-size: 17px; font-weight: 700; color: var(--gray-800); margin-bottom: 6px; }
.empty-state p { font-size: 14px; }

/* ── Responsive ── */
@media (max-width: 960px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; padding: 24px 20px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .main-content { padding: 20px 16px; }
}
