.admin-body {
  min-height: 100vh;
  background: var(--bg);
}

.login-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 10%, color-mix(in srgb, var(--gold) 15%, transparent), transparent 36%),
    var(--bg);
}

.login-header {
  display: flex;
  min-height: 96px;
  align-items: center;
  justify-content: space-between;
}

.login-main {
  display: grid;
  min-height: calc(100vh - 96px);
  place-items: center;
  padding: 36px 16px 100px;
}

.login-card {
  width: min(100%, 460px);
  padding: clamp(30px, 6vw, 52px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-card h1 {
  margin: 10px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(36px, 7vw, 52px);
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 1.06;
}

.login-card > p {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: var(--text-body);
  line-height: 1.65;
}

.login-card form {
  display: grid;
  gap: 18px;
  margin-top: 32px;
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 76px;
}

.password-field button {
  position: absolute;
  top: 50%;
  right: 8px;
  padding: 7px 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--gold-deep);
  cursor: pointer;
  font-size: var(--text-label);
  font-weight: 700;
  transform: translateY(-50%);
}

.login-error {
  min-height: 20px;
  margin: -4px 0 0;
  color: var(--danger);
  font-size: var(--text-label);
  line-height: 1.45;
}

.login-submit {
  width: 100%;
}

.login-submit:disabled {
  cursor: wait;
  opacity: 0.65;
}

.admin-header {
  position: sticky;
  z-index: 60;
  top: 0;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(18px);
}

.admin-header-inner {
  display: grid;
  min-height: 82px;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 0 28px;
}

.admin-title-wrap {
  display: flex;
  flex-direction: column;
}

.admin-title-wrap strong {
  font-size: 18px;
}

.admin-kicker {
  color: var(--muted);
  font-size: var(--text-meta);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

.admin-layout {
  display: grid;
  min-height: calc(100vh - 82px);
  grid-template-columns: 270px minmax(0, 1fr);
}

.admin-sidebar {
  position: sticky;
  top: 82px;
  display: flex;
  height: calc(100vh - 82px);
  flex-direction: column;
  padding: 28px 20px;
  border-right: 1px solid var(--line);
}

.admin-note {
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--gold) 36%, var(--line));
  border-radius: 14px;
  background: color-mix(in srgb, var(--gold) 10%, var(--surface));
}

.admin-note span {
  color: var(--gold-deep);
  font-size: var(--text-meta);
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.admin-note p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: var(--text-label);
  line-height: 1.6;
}

.admin-nav {
  display: grid;
  gap: 6px;
  margin-top: 28px;
}

.admin-nav button {
  min-height: 44px;
  padding: 11px 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  font-size: var(--text-label);
  font-weight: 700;
}

.admin-nav button:hover,
.admin-nav button.active {
  background: var(--surface-strong);
  color: var(--ink);
}

.text-button {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  min-height: 44px;
  font-size: var(--text-label);
  font-weight: 700;
}

.admin-sidebar > .text-button {
  margin-top: auto;
  text-align: left;
}

.danger {
  color: var(--danger);
}

.admin-main {
  width: min(940px, calc(100% - 64px));
  margin: 0 auto;
  padding: 52px 0 100px;
}

.admin-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.admin-language {
  margin-top: 8px;
}

.admin-toolbar > p {
  max-width: 430px;
  margin: 0;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.admin-form {
  padding-top: 32px;
}

.admin-loading {
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  color: var(--muted);
  text-align: center;
  font-size: 0.9375rem;
}

.admin-loading.error {
  border-color: color-mix(in srgb, var(--danger) 40%, var(--line));
  color: var(--danger);
}

.form-section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.form-section-header h1 {
  margin: 5px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 36px;
  font-weight: 400;
  letter-spacing: -0.04em;
}

.editor-card {
  display: grid;
  gap: 20px;
  margin-bottom: 16px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}

.editor-card-grid {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 24px;
}

.editor-preview {
  position: relative;
  align-self: start;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 12px;
  background: #ded8cb;
}

.editor-preview.wide {
  aspect-ratio: 1.5 / 1;
}

.editor-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.editor-fields,
.field-grid {
  display: grid;
  gap: 16px;
}

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

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

.field label,
.field > span {
  color: var(--muted);
  font-size: var(--text-label);
  font-weight: 700;
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  background: var(--surface-strong);
  color: var(--ink);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.field input {
  min-height: 48px;
  padding: 0 12px;
}

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

.field input:focus,
.field textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 18%, transparent);
}

.image-controls {
  display: grid;
  gap: 9px;
}

.file-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: var(--surface-strong);
  cursor: pointer;
  font-size: var(--text-label);
  font-weight: 800;
}

.file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.editor-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.editor-card-title strong {
  font-size: var(--text-body);
}

.small-button {
  min-height: 40px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: var(--text-label);
  font-weight: 800;
}

.confirm-dialog {
  width: min(440px, calc(100% - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.confirm-dialog::backdrop {
  background: rgba(10, 10, 8, 0.58);
  backdrop-filter: blur(4px);
}

.confirm-dialog form {
  padding: 28px;
}

.confirm-dialog h2 {
  margin: 8px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 30px;
  font-weight: 400;
  letter-spacing: -0.04em;
}

.confirm-dialog p {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: var(--text-body);
  line-height: 1.6;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 26px;
}

@media (max-width: 900px) {
  .admin-header-inner {
    grid-template-columns: auto 1fr;
    padding: 0 16px;
  }

  .admin-title-wrap {
    display: none;
  }

  .admin-actions {
    justify-content: flex-end;
  }

  .admin-actions .button-ghost {
    display: none;
  }

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

  .admin-sidebar {
    position: static;
    height: auto;
    padding: 14px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .admin-note,
  .admin-sidebar > .text-button {
    display: none;
  }

  .admin-nav {
    display: flex;
    gap: 4px;
    margin: 0;
    overflow-x: auto;
  }

  .admin-nav button {
    flex: none;
  }

  .admin-main {
    width: min(100% - 30px, 760px);
    padding-top: 30px;
  }
}

@media (max-width: 620px) {
  .login-header {
    min-height: 78px;
  }

  .login-header .brand {
    width: 96px;
  }

  .login-main {
    min-height: calc(100vh - 78px);
    align-items: start;
    padding-top: 26px;
  }

  .login-card {
    border-radius: 18px;
  }

  .admin-header-inner .brand {
    width: 88px;
  }

  .admin-actions .theme-toggle {
    display: none;
  }

  .admin-toolbar {
    display: grid;
  }

  .editor-card-grid,
  .field-grid.two {
    grid-template-columns: 1fr;
  }

  .editor-preview,
  .editor-preview.wide {
    width: 100%;
    aspect-ratio: 1.6 / 1;
  }

  .editor-card {
    padding: 18px;
  }
}
