:root {
  --ink: #1a1712;
  --forest: #24382a;
  --moss: #3f6b4a;
  --cream: #f4ede1;
  --paper: #faf6ef;
  --terracotta: #c2541a;
  --terracotta-dark: #9a3f10;
  --gold: #d4a24a;
  --muted: #6b6458;
  --line: rgba(26, 23, 18, 0.12);
  --danger: #9b2c2c;
  --ok: #2f6b3a;
  --font-display: "Fraunces", Georgia, serif;
  --font-ui: "Figtree", "Segoe UI", sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.5;
}

a { color: inherit; }

h1, h2, h3 {
  font-family: var(--font-display);
  margin: 0 0 0.4em;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

p { margin: 0 0 1em; }

.admin-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.admin-side {
  background: var(--forest);
  color: #fff;
  padding: 28px 18px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--terracotta);
  display: grid;
  place-items: center;
}

.brand-mark svg { fill: #fff; }

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

.side-nav a {
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 600;
  color: rgba(255,255,255,.82);
}

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

.side-user {
  margin-top: auto;
  font-size: 0.9rem;
  color: rgba(255,255,255,.7);
}

.side-user a { color: var(--gold); }

.admin-main { padding: 32px 36px 60px; }

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 28px;
}

.page-head h1 { font-size: 2rem; margin: 0; }

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

.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  padding: 10px 16px;
  line-height: 1.2;
}

.btn-primary { background: var(--terracotta); color: #fff; }
.btn-primary:hover { background: var(--terracotta-dark); }
.btn-secondary { background: var(--cream); color: var(--forest); box-shadow: inset 0 0 0 1px var(--line); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 7px 12px; font-size: 0.9rem; }

.flash {
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 18px;
  font-weight: 600;
}
.flash-ok { background: #e5f3e8; color: var(--ok); }
.flash-error { background: #fde8e8; color: var(--danger); }

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
  margin-bottom: 18px;
}

.card h2 { font-size: 1.25rem; }

.form { display: grid; gap: 12px; }
.form label { display: grid; gap: 6px; font-weight: 600; font-size: 0.92rem; }
.form input,
.form select,
.form textarea {
  width: 100%;
  font: inherit;
  font-weight: 400;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}
.form textarea { min-height: 88px; resize: vertical; }
.form label:has(input[type='checkbox']) {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}
.form input[type='checkbox'] { width: auto; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }

.list-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.list-head h2 { margin: 0; }

.land-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  background: var(--cream);
  padding: 4px;
  border-radius: 999px;
}
.land-switch-btn {
  text-decoration: none;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--forest);
}
.land-switch-btn span {
  font-weight: 600;
  opacity: 0.55;
  margin-left: 4px;
}
.land-switch-btn.is-active {
  background: var(--forest);
  color: #fff;
}
.land-switch-btn.is-active span { opacity: 0.75; color: #fff; }

.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.preview {
  width: 100%;
  max-width: 420px;
  border-radius: 12px;
  display: block;
  margin-top: 8px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
.stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
}
.stat b {
  display: block;
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1;
  margin-bottom: 6px;
}

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(900px 420px at 50% -10%, rgba(194, 84, 26, .16), transparent 60%),
    var(--paper);
}

.login-card {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 22px;
  padding: 28px 24px;
  box-shadow: 0 18px 50px rgba(36, 56, 42, .14);
}

.hint { font-size: 0.88rem; color: var(--muted); font-weight: 400; }

.style-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin: 8px 0 4px;
}

.style-card {
  position: relative;
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  cursor: pointer;
  background: var(--paper);
}

.style-card:hover {
  border-color: var(--moss);
}

.style-card:has(input:checked) {
  background: #fff;
  box-shadow: inset 0 0 0 2px var(--forest);
}

.style-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.style-swatches {
  display: flex;
  height: 40px;
  border-radius: 10px;
  overflow: hidden;
}

.style-swatches span { flex: 1; }

.style-card strong {
  font-family: var(--font-display);
  font-size: 1.15rem;
}

@media (max-width: 900px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { padding: 18px; }
  .side-nav { grid-template-columns: repeat(2, 1fr); }
  .side-user { margin-top: 8px; }
  .admin-main { padding: 22px 16px 48px; }
  .form-row, .stats { grid-template-columns: 1fr; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .list-head { align-items: flex-start; }
}
