:root {
  --bg: #f2f5f9;
  --panel: #ffffff;
  --ink: #1a2533;
  --muted: #637083;
  --line: #d7dee8;
  --brand: #0f5db8;
  --accent: #0e8f69;
  --warn: #cb7f00;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(circle at top, #e6eef9 0%, var(--bg) 45%);
  color: var(--ink);
  font-family: "Pretendard", "Noto Sans KR", "Apple SD Gothic Neo", sans-serif;
}

.wrap {
  width: min(1080px, 92vw);
  margin: 0 auto;
}

.topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
}

.brand {
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.125rem;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  margin-left: 14px;
}

nav a:hover {
  color: var(--brand);
}

main {
  padding: 24px 0 48px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 16px;
}

h1,
h2,
h3 {
  margin-top: 0;
}

.filters {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.location-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

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

button {
  border: 0;
  border-radius: 9px;
  padding: 10px 12px;
  cursor: pointer;
  background: var(--brand);
  color: #fff;
}

button.secondary {
  background: #fff;
  color: var(--brand);
  border: 1px solid #9cc0eb;
}

button.ghost {
  background: #f5f9ff;
  color: var(--brand);
  border: 1px solid #c5dcf8;
}

button.warn {
  background: #fff8ec;
  color: var(--warn);
  border: 1px solid #f0cf8d;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

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

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

.card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

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

.badge {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
  color: var(--muted);
  font-size: 0.85rem;
}

.badge.open {
  border-color: #afe8d8;
  color: var(--accent);
  background: #eefbf6;
}

.badge.closed {
  border-color: #f0cf8d;
  color: var(--warn);
  background: #fff8ec;
}

.small {
  color: var(--muted);
  font-size: 0.92rem;
}

.auth-msg {
  margin: -4px 0 0;
  min-height: 16px;
}

.auth-msg.ok {
  color: var(--accent);
}

.auth-msg.error {
  color: #b4440f;
}

.auth-code-mask {
  -webkit-text-security: disc;
}

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

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

.toggle-row button.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.map-panel {
  margin-top: 0;
  padding: 14px;
}

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

.map-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: #fcfeff;
}

.map-card h4 {
  margin: 0;
}

.applicant-list {
  margin-top: 12px;
  border-top: 1px dashed var(--line);
  padding-top: 10px;
}

.applicant-list h4 {
  margin: 0 0 8px;
}

.applicant-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  margin-bottom: 8px;
  background: #fafcff;
}

.applicant-main {
  margin-bottom: 6px;
}

button.mini {
  padding: 6px 10px;
  font-size: 0.85rem;
}

.hidden {
  display: none !important;
}

.host-wizard-head {
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 10px;
  background: #f9fcff;
}

.host-stepper {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
}

.host-step {
  background: #fff;
  color: var(--muted);
  border: 1px solid var(--line);
}

.host-step.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

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

.host-quick-types {
  margin-bottom: 4px;
}

.host-inline-error {
  color: #b4440f;
  min-height: 18px;
  margin: 0;
}

.host-optional {
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 8px;
  background: #fbfdff;
}

.host-optional summary {
  cursor: pointer;
  color: var(--muted);
  margin-bottom: 8px;
}

.admin-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17, 26, 38, 0.56);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1000;
}

.admin-modal {
  width: min(760px, 96vw);
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}

.admin-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.admin-modal-head h3 {
  margin: 0;
}

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

.admin-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-field span {
  font-size: 0.9rem;
  color: var(--muted);
}

.admin-modal-error {
  min-height: 18px;
  color: #b4440f;
}

.admin-modal-json {
  background: #f5f8fc;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  overflow: auto;
}

textarea {
  min-height: 140px;
}

@media (max-width: 900px) {
  .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

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

  .admin-modal-grid {
    grid-template-columns: 1fr;
  }
}
