:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #eef3ff;
  --text: #172033;
  --muted: #647089;
  --line: #dfe5ef;
  --primary: #4f6df5;
  --primary-dark: #3d57d9;
  --danger: #db4b57;
  --success: #0f9f74;
  --warning: #d28a13;
  --shadow: 0 16px 40px rgba(31, 45, 76, .10);
  --radius: 20px;
  --radius-sm: 12px;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  font-family: Pretendard, "Noto Sans KR", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.2; }
.container { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.page-space { padding: 32px 0 64px; }

.site-header {
  background: rgba(255,255,255,.94);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 0;
}
.header-inner h1 { margin-bottom: 6px; font-size: clamp(1.5rem, 4vw, 2.2rem); }

.eyebrow {
  margin-bottom: 6px;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .12em;
  color: var(--primary);
}
.muted { color: var(--muted); }
.muted-light { color: rgba(255,255,255,.78); }

.panel, .notice-card, .auth-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel { padding: 24px; }

.button {
  appearance: none;
  border: 0;
  border-radius: 12px;
  min-height: 44px;
  padding: 11px 16px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.button:hover { transform: translateY(-1px); }
.button:focus-visible, input:focus-visible, textarea:focus-visible, .nav-button:focus-visible {
  outline: 3px solid rgba(79,109,245,.28);
  outline-offset: 2px;
}
.button:disabled { cursor: not-allowed; opacity: .55; transform: none; }
.button-primary { color: white; background: var(--primary); }
.button-primary:hover { background: var(--primary-dark); }
.button-secondary { color: var(--text); background: white; border: 1px solid var(--line); }
.button-danger { color: white; background: var(--danger); }
.button-full { width: 100%; }
.button-row { display: flex; gap: 10px; flex-wrap: wrap; }

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: .86rem;
  font-weight: 800;
  white-space: nowrap;
}
.status-off { color: #8a4d07; background: #fff1d5; }
.status-on { color: #087250; background: #dff7ed; }
.status-draft { color: #586174; background: #edf0f5; }

.form-stack { display: grid; gap: 18px; }
.form-stack label { display: grid; gap: 8px; font-weight: 700; }
input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  color: var(--text);
  padding: 12px 14px;
}
textarea { resize: vertical; }
.helper-text { margin: 16px 0 0; font-size: .86rem; color: var(--muted); }
.form-message { margin: 12px 0 0; min-height: 1.5em; font-weight: 700; }

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 10%, rgba(79,109,245,.12), transparent 30%),
    var(--bg);
}
.auth-card {
  width: min(460px, 100%);
  padding: 32px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin: 30px 0 18px;
}
.hidden { display: none !important; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  background: #101828;
  color: white;
  padding: 12px 18px;
  border-radius: 12px;
  opacity: 0;
  pointer-events: none;
  transition: .2s ease;
  z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.dialog {
  border: 0;
  padding: 0;
  border-radius: 20px;
  width: min(460px, calc(100% - 28px));
  box-shadow: 0 24px 80px rgba(0,0,0,.22);
}
.dialog::backdrop { background: rgba(17,24,39,.5); }
.dialog-card { padding: 26px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.warning-text { color: var(--danger); font-size: .9rem; font-weight: 800; }

.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; background: white; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.data-table th, .data-table td { padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.data-table th { background: #f8faff; color: #4d5870; font-size: .86rem; }
.data-table tr:last-child td { border-bottom: 0; }

@media (max-width: 680px) {
  .container { width: min(100% - 22px, 1120px); }
  .header-inner { align-items: flex-start; }
  .section-heading { align-items: stretch; flex-direction: column; }
  .button-row > .button { flex: 1 1 160px; }
}
