/* The admin pages. Plain and roomy: the people using them aren't web people. */
:root {
  --navy: #13285a;
  --navy-deep: #0c1a3c;
  --gold: #e3b23c;
  --cream: #faf7f0;
  --ink: #1a1d24;
  --muted: #5a606c;
  --line: #d9d3c3;
  --danger: #a3261b;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: "Barlow", system-ui, sans-serif; font-size: 17px; line-height: 1.5; color: var(--ink); background: var(--cream); }
h1, h2 { font-family: "Barlow Condensed", "Barlow", sans-serif; color: var(--navy); line-height: 1.15; }
h1 { font-size: 2.2rem; margin: 0 0 8px; }
h2 { font-size: 1.5rem; margin: 40px 0 10px; }
a { color: #1f4fa8; }
code { background: #efe9d9; padding: 1px 5px; border-radius: 4px; font-size: .92em; }
small, .muted, .meta { color: var(--muted); font-size: .88rem; font-weight: 400; }

.top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding: 12px 20px; background: var(--navy-deep); color: #fff; }
.top a { color: #fff; }
.top-title { font-family: "Barlow Condensed", sans-serif; font-size: 1.4rem; font-weight: 700; text-decoration: none; }
.top-user { margin-left: auto; opacity: .8; }
button.link { background: none; border: 0; padding: 0; color: #fff; font: inherit; text-decoration: underline; cursor: pointer; }

.layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: calc(100vh - 54px); }
.side { background: #fff; border-right: 1px solid var(--line); padding: 12px 0 32px; }
.side p { margin: 18px 20px 4px; font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.side a { display: block; padding: 7px 20px; color: var(--ink); text-decoration: none; }
.side a:hover, .side a[aria-current] { background: var(--cream); }
.side a[aria-current] { font-weight: 600; box-shadow: inset 4px 0 var(--gold); }
main { padding: 28px clamp(16px, 4vw, 44px) 80px; max-width: 1040px; width: 100%; }

@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; }
  .side { display: flex; flex-wrap: wrap; gap: 0 4px; padding: 6px 10px; border-right: 0; border-bottom: 1px solid var(--line); }
  .side p { display: none; }
  .side a { padding: 6px 10px; }
  .side a[aria-current] { box-shadow: inset 0 -3px var(--gold); }
}

input, select, textarea { font: inherit; color: inherit; width: 100%; padding: 9px 11px; border: 1px solid #b9b2a0; border-radius: 8px; background: #fff; }
input[type="checkbox"] { width: 20px; height: 20px; flex: none; }
input[type="file"] { padding: 8px; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgb(227 178 60 / 50%); border-color: #a87a12; }
textarea { resize: vertical; }
label { display: grid; gap: 4px; font-weight: 600; font-size: .95rem; }
label.check { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-weight: 500; }

button, a.button { font: inherit; font-weight: 600; padding: 9px 18px; border-radius: 8px; border: 2px solid var(--navy); background: var(--navy); color: #fff; cursor: pointer; text-decoration: none; display: inline-block; }
button:hover, a.button:hover { background: var(--navy-deep); }
button.danger { background: #fff; color: var(--danger); border-color: var(--danger); }
button.danger:hover { background: var(--danger); color: #fff; }
button.move { padding: 4px 10px; background: #fff; color: var(--navy); border-color: var(--line); }
button.move:hover { background: var(--cream); border-color: var(--navy); }
button:disabled { opacity: .5; cursor: default; }

.saved { background: #e1f1e6; color: #1d5a31; border-radius: 8px; padding: 10px 16px; font-weight: 600; margin: 0 0 20px; }
.error, .warn { background: #fdecea; color: #8a1c13; border-radius: 8px; padding: 10px 16px; font-weight: 600; }
.badge { display: inline-block; background: #e6e1d3; color: #4a4638; border-radius: 99px; padding: 1px 10px; font-size: .8rem; font-weight: 600; margin: 0; }
.badge.gold { background: var(--gold); color: var(--navy-deep); }

.stack { display: grid; gap: 16px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
fieldset { border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 8px 20px 20px; margin: 0; display: grid; gap: 14px; }
legend { font-family: "Barlow Condensed", sans-serif; font-size: 1.35rem; font-weight: 700; color: var(--navy); padding: 0 8px; }
.sticky-save { position: sticky; bottom: 0; padding: 14px 0; background: linear-gradient(transparent, var(--cream) 30%); }

.rows { display: grid; gap: 10px; }
.row { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.row > label { flex: 1 1 130px; }
.row > label.grow { flex: 3 1 240px; }
.row > label.full { flex: 1 1 100%; }
.row > label.check { flex: 0 1 auto; padding-bottom: 9px; }
.row .meta { flex: 1 1 100%; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-left: auto; }
.row.is-past, .row.is-hidden { background: #f3efe4; }
.row.is-past input { color: var(--muted); }
.moves { display: flex; gap: 4px; }

.photo-rows .row { align-items: start; flex-wrap: nowrap; }
.photo-rows img { width: 180px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; flex: none; background: #ddd; }
.photo-rows .is-hidden img { opacity: .55; }
.photo-fields { flex: 1; display: grid; gap: 10px; min-width: 0; }
.photo-rows .moves { flex-direction: column; }
@media (max-width: 600px) {
  .photo-rows .row { flex-wrap: wrap; }
  .photo-rows img { width: 100%; }
  .photo-rows .moves { flex-direction: row; }
}
.range-thumb { width: 200px; border-radius: 8px; }

.post-rows { list-style: none; padding: 0; display: grid; gap: 8px; }
.post-rows li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; }
.post-rows a { font-weight: 600; font-size: 1.05rem; }

.editor { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 900px) { .editor { grid-template-columns: 1fr; } }
.label { font-weight: 600; font-size: .95rem; margin: 0 0 4px; }
.preview { background: #fff; border: 1px dashed #b9b2a0; border-radius: 8px; padding: 4px 16px; min-height: 120px; overflow-wrap: break-word; }
.preview img { max-width: 100%; }
.delete-form { margin-top: 32px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-top: 24px; }
.tiles a { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; text-decoration: none; color: var(--muted); font-size: .95rem; }
.tiles a:hover { border-color: var(--navy); }
.tiles strong { display: block; font-family: "Barlow Condensed", sans-serif; font-size: 1.35rem; color: var(--navy); }

body.login { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 32px; width: min(420px, 100%); }
