:root {
    --bg: #f4f2ee; --card: #fff; --text: #1f2328; --muted: #6a6f76; --line: #dcd8d0;
    --accent: #7a2e8e; --accent-ink: #fff; --ok: #1f7a3a; --due: #b3261e; --warn-bg: #fff4d6;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.wrap { max-width: 860px; margin: 0 auto; padding: 24px 16px 64px; }
h1 { font-size: 1.8rem; line-height: 1.2; margin: .2em 0 .5em; }
h2 { font-size: 1.3rem; margin: 0 0 .8em; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.ok { color: var(--ok); font-weight: 600; }
.due { color: var(--due); font-weight: 600; }
.crumb { margin: 0 0 12px; }

.flyer, .details, .signup { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 20px; margin-bottom: 20px; }
.flyer img { max-width: 100%; height: auto; }
.flyer { overflow-wrap: anywhere; }
.narrow { max-width: 420px; margin: 40px auto; }
dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
dt { color: var(--muted); }
dd { margin: 0; font-weight: 600; }

label { display: block; margin: 0 0 14px; font-weight: 600; font-size: .95rem; }
input, select, textarea { display: block; width: 100%; margin-top: 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; font: inherit; background: #fff; color: inherit; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
label.check input { width: auto; margin: 0; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px 4px; margin: 0 0 16px; }
legend { font-weight: 700; padding: 0 6px; }
.person { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.person > input { flex: 1; margin: 0; }
.person label.check { margin: 0; white-space: nowrap; }
.total { font-size: 1.15rem; }
button, .btn { display: inline-block; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 6px; padding: 11px 22px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
button:hover, .btn:hover { filter: brightness(1.1); }
button.link { background: none; color: var(--accent); padding: 0; font-weight: 500; text-decoration: underline; }
button.link.danger { color: var(--due); }
.errors { background: #fdecea; border: 1px solid #f3b8b3; color: #7a1a12; border-radius: 6px; padding: 10px 14px; margin-bottom: 16px; }
.errors ul { margin: 0; padding-left: 18px; }
.notice { background: var(--warn-bg); border: 1px solid #ecd58a; border-radius: 6px; padding: 12px 16px; }
.notice.ok { background: #e7f5ea; border-color: #a9d8b4; color: var(--text); font-weight: 400; }

.event-list { display: grid; gap: 12px; }
.event-card { display: grid; gap: 2px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px 20px; text-decoration: none; color: inherit; }
.event-card:hover { border-color: var(--accent); }
.event-card strong { font-size: 1.15rem; }

/* admin */
.adminbar { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 10px 0 16px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.adminbar a { font-weight: 600; text-decoration: none; }
body:has(.adminbar) .wrap { max-width: 1200px; }
.admin-form { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 20px; }
.table-scroll { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); font-size: .95rem; }
table.data th, table.data td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data thead th { background: #ece8e0; font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; }
table.data tfoot th { background: #ece8e0; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
.actions { white-space: nowrap; }
.actions a, .actions button { margin-right: 10px; }
.actions form { display: inline; }
.tag { display: inline-block; font-size: .75rem; background: #efe3f3; color: var(--accent); border-radius: 4px; padding: 0 6px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 16px 0; }
.stats div { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; color: var(--muted); font-size: .9rem; }
.stats span { display: block; color: var(--text); font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }

@media (max-width: 640px) {
    .row { grid-template-columns: 1fr; }
    .stats { grid-template-columns: 1fr 1fr; }
    .person { flex-wrap: wrap; gap: 6px; padding-bottom: 6px; }
    .person > input { flex: 1 1 100%; }
}
@media print {
    body { background: #fff; }
    .adminbar, .no-print { display: none !important; }
    .stats div, table.data { border-color: #999; }
}
