:root {
	--bg: #fff8ef;
	--surface: #ffffff;
	--surface-warm: #fdf1e3;
	--ink: #3a3330;
	--muted: #8a7f78;
	--pine: #2f5d4e;
	--pine-dark: #244a3e;
	--red: #c0392b;
	--red-dark: #a5301f;
	--gold: #c8892b;
	--line: #ece0d2;
	--radius: 14px;
	--shadow: 0 6px 20px rgba(90, 60, 30, .08);
}

* { box-sizing: border-box; }

body {
	margin: 0;
	font-family: "Nunito", system-ui, sans-serif;
	color: var(--ink);
	background: var(--bg);
	line-height: 1.6;
}

h1, h2, h3, .brand { font-family: "Comic Neue", "Nunito", cursive; }
h1 { font-size: 2rem; margin: .2em 0 .5em; color: var(--pine-dark); }
h2 { color: var(--pine); }
a { color: var(--red); }

.container { width: 100%; max-width: 1040px; margin-inline: auto; padding-inline: 1.5rem; }
.container-wide { max-width: 1600px; }
main.container { padding: 2rem 1.5rem 3rem; }

/* Header / nav */
.site-header { background: var(--pine); color: #fff8ef; box-shadow: var(--shadow); position: sticky; top: 0; z-index: 20; }
.nav-inner { display: flex; align-items: center; gap: 1rem; padding: .6rem 0; }
.brand { display: flex; align-items: center; gap: .6rem; color: #fff8ef; text-decoration: none; font-size: 1.15rem; font-weight: 700; line-height: 1.05; }
.brand-mark { width: 44px; height: 44px; object-fit: contain; }
.nav-links { margin-left: auto; display: flex; gap: .3rem; flex-wrap: wrap; }
.nav-links a { color: #fff8ef; text-decoration: none; padding: .45rem .8rem; border-radius: 999px; font-weight: 600; }
.nav-links a:hover { background: rgba(255,255,255,.12); }
.nav-links a.active { background: var(--red); }
.nav-toggle, .nav-burger { display: none; }

/* Hero */
.hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 1.5rem; align-items: center; margin-bottom: 2rem; }
.hero-img { width: 100%; max-width: 320px; justify-self: center; }
.lead { font-size: 1.15rem; color: var(--ink); }
.hero-actions { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1rem; }

/* Buttons */
.btn { display: inline-block; padding: .6rem 1.2rem; border-radius: 999px; font-weight: 700; text-decoration: none; border: none; cursor: pointer; font-size: 1rem; font-family: inherit; }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); }
.btn-ghost { background: transparent; border: 2px solid var(--pine); color: var(--pine); }
.btn-ghost:hover { background: var(--pine); color: #fff; }
.btn-link { background: none; border: none; color: var(--red); cursor: pointer; font: inherit; padding: 0; text-decoration: underline; }
.btn-link.danger { color: var(--red-dark); }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem 1.5rem; box-shadow: var(--shadow); margin-bottom: 1.5rem; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.two-col .card { margin-bottom: 0; }
.muted { color: var(--muted); }
.tag { display: inline-block; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--pine); }

/* Facts */
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 2rem; }
.fact-card { background: var(--surface-warm); border-radius: var(--radius); padding: 1.1rem; text-align: center; }
.fact-value { display: block; font-size: 1.35rem; font-weight: 800; color: var(--red); font-family: "Comic Neue", cursive; }
.fact-label { color: var(--muted); font-size: .9rem; font-weight: 700; }

/* Pack lists */
.steps { padding-left: 1.2rem; }
.steps li { margin: .4rem 0; }
.list-ok ul li::marker { content: "✓ "; color: var(--pine); }
.list-no ul li::marker { content: "✗ "; color: var(--red); }
.list-ok ul, .list-no ul { list-style: none; padding-left: 1.2rem; }
.list-ok li, .list-no li { margin: .35rem 0; }

/* Annahmestellen */
.stellen-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.2rem; }
.stelle h2 { margin-top: 0; }
.stelle-addr { font-size: 1.05rem; }
.stelle-note { background: var(--surface-warm); border-radius: 10px; padding: .6rem .8rem; font-size: .95rem; }

/* Statistics */
.year-picker { display: flex; align-items: center; gap: .6rem; margin: 1.5rem 0; }
.year-picker select { padding: .4rem .8rem; border-radius: 8px; border: 1px solid var(--line); font: inherit; }

