:root {
  --page: #f6f6f3;
  --surface: #ffffff;
  --ink: #111111;
  --muted: #686864;
  --line: #dfdfda;
  --soft: #eeeeea;
  --charcoal: #1b1b1a;
  --danger: #9f2d2d;
  --success: #276748;
  --shadow: 0 18px 54px rgba(17, 17, 17, 0.07);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  color: var(--ink);
  background: linear-gradient(180deg, var(--page), #ffffff);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.admin-shell {
  width: min(calc(100% - 32px), 1180px);
  margin: 0 auto;
  padding: 28px 0 80px;
}

.admin-header,
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.admin-header {
  min-height: 74px;
}

.admin-header p,
.toolbar p,
.eyebrow {
  margin: 0 0 8px;
  color: #4c4a45;
  font-size: 0.74rem;
  font-weight: 760;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(1.9rem, 5vw, 3.8rem);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.5rem, 3vw, 2.6rem);
  line-height: 1.05;
}

h3 {
  margin-bottom: 18px;
  font-size: 1.08rem;
}

.login-panel {
  display: grid;
  min-height: calc(100svh - 150px);
  place-items: center;
}

.login-card,
.admin-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}

.login-card {
  width: min(100%, 460px);
  padding: 32px;
}

label {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

label span {
  color: #373733;
  font-size: 0.86rem;
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input {
  min-height: 44px;
  padding: 0 12px;
}

textarea {
  min-height: 112px;
  padding: 12px;
  line-height: 1.5;
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: #9a978c;
  box-shadow: 0 0 0 4px rgba(125, 118, 104, 0.14);
}

.primary-button,
.ghost-button,
.danger-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 15px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 720;
  text-decoration: none;
}

.primary-button {
  border: 1px solid var(--ink);
  color: #ffffff;
  background: var(--ink);
}

.ghost-button {
  border: 1px solid var(--line);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
}

.danger-button {
  border: 1px solid rgba(159, 45, 45, 0.34);
  color: var(--danger);
  background: #ffffff;
}

.toolbar {
  position: sticky;
  z-index: 10;
  top: 12px;
  margin: 20px 0 18px;
  padding: 18px;
  border: 1px solid rgba(223, 223, 218, 0.86);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 14px 40px rgba(17, 17, 17, 0.06);
  backdrop-filter: blur(16px);
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.status {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.status.is-error {
  color: var(--danger);
}

.status.is-success {
  color: var(--success);
}

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

.admin-section {
  padding: 24px;
}

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

.span-2 {
  grid-column: span 2;
}

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

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

.editor-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.editor-card-header strong {
  color: #3c3b37;
  font-size: 0.86rem;
}

.image-tools {
  display: grid;
  grid-template-columns: minmax(220px, 0.45fr) 1fr;
  gap: 18px;
  align-items: start;
}

.image-preview {
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

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

.file-input {
  padding: 14px;
  border: 1px dashed #bdbbb3;
  border-radius: 8px;
  background: #fbfbf9;
}

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

@media (max-width: 760px) {
  .admin-shell {
    width: calc(100% - 24px);
    padding-top: 14px;
  }

  .admin-header,
  .toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar-actions,
  .primary-button,
  .ghost-button,
  .danger-button {
    width: 100%;
  }

  .section-grid,
  .image-tools {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: span 1;
  }
}
