:root {
  --ink: #10141b;
  --muted: #68707c;
  --line: #dfe4ea;
  --soft: #f5f7f9;
  --navy: #0d2c49;
  --teal: #0a7c86;
  --red: #c43e3e;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f6f8fa;
  color: var(--ink);
  font-family: "Pretendard", "Noto Sans KR", system-ui, sans-serif;
  letter-spacing: 0;
}

.admin-topbar {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}

.admin-topbar::-webkit-scrollbar {
  display: none;
}

.admin-topbar span + span {
  padding-left: 18px;
  border-left: 1px solid var(--line);
}

a {
  color: inherit;
  text-decoration: none;
}

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

.admin-header {
  min-height: 66px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 22px;
  padding: 0 28px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.admin-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: Georgia, serif;
  font-size: 24px;
  font-weight: 700;
}

.admin-brand__mark {
  width: 46px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--navy);
}

.admin-brand__mark svg {
  width: 43px;
  height: 43px;
  overflow: visible;
}

.admin-brand__q,
.admin-brand__tail,
.admin-brand__line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.admin-brand__q {
  stroke: #fff;
  stroke-width: 8;
}

.admin-brand__tail {
  stroke: var(--teal);
  stroke-width: 8;
}

.admin-brand__line {
  stroke: #9bd9de;
  stroke-width: 5;
}

.admin-header nav,
.admin-user {
  display: flex;
  align-items: center;
  gap: 14px;
}

.admin-header nav a,
.admin-user a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.admin-main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 30px 0 60px;
}

.page-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.page-head h1 {
  margin: 0;
  font-size: 30px;
}

.page-head p {
  margin: 8px 0 0;
  color: var(--muted);
}

.button,
button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

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

.button.danger,
button.danger {
  border-color: #f0c9c9;
  color: var(--red);
}

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

.panel,
.table-wrap,
.login-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.filters,
.panel {
  padding: 18px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.filters a {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  padding: 0 12px;
  color: var(--muted);
  font-weight: 800;
}

.filters a.active {
  background: var(--navy);
  color: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 13px;
}

tr:last-child td {
  border-bottom: 0;
}

.status {
  display: inline-flex;
  border-radius: 999px;
  padding: 5px 9px;
  background: #eef3f7;
  color: var(--navy);
  font-size: 12px;
  font-weight: 900;
}

.status.published {
  background: #e5f5f6;
  color: var(--teal);
}

.status.rejected,
.status.deleted {
  background: #faeaea;
  color: var(--red);
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.article-form {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.field small {
  color: var(--muted);
  font-size: 12px;
}

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

.field textarea {
  min-height: 220px;
  resize: vertical;
  line-height: 1.6;
}

.image-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.image-preview img {
  width: 120px;
  height: 76px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.inline-admin-form {
  display: grid;
  gap: 8px;
  min-width: 220px;
}

.inline-admin-form select,
.inline-admin-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.inline-admin-form textarea {
  min-height: 76px;
  resize: vertical;
}

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

.topic-card {
  min-height: 110px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #fff;
}

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

.topic-card strong {
  display: block;
  margin-top: 18px;
  font-size: 28px;
}

.topic-card.active {
  background: var(--navy);
  color: #fff;
}

.topic-card.active span {
  color: #9bd9de;
}

.login-screen {
  min-height: calc(100vh - 220px);
  display: grid;
  place-items: center;
  padding: 24px;
}

.admin-auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.admin-auth-page .login-screen {
  flex: 1;
  width: 100%;
}

.login-card {
  width: min(420px, 100%);
  padding: 28px;
}

.login-card h1 {
  margin: 0 0 8px;
  font-family: Georgia, serif;
  font-size: 32px;
}

.login-card p {
  margin: 0 0 20px;
  color: var(--muted);
}

.error {
  border: 1px solid #f0c9c9;
  border-radius: 8px;
  padding: 12px;
  background: #fff4f4;
  color: var(--red);
  font-weight: 800;
}

.site-footer {
  margin-top: 46px;
  color: #eef6f7;
  background: #0b2026;
}

.site-footer__inner {
  width: min(1600px, calc(100% - clamp(28px, 4vw, 72px)));
  display: grid;
  gap: 18px;
  margin: 0 auto;
  padding: 38px 0;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
}

.footer-brand__mark {
  width: 42px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--navy);
}

.footer-brand__mark svg {
  width: 40px;
  height: 40px;
  overflow: visible;
}

.brand__q,
.brand__tail,
.brand__line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand__q {
  stroke: #fff;
  stroke-width: 8;
}

.brand__tail {
  stroke: var(--teal);
  stroke-width: 8;
}

.brand__line {
  stroke: #9bd9de;
  stroke-width: 5;
}

.site-footer .footer-brand strong {
  display: block;
  margin: 0;
  color: #fff;
  font-family: Georgia, serif;
  font-size: 24px;
  letter-spacing: 0.02em;
}

.company-info {
  max-width: 980px;
  margin: 8px 0 0;
  color: rgba(216, 229, 231, 0.82);
  font-size: 12px;
  line-height: 1.65;
}

.company-info--spaced {
  margin-top: 18px;
}

.footer-policy-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0;
  padding-top: 14px;
  border-top: 1px solid rgba(216, 229, 231, 0.16);
  color: #9fb4b8;
  font-size: 13px;
  font-weight: 800;
}

.footer-policy-links a,
.footer-policy-links button {
  min-height: 0;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  color: #d8e5e7;
  font: inherit;
  font-weight: inherit;
  text-decoration: none;
}

.footer-policy-links a:hover,
.footer-policy-links button:hover,
.footer-policy-links button:focus-visible {
  color: #9bd9de;
  outline: none;
}

.footer-admin-link {
  display: inline-flex !important;
  min-height: 28px !important;
  align-items: center;
  padding: 0 10px !important;
  color: #102024 !important;
  background: #9bd9de !important;
  border-radius: 999px !important;
  font-size: 12px !important;
  font-weight: 900 !important;
}

.policy-panel {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 7, 12, 0.68);
  backdrop-filter: blur(8px);
}

.policy-panel[hidden] {
  display: none;
}

.policy-card {
  position: relative;
  width: min(720px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  padding: 34px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

.policy-card .eyebrow {
  margin: 0 0 10px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
}

.policy-card h2 {
  margin: 0 0 18px;
  color: var(--ink);
  font-size: clamp(28px, 4vw, 38px);
}

.policy-card ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.7;
}

.policy-close {
  position: absolute;
  top: 18px;
  right: 18px;
  display: grid;
  width: 36px;
  height: 36px;
  min-height: 36px;
  place-items: center;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  font-size: 22px;
}

.policy-close:hover,
.policy-close:focus-visible {
  color: #fff;
  background: var(--teal);
  outline: none;
}

@media (max-width: 780px) {
  .admin-topbar {
    justify-content: flex-start;
  }

  .admin-header {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .admin-header nav,
  .admin-user,
  .page-head {
    align-items: flex-start;
    flex-direction: column;
  }

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

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

  .table-wrap {
    overflow-x: auto;
  }

  .site-footer__inner {
    width: min(100% - 24px, 1600px);
  }
}