/* Journey */
.journey { list-style: none; padding: 0; margin: 1.5rem 0; position: relative; }
.journey::before { content: ""; position: absolute; left: 1.2rem; top: 1.4rem; bottom: 1.4rem; width: 3px; background: var(--line); border-radius: 3px; }
.journey-step { position: relative; display: flex; gap: 1.1rem; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.3rem; box-shadow: var(--shadow); margin-bottom: 1.1rem; }
.journey-step h2 { margin: .1rem 0 .4rem; }
.journey-step > div { flex: 1; }
.journey-step p { margin: 0; }
.journey-num { flex: 0 0 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--red); color: #fff; font-family: "Comic Neue", cursive; font-weight: 800; font-size: 1.3rem; display: grid; place-items: center; box-shadow: 0 0 0 4px var(--bg); z-index: 1; }
.tasklist { list-style: none; margin: .7rem 0 0; padding: 0; display: grid; gap: .5rem; }
.tasklist li { position: relative; padding: .5rem .8rem .5rem 1.9rem; background: var(--surface-warm); border-radius: 10px; }
.tasklist li::before { content: "✓"; position: absolute; left: .7rem; top: .5rem; color: var(--pine); font-weight: 800; }
.teaser { display: flex; align-items: center; justify-content: space-between; gap: 1.2rem; flex-wrap: wrap; background: var(--surface-warm); }
.teaser h2 { margin-top: 0; }

