* { box-sizing: border-box; }
.hidden { display: none !important; }
html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #f4f6f8;
  color: #1a1a1a;
}

/* ---------------- Kiosk / Umfrage ---------------- */
.survey-body {
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #eef3f8 0%, #dfe9f2 100%);
  user-select: none;
  -webkit-user-select: none;
}

.survey-screen {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  text-align: center;
}
.survey-screen.hidden { display: none; }

.survey-screen h1 {
  font-size: 2.6rem;
  margin-bottom: 48px;
  color: #103a5e;
}
.survey-screen h2 { font-size: 2rem; color: #103a5e; margin-bottom: 8px; }
.hint { color: #5b6b78; margin-bottom: 24px; font-size: 1.1rem; }
.welcome {
  font-size: 1.4rem;
  color: #4a6079;
  margin: 0 0 8px 0;
  font-weight: 600;
}

/* Dezentes Logo als Wasserzeichen im Hintergrund */
.bg-logo {
  position: fixed;
  top: 4%;
  left: 50%;
  transform: translateX(-50%);
  width: 85%;
  max-width: 1200px;
  height: auto;
  opacity: 0.06;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}
.survey-screen { position: relative; z-index: 1; }

.smileys {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
}

.smiley-btn {
  border: 4px solid var(--c);
  background: #fff;
  border-radius: 24px;
  padding: 28px 18px;
  width: 190px;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  box-shadow: 0 4px 10px rgba(0,0,0,0.06);
}
.smiley-btn:active { transform: scale(0.94); background: var(--c); }
.smiley-btn .face { font-size: 5rem; line-height: 1; }
.smiley-btn .label { font-size: 1.3rem; font-weight: 600; color: #222; }

.reason-tags {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 24px;
}
.tag-btn {
  font-size: 1.1rem;
  padding: 14px 22px;
  border-radius: 999px;
  border: 2px solid #cbd6e0;
  background: #fff;
  color: #333;
  cursor: pointer;
  font-weight: 600;
}
.tag-btn.selected {
  background: #103a5e;
  border-color: #103a5e;
  color: #fff;
}

#comment-input {
  width: 100%;
  max-width: 700px;
  height: 160px;
  font-size: 1.3rem;
  padding: 18px;
  border-radius: 16px;
  border: 2px solid #cbd6e0;
  resize: none;
  margin-bottom: 28px;
}

.comment-actions { display: flex; gap: 20px; }
.btn-primary, .btn-secondary {
  font-size: 1.3rem;
  padding: 20px 36px;
  border-radius: 16px;
  border: none;
  cursor: pointer;
  font-weight: 600;
}
.btn-primary { background: #103a5e; color: #fff; }
.btn-primary:active { background: #0a2740; }
.btn-secondary { background: #e2e8ef; color: #103a5e; }
.btn-secondary:active { background: #cdd8e2; }

.thanks-icon {
  font-size: 6rem;
  color: #2e9e4b;
  margin-bottom: 24px;
}

/* ---------------- Admin ---------------- */
.admin-body { padding: 0; min-height: 100vh; }
.admin-header {
  background: #103a5e;
  color: #fff;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.admin-header h1 { font-size: 1.3rem; margin: 0; }
.admin-header button {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.5);
  color: #fff;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
}

.admin-wrap { max-width: 1100px; margin: 0 auto; padding: 24px; }

.login-wrap {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-box {
  background: #fff;
  padding: 40px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  width: 320px;
  text-align: center;
}
.login-box h1 { font-size: 1.4rem; margin-bottom: 24px; color: #103a5e; }
.login-box input {
  width: 100%;
  padding: 14px;
  font-size: 1rem;
  border-radius: 8px;
  border: 1px solid #cbd6e0;
  margin-bottom: 16px;
}
.login-box button {
  width: 100%;
  padding: 14px;
  font-size: 1rem;
  border-radius: 8px;
  border: none;
  background: #103a5e;
  color: #fff;
  cursor: pointer;
  font-weight: 600;
}
.login-error { color: #d32f2f; font-size: 0.9rem; margin-bottom: 12px; min-height: 18px; }

.stat-cards {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  flex: 1;
  min-width: 160px;
}
.stat-card .value { font-size: 2rem; font-weight: 700; color: #103a5e; }
.stat-card .label { color: #5b6b78; font-size: 0.9rem; margin-top: 4px; }

.bar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.bar-row .bar-label { width: 220px; font-size: 0.95rem; }
.bar-row .bar-track { flex: 1; background: #e2e8ef; border-radius: 6px; height: 18px; overflow: hidden; }
.bar-row .bar-fill { height: 100%; border-radius: 6px; }
.bar-row .bar-count { width: 40px; text-align: right; font-size: 0.9rem; color: #5b6b78; }

.panel {
  background: #fff;
  border-radius: 12px;
  padding: 20px 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  margin-bottom: 24px;
}
.panel h2 { margin-top: 0; font-size: 1.1rem; color: #103a5e; }

.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; margin-bottom: 16px; }
.filters label { display: flex; flex-direction: column; font-size: 0.85rem; color: #5b6b78; gap: 4px; }
.filters input, .filters select {
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #cbd6e0;
  font-size: 0.95rem;
}
.filters button {
  padding: 9px 16px;
  border-radius: 6px;
  border: none;
  background: #103a5e;
  color: #fff;
  cursor: pointer;
}
.filters .export-btn { background: #2e9e4b; margin-left: auto; }

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid #eef1f4; }
th { color: #5b6b78; font-weight: 600; }
td.comment { max-width: 320px; white-space: pre-wrap; }

.empty-msg { color: #5b6b78; text-align: center; padding: 24px; }

/* ---------------- Tabs (Admin) ---------------- */
.tab-bar {
  background: #fff;
  border-bottom: 2px solid #e2e8ef;
  display: flex;
  padding: 0 24px;
}
.tab-btn {
  padding: 14px 22px;
  border: none;
  background: transparent;
  color: #5b6b78;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s;
}
.tab-btn.active { color: #103a5e; border-bottom-color: #103a5e; }
.tab-btn:hover:not(.active) { color: #103a5e; }

/* ---------------- Header-Right ---------------- */
.header-right { display: flex; align-items: center; gap: 16px; }
.logged-in-user { font-size: 0.9rem; opacity: 0.75; }

/* ---------------- Benutzerverwaltung ---------------- */
.user-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 8px;
}
.user-form input {
  padding: 9px 12px;
  border-radius: 6px;
  border: 1px solid #cbd6e0;
  font-size: 0.95rem;
  min-width: 180px;
}
.user-form button {
  padding: 9px 16px;
  border-radius: 6px;
  border: none;
  background: #103a5e;
  color: #fff;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
}
.action-cell { white-space: nowrap; }
.action-cell button {
  padding: 7px 12px;
  border-radius: 6px;
  border: none;
  background: #103a5e;
  color: #fff;
  cursor: pointer;
  font-size: 0.85rem;
  margin-right: 6px;
}
.btn-danger { background: #d32f2f !important; }
.badge-self { font-size: 0.8rem; color: #5b6b78; font-weight: normal; }

.pw-form {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 4px;
  flex-wrap: wrap;
}
.pw-form input {
  padding: 7px 10px;
  border-radius: 6px;
  border: 1px solid #cbd6e0;
  font-size: 0.9rem;
  min-width: 200px;
}
.pw-form button {
  padding: 7px 12px;
  border-radius: 6px;
  border: none;
  background: #103a5e;
  color: #fff;
  cursor: pointer;
  font-size: 0.85rem;
}
.btn-secondary-sm {
  background: #e2e8ef !important;
  color: #103a5e !important;
}
.form-error { color: #d32f2f; font-size: 0.85rem; }

/* ---------------- Protokoll ---------------- */
.row-warning td { background: #fff8f8; color: #b71c1c; }
