/* ─── Admin Panel Styles ─── */
:root {
  --admin-sidebar-width: 240px;
  --admin-header-height: 56px;
  --admin-bg: #F4F5F7;
  --admin-sidebar-bg: #1E1620;
  --admin-primary: #C06A7C;
  --admin-border: #E2E8F0;
  --admin-text: #1A202C;
  --admin-text-secondary: #718096;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body.admin-body {
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--admin-bg);
  color: var(--admin-text);
  min-height: 100vh;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

/* ─── Login Screen ─── */
.admin-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1E1620 0%, #2D1B25 100%);
}
.admin-login__box {
  background: white;
  border-radius: 16px;
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.admin-login__logo {
  text-align: center;
  margin-bottom: 28px;
}
.admin-login__logo-icon {
  width: 48px;
  height: 48px;
  background: var(--admin-primary);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.2rem;
  font-weight: 800;
  margin: 0 auto 10px;
}
.admin-login__logo-name { font-size: 1.1rem; font-weight: 800; color: #1A202C; }
.admin-login__subtitle { font-size: 0.78rem; color: #718096; margin-top: 2px; }
.admin-login h2 { font-size: 1rem; font-weight: 700; margin-bottom: 20px; }
.admin-notice {
  background: #FFF8E1;
  border: 1px solid #FFD54F;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.78rem;
  color: #E65100;
  margin-bottom: 20px;
  line-height: 1.5;
}
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-form label { font-size: 0.8rem; font-weight: 600; display: block; margin-bottom: 5px; color: #4A5568; }
.login-form input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #E2E8F0;
  border-radius: 8px;
  font: inherit;
  font-size: 0.9rem;
  transition: border-color 0.2s;
}
.login-form input:focus { outline: none; border-color: var(--admin-primary); }
.login-error { font-size: 0.8rem; color: #E53E3E; display: none; margin-top: -4px; }
.login-error.show { display: block; }
.btn-login {
  background: var(--admin-primary);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 11px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  width: 100%;
}
.btn-login:hover { background: #A3566A; }
.login-demo-note { font-size: 0.75rem; color: #A0AEC0; text-align: center; margin-top: 12px; }

/* ─── Admin Layout ─── */
.admin-wrap { display: flex; min-height: 100vh; }

/* ─── Sidebar ─── */
.admin-sidebar {
  width: var(--admin-sidebar-width);
  background: var(--admin-sidebar-bg);
  color: rgba(255,255,255,0.8);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 50;
}
.sidebar-brand {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-brand__name { font-size: 1rem; font-weight: 800; color: white; }
.sidebar-brand__sub { font-size: 0.72rem; color: rgba(255,255,255,0.4); margin-top: 2px; }
.sidebar-nav { padding: 16px 12px; flex: 1; }
.sidebar-section-title { font-size: 0.65rem; font-weight: 700; color: rgba(255,255,255,0.3); letter-spacing: 0.08em; text-transform: uppercase; padding: 8px 8px 4px; }
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.65);
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: 2px;
  user-select: none;
}
.sidebar-item:hover { background: rgba(255,255,255,0.06); color: white; }
.sidebar-item.active { background: var(--admin-primary); color: white; }
.sidebar-item__icon { width: 20px; text-align: center; font-size: 0.9rem; flex-shrink: 0; }
.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 0.78rem;
  color: rgba(255,255,255,0.35);
}
.sidebar-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,0.45);
  cursor: pointer;
  font-size: 0.82rem;
  padding: 6px 0;
}
.sidebar-logout:hover { color: white; }

/* ─── Main Panel ─── */
.admin-main {
  margin-left: var(--admin-sidebar-width);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.admin-topbar {
  background: white;
  height: var(--admin-header-height);
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 40;
}
.admin-topbar__title { font-size: 1rem; font-weight: 700; }
.admin-topbar__actions { display: flex; gap: 10px; align-items: center; }
.admin-user { font-size: 0.82rem; color: var(--admin-text-secondary); display: flex; align-items: center; gap: 8px; }
.admin-user__badge {
  background: var(--admin-primary);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
}
.admin-content { padding: 28px 28px; flex: 1; }

/* ─── Dashboard Cards ─── */
.dash-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
.dash-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid var(--admin-border);
}
.dash-card__label { font-size: 0.75rem; font-weight: 700; color: var(--admin-text-secondary); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 10px; }
.dash-card__value { font-size: 2rem; font-weight: 800; color: var(--admin-text); line-height: 1; }
.dash-card__sub { font-size: 0.75rem; color: var(--admin-text-secondary); margin-top: 6px; }
.dash-card--primary .dash-card__value { color: var(--admin-primary); }
.dash-card--secondary .dash-card__value { color: #7DAAB8; }

/* ─── Admin Panels ─── */
.admin-panel { display: none; }
.admin-panel.active { display: block; }
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.panel-header h2 { font-size: 1.1rem; font-weight: 700; }

/* ─── Buttons ─── */
.btn-admin {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  border: none;
}
.btn-admin--primary { background: var(--admin-primary); color: white; }
.btn-admin--primary:hover { background: #A3566A; }
.btn-admin--outline { background: white; color: var(--admin-text); border: 1.5px solid var(--admin-border); }
.btn-admin--outline:hover { border-color: var(--admin-primary); color: var(--admin-primary); }
.btn-admin--danger { background: #FFF5F5; color: #E53E3E; border: 1.5px solid #FED7D7; }
.btn-admin--danger:hover { background: #FED7D7; }
.btn-admin--sm { padding: 5px 10px; font-size: 0.75rem; }
.btn-admin--success { background: #48BB78; color: white; }
.btn-admin--success:hover { background: #38A169; }

/* ─── Table ─── */
.admin-table-wrap { background: white; border-radius: 12px; border: 1px solid var(--admin-border); overflow: hidden; }
.admin-table { width: 100%; font-size: 0.85rem; }
.admin-table th {
  background: #F7FAFC;
  padding: 11px 16px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--admin-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--admin-border);
}
.admin-table td { padding: 12px 16px; border-bottom: 1px solid var(--admin-border); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #FAFAFA; }
.admin-table__title { font-weight: 600; color: var(--admin-text); }
.admin-table__meta { font-size: 0.75rem; color: var(--admin-text-secondary); margin-top: 2px; }
.admin-table__actions { display: flex; gap: 6px; }
.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 700;
}
.status-badge--published { background: #E6FFED; color: #276749; }
.status-badge--draft { background: #EDF2F7; color: #4A5568; }
.featured-badge {
  display: inline-block;
  background: #FFF3CD;
  color: #856404;
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: 6px;
  margin-left: 4px;
}

/* ─── Form ─── */
.admin-form-wrap { background: white; border-radius: 12px; border: 1px solid var(--admin-border); padding: 24px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 0.8rem; font-weight: 600; margin-bottom: 6px; color: #4A5568; }
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--admin-border);
  border-radius: 8px;
  font: inherit;
  font-size: 0.88rem;
  transition: border-color 0.2s;
  background: white;
  color: var(--admin-text);
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus { outline: none; border-color: var(--admin-primary); }
.form-group textarea { min-height: 180px; resize: vertical; line-height: 1.6; }
.form-group--inline { display: flex; align-items: center; gap: 10px; }
.form-group--inline label { margin-bottom: 0; }
.toggle-switch {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: #CBD5E0;
  border-radius: 22px;
  cursor: pointer;
  transition: background 0.2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--admin-primary); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); }
.form-hint { font-size: 0.75rem; color: var(--admin-text-secondary); margin-top: 4px; }
.form-actions { display: flex; gap: 10px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--admin-border); }

/* ─── Recent Activity ─── */
.admin-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }
.admin-card { background: white; border-radius: 12px; border: 1px solid var(--admin-border); }
.admin-card__header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--admin-border); }
.admin-card__header h3 { font-size: 0.9rem; font-weight: 700; }
.admin-card__body { padding: 16px 20px; }
.recent-item { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--admin-border); }
.recent-item:last-child { border-bottom: none; }
.recent-item__title { font-size: 0.85rem; font-weight: 500; }
.recent-item__meta { font-size: 0.75rem; color: var(--admin-text-secondary); }
.recent-item__date { font-size: 0.75rem; color: var(--admin-text-secondary); flex-shrink: 0; }

/* ─── Settings ─── */
.settings-section { margin-bottom: 28px; }
.settings-section h3 { font-size: 0.85rem; font-weight: 700; color: var(--admin-text-secondary); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 16px; padding-bottom: 8px; border-bottom: 1px solid var(--admin-border); }
.color-input-wrap { display: flex; align-items: center; gap: 10px; }
.color-input-wrap input[type="color"] { width: 40px; height: 36px; border: 1.5px solid var(--admin-border); border-radius: 6px; cursor: pointer; padding: 2px; }
.color-input-wrap input[type="text"] { flex: 1; }
.data-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ─── Toast ─── */
.admin-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #2D3748;
  color: white;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 0.85rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  z-index: 999;
  display: none;
  align-items: center;
  gap: 8px;
}
.admin-toast.show { display: flex; }
.admin-toast--success { background: #276749; }
.admin-toast--error { background: #9B2C2C; }

/* ─── Storage Notice ─── */
.storage-notice { background: #EBF4FF; border: 1px solid #BEE3F8; border-radius: 8px; padding: 10px 14px; font-size: 0.78rem; color: #2A69AC; margin-bottom: 20px; }

/* ─── Responsive ─── */
@media (max-width: 900px) {
  .admin-sidebar { width: 200px; }
  .admin-main { margin-left: 200px; }
  .dash-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-two-col { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .admin-sidebar { transform: translateX(-100%); transition: transform 0.25s; }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .admin-content { padding: 16px; }
  .dash-grid { grid-template-columns: repeat(2, 1fr); }
}

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;700;800&display=swap');
