:root {
  --bg: #f6f4f1;
  --panel: #ffffff;
  --text: #1f1b17;
  --muted: #756f68;
  --line: #e5ddd4;
  --accent: #c9784b;
  --accent-dark: #a85f38;
  --side: #181612;
  --radius: 8px;
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
}

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

.admin-side {
  position: fixed;
  inset: 0 auto 0 0;
  width: 250px;
  padding: 28px 22px;
  background: var(--side);
  color: #f7f1eb;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.admin-side h1 {
  margin: 0 0 8px;
  font-size: 1.35rem;
  font-weight: 500;
}

.admin-side nav {
  display: grid;
  gap: 6px;
}

.admin-side a {
  display: block;
  padding: 10px 12px;
  border-radius: 6px;
  color: rgba(255,255,255,.72);
}

.admin-side a:hover,
.admin-side a.is-active {
  color: #fff;
  background: rgba(255,255,255,.1);
}

.view-site { margin-top: auto; }
.logout { color: #e8b5a1 !important; }

.admin-main {
  margin-left: 250px;
  padding: 32px;
}

.admin-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 24px;
}

.admin-head span {
  color: var(--muted);
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .12em;
}

.admin-head h2 {
  margin: 4px 0 0;
  font-size: 2rem;
  font-weight: 500;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 10px 30px rgba(31,27,23,.04);
}

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

.form-grid section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}

.form-grid section:last-of-type {
  grid-column: 1 / -1;
}

h3 {
  margin: 0 0 16px;
  font-size: 1rem;
  font-weight: 600;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: .82rem;
  margin-bottom: 13px;
}

input,
textarea,
select {
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: #fff;
  font: inherit;
}

.file-input {
  margin-top: 8px;
  min-height: 36px;
  padding: 6px;
  font-size: .8rem;
  color: var(--muted);
  background: #fbfaf8;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

textarea.large {
  min-height: 180px;
}

.check {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
}

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

button,
.primary,
.secondary {
  border: 0;
  border-radius: 6px;
  padding: 11px 18px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.secondary {
  background: var(--side);
}

button:hover,
.primary:hover {
  background: var(--accent-dark);
}

.notice {
  padding: 10px 14px;
  border-radius: 6px;
  background: #e8f5ee;
  color: #256341;
}

.notice--error {
  background: #fae8e4;
  color: #9e3426;
  margin-bottom: 16px;
}

.stack {
  display: grid;
  gap: 16px;
}

.row-editor h3 {
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

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

.fields label:has(textarea) {
  grid-column: span 2;
}

.message {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.message:first-child { padding-top: 0; }
.message:last-child { border-bottom: 0; }

.message strong,
.message a,
.message span {
  display: inline-block;
  margin-right: 14px;
}

.message span { color: var(--muted); }
.message p { margin: 10px 0 0; color: var(--text); }

.admin-login {
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-box {
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
}

.login-box h1 {
  margin: 0 0 6px;
}

.login-box p {
  margin: 0 0 22px;
  color: var(--muted);
}

@media (max-width: 900px) {
  .admin-side {
    position: static;
    width: auto;
  }

  .admin-main {
    margin-left: 0;
    padding: 20px;
  }

  .form-grid,
  .fields {
    grid-template-columns: 1fr;
  }

  .fields label:has(textarea),
  .form-grid section:last-of-type {
    grid-column: auto;
  }
}
