:root {
  --bg: #f7f6f2;
  --surface: #ffffff;
  --surface-alt: #f1f0ea;
  --border: #e4e1d8;
  --text: #2b2b28;
  --text-muted: #6b6a63;
  --primary: #2c7a6f;
  --primary-dark: #205a52;
  --primary-light: #e3f1ee;
  --accent: #d98c3d;
  --danger: #b3261e;
  --danger-light: #fbe9e7;
  --success: #1f7a4d;
  --success-light: #e6f5ec;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(40, 38, 30, 0.06);
  --shadow-lg: 0 8px 30px rgba(40, 38, 30, 0.10);
  font-size: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { color: #1f1e1b; line-height: 1.25; font-weight: 700; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.1rem; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 560px; margin: 0 auto; padding: 0 20px; }

/* --- Topbar --- */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1100px; margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { font-weight: 800; color: var(--primary-dark); font-size: 1.15rem; display: flex; align-items: center; gap: 8px; }
.brand-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); display: inline-block; }
.nav-links { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.nav-links a { color: var(--text); font-weight: 600; font-size: .95rem; }
.nav-links a.active { color: var(--primary); }
.user-pill {
  background: var(--surface-alt); border-radius: 999px; padding: 6px 14px;
  font-size: .88rem; color: var(--text-muted); display:flex; gap:8px; align-items:center;
}

/* --- Layout --- */
.page { padding: 36px 0 60px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 18px; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--primary); color: #fff; border: none;
  padding: 10px 18px; border-radius: 9px; font-weight: 600; font-size: .95rem;
  cursor: pointer; text-decoration: none;
  transition: background .15s ease, transform .05s ease;
}
.btn:hover { background: var(--primary-dark); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-secondary { background: var(--surface-alt); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: #e9e7de; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #8f1e18; }
.btn-sm { padding: 6px 12px; font-size: .85rem; border-radius: 7px; }
.btn-block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* --- Forms --- */
label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .92rem; }
.field { margin-bottom: 18px; }
.hint { color: var(--text-muted); font-size: .85rem; margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=url], input[type=date], textarea, select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  background: #fff; color: var(--text); font-size: .96rem; font-family: inherit;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
textarea { resize: vertical; min-height: 90px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input { width: auto; }

/* --- Tabelle --- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: .93rem; }
th { color: var(--text-muted); font-weight: 700; font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; }
tr:last-child td { border-bottom: none; }

/* --- Alerts --- */
.alert { padding: 12px 16px; border-radius: 9px; margin-bottom: 16px; font-size: .92rem; }
.alert-success { background: var(--success-light); color: var(--success); }
.alert-error { background: var(--danger-light); color: var(--danger); }
.alert-info { background: var(--primary-light); color: var(--primary-dark); }

/* --- Badges --- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.badge-green { background: var(--success-light); color: var(--success); }
.badge-gray { background: var(--surface-alt); color: var(--text-muted); }
.badge-orange { background: #fdf0e2; color: var(--accent); }

/* --- Event Karten --- */
.event-card { display: flex; flex-direction: column; gap: 10px; }
.event-card .title { font-weight: 700; font-size: 1.05rem; }
.event-card .meta { color: var(--text-muted); font-size: .85rem; }
.event-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

/* --- Frage-Builder --- */
.question-block {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; margin-bottom: 14px; background: var(--surface-alt);
}
.question-block .qhead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.option-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.option-row input { flex: 1; }
.small-btn { background: none; border: none; color: var(--danger); cursor: pointer; font-size: .85rem; font-weight: 600; }

/* --- Stat-Boxen --- */
.stat-box { text-align: center; padding: 16px; background: var(--surface-alt); border-radius: var(--radius); }
.stat-box .num { font-size: 1.6rem; font-weight: 800; color: var(--primary-dark); }
.stat-box .label { font-size: .82rem; color: var(--text-muted); margin-top: 2px; }

/* --- Login/Auth Seiten --- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-box { width: 100%; max-width: 400px; }
.auth-logo { text-align: center; margin-bottom: 24px; }
.auth-logo .brand { justify-content: center; font-size: 1.4rem; }

/* --- Utility --- */
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mt-8{margin-top:8px} .mt-16{margin-top:16px} .mt-24{margin-top:24px}
.mb-8{margin-bottom:8px} .mb-16{margin-bottom:16px} .mb-24{margin-bottom:24px}
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.text-sm { font-size: .85rem; }
.divider { border: none; border-top: 1px solid var(--border); margin: 22px 0; }

footer.app-footer { text-align: center; color: var(--text-muted); font-size: .82rem; padding: 30px 0; }

@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 1px solid #ccc; }
}

@media (max-width: 680px) {
  .topbar-inner { flex-direction: column; align-items: flex-start; gap: 10px; }
  .nav-links { gap: 12px; }
}
