/* Serviceportal: mobile-first, grosse Flaechen, Hell- und Dunkelmodus. */

:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --text: #16202e;
  --muted: #5b6779;
  --border: #d8dee9;
  --accent: #0b5fa5;
  --accent-text: #ffffff;
  --green: #2e7d4f;
  --yellow: #b47100;
  --red: #b3261e;
  --shadow: 0 2px 12px rgba(16, 32, 56, 0.08);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131820;
    --surface: #1c232e;
    --text: #eaeef5;
    --muted: #9aa6b8;
    --border: #2d3644;
    --accent: #4d9de0;
    --accent-text: #0d1218;
    --green: #6fcf97;
    --yellow: #f2c14e;
    --red: #ef8b84;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
  }
}

:root[data-theme="dark"] {
  --bg: #131820;
  --surface: #1c232e;
  --text: #eaeef5;
  --muted: #9aa6b8;
  --border: #2d3644;
  --accent: #4d9de0;
  --accent-text: #0d1218;
  --green: #6fcf97;
  --yellow: #f2c14e;
  --red: #ef8b84;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.5;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.brand { font-weight: 600; font-size: 0.95rem; }

.theme-toggle {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  border-radius: 999px;
  width: 2.25rem;
  height: 2.25rem;
  font-size: 1.1rem;
  cursor: pointer;
}

.page {
  max-width: 34rem;
  margin: 0 auto;
  padding: 1rem 1rem 3rem;
}

.progress {
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin: 0.5rem 0 1.25rem;
}

.progress-bar {
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.35s ease;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 1.25rem;
}

.card.fade-in { animation: fade 0.25s ease; }

@keyframes fade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .card.fade-in { animation: none; }
  .progress-bar { transition: none; }
}

h1 { font-size: 1.35rem; margin-top: 0; }
h2 { font-size: 1.05rem; }

.survey-title { font-size: 1.15rem; margin-bottom: 0.25rem; }
.greeting { margin: 0.25rem 0; }
.intro, .muted { color: var(--muted); }
.question { font-size: 1.2rem; font-weight: 600; margin: 0 0 1rem; }

.options { display: grid; gap: 0.6rem; }

.button, .option {
  display: block;
  width: 100%;
  min-height: 3rem;
  padding: 0.85rem 1rem;
  font: inherit;
  text-align: left;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.option:hover, .button:hover { border-color: var(--accent); }
.option.selected { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }

.button.primary {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
  text-align: center;
  font-weight: 600;
  text-decoration: none;
}

.button.link {
  background: none;
  border: none;
  color: var(--muted);
  text-align: center;
  text-decoration: underline;
  min-height: 2.25rem;
}

.options + .button, .contact-list + .button, .nps-scale + .button,
textarea + .button, .card > .button + .button, .form { margin-top: 0.75rem; }

.stars { display: flex; gap: 0.4rem; justify-content: space-between; }

.star {
  flex: 1;
  font-size: 1.9rem;
  line-height: 1;
  padding: 0.6rem 0;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  color: var(--yellow);
  cursor: pointer;
}

.nps { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0.4rem; }

.nps-button {
  min-height: 3rem;
  font: inherit;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}

.nps-scale { display: flex; justify-content: space-between; color: var(--muted); font-size: 0.8rem; margin-top: 0.4rem; }

.form { display: grid; gap: 0.5rem; }
.form label { font-weight: 600; font-size: 0.9rem; }

input[type="text"], input[type="password"], input:not([type]), textarea {
  width: 100%;
  padding: 0.7rem;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
}

textarea { min-height: 6rem; }

.contact-list { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: 0.4rem; }
.contact-list .label { color: var(--muted); font-size: 0.85rem; display: block; }

.cheer { text-align: center; font-weight: 600; min-height: 1.5rem; margin-top: 1rem; }
.flash { padding: 0.6rem 0.9rem; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); }
.error { color: var(--red); font-weight: 600; }

.done { text-align: center; }
.score { font-size: 3.5rem; font-weight: 700; margin: 0.5rem 0; }
.score-max { font-size: 1.2rem; color: var(--muted); }
.score-gruen { color: var(--green); }
.score-gelb { color: var(--yellow); }
.score-rot { color: var(--red); }

.badges { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; }
.badge { border: 1px solid var(--border); border-radius: 999px; padding: 0.35rem 0.8rem; font-size: 0.9rem; }

.hint { margin: 1.25rem 0; }
.raffle { font-size: 0.9rem; color: var(--muted); }
.terms { text-align: left; }

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

/* --- Backoffice: breitere Seite, Tabellen, Kennzahlen --------------------- */

.page.wide { max-width: 64rem; }

.bo-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

.bo-nav a { text-decoration: none; font-weight: 600; }
.bo-nav a:hover { text-decoration: underline; }
.bo-user { margin-left: auto; color: var(--muted); font-size: 0.85rem; }
.bo-inline { display: inline; }

.bo-linkbutton {
  border: none;
  background: none;
  font: inherit;
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

.bo-button {
  display: inline-block;
  min-height: 2.5rem;
  padding: 0.5rem 0.9rem;
  font: inherit;
  color: var(--accent-text);
  background: var(--accent);
  border: 1.5px solid var(--accent);
  border-radius: 10px;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.bo-button:hover { filter: brightness(1.08); }
.bo-danger { background: var(--red); border-color: var(--red); }

.bo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.bo-metric .bo-label { color: var(--muted); font-size: 0.85rem; }
.bo-metric .bo-value { display: block; font-size: 2rem; line-height: 1.2; }
.bo-metric p { margin: 0.4rem 0 0; font-size: 0.85rem; }

.bo-bar {
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin: 0.4rem 0;
}

.bo-bar-fill { display: block; height: 100%; background: var(--accent); }
.bo-bar-fill.gruen { background: var(--green); }
.bo-bar-fill.gelb { background: var(--yellow); }
.bo-bar-fill.rot { background: var(--red); }

.bo-segment { display: flex; justify-content: space-between; margin: 0.6rem 0 0; }

.card + .card { margin-top: 1rem; }

.bo-tablewrap { overflow-x: auto; }

.bo-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.bo-table th, .bo-table td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--border); }
.bo-table th { color: var(--muted); font-weight: 600; }

.bo-tag {
  display: inline-block;
  padding: 0.05rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.75rem;
  color: var(--muted);
}

.bo-warn { border-left: 4px solid var(--red); }

.bo-filter { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 1rem; }
.bo-filter input[type="text"], .bo-filter input[type="password"] { width: auto; flex: 1 1 12rem; }

.bo-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.bo-actions form { display: flex; gap: 0.4rem; align-items: center; }

.bo-data { display: grid; grid-template-columns: minmax(10rem, 18rem) 1fr; gap: 0.35rem 1rem; margin: 0; }
.bo-data dt { color: var(--muted); font-size: 0.9rem; }
.bo-data dd { margin: 0; }

.bo-pre {
  white-space: pre-wrap;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem;
  font: inherit;
}

select {
  padding: 0.6rem;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
}

@media (max-width: 40rem) {
  .bo-data { grid-template-columns: 1fr; }
  .bo-data dd { margin-bottom: 0.4rem; }
}
