:root {
    --sage: #8fb388;
    --petrol: #4a829e;
    --eucalyptus: #5b8e7d;
    --pale-sage: #d8e2dc;
    --blush: #f4acb7;
    --coral: #e76f51;
    --teal: #2a9d8f;
    --charcoal: #4a4a4a;
    --ink: #242a28;
    --muted: #68736f;
    --canvas: #f4f7f5;
    --line: #d8e2dc;
    --white: #fff;
    --danger: #a33a2b;
    --success: #356f5c;
    --shadow: 0 18px 52px rgba(39, 62, 53, .09);
    --radius: 18px;
    --font: "DIN Next", "DIN Pro", Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }
html { color: var(--ink); background: var(--canvas); font-family: var(--font); line-height: 1.5; }
body { margin: 0; min-height: 100vh; }
a { color: #27657b; text-underline-offset: 3px; }
a:hover { color: var(--ink); }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
img { max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: .55rem; color: var(--ink); font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.05; letter-spacing: -.035em; }
h2 { color: var(--ink); font-size: 1.3rem; line-height: 1.25; }
h3 { font-size: 1rem; }

.skip-link { position: fixed; z-index: 1000; top: 12px; left: 12px; padding: .7rem 1rem; background: var(--ink); color: #fff; transform: translateY(-160%); border-radius: 6px; }
.skip-link:focus { transform: translateY(0); }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.eyebrow { display: block; margin-bottom: .75rem; color: var(--eucalyptus); font-size: .76rem; font-weight: 800; letter-spacing: .17em; text-transform: uppercase; }
.lead { color: var(--charcoal); font-size: 1.1rem; line-height: 1.65; }
.required { margin-left: .2rem; color: var(--danger); }

.public-body { background: radial-gradient(circle at 12% 0%, rgba(143,179,136,.2), transparent 30rem), linear-gradient(135deg, #f7f9f8, #eef3f0); }
.public-header { display: flex; align-items: center; justify-content: space-between; width: min(1180px, calc(100% - 2.5rem)); margin: 0 auto; padding: 1.7rem 0; }
.brand-logo { display: block; width: 198px; height: auto; }
.header-label { color: var(--charcoal); font-size: .73rem; font-weight: 800; letter-spacing: .2em; }
.public-main { width: min(780px, calc(100% - 2rem)); margin: 1.8rem auto 5rem; }
.public-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .7rem; width: min(1180px, calc(100% - 2.5rem)); margin: 0 auto; padding: 1.5rem 0 2.4rem; border-top: 1px solid rgba(74,74,74,.14); color: var(--muted); font-size: .84rem; }
.hero-card, .form-card { position: relative; overflow: hidden; background: rgba(255,255,255,.96); border: 1px solid rgba(91,142,125,.16); border-radius: 26px; box-shadow: var(--shadow); }
.home-card { min-height: 410px; padding: clamp(2.2rem, 7vw, 5.5rem); background: linear-gradient(140deg, rgba(216,226,220,.9), rgba(255,255,255,.98) 58%); }
.home-card h1 { max-width: 620px; }
.home-card p { max-width: 560px; color: var(--charcoal); font-size: 1.18rem; }
.home-accent { position: absolute; right: -70px; bottom: -90px; width: 270px; height: 270px; border: 54px solid rgba(143,179,136,.42); border-radius: 50%; }
.form-card { padding: clamp(1.3rem, 5vw, 3.6rem); }
.compact-card { max-width: 650px; margin: 4rem auto; }
.form-cover { width: calc(100% + clamp(2.6rem, 10vw, 7.2rem)); max-width: none; height: 270px; margin: calc(-1 * clamp(1.3rem, 5vw, 3.6rem)) calc(-1 * clamp(1.3rem, 5vw, 3.6rem)) 2.5rem; object-fit: cover; }
.form-intro { padding-bottom: 1.7rem; border-bottom: 1px solid var(--line); }
.capacity-note { display: inline-flex; align-items: center; margin: .5rem 0 0; padding: .55rem .85rem; background: var(--pale-sage); border-radius: 999px; color: #30473f; font-size: .9rem; }
.capacity-note strong { margin-right: .3rem; }
.registration-form { padding-top: 1.8rem; }
.preview-banner { margin: -1rem -1rem 2rem; padding: .7rem 1rem; background: var(--blush); border-radius: 12px; color: #562b34; text-align: center; }
.honeypot { position: absolute; left: -10000px; }

.field { margin-bottom: 1.35rem; }
.field > label:not(.choice) { display: block; margin-bottom: .42rem; color: var(--ink); font-size: .94rem; font-weight: 750; }
.field-help { margin: -.15rem 0 .5rem; color: var(--muted); font-size: .84rem; }
.field input:not([type="checkbox"]):not([type="radio"]), .field textarea, .field select {
    display: block; width: 100%; min-height: 50px; padding: .77rem .9rem; background: #fff; border: 1.5px solid #b9c7c1; border-radius: 10px; color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
.field textarea { resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { outline: 0; border-color: var(--petrol); box-shadow: 0 0 0 4px rgba(74,130,158,.18); }
.field-invalid input, .field-invalid textarea, .field-invalid select { border-color: var(--danger) !important; }
.field-error { margin: .38rem 0 0; color: var(--danger); font-size: .88rem; font-weight: 700; }
.choice-group, .choice-grid { display: grid; gap: .65rem; margin: 0; padding: 0; border: 0; }
.choice { display: flex; align-items: flex-start; gap: .7rem; padding: .75rem .85rem; background: #f8faf9; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.choice:hover { border-color: var(--sage); }
.choice input { flex: 0 0 auto; width: 20px; height: 20px; margin: .12rem 0 0; accent-color: var(--eucalyptus); }
.choice span { line-height: 1.4; }
.choice small { display: block; color: var(--muted); }
.choice-single { margin-bottom: 1.25rem; }
.compact-choice { padding: .45rem .6rem; }
.privacy-section { margin: 2.2rem 0 1.8rem; padding: 1.35rem; background: #f3f7f4; border-radius: 14px; }
.privacy-section h2 { font-size: 1.05rem; }
.privacy-list { margin: 0; }
.privacy-list div { display: grid; grid-template-columns: 135px 1fr; gap: 1rem; padding: .55rem 0; border-bottom: 1px solid rgba(91,142,125,.16); }
.privacy-list div:last-child { border-bottom: 0; }
.privacy-list dt { font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.privacy-list dd { margin: 0; color: var(--charcoal); font-size: .9rem; }
.review-notice { margin: 1rem 0 0; padding-top: 1rem; border-top: 1px solid var(--line); color: #6e4022; font-size: .88rem; }
.submit-note { margin: .8rem 0 0; color: var(--muted); font-size: .83rem; text-align: center; }

.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: .68rem 1rem; border: 1px solid transparent; border-radius: 9px; font-weight: 750; line-height: 1.2; text-decoration: none; cursor: pointer; transition: transform .12s, background-color .12s, border-color .12s; }
.button:hover { transform: translateY(-1px); }
.button:focus-visible, .text-link:focus-visible, .link-button:focus-visible { outline: 3px solid var(--blush); outline-offset: 3px; }
.button-primary { background: var(--charcoal); color: #fff; box-shadow: 0 8px 22px rgba(74,74,74,.16); }
.button-primary:hover { background: #282d2b; color: #fff; }
.button-secondary { background: #fff; border-color: #aebdb7; color: #315f52; }
.button-secondary:hover { border-color: var(--eucalyptus); color: var(--ink); }
.button-danger { background: #fff; border-color: #d8a094; color: #8c2e20; }
.button-danger:hover { background: #fff1ee; color: #6f2016; }
.button-quiet { background: transparent; color: var(--muted); }
.button-wide { width: 100%; min-height: 54px; }
.text-link, .back-link { font-weight: 700; text-decoration-thickness: 1px; }
.back-link { display: inline-block; margin-bottom: 1.2rem; font-size: .9rem; }
.link-button { padding: 0; background: none; border: 0; color: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.alert { margin: 0 0 1.25rem; padding: .9rem 1rem; border-radius: 10px; font-size: .92rem; }
.alert-error { background: #fff0ed; border: 1px solid #e6b0a6; color: #762519; }
.alert-success { background: #e8f2ed; border: 1px solid #a6c9ba; color: #245846; }
.status-panel { padding: 1.2rem; border-radius: 12px; }
.status-panel h2 { margin-bottom: .35rem; }
.status-panel p { margin-bottom: 0; }
.status-success { background: #e8f2ed; color: #245846; }
.status-error { background: #fff0ed; color: #762519; }
.status-neutral { background: var(--pale-sage); color: #34473f; }
.success-mark { display: grid; place-items: center; width: 58px; height: 58px; margin-bottom: 1.5rem; background: var(--sage); border-radius: 50%; color: #1f3b31; font-size: 1.8rem; font-weight: 900; }
.number-card { display: flex; flex-direction: column; gap: .25rem; margin: 1.6rem 0; padding: 1.2rem; background: var(--pale-sage); border-radius: 12px; }
.number-card span { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }
.number-card strong { font-size: 1.25rem; letter-spacing: .04em; }

/* Administration */
.admin-body { display: grid; grid-template-columns: 252px 1fr; background: var(--canvas); }
.admin-sidebar { position: sticky; top: 0; display: flex; flex-direction: column; height: 100vh; padding: 1.4rem; background: var(--petrol); color: #fff; }
.admin-brand { display: block; color: #fff; text-decoration: none; }
.admin-brand img { width: 172px; }
.admin-brand span { display: block; margin-top: .3rem; font-size: .72rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.admin-sidebar nav { display: grid; gap: .25rem; margin: 2.6rem 0; }
.admin-sidebar nav a { padding: .72rem .8rem; border-radius: 8px; color: #fff; font-weight: 700; text-decoration: none; }
.admin-sidebar nav a:hover { background: rgba(255,255,255,.14); }
.sidebar-user { display: flex; flex-direction: column; margin-top: auto; padding: 1rem; background: rgba(21,55,68,.25); border-radius: 10px; }
.sidebar-user small { margin-bottom: .65rem; color: rgba(255,255,255,.8); }
.admin-shell { min-width: 0; }
.admin-main { width: min(1320px, calc(100% - 3rem)); margin: 0 auto; padding: 3.1rem 0 5rem; }
.mobile-admin-header { display: none; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 2rem; margin-bottom: 2rem; }
.page-heading h1 { margin-bottom: .35rem; font-size: clamp(2rem, 4vw, 3rem); }
.page-heading p { margin-bottom: 0; color: var(--muted); }
.heading-actions, .card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; }
.admin-card { background: #fff; border: 1px solid rgba(91,142,125,.18); border-radius: var(--radius); box-shadow: 0 10px 32px rgba(39,62,53,.06); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem; }
.form-overview-card { padding: 1.35rem; }
.form-overview-card h2 { margin: 1rem 0 1.2rem; font-size: 1.35rem; }
.form-overview-card h2 a { color: var(--ink); text-decoration: none; }
.card-topline { display: flex; align-items: center; justify-content: space-between; gap: 1rem; font-size: .78rem; }
.metrics-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: .55rem; margin-bottom: 1.25rem; }
.metrics-row div { padding: .75rem .55rem; background: #f3f7f4; border-radius: 9px; }
.metrics-row strong, .metrics-row span { display: block; }
.metrics-row strong { font-size: 1.25rem; }
.metrics-row span { color: var(--muted); font-size: .7rem; }
.card-actions { justify-content: space-between; padding-top: 1rem; border-top: 1px solid var(--line); }
.status-badge { display: inline-flex; align-items: center; width: fit-content; padding: .28rem .55rem; border-radius: 999px; font-size: .72rem; font-weight: 800; white-space: nowrap; }
.large-badge { padding: .5rem .75rem; font-size: .82rem; }
.status-draft { background: #edf0ef; color: #59625f; }
.status-published, .status-confirmed { background: #dcebe3; color: #285946; }
.status-closed, .status-cancelled { background: #f2e1dd; color: #7a3328; }
.status-archived { background: #ecebed; color: #5e5962; }
.status-waitlist { background: #fff0d2; color: #744f0b; }
.empty-state { padding: 4rem 1.5rem; background: #fff; border: 1px dashed #aebdb7; border-radius: var(--radius); text-align: center; }

.editor-form { display: grid; gap: 1.2rem; }
.editor-section { padding: clamp(1.2rem, 3vw, 2rem); }
.section-heading { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 1.6rem; padding-bottom: 1.2rem; border-bottom: 1px solid var(--line); }
.section-heading > span { display: grid; place-items: center; flex: 0 0 34px; height: 34px; background: var(--pale-sage); border-radius: 50%; color: #355b4f; font-size: .78rem; font-weight: 900; }
.section-heading h2 { margin-bottom: .2rem; }
.section-heading p { margin: 0; color: var(--muted); font-size: .9rem; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.form-row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.align-end { align-self: end; min-height: 50px; align-items: center; }
.input-suffix { display: flex; }
.input-suffix input { border-radius: 10px 0 0 10px !important; }
.input-suffix span { display: grid; place-items: center; padding: 0 .8rem; background: var(--pale-sage); border: 1.5px solid #b9c7c1; border-left: 0; border-radius: 0 10px 10px 0; }
.choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.editor-actions { position: sticky; z-index: 5; bottom: 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.2rem; background: rgba(255,255,255,.95); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); backdrop-filter: blur(8px); }
.copy-form { margin: 1.2rem 0; }
.field-builder { display: grid; gap: .75rem; margin-bottom: 1rem; }
.builder-row { display: grid; grid-template-columns: 38px minmax(130px, 1.2fr) minmax(100px, .7fr) minmax(120px, 1fr) auto; align-items: start; gap: .65rem; padding: .85rem; background: #f5f8f6; border: 1px solid var(--line); border-radius: 12px; }
.builder-number { display: grid; place-items: center; width: 32px; height: 32px; background: var(--pale-sage); border-radius: 8px; font-size: .78rem; font-weight: 900; }
.builder-row .mini-field label { display: block; margin-bottom: .25rem; color: var(--muted); font-size: .7rem; font-weight: 800; text-transform: uppercase; }
.builder-row input, .builder-row select, .builder-row textarea { width: 100%; min-height: 40px; padding: .5rem .58rem; border: 1px solid #b9c7c1; border-radius: 7px; background: #fff; }
.builder-options { grid-column: 2 / -1; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .65rem; }
.builder-actions { display: flex; gap: .3rem; }
.icon-button { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; background: #fff; border: 1px solid var(--line); border-radius: 7px; color: var(--charcoal); cursor: pointer; }
.icon-button:hover { border-color: var(--eucalyptus); }
.icon-button.danger { color: var(--danger); }

.metric-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.2rem; }
.metric-cards div { padding: 1rem 1.1rem; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.metric-cards span, .metric-cards strong { display: block; }
.metric-cards span { color: var(--muted); font-size: .78rem; }
.metric-cards strong { margin-top: .2rem; font-size: 1.65rem; }
.filter-bar { display: grid; grid-template-columns: minmax(250px, 1fr) 200px auto; align-items: end; gap: .8rem; margin-bottom: 1rem; }
.filter-bar .field { margin: 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .9rem 1rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { background: #edf3ef; color: #3e4b47; font-size: .73rem; letter-spacing: .04em; text-transform: uppercase; }
td { font-size: .9rem; }
td small, td strong { display: block; }
td small { margin-top: .16rem; color: var(--muted); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafcfb; }
.numeric { text-align: right; }
.empty-cell { padding: 2rem; color: var(--muted); text-align: center; }
.narrow-form { max-width: 820px; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, .8fr); gap: 1.2rem; align-items: start; }
.detail-sidebar { display: grid; gap: 1.2rem; }
.history-list { position: relative; display: grid; gap: 1rem; margin: 0; padding: 0; list-style: none; }
.history-list li { display: grid; grid-template-columns: 14px 1fr; gap: .65rem; }
.history-dot { width: 10px; height: 10px; margin-top: .3rem; background: var(--sage); border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px var(--eucalyptus); }
.history-list strong, .history-list small { display: block; }
.history-list small { color: var(--muted); }
.history-list p { margin: .25rem 0 0; font-size: .88rem; }
.danger-zone { padding: 1.4rem; border-color: #e1b1a7; }
.danger-zone p { color: var(--muted); font-size: .88rem; }
.inline-user-form { display: grid; grid-template-columns: 1fr 1.4fr 180px auto; align-items: end; gap: .8rem; }
.inline-user-form .field { margin: 0; }
.user-row-form { display: grid; grid-template-columns: 180px 100px 1fr 100px auto; align-items: center; gap: .8rem; }
.user-row-form select { min-height: 40px; padding: .45rem; border: 1px solid #b9c7c1; border-radius: 7px; }
.setup-steps { padding-left: 1.25rem; }
.setup-steps li { margin-bottom: .65rem; }
.secret-box { margin: 1.2rem 0; padding: 1rem; background: var(--pale-sage); border-radius: 10px; }
.secret-box span, .secret-box code { display: block; }
.secret-box span { margin-bottom: .35rem; color: var(--muted); font-size: .75rem; text-transform: uppercase; }
.secret-box code { font-size: 1.1rem; letter-spacing: .08em; overflow-wrap: anywhere; }
.uri-code { display: block; margin: .7rem 0; padding: .7rem; background: #f3f3f3; overflow-wrap: anywhere; }
.code-input { max-width: 220px; font-size: 1.35rem !important; letter-spacing: .2em; text-align: center; }

/* Authentication and print */
.auth-body { display: grid; place-items: center; padding: 1.25rem; background: radial-gradient(circle at 15% 0, var(--pale-sage), transparent 34rem), #f3f6f4; }
.auth-card { width: min(450px, 100%); padding: clamp(1.5rem, 5vw, 2.7rem); background: #fff; border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
.auth-logo { width: 190px; margin-bottom: 2.5rem; }
.auth-card h1 { font-size: 2rem; }
.stack-form { display: grid; gap: .15rem; }
.stack-form + .text-link { display: inline-block; margin-top: 1rem; }
.print-body { padding: 2rem; background: #fff; color: #000; font: 10pt Arial, sans-serif; }
.print-header { display: flex; align-items: center; justify-content: space-between; gap: 2rem; margin-bottom: 1.5rem; border-bottom: 2px solid var(--sage); }
.print-header img { width: 180px; }
.print-header h1 { font-size: 20pt; }
.print-table th, .print-table td { padding: .5rem; border: 1px solid #ccc; }

@media (max-width: 1050px) {
    .form-grid { grid-template-columns: 1fr; }
    .form-row-3 { grid-template-columns: 1fr 1fr; }
    .builder-row { grid-template-columns: 36px 1fr 1fr auto; }
    .builder-row .builder-name { grid-column: 2 / 4; }
    .builder-options { grid-column: 2 / -1; }
    .inline-user-form { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 820px) {
    .admin-body { display: block; }
    .admin-sidebar { position: static; display: block; width: 100%; height: auto; padding: 1rem; }
    .admin-brand { display: none; }
    .admin-sidebar nav { display: flex; overflow-x: auto; margin: 0; }
    .admin-sidebar nav a { white-space: nowrap; }
    .sidebar-user { display: none; }
    .admin-main { width: min(100% - 1.5rem, 1320px); padding-top: 2rem; }
    .mobile-admin-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem; background: #fff; border-bottom: 1px solid var(--line); }
    .mobile-admin-header img { width: 150px; }
    .mobile-admin-header form { margin: 0; }
    .mobile-admin-header .button { min-height: 38px; padding: .45rem .7rem; }
    .page-heading, .editor-actions { align-items: stretch; flex-direction: column; }
    .metric-cards { grid-template-columns: 1fr 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
    .filter-bar { grid-template-columns: 1fr 1fr; }
    .filter-bar .button { grid-column: 1 / -1; }
    .user-row-form { min-width: 750px; }
}

@media (max-width: 600px) {
    .public-header { width: calc(100% - 2rem); padding: 1rem 0; }
    .brand-logo { width: 160px; }
    .header-label { display: none; }
    .public-main { width: calc(100% - 1rem); margin-top: .7rem; }
    .public-footer { width: calc(100% - 2rem); }
    .form-card { border-radius: 18px; }
    .home-card { min-height: 360px; }
    .privacy-list div { grid-template-columns: 1fr; gap: .2rem; }
    .form-row, .form-row-3, .choice-grid { grid-template-columns: 1fr; }
    .metrics-row { grid-template-columns: 1fr 1fr; }
    .metric-cards { grid-template-columns: 1fr 1fr; gap: .6rem; }
    .metric-cards div { padding: .8rem; }
    .heading-actions { width: 100%; }
    .heading-actions .button { flex: 1 1 auto; }
    .builder-row { grid-template-columns: 34px 1fr; }
    .builder-number { grid-row: span 2; }
    .builder-row .builder-name { grid-column: 2; }
    .builder-row .mini-field { grid-column: 2; }
    .builder-actions { grid-column: 2; }
    .builder-options { grid-column: 2; grid-template-columns: 1fr; }
    .editor-actions { position: static; }
    .inline-user-form { grid-template-columns: 1fr; }
}

@media print {
    .admin-sidebar, .mobile-admin-header, .button, .public-header, .public-footer { display: none !important; }
    .admin-body, .admin-main { display: block; width: 100%; padding: 0; background: #fff; }
    .admin-card { box-shadow: none; }
}
