:root { --green: #2c4a3b; --green-dark: #1f362b; --bg: #f5f3ee; --ink: #26302b; --muted: #5d6a63; --line: #ddd8cc; --red: #a23b2e; --gold: #a9812f; }
* { box-sizing: border-box; }
body { margin: 0; font: 1rem/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--green); } img { max-width: 100%; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
h1 { font-size: 1.7rem; margin: 0 0 0.4rem; } h2 { font-size: 1.2rem; margin: 2rem 0 0.75rem; }
small { color: var(--muted); display: block; font-size: 0.875rem; }
.lede { color: var(--muted); margin: 0 0 1.5rem; }

.shell { display: grid; grid-template-columns: 15rem 1fr; min-height: 100vh; }
.side { background: var(--green-dark); color: #fff; padding: 1.25rem 0.75rem; display: flex; flex-direction: column; }
.side .brand { font-weight: 700; font-size: 1.1rem; margin: 0 0.75rem 1.25rem; } .side .brand small { color: #b9c7be; font-weight: 400; }
.side nav a { display: block; color: #e3ebe5; text-decoration: none; padding: 0.55rem 0.75rem; border-radius: 0.35rem; }
.side nav a:hover, .side nav a[aria-current] { background: rgb(255 255 255 / 0.13); color: #fff; }
.side-foot { margin-top: auto; padding: 1.5rem 0.75rem 0; font-size: 0.9rem; display: grid; gap: 0.5rem; }
.side-foot a, .side-foot .link { color: #b9c7be; }
main { padding: 2rem clamp(1rem, 4vw, 3rem) 4rem; max-width: 60rem; width: 100%; }
@media (max-width: 48rem) {
  .shell { display: block; } .side { padding: 0.75rem; } .side nav { display: flex; flex-wrap: wrap; } .side-foot { display: flex; padding-top: 0.5rem; gap: 1.25rem; }
  .side .brand { margin-bottom: 0.5rem; }
}

.btn { display: inline-block; font: inherit; font-weight: 600; background: var(--green); color: #fff; border: 0; border-radius: 0.35rem; padding: 0.6rem 1.1rem; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--green-dark); } .btn:disabled { opacity: 0.6; cursor: progress; }
.btn.red { background: #fff; color: var(--red); border: 1px solid var(--red); } .btn.red:hover { background: var(--red); color: #fff; }
.link { font: inherit; background: none; border: 0; padding: 0; color: var(--green); text-decoration: underline; cursor: pointer; }
.red { color: var(--red); }
.head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.4rem; } .head h1 { margin: 0; }
.crumb { margin: 0 0 0.75rem; font-size: 0.9rem; }
.flash { background: #e3f1e6; border: 1px solid #9cc7a6; border-radius: 0.35rem; padding: 0.7rem 1rem; margin: 0 0 1.25rem; }
.errors { background: #fbeae7; border: 1px solid #e0a59c; border-radius: 0.35rem; padding: 0.7rem 1rem; margin: 0 0 1.25rem; } .errors p { margin: 0.15rem 0; }
.empty { color: var(--muted); background: #fff; border: 1px dashed var(--line); border-radius: 0.4rem; padding: 2rem; text-align: center; }

table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 0.4rem; overflow: hidden; }
td { padding: 0.8rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; } tr:last-child td { border: 0; }
td a { text-decoration: none; }
.row-actions { text-align: right; white-space: nowrap; } .row-actions form { display: inline; margin-left: 1rem; }
.inline-form input { width: 11rem; padding: 0.3rem 0.5rem; margin-right: 0.4rem; }

.form { background: #fff; border: 1px solid var(--line); border-radius: 0.4rem; padding: 1.5rem; max-width: 44rem; }
.field { margin-bottom: 1.25rem; } .field > label, .box label { display: block; font-weight: 600; margin-bottom: 0.3rem; }
label em { font-weight: 400; font-style: normal; color: var(--muted); }
input:not([type=checkbox], [type=file]), textarea, select { font: inherit; width: 100%; padding: 0.55rem 0.7rem; border: 1px solid #b9b3a4; border-radius: 0.3rem; background: #fff; color: inherit; }
input[type=date], input[type=time], input[type=number] { width: 12rem; }
textarea { resize: vertical; } .field small { margin-top: 0.3rem; }
.current { display: block; margin-bottom: 0.5rem; } .current img { max-height: 9rem; border-radius: 0.3rem; display: block; margin-bottom: 0.4rem; }
.check { font-weight: 400; }
.actions { display: flex; align-items: center; gap: 1rem; }
.status { background: #eef3f0; border-radius: 0.3rem; padding: 0.6rem 0.9rem; } .status.bad { background: #fbeae7; color: #7a2419; }
.danger { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr)); gap: 1rem; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: 0.4rem; padding: 1.25rem; display: grid; gap: 1rem; }
.tile .count { text-decoration: none; color: var(--muted); } .tile strong { display: block; font-size: 2rem; color: var(--ink); line-height: 1.1; }
.tile .btn { text-align: center; }
.help { margin-top: 2rem; background: #fff; border: 1px solid var(--line); border-radius: 0.4rem; padding: 0.25rem 1.5rem 1rem; max-width: 44rem; } .help li { margin-bottom: 0.4rem; }

.photos-admin { margin-top: 2.5rem; }
.dropzone { background: #fff; border: 2px dashed #b9b3a4; border-radius: 0.5rem; padding: 1.5rem; text-align: center; } .dropzone.over { border-color: var(--green); background: #eef3f0; }
.dropzone p { margin: 0.75rem 0 0; color: var(--muted); }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: 1rem; margin-top: 1.25rem; }
.photo { background: #fff; border: 1px solid var(--line); border-radius: 0.4rem; padding: 0.5rem; font-size: 0.9rem; }
.photo img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 0.25rem; display: block; }
.photo form { display: flex; gap: 0.4rem; margin-top: 0.4rem; } .photo input { padding: 0.3rem 0.45rem; }

.bare { display: grid; place-items: center; min-height: 100vh; padding: 1rem; }
.box { background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--green); border-radius: 0.4rem; padding: 2rem; width: min(100%, 25rem); }
.box .brand { color: var(--muted); margin: 0 0 0.25rem; } .box label { margin-bottom: 1rem; } .box label input { margin-top: 0.3rem; font-weight: 400; }
.box .btn { width: 100%; } .small { font-size: 0.875rem; color: var(--muted); margin: 1rem 0 0; }

.tools { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin-top: 0.4rem; } .tools .status { padding: 0.25rem 0.6rem; font-size: 0.875rem; }

.message { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 0.4rem; padding: 1rem 1.25rem; margin-bottom: 1rem; max-width: 46rem; }
.message.unread { border-left-color: var(--gold); } .message header { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; } .message header span { color: var(--muted); font-size: 0.875rem; }
.message p { margin: 0.5rem 0; } .message .text { white-space: pre-wrap; } .message .row-actions { text-align: left; } .message .row-actions form:first-child { margin-left: 0; }

/* Date boxes: DD/MM/YYYY text plus a calendar button. */
.datefield { position: relative; display: flex; gap: 0.4rem; max-width: 15rem; }
.datefield .cal { flex: none; display: grid; place-items: center; width: 2.6rem; border: 1px solid #b9b3a4; border-radius: 0.3rem; background: #fff; color: inherit; cursor: pointer; }
.datefield .cal:hover { background: #f4f1ea; }
.datefield input.native-date { position: absolute; right: 0; bottom: 0; width: 2.6rem; height: 1px; padding: 0; border: 0; opacity: 0; pointer-events: none; }

/* Coming dates of a repeating event, each with a skip button */
.occurrences { margin-top: 2rem; }
.occurrences ul { list-style: none; padding: 0; margin: 0; border: 1px solid #ddd6c6; border-radius: 0.35rem; background: #fff; }
.occurrences li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.55rem 0.9rem; border-bottom: 1px solid #eee8db; }
.occurrences li:last-child { border-bottom: 0; }
.occurrences li.skipped span { color: #8a8478; text-decoration: line-through; }

/* Page editor with a live preview beside it (on wide screens; underneath on narrower ones). */
main.wide { max-width: none; }
.with-preview { display: grid; gap: 1.5rem; align-items: start; }
.with-preview .form { max-width: none; }
.preview { background: #fff; border: 1px solid var(--line); border-radius: 0.4rem; overflow: hidden; }
.preview-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.75rem; padding: 0.6rem 0.9rem; border-bottom: 1px solid var(--line); }
.preview-bar .small { color: #666; font-size: 0.85rem; flex: 1 1 12rem; }
.preview-size { display: inline-flex; border: 1px solid var(--line); border-radius: 0.3rem; overflow: hidden; }
.preview-size button { font: inherit; font-size: 0.85rem; border: 0; background: #fff; padding: 0.25rem 0.7rem; cursor: pointer; }
.preview-size button.on { background: var(--green); color: #fff; }
.preview-frame { position: relative; height: 70vh; overflow: hidden; background: #eee; }
.preview-frame iframe { position: absolute; top: 0; left: 0; border: 0; transform-origin: 0 0; background: #fff; }
.preview.stale .preview-frame { opacity: 0.5; }
@media (min-width: 75rem) {
  .with-preview { grid-template-columns: minmax(26rem, 1fr) minmax(0, 1.15fr); }
  .preview { position: sticky; top: 1rem; }
  .preview-frame { height: calc(100vh - 6rem); }
}
