:root {
  --bg: #f4f1ea;
  --paper: #fffdf8;
  --ink: #171717;
  --muted: #5f5b54;
  --line: #e4dfd4;
  --accent: #ffe14a;
  --danger: #8d2430;
  --ok: #e7f6ec;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", "Liberation Sans", sans-serif;
  line-height: 1.45;
}
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
.topbar, .shell, .narrow { width: min(1180px, calc(100% - 2rem)); margin: 0 auto; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 1.1rem 0; }
.brand { font-weight: 750; letter-spacing: -0.03em; text-decoration: none; font-size: 1.15rem; }
.topbar form { margin: 0; }
.shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 1.5rem; padding-bottom: 3rem; }
.side { display: flex; flex-direction: column; gap: 0.25rem; }
.side a, .text-btn {
  display: block;
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  text-decoration: none;
}
.side a.is-active, .side a:hover { background: #fff; }
.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.1rem 1.15rem 1.25rem;
}
.stack { display: grid; gap: 0.85rem; }
label { display: grid; gap: 0.3rem; font-weight: 650; }
label span, .hint { color: var(--muted); font-weight: 450; font-size: 0.92rem; }
input[type="text"], input[type="password"], input[type="email"], input[type="number"], input[type="url"], textarea, select {
  width: 100%;
  border: 1px solid #d9d3c7;
  background: #fff;
  border-radius: 8px;
  padding: 0.6rem 0.7rem;
}
textarea { min-height: 90px; resize: vertical; }
.row { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.btn, button.btn {
  border: 0;
  background: var(--accent);
  color: #171717;
  border-radius: 8px;
  padding: 0.65rem 0.9rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.btn.secondary { background: #fff; border: 1px solid #d9d3c7; }
.btn.danger { background: #fff; color: var(--danger); border: 1px solid #e7c4c8; }
.banner { padding: 0.75rem 0.85rem; border-radius: 10px; margin-bottom: 0.9rem; }
.banner.ok { background: var(--ok); }
.banner.error { background: #fdecee; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.7rem 0.45rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.actions { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.actions form { margin: 0; }
.card-grid { display: grid; gap: 0.8rem; }
.repeater { border: 1px solid var(--line); border-radius: 12px; padding: 0.8rem; display: grid; gap: 0.6rem; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.8rem; }
.media-grid article { border: 1px solid var(--line); border-radius: 10px; padding: 0.45rem; background: #fff; }
.media-grid img, .thumb { width: 100%; height: 110px; object-fit: cover; border-radius: 8px; background: #eee; }
.thumb { width: 160px; height: 90px; }
.colors { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.7rem; }
input[type="color"] { height: 42px; padding: 0.2rem; width: 100%; }
.check { display: flex; gap: 0.5rem; align-items: center; font-weight: 600; }
.check input { width: auto; }
.meta { color: var(--muted); font-size: 0.92rem; }
.login { width: min(420px, calc(100% - 2rem)); margin: 8vh auto; }
:focus-visible { outline: 3px solid #111; outline-offset: 2px; }
@media (max-width: 800px) {
  .shell { grid-template-columns: 1fr; }
  .side { flex-direction: row; flex-wrap: wrap; }
}
