.is-hidden { display: none !important; }
:root {
  --ink: #111827;
  --sub: #4b5563;
  --muted: #7b8493;
  --line: #dbe4f5;
  --paper: #f6f8ff;
  --white: #ffffff;
  --brand: #2854ff;
  --brand-deep: #172b85;
  --brand-soft: #eef3ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
}

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

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

.admin-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  min-height: 72px;
  padding: 0 32px;
  border-bottom: 1px solid var(--line);
  background: rgba(246, 248, 255, 0.94);
  backdrop-filter: blur(12px);
}

.brand img {
  display: block;
  width: 118px;
}

.admin-header strong,
.admin-header span {
  display: block;
}

.admin-header span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.admin-shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 22px;
  padding: 24px;
}

.admin-side,
.editor-panel {
  min-width: 0;
}

.login-panel,
.section-nav,
.admin-account-panel,
.editor-panel,
.editor-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.login-panel {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.section-nav {
  display: grid;
  gap: 6px;
  margin-top: 14px;
  padding: 10px;
}

.admin-account-panel {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
}

.admin-account-panel.is-hidden {
  display: none;
}

.account-panel-head,
.account-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.admin-account-list,
.admin-account-form {
  display: grid;
  gap: 9px;
}

.admin-account-item {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  text-align: left;
  cursor: pointer;
}

.admin-account-item:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.admin-account-item.inactive {
  opacity: 0.6;
}

.admin-account-item span,
.empty-copy,
#adminAccountMessage {
  color: var(--muted);
  font-size: 12px;
}

.inline-check {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
}

.inline-check input {
  width: 16px;
  height: 16px;
}

.section-nav a {
  padding: 10px;
  border-radius: 8px;
  color: var(--sub);
  font-size: 14px;
  font-weight: 800;
}

.section-nav a:hover {
  color: var(--brand);
  background: var(--brand-soft);
}

label {
  display: grid;
  gap: 7px;
  color: var(--sub);
  font-size: 13px;
  font-weight: 900;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--white);
}

input,
select {
  height: 42px;
  padding: 0 12px;
}

textarea {
  min-height: 86px;
  padding: 12px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(40, 84, 255, 0.16);
  border-color: var(--brand);
}

.primary-button,
.ghost-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 8px;
  padding: 0 14px;
  font-weight: 900;
  cursor: pointer;
}

.primary-button {
  border: 0;
  color: var(--white);
  background: var(--brand);
}

.ghost-button,
.danger-button {
  border: 1px solid var(--line);
  color: var(--sub);
  background: var(--white);
}

.danger-button {
  color: #b42318;
}

.compact-button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

.editor-panel {
  overflow: hidden;
}

.editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  border-bottom: 1px solid var(--line);
}

.editor-head h1 {
  margin: 0;
  font-size: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
}

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

.editor-body {
  display: grid;
  gap: 18px;
  padding: 22px;
}

.editor-card {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.editor-card h2 {
  margin: 0;
  font-size: 21px;
}

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

.wide-field {
  grid-column: 1 / -1;
}

.list-editor {
  display: grid;
  gap: 12px;
}

.list-row {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) minmax(0, 1.4fr) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.row-actions {
  display: flex;
  gap: 6px;
  align-items: end;
}

.image-tools {
  display: grid;
  grid-template-columns: auto minmax(0, 120px);
  gap: 10px;
  align-items: center;
}

.image-tools img {
  display: block;
  max-width: 120px;
  max-height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: contain;
  background: var(--paper);
}

.list-row.is-simple {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto;
}

.list-actions {
  display: flex;
  justify-content: flex-end;
}

.save-message,
#loginMessage {
  min-height: 22px;
  margin: 0;
  color: var(--brand);
  font-weight: 900;
}

.save-message {
  padding: 0 22px 22px;
}

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

  .section-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .list-row,
  .list-row.is-simple {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .admin-header {
    grid-template-columns: 1fr;
    padding: 16px 20px;
  }

  .admin-shell {
    padding: 14px;
  }

  .field-grid,
  .section-nav {
    grid-template-columns: 1fr;
  }

  .editor-head {
    align-items: stretch;
    flex-direction: column;
  }

  .editor-actions {
    flex-direction: column;
  }
}
