.admin-body {
  background: #eef1ed;
}

[hidden] {
  display: none !important;
}

.admin-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(22, 53, 47, 0.96);
  color: white;
  backdrop-filter: blur(16px);
}

.admin-header-shell,
.admin-main {
  width: min(1120px, calc(100% - 32px));
  margin-inline: auto;
}

.admin-header-shell {
  min-height: 108px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.admin-header h1 {
  margin: 0;
  font-family: Georgia, serif;
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  font-weight: 500;
}

.admin-kicker {
  margin-bottom: 4px;
  color: var(--mint);
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.admin-header-actions,
.card-actions,
.section-heading-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.admin-user {
  display: inline-flex;
  align-items: center;
  padding-inline: 4px;
  color: var(--mint);
  font-size: 0.78rem;
  font-weight: 800;
}

.admin-button {
  min-height: 43px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--clay);
  color: white;
  font-size: 0.88rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.admin-button:hover,
.admin-button:focus-visible {
  filter: brightness(1.06);
  outline: 3px solid rgba(183, 214, 199, 0.42);
}

.admin-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.admin-button-light {
  border-color: rgba(255, 255, 255, 0.25);
  background: transparent;
}

.admin-button-small {
  min-height: 35px;
  padding: 6px 10px;
  border-color: var(--line);
  background: #f6f3ed;
  color: var(--forest);
  font-size: 0.78rem;
}

.admin-button-danger {
  background: #fff0eb;
  color: #9e3f23;
}

.admin-main {
  padding-block: 28px 90px;
}

.mode-notice,
.save-status {
  margin-bottom: 18px;
  padding: 13px 16px;
  border-radius: 12px;
  font-size: 0.9rem;
}

.mode-notice {
  border: 1px solid #e3ba74;
  background: #fff5df;
  color: #684916;
}

.save-status:empty {
  display: none;
}

.save-status.is-success {
  border: 1px solid #8dc2a6;
  background: #e7f6ed;
  color: #24583f;
}

.save-status.is-error {
  border: 1px solid #e2a08d;
  background: #fff0eb;
  color: #8a351f;
}

.admin-loading {
  padding: 70px;
  border-radius: 20px;
  background: white;
  text-align: center;
}

.admin-section {
  margin-bottom: 24px;
  overflow: hidden;
  border: 1px solid rgba(23, 38, 33, 0.12);
  border-radius: 22px;
  background: white;
  box-shadow: 0 12px 38px rgba(22, 53, 47, 0.06);
}

.admin-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 26px;
  border-bottom: 1px solid var(--line);
  background: #fbfaf6;
}

.admin-section-heading h2 {
  margin: 0 0 4px;
  font-size: 1.35rem;
  letter-spacing: -0.025em;
}

.admin-section-heading p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.admin-section-body {
  padding: 26px;
}

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

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

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

.form-field > span,
.checkbox-field > span {
  color: #31463f;
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.03em;
}

.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
  border: 1px solid #cbd4cf;
  border-radius: 10px;
  background: white;
  color: var(--ink);
  outline: none;
}

.form-field input,
.form-field select {
  min-height: 45px;
  padding: 9px 12px;
}

.form-field textarea {
  min-height: 108px;
  padding: 11px 12px;
  resize: vertical;
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  border-color: var(--forest-light);
  box-shadow: 0 0 0 3px rgba(36, 88, 78, 0.13);
}

.field-help {
  color: #6e7a75;
  font-size: 0.76rem;
}

.theme-editor {
  display: grid;
  gap: 24px;
}

.theme-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.theme-note {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.86rem;
}

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

.color-field {
  display: grid;
  gap: 7px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fcfbf8;
}

.color-field > span {
  color: #31463f;
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.03em;
}

.color-field-controls {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
}

.color-field input {
  min-width: 0;
  height: 46px;
  border: 1px solid #cbd4cf;
  border-radius: 10px;
  background: white;
  color: var(--ink);
  outline: none;
}

.color-field input[type="color"] {
  width: 58px;
  padding: 4px;
  cursor: pointer;
}

.color-field input[type="text"] {
  width: 100%;
  padding: 9px 12px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  text-transform: uppercase;
}

.color-field input:focus {
  border-color: var(--forest-light);
  box-shadow: 0 0 0 3px rgba(36, 88, 78, 0.13);
}

