:root {
  --bg: #F7F8FB;
  --surface: #FFFFFF;
  --border: #E8ECF2;
  --text: #1A1F36;
  --muted: #6B7280;
  --teal: #0891B2;
  --teal-bg: #ECFEFF;
  --purple: #7C3AED;
  --green: #059669;
  --amber: #D97706;
  --red: #DC2626;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 960px; margin: 0 auto; padding: 32px 20px 80px; }
.wrap-narrow { max-width: 560px; margin: 0 auto; padding: 48px 20px 80px; }

.eyebrow {
  display: inline-block;
  background: var(--teal-bg);
  color: var(--teal);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  padding: 6px 16px;
  border-radius: 100px;
  margin-bottom: 14px;
}

h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 8px; }
h2 { font-size: 18px; font-weight: 700; margin-bottom: 12px; }
.sub { color: var(--muted); margin-bottom: 24px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px;
  margin-bottom: 16px;
}

/* ---------- Formulare ---------- */
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
input, textarea, select {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 11px 14px;
  margin-bottom: 16px;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.12);
}
textarea { resize: vertical; min-height: 90px; }

.btn {
  display: inline-block;
  font: inherit;
  font-weight: 700;
  color: #fff;
  background: var(--teal);
  border: none;
  border-radius: 10px;
  padding: 12px 26px;
  cursor: pointer;
  transition: filter 0.15s;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1.5px solid var(--border);
  font-weight: 600;
}
.btn-ghost:hover { color: var(--text); filter: none; }

.error {
  background: #FEF2F2;
  border: 1px solid #FCA5A5;
  color: #991B1B;
  border-radius: 10px;
  padding: 11px 14px;
  margin-bottom: 16px;
  font-size: 13.5px;
  display: none;
}
.notice {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  color: #92400E;
  border-radius: 10px;
  padding: 11px 14px;
  margin-bottom: 16px;
  font-size: 13.5px;
}
.success {
  background: #F0FDF4;
  border: 1px solid #A7F3D0;
  color: #065F46;
  border-radius: 10px;
  padding: 11px 14px;
  margin-bottom: 16px;
  font-size: 13.5px;
}

/* ---------- Umfrage: 0–10 Skala ---------- */
.scale { display: flex; gap: 6px; flex-wrap: wrap; margin: 14px 0 6px; }
.scale button {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--surface);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  transition: transform 0.1s;
}
.scale button:hover { transform: scale(1.1); }
.scale button.sel-detractor { background: #FEE2E2; border-color: #FCA5A5; color: var(--red); }
.scale button.sel-passive { background: #FEF9C3; border-color: #FDE047; color: #A16207; }
.scale button.sel-promoter { background: #D1FAE5; border-color: #6EE7B7; color: #047857; }
.scale-legend { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 6px; }

/* ---------- Dashboard ---------- */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.topbar .who { font-size: 13px; color: var(--muted); }

.score-card {
  background: #1A1F36;
  color: #F1F5F9;
  border-radius: 18px;
  padding: 28px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.score-label { font-size: 11px; text-transform: uppercase; letter-spacing: 2px; color: #94A3B8; margin-bottom: 4px; }
.score-value { font-size: 60px; font-weight: 900; letter-spacing: -3px; line-height: 1; }
.score-delta { font-size: 14px; font-weight: 700; margin-top: 8px; }

.trend-bar rect { transition: opacity 0.12s; }
.trend-bar:not(.active) rect { opacity: 0.5; }
.trend-bar:hover rect { opacity: 1; }

.zone-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 6px 16px;
  border-radius: 100px;
  color: #fff;
}

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  text-align: center;
}
.stat .v { font-size: 28px; font-weight: 900; letter-spacing: -1px; }
.stat .l { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 1px; margin-top: 2px; }

.dist-bar { display: flex; height: 14px; border-radius: 100px; overflow: hidden; margin: 10px 0 8px; background: var(--border); }
.dist-legend { display: flex; gap: 18px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }

.seg-filter { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 4px; }
.seg-filter button {
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 100px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  padding: 5px 14px;
  cursor: pointer;
}
.seg-filter button:hover { color: var(--text); }
.seg-filter button.active[data-seg="all"] { background: #1A1F36; border-color: #1A1F36; color: #fff; }
.seg-filter button.active[data-seg="promoter"] { background: #D1FAE5; border-color: #6EE7B7; color: #047857; }
.seg-filter button.active[data-seg="passive"] { background: #FEF9C3; border-color: #FDE047; color: #A16207; }
.seg-filter button.active[data-seg="detractor"] { background: #FEE2E2; border-color: #FCA5A5; color: var(--red); }

.answer {
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}
.answer:last-child { border-bottom: none; }
.answer .meta { font-size: 12px; color: var(--muted); margin-bottom: 6px; display: flex; gap: 10px; align-items: center; }
.answer .badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 2px 10px;
  border-radius: 100px;
}
.badge-promoter { background: #D1FAE5; color: #047857; }
.badge-passive { background: #FEF9C3; color: #A16207; }
.badge-detractor { background: #FEE2E2; color: var(--red); }
.answer p { font-size: 14px; margin-bottom: 4px; }
.answer p strong { font-size: 12px; color: var(--muted); font-weight: 600; display: block; }

/* ---------- Tabellen (Admin) ---------- */
table { width: 100%; border-collapse: collapse; }
th {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
  text-align: left;
  padding: 8px 10px;
  border-bottom: 2px solid var(--border);
}
td { padding: 12px 10px; border-bottom: 1px solid var(--border); font-size: 14px; vertical-align: top; }
tr:last-child td { border-bottom: none; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.link-btn {
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--teal);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.link-btn:hover { text-decoration: underline; }

.footer {
  text-align: center;
  margin-top: 40px;
  font-size: 12.5px;
  color: var(--muted);
}
.footer a {
  color: var(--muted);
  text-decoration: none;
  margin: 0 8px;
}
.footer a:hover { color: var(--text); text-decoration: underline; }

@media (max-width: 560px) {
  .scale button { width: 36px; height: 36px; font-size: 13px; }
  .score-value { font-size: 44px; }
  .card { padding: 20px; }
}
