:root {
  --primary: #1e40af;
  --ink: #111827;
  --muted: #64748b;
  --line: #dbe3ef;
  --bg: #f1f5f9;
  --surface: #ffffff;
  --success: #047857;
  --danger: #b91c1c;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  background: var(--bg);
}

a {
  color: inherit;
}

button,
input,
textarea,
select {
  font: inherit;
}

.login-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(520px, 100%);
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.12);
}

.login-card h1 {
  margin: 0 0 10px;
  font-size: 30px;
}

.notice {
  padding: 12px 14px;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  color: #1e3a8a;
  background: #eff6ff;
}

.login-actions,
.form-actions,
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.field {
  display: grid;
  gap: 7px;
  margin-top: 14px;
  font-weight: 700;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.field textarea {
  resize: vertical;
}

.button {
  min-height: 40px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-weight: 800;
  background: #fff;
  cursor: pointer;
}

.button.primary {
  border-color: var(--primary);
  color: #fff;
  background: var(--primary);
}

.button.danger {
  border-color: #fecaca;
  color: var(--danger);
  background: #fff7f7;
}

.admin-shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 20px;
  color: #cbd5e1;
  background: #0f172a;
}

.sidebar h1 {
  margin: 0 0 2px;
  color: #fff;
  font-size: 22px;
}

.sidebar p {
  margin: 0 0 22px;
  color: #94a3b8;
  font-size: 13px;
}

.sidebar nav {
  display: grid;
  gap: 6px;
}

.sidebar button,
.sidebar a {
  display: flex;
  width: 100%;
  min-height: 42px;
  align-items: center;
  padding: 9px 10px;
  border: 0;
  border-radius: 7px;
  color: #dbeafe;
  background: transparent;
  text-align: left;
  text-decoration: none;
  font-weight: 800;
  cursor: pointer;
}

.sidebar button.is-active,
.sidebar button:hover,
.sidebar a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.admin-main {
  min-width: 0;
}

.admin-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.admin-top strong {
  display: block;
}

.admin-content {
  padding: 24px;
}

.panel {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.panel + .panel {
  margin-top: 18px;
}

.panel h2 {
  margin: 0 0 14px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.stat-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafc;
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.stat-card strong {
  display: block;
  margin-top: 6px;
  font-size: 30px;
}

.content-list {
  display: grid;
  gap: 10px;
}

.list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.list-item h3 {
  margin: 0 0 4px;
  font-size: 17px;
}

.list-item p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.badge {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 999px;
  color: #1e3a8a;
  background: #dbeafe;
  font-size: 12px;
  font-weight: 900;
}

.badge.draft {
  color: #854d0e;
  background: #fef3c7;
}

.editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid .wide {
  grid-column: 1 / -1;
}

.preview {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafc;
}

.json-box {
  width: 100%;
  min-height: 220px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

.empty {
  padding: 18px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

@media (max-width: 960px) {
  .admin-shell,
  .editor-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .stats-grid,
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .admin-top,
  .list-item {
    display: block;
  }

  .stats-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }
}
