/* ── Reset & Base ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Pretendard', 'Noto Sans KR', sans-serif; background: #f4f6fb; color: #222; font-size: 15px; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }

/* ── Layout ─────────────────────────────────────────────── */
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ── Header ─────────────────────────────────────────────── */
header {
  background: #1a3a5c;
  color: #fff;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
header .logo { font-size: 18px; font-weight: 700; letter-spacing: -0.3px; }
header .logo span { color: #5eaeff; }
header nav a {
  color: #cde;
  font-size: 13px;
  margin-left: 20px;
  padding: 6px 12px;
  border-radius: 6px;
  transition: background .2s;
}
header nav a:hover, header nav a.active { background: rgba(255,255,255,.15); color: #fff; }

/* ── Search Hero ─────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #1a3a5c 0%, #2563a8 100%);
  padding: 48px 20px 40px;
  text-align: center;
  color: #fff;
}
.hero h1 { font-size: 26px; font-weight: 700; margin-bottom: 8px; }
.hero p  { font-size: 14px; opacity: .8; margin-bottom: 28px; }
.search-bar {
  display: flex;
  max-width: 640px;
  margin: 0 auto;
  background: #fff;
  border-radius: 50px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,.2);
}
.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  padding: 14px 22px;
  font-size: 15px;
  color: #222;
}
.search-bar button {
  background: #2563a8;
  border: none;
  color: #fff;
  padding: 14px 26px;
  font-size: 14px;
  font-weight: 600;
  transition: background .2s;
}
.search-bar button:hover { background: #1a3a5c; }

/* ── Filter Bar ─────────────────────────────────────────── */
.filter-bar {
  background: #fff;
  border-bottom: 1px solid #e8eaf0;
  padding: 12px 20px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.filter-bar select {
  border: 1px solid #d0d5e0;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 13px;
  background: #f8fafc;
  color: #333;
  outline: none;
  cursor: pointer;
  min-width: 120px;
}
.filter-bar .result-count { margin-left: auto; font-size: 13px; color: #666; }

/* ── Content Grid ───────────────────────────────────────── */
.content-section { padding: 28px 0 60px; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}
.card {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e8eaf0;
  overflow: hidden;
  transition: transform .15s, box-shadow .15s;
  cursor: pointer;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 8px 28px rgba(0,0,0,.1); }
.card-badge {
  display: flex;
  gap: 6px;
  padding: 14px 16px 0;
}
.badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  background: #e8f0fe;
  color: #2563a8;
}
.badge.type  { background: #fef3e2; color: #d97706; }
.badge.level { background: #e6faf0; color: #16a34a; }
.card-body { padding: 12px 16px 16px; }
.card-title {
  font-size: 14px;
  font-weight: 600;
  color: #1a2a3a;
  line-height: 1.5;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: #888;
}
.card-price {
  margin-top: 10px;
  font-size: 15px;
  font-weight: 700;
  color: #2563a8;
}

/* ── Pagination ─────────────────────────────────────────── */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
}
.pagination button {
  border: 1px solid #dde;
  background: #fff;
  padding: 7px 13px;
  border-radius: 8px;
  font-size: 13px;
  color: #444;
  transition: all .15s;
}
.pagination button:hover, .pagination button.active {
  background: #2563a8;
  border-color: #2563a8;
  color: #fff;
}
.pagination button:disabled { opacity: .4; cursor: default; }

/* ── Empty State ────────────────────────────────────────── */
.empty { text-align: center; padding: 80px 0; color: #aaa; }
.empty .icon { font-size: 52px; margin-bottom: 16px; }
.empty p { font-size: 15px; }

/* ── Modal ──────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 780px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 16px 60px rgba(0,0,0,.25);
  animation: slideUp .2s ease;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-header {
  position: sticky;
  top: 0;
  background: #fff;
  border-bottom: 1px solid #eee;
  padding: 20px 24px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  z-index: 10;
}
.modal-header-info { flex: 1; }
.modal-header-info h2 { font-size: 17px; font-weight: 700; line-height: 1.5; color: #1a2a3a; }
.modal-header-info .cats { font-size: 12px; color: #888; margin-top: 4px; }
.modal-close {
  background: none;
  border: none;
  font-size: 22px;
  color: #999;
  padding: 0 4px;
  line-height: 1;
  flex-shrink: 0;
}
.modal-close:hover { color: #333; }
.modal-body { padding: 24px; }
.info-section { margin-bottom: 24px; }
.info-section h3 {
  font-size: 13px;
  font-weight: 700;
  color: #2563a8;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid #e8f0fe;
}
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.info-item label { font-size: 11px; color: #999; display: block; margin-bottom: 2px; }
.info-item span  { font-size: 13px; color: #222; font-weight: 500; }
.info-text { font-size: 13px; color: #444; line-height: 1.8; white-space: pre-wrap; word-break: break-word; }
.sample-btn {
  display: inline-block;
  margin-top: 12px;
  background: #2563a8;
  color: #fff;
  padding: 9px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  transition: background .2s;
}
.sample-btn:hover { background: #1a3a5c; }

/* ── Admin ──────────────────────────────────────────────── */
.admin-hero {
  background: linear-gradient(135deg, #1a3a5c, #2563a8);
  color: #fff;
  padding: 32px 20px;
}
.admin-hero h1 { font-size: 22px; font-weight: 700; }
.admin-hero p  { font-size: 13px; opacity: .8; margin-top: 4px; }

.admin-toolbar {
  background: #fff;
  border-bottom: 1px solid #e8eaf0;
  padding: 14px 20px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.admin-toolbar input[type=text] {
  border: 1px solid #d0d5e0;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  outline: none;
  width: 240px;
}
.btn {
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  transition: filter .15s;
}
.btn:hover { filter: brightness(.9); }
.btn-primary   { background: #2563a8; color: #fff; }
.btn-success   { background: #16a34a; color: #fff; }
.btn-danger    { background: #dc2626; color: #fff; }
.btn-warning   { background: #d97706; color: #fff; }
.btn-secondary { background: #e5e7eb; color: #333; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

.admin-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 20px;
  background: #f8fafc;
  border-bottom: 1px solid #e8eaf0;
}
.stat-card {
  background: #fff;
  border: 1px solid #e8eaf0;
  border-radius: 10px;
  padding: 14px 20px;
  min-width: 140px;
}
.stat-card .num { font-size: 26px; font-weight: 700; color: #2563a8; }
.stat-card .lbl { font-size: 12px; color: #888; margin-top: 2px; }

/* ── Upload Box ─────────────────────────────────────────── */
.upload-box {
  border: 2px dashed #b0c4de;
  border-radius: 12px;
  padding: 28px;
  text-align: center;
  background: #f0f6ff;
  margin: 16px 0;
  cursor: pointer;
  transition: border-color .2s;
}
.upload-box:hover { border-color: #2563a8; }
.upload-box p { font-size: 14px; color: #555; margin-top: 8px; }
.upload-box .icon { font-size: 36px; }

/* ── Table ──────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  white-space: nowrap;
}
th {
  background: #f0f4fa;
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  color: #444;
  border-bottom: 2px solid #dde;
  position: sticky;
  top: 0;
}
td {
  padding: 9px 12px;
  border-bottom: 1px solid #eef;
  color: #333;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
}
tr:hover td { background: #f5f8ff; }
.cb-col { width: 36px; text-align: center; }
input[type=checkbox] { width: 15px; height: 15px; cursor: pointer; }

/* ── Form Modal ─────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group.full { grid-column: 1 / -1; }
.form-group label { font-size: 12px; font-weight: 600; color: #555; }
.form-group input,
.form-group select,
.form-group textarea {
  border: 1px solid #d0d5e0;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color .2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: #2563a8; }
.form-group textarea { resize: vertical; min-height: 80px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* ── Toast ──────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #222;
  color: #fff;
  padding: 11px 22px;
  border-radius: 10px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: all .3s;
  z-index: 9999;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { background: #16a34a; }
.toast.error   { background: #dc2626; }

/* ── Progress ───────────────────────────────────────────── */
.progress-bar { height: 4px; background: #e0e7ff; border-radius: 2px; overflow: hidden; margin: 8px 0; }
.progress-fill { height: 100%; background: #2563a8; width: 0; transition: width .3s; border-radius: 2px; }

/* ── Recommend Cards ────────────────────────────────────── */
.recommend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.rec-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, background .15s;
}
.rec-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,.08);
  background: #fff;
}
.rec-badges { display: flex; gap: 5px; margin-bottom: 8px; flex-wrap: wrap; }
.rec-title {
  font-size: 13px;
  font-weight: 600;
  color: #1a2a3a;
  line-height: 1.5;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.rec-meta  { font-size: 11px; color: #999; }
.rec-price { font-size: 13px; font-weight: 700; color: #2563a8; margin-top: 6px; }

@media (max-width: 600px) {
  .form-grid { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr; }
  .admin-toolbar input[type=text] { width: 100%; }
}
