/* ── Survey-Extra — Ergänzungen zu style.css ─────────────────── */

/* ── Flash-Nachrichten ───────────────────────────────────────── */
.flash-msg {
  padding: 14px 20px;
  border-radius: var(--radius-m);
  font-size: 14px;
  margin-bottom: 24px;
  font-weight: 500;
}
.flash-success { background: var(--success-bg); color: var(--success-text); }
.flash-error   { background: #fde8e8; color: var(--warn); }
.flash-info    { background: var(--accent-soft); color: var(--accent-dark); }

/* ── Formular-Felder ─────────────────────────────────────────── */
.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}
.form-field label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  letter-spacing: -0.003em;
}
.form-field input,
.form-field textarea,
.form-field select {
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 11px 14px;
  width: 100%;
  transition: border-color 140ms ease, box-shadow 140ms ease;
  -webkit-appearance: none;
  appearance: none;
}
.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-field textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.5;
}
.form-field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236e6e73' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.form-hint { font-size: 12px; color: var(--muted); margin-top: 2px; }
.form-error { font-size: 12px; color: var(--warn); margin-top: 2px; }

/* ── Code-Eingabe ────────────────────────────────────────────── */
.code-input-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin: 40px 0;
}
.code-input {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(24px, 5vw, 36px);
  letter-spacing: 0.22em;
  text-align: center;
  text-transform: uppercase;
  padding: 18px 28px;
  border: 2px solid var(--line);
  border-radius: var(--radius-l);
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  color: var(--ink);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.code-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.code-input::placeholder { color: var(--muted-2); letter-spacing: 0.1em; }

/* ── Firmen-Preview auf Loginseite ───────────────────────────── */
.company-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  max-width: 400px;
  margin: 0 auto 32px;
  box-shadow: var(--shadow-sm);
}
.company-preview img {
  max-height: 60px;
  max-width: 200px;
  object-fit: contain;
}
.company-preview .co-name {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
}

/* ── Likert-Skala ────────────────────────────────────────────── */
.scale-question { margin-bottom: 32px; }
.scale-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--muted);
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.scale-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.scale-opt { display: none; }
.scale-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 140ms ease;
  user-select: none;
}
.scale-btn:hover { border-color: var(--accent); color: var(--accent); }
.scale-opt:checked + .scale-btn {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* ── Survey-Progress ─────────────────────────────────────────── */
.survey-progress-wrap {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg);
  padding: 12px 0 0;
  border-bottom: 1px solid var(--line-2);
  margin-bottom: 40px;
}
.survey-progress {
  height: 3px;
  background: var(--line);
  border-radius: 99px;
  overflow: hidden;
}
.survey-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width 400ms ease;
}
.survey-progress-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.1em;
  padding-bottom: 10px;
  display: flex;
  justify-content: space-between;
}

/* ── Frage-Karte ─────────────────────────────────────────────── */
.question-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  padding: 28px 28px 24px;
  margin-bottom: 20px;
  transition: border-color 160ms ease;
}
.question-card:focus-within { border-color: var(--accent); }
.question-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.question-text {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 16px;
  line-height: 1.45;
}
.question-group-header {
  padding: 20px 0 12px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
  margin-top: 40px;
}
.question-group-header:first-of-type { margin-top: 0; }

/* ── Ergebnisse ──────────────────────────────────────────────── */
.result-question {
  margin-bottom: 36px;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--line-2);
}
.result-question:last-child { border-bottom: none; }
.result-question-text {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 14px;
  line-height: 1.45;
}
.result-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}
/* Scale result bars */
.result-scale {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.result-scale-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.result-scale-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--muted);
  width: 20px;
  flex-shrink: 0;
  text-align: right;
}
.result-bar-wrap {
  flex: 1;
  background: var(--line-2);
  border-radius: 99px;
  height: 8px;
  overflow: hidden;
}
.result-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width 600ms ease;
}
.result-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  width: 28px;
  flex-shrink: 0;
}
.result-avg {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--accent-soft);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent-dark);
  margin-top: 8px;
}
/* Text answers */
.result-text-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.result-text-item {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-2);
}

