:root {
  --bg: #f6f3ec;
  --surface: #ffffff;
  --text: #1c1c1c;
  --muted: #6a6a6a;
  --border: #e2ddd2;
  --accent: #2f6b3a;
  --accent-dark: #255530;
  --accent-contrast: #ffffff;
  --warn-bg: #fff4d6;
  --warn-border: #e8c86a;
  --danger: #b83232;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.06);
  font-size: 17px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--accent-dark); }

.container {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px;
}

.header {
  padding: 20px 16px 8px;
  max-width: 560px;
  margin: 0 auto;
}
.header h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
}
.header .sub {
  color: var(--muted);
  font-size: .95rem;
  margin-top: 2px;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin: 12px 0;
}

.card h2 { margin-top: 0; font-size: 1.1rem; }
.card + .card { margin-top: 16px; }

.callout {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 14px 0;
}
.callout.warn { background: #ffe8e0; border-color: #f3b59a; }
.callout.info { background: #e5f0e6; border-color: #b0d4b8; }

.muted { color: var(--muted); }
.small { font-size: .9rem; }

/* Gerichte-Liste */
.dish-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.dish {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}
.dish-name { font-weight: 600; overflow-wrap: anywhere; }
.dish-price { color: var(--muted); font-size: .95rem; margin-top: 2px; }

/* Stepper */
.stepper {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
}
.stepper button {
  border: 0;
  background: #fff;
  width: 44px;
  height: 44px;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--accent-dark);
}
.stepper button:active { background: #eee; }
.stepper input {
  border: 0;
  width: 44px;
  height: 44px;
  text-align: center;
  font-size: 1.05rem;
  background: transparent;
  -moz-appearance: textfield;
}
.stepper input::-webkit-outer-spin-button,
.stepper input::-webkit-inner-spin-button {
  -webkit-appearance: none; margin: 0;
}

/* Form elements */
label { display: block; font-weight: 600; margin: 12px 0 6px; }

input[type="text"], input[type="password"], input[type="number"], input[type="date"], input[type="email"], textarea, select {
  width: 100%;
  padding: 14px 14px;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
}
input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.radio-row { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); margin-top: 6px; }
.radio-row label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  background: #fff;
  cursor: pointer;
  font-weight: 600;
  margin: 0;
}
.radio-row input[type="radio"] { accent-color: var(--accent); }
.radio-row label:has(input:checked) {
  border-color: var(--accent);
  background: #edf3ed;
}

/* Buttons */
.btn {
  display: inline-block;
  width: 100%;
  padding: 16px 18px;
  font-size: 1.05rem;
  font-weight: 700;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: var(--accent-contrast);
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  min-height: 48px;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn:hover:not(:disabled) { background: var(--accent-dark); }
.btn.secondary {
  background: #fff;
  color: var(--accent-dark);
  border: 1px solid var(--border);
}
.btn.secondary:hover:not(:disabled) { background: #f3efe5; }
.btn.danger { background: var(--danger); }
.btn.danger:hover:not(:disabled) { background: #8f2626; }
.btn.small { padding: 10px 14px; font-size: .95rem; width: auto; min-height: 0; }

.actions { display: grid; gap: 10px; margin-top: 16px; }
.actions.row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }

/* Bestellübersicht / Totals */
.total {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 0 0; margin-top: 8px; border-top: 1px solid var(--border);
  font-weight: 700;
}

.table {
  width: 100%; border-collapse: collapse;
}
.table th, .table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.table th { font-size: .85rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.table td.num { text-align: right; font-variant-numeric: tabular-nums; }

.pill {
  display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600;
  background: #eee; color: #444;
}
.pill.open { background: #e2f0e5; color: #1e5f2a; }
.pill.closed { background: #f5d9d9; color: #7a1f1f; }

.list-unstyled { list-style: none; padding: 0; margin: 0; }

nav.admin-nav {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding: 8px 16px 0; max-width: 560px; margin: 0 auto;
}
nav.admin-nav a {
  text-decoration: none;
  color: var(--accent-dark);
  padding: 8px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--border);
  font-size: .95rem;
}
nav.admin-nav a.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.inline-form { display: flex; gap: 8px; align-items: center; }

/* Printable Orders-Liste */
@media print {
  body { background: #fff; }
  .no-print { display: none !important; }
  .card { box-shadow: none; border: 1px solid #ccc; }
  nav.admin-nav, .header .sub { display: none; }
}

/* Utility */
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack-sm > * + * { margin-top: 8px; }
.stack > * + * { margin-top: 14px; }

.error { color: var(--danger); font-weight: 600; }
.success { color: var(--accent-dark); font-weight: 600; }

pre.callout { overflow: auto; font-size: 1rem; }
code { background: #eee; padding: 2px 6px; border-radius: 4px; font-size: .95em; }

.empty {
  text-align: center;
  color: var(--muted);
  padding: 28px 12px;
}

/* Ausklappbare Termin-Karten */
details.date-card {
  padding: 0;
  overflow: hidden;
}
details.date-card > summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  user-select: none;
}
details.date-card > summary::-webkit-details-marker { display: none; }
details.date-card > summary:hover { background: #f8f5ee; }
details.date-card > summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.date-summary-title { font-size: 1.05rem; }
.date-summary-hint {
  font-size: .85rem;
  color: var(--muted);
  font-weight: 500;
}
.date-summary-caret {
  color: var(--accent-dark);
  font-size: 1.2rem;
  transition: transform .2s ease;
}
details.date-card[open] > summary .date-summary-caret {
  transform: rotate(180deg);
}
details.date-card[open] > summary {
  border-bottom: 1px solid var(--border);
}
.date-body {
  padding: 16px 20px 20px;
}

/* Checkbox-Zeile im Adminformular */
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  margin: 0;
}
.checkbox-row input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: var(--accent);
  margin: 0;
}

/* Veranstaltungs-Liste (öffentlich) */
.event-month { margin: 18px 0 8px; }
.event-month + .event-month { margin-top: 28px; }
.event-month-title {
  margin: 0 0 10px 4px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .02em;
}
.event-item {
  position: relative;
  padding: 20px 22px 20px 26px;
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(0,0,0,.03);
}
.event-item + .event-item { margin-top: 12px; }

.event-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--accent-dark);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.event-meta-num {
  font-size: 1.15rem;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.event-title {
  margin: 8px 0 0;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
  word-wrap: break-word;
}

.event-desc {
  margin: 10px 0 0;
  color: #333;
  line-height: 1.55;
  white-space: pre-line;
}

.event-reg {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 7px 14px 7px 10px;
  background: #fff7e0;
  border: 1px solid #e8c86a;
  border-radius: 999px;
  font-size: .88rem;
  font-weight: 600;
  color: #7a4d0b;
  line-height: 1;
}
.event-reg-icon {
  width: 16px;
  height: 16px;
  color: #b58412;
  flex-shrink: 0;
}