.color-field input:invalid {
  border-color: #c95d3b;
  box-shadow: 0 0 0 3px rgba(201, 93, 59, 0.12);
}

.theme-preview {
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--preview-text) 14%, transparent);
  border-radius: 18px;
  background: var(--preview-background);
  color: var(--preview-text);
}

.theme-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 20px;
  border-bottom: 1px solid color-mix(in srgb, var(--preview-text) 12%, transparent);
  background: var(--preview-surface);
}

.theme-preview-brand {
  color: var(--preview-primary);
  font-family: Georgia, serif;
  font-size: 1.05rem;
}

.theme-preview-nav {
  color: var(--preview-muted);
  font-size: 0.74rem;
  font-weight: 750;
}

.theme-preview-body {
  padding: clamp(24px, 5vw, 42px);
  background:
    radial-gradient(circle at 92% 12%, var(--preview-soft), transparent 45%),
    var(--preview-background);
}

.theme-preview-kicker {
  display: block;
  margin-bottom: 10px;
  color: var(--preview-accent);
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.theme-preview h3 {
  max-width: 620px;
  margin: 0 0 12px;
  color: var(--preview-text);
  font-family: Georgia, serif;
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 500;
}

.theme-preview p {
  max-width: 620px;
  margin: 0 0 22px;
  color: var(--preview-muted);
}

.theme-preview-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--preview-primary);
  color: var(--preview-on-primary);
  font-size: 0.8rem;
  font-weight: 800;
}

.checkbox-field {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfaf6;
}

.checkbox-field input {
  width: 18px;
  height: 18px;
  accent-color: var(--forest);
}

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

.editor-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fcfbf8;
}

.editor-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.editor-card-heading h3 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.slot-label {
  display: inline-block;
  margin-bottom: 5px;
  color: var(--clay);
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.page-group + .page-group {
  margin-top: 30px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
}

.page-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.page-group-title h3 {
  margin: 0;
  font-size: 1.18rem;
}

.empty-editor {
  padding: 24px;
  border: 1px dashed #b8c4be;
  border-radius: 14px;
  color: var(--ink-soft);
  text-align: center;
}

.admin-save-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 4px;
}

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 15% 10%, rgba(183, 214, 199, 0.3), transparent 34%),
    linear-gradient(145deg, #edf1ec, #f8f4ec);
}

.login-shell {
  width: min(100%, 480px);
}

.login-card {
  padding: clamp(28px, 7vw, 46px);
  border: 1px solid rgba(23, 38, 33, 0.12);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 24px 70px rgba(22, 53, 47, 0.14);
}

.login-brand {
  display: inline-block;
  margin-bottom: 30px;
  color: var(--forest);
  font-family: Georgia, serif;
  font-size: 1.25rem;
  font-weight: 700;
  text-decoration: none;
}

.login-card h1 {
  margin: 0 0 9px;
  color: var(--forest);
  font-family: Georgia, serif;
  font-size: clamp(2rem, 7vw, 2.8rem);
  font-weight: 500;
  letter-spacing: -0.04em;
}

.login-intro {
  margin: 0 0 26px;
  color: var(--ink-soft);
  line-height: 1.65;
}

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

.login-submit {
  width: 100%;
  margin-top: 4px;
}

.login-card .save-status {
  margin: 22px 0 0;
}

.login-back {
  display: inline-block;
  margin-top: 24px;
  color: var(--forest-light);
  font-size: 0.85rem;
  font-weight: 750;
  text-decoration: none;
}

.login-back:hover,
.login-back:focus-visible {
  text-decoration: underline;
}

@media (max-width: 720px) {
  .admin-header {
    position: static;
  }

  .admin-header-shell {
    align-items: flex-start;
    flex-direction: column;
    padding-block: 22px;
  }

  .admin-header-actions {
    width: 100%;
  }

  .admin-header-actions > * {
    flex: 1;
  }

  .admin-user {
    flex-basis: 100%;
  }

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

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

  .theme-toolbar,
  .theme-preview-header {
    align-items: stretch;
    flex-direction: column;
  }

  .field-full {
    grid-column: auto;
  }

  .admin-section-heading,
  .editor-card-heading,
  .page-group-title {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-section-body,
  .admin-section-heading {
    padding: 20px;
  }
}