/* Support / tasks */
.task-list { display: grid; gap: 1.2rem; }
.task-head { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.task-head h2 { margin: 0; }
.task-meta { color: var(--ink); margin: .3rem 0 .6rem; }
.badge { display: inline-block; background: var(--pine); color: #fff; border-radius: 999px; padding: .15rem .7rem; font-size: .82rem; font-weight: 700; }
.badge-full { background: var(--muted); }
.badge-no { background: var(--red); }
.banner-ok { background: #e7f4ec; border: 1px solid #b6ddc4; color: var(--pine-dark); border-radius: var(--radius); padding: .8rem 1.1rem; font-weight: 600; }
.signup { margin-top: .6rem; }
.signup summary { cursor: pointer; font-weight: 700; color: var(--red); width: max-content; }
.signup .form { margin-top: .8rem; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* Calendar */
.cal-list { display: grid; gap: .8rem; }
.cal-item { display: flex; gap: 1rem; background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--pine); border-radius: var(--radius); padding: .9rem 1.1rem; box-shadow: var(--shadow); }
.cal-date { flex: 0 0 auto; min-width: 8.5rem; font-weight: 700; color: var(--pine-dark); }
.cal-time { display: block; color: var(--red); font-size: .9rem; }
.cal-body h2 { margin: 0 0 .3rem; font-size: 1.15rem; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.cal-body p { margin: .2rem 0 0; }
.cal-actions { display: flex; gap: .8rem; align-items: center; margin-top: .5rem !important; }
@media (max-width: 600px) { .cal-item { flex-direction: column; gap: .3rem; } .cal-date { min-width: 0; } }

/* Lieferschein / Packliste */
.sheet-actions { display: flex; gap: .8rem; margin-bottom: 1rem; }
.sheet { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 2rem 2.2rem; max-width: 820px; margin: 0 auto; color: #222; box-shadow: var(--shadow); }
.sheet-head { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 2px solid var(--pine); padding-bottom: 1rem; }
.sheet-brand { font-family: "Comic Neue", cursive; font-size: 1.4rem; font-weight: 700; color: var(--pine-dark); }
.sheet-sender { text-align: right; font-size: .9rem; line-height: 1.5; }
.sheet-title { font-size: 1.5rem; margin: 1.3rem 0; color: var(--pine-dark); }
.sheet-meta { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; line-height: 1.5; }
.sheet-meta-right { text-align: right; }
.sheet-table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.sheet-table th, .sheet-table td { border-bottom: 1px solid var(--line); padding: .55rem .6rem; text-align: left; }
.sheet-table th { background: var(--surface-warm); }
.sheet-table .num { text-align: right; }
.sheet-table tfoot td { font-weight: 700; border-top: 2px solid var(--pine); border-bottom: none; }
.sheet-note { background: var(--surface-warm); padding: .6rem .9rem; border-radius: 8px; }
.sheet-sign { display: flex; gap: 3rem; margin-top: 3.5rem; }
.sheet-sign > div { flex: 1; font-size: .85rem; }
.sign-line { border-top: 1px solid #333; margin-bottom: .3rem; height: 2.5rem; }

@media print {
	.site-header, .admin-bar, .site-footer, .noprint { display: none !important; }
	body { background: #fff; }
	main.container { padding: 0; width: 100%; }
	.sheet { border: none; box-shadow: none; max-width: none; padding: 0; }
}

/* Footer */
.site-footer { background: var(--pine-dark); color: #e8ddcf; padding: 1.5rem 0; margin-top: 2rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.footer-links { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.footer-links a { color: #ffd9b0; text-decoration: none; }

/* Admin */
.admin-bar { background: var(--surface-warm); border-bottom: 1px solid var(--line); }
.admin-bar-inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .5rem 0; flex-wrap: wrap; }
.admin-links { display: flex; gap: 1rem; flex-wrap: wrap; }
.admin-links a { color: var(--pine-dark); text-decoration: none; font-weight: 600; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.head-actions { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.tile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1.2rem; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; text-align: center; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); }
.tile:hover { border-color: var(--pine); }
.tile-value { display: block; font-size: 2rem; font-weight: 800; color: var(--red); font-family: "Comic Neue", cursive; }
.tile-label { color: var(--muted); }

/* Tables */
.data-table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.data-table th, .data-table td { padding: .6rem .8rem; text-align: left; border-bottom: 1px solid var(--line); }
.data-table th:not(.col-grow), .data-table td:not(.col-grow) { white-space: nowrap; }
.data-table .col-grow { white-space: normal; overflow-wrap: anywhere; }
.data-table th { background: var(--surface-warm); color: var(--pine-dark); font-size: .9rem; }
.row-actions { display: flex; gap: .8rem; align-items: center; }
.data-table td.row-actions { width: 1%; white-space: nowrap; }
.data-table .col-grow { width: 100%; }
.inline { display: inline; }

/* Forms */
.form label, .form-row label { display: block; font-weight: 600; margin-bottom: .8rem; }
.form input, .form textarea, .form select, .pw-form input { width: 100%; padding: .5rem .7rem; border: 1px solid var(--line); border-radius: 8px; font: inherit; margin-top: .2rem; }
.form-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.form-row label { flex: 1; min-width: 160px; }
.form-row label.narrow { flex: 0 0 120px; }
.form label.check { display: flex; align-items: center; gap: .5rem; font-weight: 600; }
.form label.check input { width: auto; margin: 0; }
.form-row label.check { flex: 1; }
.form-actions { display: flex; gap: .8rem; margin-top: 1rem; }
.inline-form { display: flex; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }
.inline-form label { margin: 0; }
.pw-form { display: flex; gap: .4rem; align-items: center; }
.pw-form input { width: auto; }
.auth-box { max-width: 380px; margin: 3rem auto; }
.auth-box label { display: block; margin-bottom: 1rem; font-weight: 600; }
.auth-box input { width: 100%; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 8px; font: inherit; margin-top: .3rem; }
.alert { background: #fdecea; color: var(--red-dark); border: 1px solid #f5c6c0; border-radius: 8px; padding: .6rem .9rem; }

/* Season participation checklist */
.check-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .7rem; margin: .8rem 0; align-items: stretch; }
.season-stelle { display: flex; flex-direction: column; gap: .35rem; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: .7rem .8rem; }
.season-stelle.is-archived { opacity: .65; }
.season-stelle .check { display: flex; align-items: center; gap: .5rem; cursor: pointer; }
.season-stelle .check input { width: auto; flex: none; margin: 0; }
.ss-main { font-weight: 700; }
.ss-name { line-height: 1.25; }
.ss-city { font-size: .85rem; padding-left: 1.55rem; }
.ss-public { margin-top: auto; padding-top: .45rem; border-top: 1px solid var(--line); font-weight: 400; font-size: .9rem; }

/* Verteiler-Ansicht */
.vert-filter { display: flex; gap: 1rem; align-items: center; margin: 1rem 0; flex-wrap: wrap; }
.vert-filter #vert-search { flex: 1; min-width: 12rem; padding: .5rem .75rem; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.vert-list { display: grid; gap: 1rem; }
.vert-card { margin-bottom: 0; }
.vert-head { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; margin-bottom: .7rem; }
.vert-name { font-size: 1.15rem; }
.vert-prev { font-size: .85rem; }
.seg-row { display: flex; align-items: center; gap: .8rem; margin: .4rem 0; flex-wrap: wrap; }
.seg-label { flex: 0 0 3.5rem; font-weight: 700; color: var(--pine-dark); }
.seg { display: inline-flex; flex-wrap: wrap; gap: .4rem; }
.seg-btn { border: 2px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: .4rem .9rem; font: inherit; font-weight: 600; cursor: pointer; min-width: 2.6rem; }
.seg-btn:hover { border-color: var(--pine); }
.seg-btn.active { background: var(--pine); border-color: var(--pine); color: #fff; }
.saved-hint { color: var(--pine); font-weight: 700; }
.saved-hint.err { color: var(--red); }
.chip-toggle { border: 2px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 999px; padding: .25rem .7rem; font: inherit; font-size: .82rem; font-weight: 700; cursor: pointer; }
.chip-toggle.active { background: var(--red); border-color: var(--red); color: #fff; }
.vert-card.no-perm .seg-row { opacity: .4; }

/* Done toggle (checkbox-style button) */
.done-toggle { width: 1.5rem; height: 1.5rem; border: 2px solid var(--muted); border-radius: 6px; background: var(--surface); color: #fff; font-size: 1rem; font-weight: 700; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; transition: background .12s, border-color .12s; }
.done-toggle:hover { border-color: var(--pine); }
.done-toggle.is-done { background: var(--pine); border-color: var(--pine); }

/* Order matrix (articles as rows, Annahmestellen as columns) */
.grid-scroll { overflow-x: auto; }
.order-grid { width: 100%; }
.order-grid input { width: 100%; max-width: 6rem; padding: .35rem; text-align: right; }
.order-grid td, .order-grid th { text-align: center; }
.order-grid .sticky-col { position: sticky; left: 0; background: var(--surface); text-align: left; z-index: 1; }
.order-grid thead .sticky-col, .order-grid tfoot .sticky-col { background: var(--surface-warm); }
.order-grid tfoot td, .order-grid tfoot th, .order-grid .itemtotal { font-weight: 700; background: var(--surface-warm); }

/* Global stats */
.order-grid td.mismatch { color: #fff; background: var(--red); font-weight: 700; }
.order-grid tr.agg td { font-weight: 700; background: var(--surface-warm); }
@media (max-width: 760px) { .chart-grid { grid-template-columns: 1fr; } }

/* Stat entry */
.data-table input { width: 8rem; padding: .35rem .5rem; }
.data-table.breakdown th, .data-table.breakdown td { text-align: center; }
.data-table.breakdown td:first-child, .data-table.breakdown th:first-child { text-align: left; }
.data-table.breakdown input { width: 6rem; }

.chartbox { width: 100%; }

@media (max-width: 760px) {
	.hero, .two-col, .facts { grid-template-columns: 1fr; }
	.nav-burger { display: block; margin-left: auto; font-size: 1.6rem; color: #fff8ef; cursor: pointer; }
	.nav-links { flex-basis: 100%; flex-direction: column; display: none; }
	.nav-toggle:checked ~ .nav-links { display: flex; }

	.container { width: 100%; padding-inline: 16px; }
	main.container { padding: 1.2rem 16px 2rem; }
	h1 { font-size: 1.55rem; }
	.card { padding: 1rem 1.1rem; }

	/* List tables become stacked cards (label : value) instead of scrolling. */
	.data-table.cards thead { display: none; }
	.data-table.cards, .data-table.cards tbody, .data-table.cards tr, .data-table.cards td { display: block; }
	.data-table.cards tr { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: .8rem; background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
	.data-table.cards td { border: none; border-bottom: 1px solid var(--line); padding: .5rem .8rem; display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; text-align: right; white-space: normal; }
	.data-table.cards td:last-child { border-bottom: none; }
	.data-table.cards td:empty { display: none; }
	.data-table.cards td::before { content: attr(data-label); font-weight: 700; color: var(--pine-dark); text-align: left; white-space: nowrap; }
	.data-table.cards td.row-actions { justify-content: flex-start; text-align: left; flex-wrap: wrap; background: var(--surface-warm); width: auto; white-space: normal; }
	.data-table.cards td.row-actions::before { content: ""; }
	/* Other (non-card, non-grid) tables scroll inside their own box. */
	.data-table:not(.cards):not(.order-grid) { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }

	/* Charts keep a readable size and scroll horizontally on small screens. */
	.chartbox { overflow-x: auto; -webkit-overflow-scrolling: touch; }
	.chartbox svg { min-width: 600px; }

	/* Admin bar: stacked, links wrap tidily. */
	.admin-bar-inner { flex-direction: column; align-items: stretch; gap: .5rem; }
	.admin-links { gap: .4rem 1rem; }

	.page-head { gap: .6rem; }
	.row-actions { gap: .6rem; }
}