/* ── Admin / GF Layout ───────────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
}
.app-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 24px 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.app-sidebar .sidebar-brand {
  padding: 0 20px 24px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}
.app-sidebar .sidebar-brand-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.app-sidebar .sidebar-brand-name span { color: var(--accent); }
.app-sidebar .sidebar-role {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 4px;
}
.sidebar-nav { display: flex; flex-direction: column; flex: 1; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  font-size: 14px;
  color: var(--ink-2);
  font-weight: 450;
  border-left: 2px solid transparent;
  transition: all 120ms ease;
}
.sidebar-nav a:hover { color: var(--ink); background: var(--bg); }
.sidebar-nav a.active { color: var(--accent); border-left-color: var(--accent); background: var(--accent-soft); font-weight: 500; }
.sidebar-nav a svg { width: 16px; height: 16px; stroke: currentColor; flex-shrink: 0; }
.sidebar-nav .nav-divider { height: 1px; background: var(--line); margin: 8px 16px; }
.sidebar-nav .nav-logout { margin-top: auto; color: var(--muted); }
.sidebar-nav .nav-logout:hover { color: var(--warn); background: #fde8e8; }

.app-main {
  flex: 1;
  padding: 40px 48px;
  overflow-x: auto;
  background: var(--bg);
}
@media (max-width: 900px) {
  .app-layout { flex-direction: column; }
  .app-sidebar { width: 100%; height: auto; position: static; flex-direction: row; flex-wrap: wrap; padding: 12px 16px; }
  .app-sidebar .sidebar-brand { padding: 0 16px 0 0; border: none; margin: 0; }
  .app-main { padding: 24px 20px; }
}

/* ── Admin Tabellen ──────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius-l);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
}
.data-table th {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 12px 16px;
  background: var(--surface-2);
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.data-table td {
  padding: 14px 16px;
  font-size: 14px;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line-2);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: 0; }
.data-table tr:hover td { background: var(--surface-2); }
.data-table .actions { display: flex; gap: 8px; align-items: center; }

/* ── Status-Badges ───────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  font-weight: 500;
  text-transform: uppercase;
}
.badge-green  { background: var(--success-bg); color: var(--success-text); }
.badge-red    { background: #fde8e8; color: var(--warn); }
.badge-blue   { background: var(--accent-soft); color: var(--accent-dark); }
.badge-gray   { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }

/* ── Page-Header ─────────────────────────────────────────────── */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}
.page-header-text { display: flex; flex-direction: column; gap: 4px; }

/* ── Karten-Raster (Dashboard) ───────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.stat-card-value {
  font-size: 36px;
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1;
  color: var(--ink);
}
.stat-card-label { font-size: 13px; color: var(--muted); }
.stat-card-warn { border-color: #fed7aa; background: #fff7ed; }
.stat-card-warn .stat-card-value { color: #ea580c; }
.stat-card-good { border-color: #bbf7d0; background: #f0fdf4; }
.stat-card-good .stat-card-value { color: #16a34a; }

/* ── Toggle-Switch ───────────────────────────────────────────── */
.toggle-wrap { display: flex; align-items: center; gap: 10px; }
.toggle {
  position: relative;
  width: 40px; height: 22px;
  flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-track {
  position: absolute; inset: 0;
  background: var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: background 160ms ease;
}
.toggle input:checked + .toggle-track { background: var(--accent); }
.toggle-track::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  background: white;
  border-radius: 50%;
  transition: transform 160ms ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.toggle input:checked + .toggle-track::after { transform: translateX(18px); }

/* ── Logo-Vorschau ───────────────────────────────────────────── */
.logo-preview {
  max-height: 48px;
  max-width: 140px;
  object-fit: contain;
  border-radius: var(--radius-s);
}

/* ── Abteilungs-Auswahl (Survey) ─────────────────────────────── */
.dept-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin: 32px 0;
}
.dept-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  padding: 20px;
  cursor: pointer;
  transition: all 160ms ease;
  text-align: center;
}
.dept-card:hover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.dept-card.selected { border-color: var(--accent); background: var(--accent-soft); }
.dept-card .dept-name { font-size: 14px; font-weight: 500; color: var(--ink); }

/* ── Survey Textarea ─────────────────────────────────────────── */
.survey-textarea {
  display: block;
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-l);
  padding: 16px 18px;
  resize: vertical;
  min-height: 120px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.04);
  margin-top: 4px;
}
.survey-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft), inset 0 1px 3px rgba(0,0,0,0.04);
}
.survey-textarea::placeholder { color: var(--muted-2); }

/* ── Radio / Checkbox Optionen ───────────────────────────────── */
.radio-option,
.check-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-l);
  cursor: pointer;
  font-size: 15px;
  color: var(--ink);
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
  user-select: none;
}
.radio-option:hover,
.check-option:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.radio-option input,
.check-option input {
  accent-color: var(--accent);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  cursor: pointer;
}

/* ── Mobile Sidebar ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .app-layout { flex-direction: column; }
  .app-sidebar {
    width: 100%;
    height: auto;
    position: static;
    padding: 0;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
  .app-sidebar .sidebar-brand {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .app-sidebar .sidebar-brand-name { font-size: 14px; }
  .sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
    overflow-x: auto;
    padding: 8px 12px;
    gap: 2px;
  }
  .sidebar-nav a {
    padding: 8px 12px;
    font-size: 13px;
    border-left: none;
    border-bottom: 2px solid transparent;
    border-radius: var(--radius-m);
  }
  .sidebar-nav a.active {
    border-left-color: transparent;
    border-bottom-color: var(--accent);
  }
  .sidebar-nav .nav-divider { display: none; }
  .sidebar-nav .nav-logout { margin-top: 0; }
  .app-main { padding: 20px 16px; }
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 600px) {
  .scale-group { gap: 6px; }
  .scale-btn { min-width: 42px; padding: 9px 10px; font-size: 13px; }
  .question-card { padding: 20px 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .data-table th, .data-table td { padding: 10px 12px; font-size: 13px; }
  .page-header { flex-direction: column; align-items: stretch; }
}
