:root {
  --ink: #202321;
  --muted: #62645f;
  --line: #dedbd2;
  --paper: #fbfaf7;
  --white: #ffffff;
  --forest: #173b34;
  --gold: #c0a468;
  --danger: #8a2f20;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Arial, "Noto Sans KR", "Malgun Gothic", sans-serif;
}

a {
  color: var(--forest);
  font-weight: 800;
  text-decoration: none;
}

.admin-shell {
  width: min(1180px, calc(100% - 36px));
  margin: 48px auto;
}

.admin-shell.narrow {
  width: min(620px, calc(100% - 36px));
}

.admin-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.admin-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

h1 {
  margin: 0;
  font-size: clamp(34px, 6vw, 64px);
  line-height: 1.05;
}

h2 {
  margin: 0;
}

p {
  color: var(--muted);
  line-height: 1.7;
}

.admin-form,
.detail-list,
.table-wrap,
.panel,
.stats-grid article,
.analytics-grid article {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.admin-form {
  display: grid;
  gap: 18px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 14px 15px;
  font: inherit;
}

button {
  min-height: 46px;
  border: 0;
  border-radius: 4px;
  background: var(--forest);
  color: var(--white);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.alert {
  margin: 18px 0;
  padding: 14px 16px;
  color: var(--danger);
  background: #fff0ec;
  border: 1px solid #ffd0c5;
}

.panel,
.stats-grid {
  margin-bottom: 24px;
}

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

.stats-grid article,
.analytics-grid article {
  display: grid;
  gap: 10px;
}

.stats-grid span,
.analytics-grid span,
.section-title p,
dt {
  color: var(--muted);
}

.stats-grid strong,
.analytics-grid strong {
  font-size: 34px;
}

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

.stat-date {
  font-size: 18px !important;
  line-height: 1.35;
}

.section-title {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.section-title p {
  margin: 6px 0 0;
}

dl {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
  margin: 0;
}

dt {
  font-weight: 800;
}

dd {
  margin: 0;
}

pre {
  overflow: auto;
  margin: 0;
  padding: 18px;
  border-radius: 6px;
  background: var(--paper);
  line-height: 1.7;
  white-space: pre-wrap;
}

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

.compact-table {
  margin-top: 18px;
  padding: 0;
}

.compact-table table {
  background: var(--white);
}

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

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

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

.message-cell {
  min-width: 340px;
  max-width: 520px;
  white-space: normal;
  line-height: 1.7;
}

.inquiry-table th,
.inquiry-table td {
  vertical-align: middle;
}

.inquiry-table td {
  height: 62px;
}

.inquiry-table .text-button,
.inquiry-table .status-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.text-button {
  min-height: 34px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--forest);
  font-size: 13px;
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

.status-form {
  margin: 0;
}

.status-toggle {
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid rgba(23, 59, 52, 0.18);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.status-toggle.is-pending {
  background: #fff0ec;
  color: var(--danger);
}

.status-toggle.is-done {
  background: #eef4ef;
  color: var(--forest);
}

.message-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(9, 25, 29, 0.58);
  backdrop-filter: blur(8px);
}

.message-modal[hidden] {
  display: none;
}

.message-modal-card {
  position: relative;
  width: min(720px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 28px 70px rgba(23, 59, 52, 0.18);
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 40px;
  height: 40px;
  min-height: 40px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
}

.modal-kicker {
  margin: 0 0 8px;
  color: var(--danger);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.message-meta {
  margin: 8px 0 18px;
  color: var(--muted);
  font-size: 13px;
}

.message-full {
  color: var(--ink);
  line-height: 1.75;
  white-space: pre-wrap;
}

.admin-footer {
  display: grid;
  gap: 18px;
  margin-top: 56px;
  padding: 38px clamp(20px, 5vw, 72px);
  color: var(--white);
  background: #0b2026;
}

.footer-logo {
  display: inline-flex;
  margin-bottom: 10px;
}

.footer-logo img {
  width: 154px;
  height: auto;
}

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

.admin-footer a {
  color: #d8e5e7;
  font-weight: 700;
}

.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:hover {
  color: var(--gold);
}

.login-admin-footer {
  padding-right: max(20px, calc((100vw - 620px) / 2));
  padding-left: max(20px, calc((100vw - 620px) / 2));
}

@media (max-width: 680px) {
  .admin-header,
  dl {
    display: grid;
  }

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

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

  dl {
    grid-template-columns: 1fr;
  }

  .message-modal {
    padding: 14px;
  }

  .message-modal-card {
    padding: 28px 20px 22px;
  }
}
