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

:root {
  --blue: #3182F6;
  --blue-weak: #E8F2FF;
  --blue-strong: #1B64DA;
  --bg: #FFFFFF;
  --surface: #F9FAFB;
  --surface-2: #F2F4F6;
  --text-strong: #191F28;
  --text: #4E5968;
  --text-weak: #8B95A1;
  --text-faint: #B0B8C1;
  --border: #E5E8EB;
  --border-light: #F2F4F6;
  --success: #00C896;
  --warning: #FF9500;
  --danger: #F04452;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-strong);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
a { color: inherit; text-decoration: none; }
input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; outline: none; border: none; background: none; }
ul, ol { list-style: none; }

/* === Mobile screen container === */
.screen {
  max-width: 420px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  position: relative;
}
.screen-scroll { padding-bottom: 100px; }

/* === Mobile header === */
.app-header {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}
.app-header.with-border { border-bottom: 1px solid var(--border-light); }
.app-header h1 { font-size: 17px; font-weight: 600; }
.app-header .icon-btn { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; margin: 0 -10px; }
.app-header .icon-btn svg { width: 24px; height: 24px; color: var(--text-strong); }

/* === Section === */
.section { padding: 20px; }
.section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-weak);
  margin-bottom: 12px;
}
.page-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  padding: 8px 20px 24px;
}

/* === Card === */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.card-white {
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.card-blue {
  background: var(--blue-weak);
  border-radius: var(--radius-lg);
  padding: 20px;
}

/* === Button === */
.btn {
  width: 100%;
  height: 56px;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .15s, background .15s;
}
.btn:active { opacity: 0.8; }
.btn-primary { background: var(--blue); color: white; }
.btn-secondary { background: var(--surface-2); color: var(--text-strong); }
.btn-ghost { background: transparent; color: var(--blue); }
.btn-sm { height: 40px; font-size: 14px; border-radius: var(--radius-sm); padding: 0 14px; width: auto; }

/* === Bottom action === */
.bottom-action {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  max-width: 420px;
  width: 100%;
  padding: 12px 20px 24px;
  background: var(--bg);
  border-top: 1px solid var(--border-light);
}

/* === Input === */
.input-group { margin-bottom: 16px; }
.input-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 8px;
  display: block;
}
.input {
  width: 100%;
  height: 56px;
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 0 18px;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-strong);
}
.input::placeholder { color: var(--text-faint); font-weight: 400; }
.input-row { display: flex; gap: 8px; }
.input-row .input { flex: 1; }

/* === List item === */
.list-item {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg);
}
.list-item:last-child { border-bottom: none; }
.list-item-body { flex: 1; min-width: 0; }
.list-item-title { font-size: 15px; font-weight: 600; color: var(--text-strong); }
.list-item-sub { font-size: 13px; color: var(--text-weak); margin-top: 2px; }
.list-item-right { font-size: 14px; color: var(--text); font-weight: 600; margin-left: 12px; }

/* === Badge === */
.badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}
.badge-blue { background: var(--blue-weak); color: var(--blue); }
.badge-green { background: #E5F8F3; color: #009973; }
.badge-orange { background: #FFF3E0; color: #E68600; }
.badge-red { background: #FEE9E9; color: #D9342B; }
.badge-gray { background: var(--surface-2); color: var(--text); }

/* === Bottom nav === */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  max-width: 420px;
  width: 100%;
  height: 64px;
  background: var(--bg);
  border-top: 1px solid var(--border-light);
  display: flex;
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 500;
}
.nav-item.active { color: var(--blue); }
.nav-item svg { width: 24px; height: 24px; }

/* === Quick menu grid === */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.quick-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 4px;
  border-radius: var(--radius);
  background: var(--surface);
}
.quick-item .icon-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue);
}
.quick-item .icon-circle svg { width: 22px; height: 22px; }
.quick-item span { font-size: 12px; font-weight: 500; color: var(--text); }

/* === Desktop (admin) === */
.admin-body {
  display: flex;
  min-height: 100vh;
  background: var(--surface);
}
.admin-sidebar {
  width: 240px;
  background: var(--bg);
  border-right: 1px solid var(--border-light);
  padding: 24px 16px;
  flex-shrink: 0;
}
.admin-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px 24px;
  font-weight: 700;
  font-size: 16px;
}
.admin-logo .logo-mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--blue); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}
.admin-nav { display: flex; flex-direction: column; gap: 2px; }
.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
}
.admin-nav-item:hover { background: var(--surface-2); }
.admin-nav-item.active { background: var(--blue-weak); color: var(--blue); font-weight: 600; }
.admin-nav-item svg { width: 18px; height: 18px; }
.admin-nav-section {
  font-size: 11px; font-weight: 600; color: var(--text-faint);
  padding: 16px 12px 6px; letter-spacing: 0.04em;
}

.admin-main { flex: 1; padding: 32px 40px; overflow: auto; }
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; }
.admin-title { font-size: 24px; font-weight: 700; }
.admin-sub { color: var(--text-weak); font-size: 14px; margin-top: 4px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.stat-label { font-size: 13px; color: var(--text-weak); font-weight: 500; }
.stat-value { font-size: 28px; font-weight: 700; margin-top: 8px; letter-spacing: -0.02em; }
.stat-delta { font-size: 12px; margin-top: 4px; font-weight: 600; }
.stat-delta.up { color: var(--success); }
.stat-delta.down { color: var(--danger); }

.panel-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.panel {
  background: var(--bg);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.panel-title { font-size: 16px; font-weight: 700; }

.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-weak);
  padding: 10px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border-light);
}
.table th:first-child { border-top-left-radius: 8px; }
.table th:last-child { border-top-right-radius: 8px; }
.table td {
  padding: 14px 12px;
  font-size: 14px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-strong);
}
.table tr:last-child td { border-bottom: none; }

.divider { height: 8px; background: var(--surface-2); margin: 0; }
.divider-line { height: 1px; background: var(--border-light); margin: 0 20px; }
