:root {
  --bg: #f7f3e8;
  --ink: #2f2a1e;
  --line: #d2c5a1;
  --panel: #fffdf7;
  --muted: #6a604e;
  --draft: #8f5f2a;
  --review: #2d628f;
  --published: #2f6d3d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "NanumSquare", "Malgun Gothic", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 98% 4%, #fff1ca 0%, transparent 25%),
    linear-gradient(180deg, #faf7f0 0%, var(--bg) 100%);
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
  padding: 20px clamp(16px, 3vw, 36px) 12px;
}

.kicker {
  margin: 0;
  font-size: 0.86rem;
  color: #5f5747;
}

h1 {
  margin: 6px 0 0;
  font-size: clamp(1.4rem, 2.5vw, 2rem);
}

.back-link {
  border: 1px solid var(--line);
  background: #fff;
  color: #3e3626;
  text-decoration: none;
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 700;
}

.admin-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 12px;
  padding: 0 clamp(14px, 3vw, 36px) 24px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  padding: 12px;
}

.panel h2 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.auth-panel,
.topic-panel,
.faq-panel,
.source-panel,
.journey-panel,
.quick-card-panel,
.season-alert-panel,
.featured-question-panel,
.question-analysis-panel,
.board-panel,
.deleted-panel {
  grid-column: 1 / 2;
}

.audit-panel {
  grid-column: 2 / 3;
  grid-row: 1 / -1;
}

.auth-grid {
  display: grid;
  grid-template-columns: 1fr 1fr auto auto;
  gap: 8px;
  align-items: end;
}

label {
  display: grid;
  gap: 5px;
  font-size: 0.9rem;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  font: inherit;
  background: #fff;
}

textarea {
  resize: vertical;
}

.btn {
  border: 1px solid #bba975;
  background: #fcf4df;
  color: #3b2f1c;
  border-radius: 8px;
  padding: 8px 10px;
  font-weight: 700;
  cursor: pointer;
}

.btn:hover {
  background: #f6ebcf;
}

.btn.ghost {
  background: #fff;
}

.status-list {
  margin: 10px 0 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.status-list p {
  margin: 4px 0;
}

.help-text {
  margin: 8px 0 0;
  font-size: 0.84rem;
  color: var(--muted);
}

.topic-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.topic-grid .full {
  grid-column: 1 / 3;
}

#qa-note[readonly] {
  background: #fffdf6;
}

.topic-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.column h3 {
  margin: 0 0 8px;
  font-size: 0.96rem;
}

.column span {
  color: var(--muted);
  font-weight: 400;
}

.card-list,
#audit-log {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.compact-list {
  margin-top: 10px;
}

.compact-list .content-card {
  background: #fffef9;
}

.compact-list .action-row {
  margin-top: 2px;
}

.content-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 8px;
  display: grid;
  gap: 6px;
}

.content-card h4 {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.35;
}

.meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.status-pill {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 8px;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
}

.status-pill.draft {
  background: var(--draft);
}

.status-pill.review {
  background: var(--review);
}

.status-pill.published {
  background: var(--published);
}

.status-pill.pending-delete {
  background: #8b1f1f;
}

.deletion-note {
  margin: 0;
  padding: 6px 8px;
  border: 1px dashed #d9a59f;
  border-radius: 8px;
  color: #6f2f24;
  background: #fff1ee;
  font-size: 0.78rem;
}

.reason-input {
  width: 100%;
  min-height: 54px;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.action-btn {
  border: 1px solid #bba975;
  background: #fcf4df;
  color: #3b2f1c;
  border-radius: 8px;
  padding: 6px 8px;
  font-weight: 700;
  cursor: pointer;
}

.action-btn:hover {
  background: #f6ebcf;
}

.action-btn.reject {
  border-color: #bc7864;
  background: #fee7df;
  color: #5f2b1d;
}

.action-btn.reject:hover {
  background: #fbdccf;
}

.action-btn.restore {
  border-color: #7aa37e;
  background: #eaf8ed;
  color: #204f28;
}

.action-btn.restore:hover {
  background: #daf0df;
}

#audit-log li {
  border-bottom: 1px dashed #e1d8bf;
  padding-bottom: 6px;
  font-size: 0.84rem;
  line-height: 1.45;
}

#audit-log li:last-child {
  border-bottom: 0;
}

@media (max-width: 1100px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .auth-panel,
  .topic-panel,
  .board-panel,
  .audit-panel {
    grid-column: 1 / 2;
    grid-row: auto;
  }
}

@media (max-width: 920px) {
  .auth-grid {
    grid-template-columns: 1fr;
  }

  .topic-grid {
    grid-template-columns: 1fr;
  }

  .topic-grid .full {
    grid-column: 1 / 2;
  }

  .board {
    grid-template-columns: 1fr;
  }
}
