.dashboard {
  max-width: 1200px;
  margin: 1.5rem auto;
}

.dashboard header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.dashboard header h1 { flex: 1; margin: 0; }
#total { color: #666; font-size: 0.95rem; }
#reset {
  font-size: 0.9rem;
  padding: 0.5rem 0.9rem;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
}

/* ───────────────────────── Layout ───────────────────────── */
.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 1.5rem;
  align-items: start;
  transition: grid-template-columns 0.35s ease;
}

.dashboard-layout.collapsed {
  grid-template-columns: minmax(0, 1fr) 56px;
}

.dashboard-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* ───────────────────────── Bars (Graphs) ───────────────────────── */
.bars {
  display: grid;
  gap: 1.25rem;
  padding: 1.75rem;
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.bar {
  position: relative;
  height: 4.5rem;
  background: #f0f0f0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
}

.bar .fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 12px;
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.bar.gruen .fill { background: linear-gradient(90deg, #66bb6a, #43a047); }
.bar.gelb  .fill { background: linear-gradient(90deg, #ffd54f, #f4c430); }
.bar.rot   .fill { background: linear-gradient(90deg, #ef5350, #e53935); }

.bar label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  font-weight: 700;
  font-size: 1.5rem;
  color: #222;
  pointer-events: none;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}

/* ───────────────────────── Comments ───────────────────────── */
.dashboard-main h2 {
  font-size: 1.1rem;
  margin: 0 0 0.75rem;
  color: #333;
}

#comments {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.5rem;
}
#comments li {
  padding: 0.7rem 0.9rem;
  background: #fff;
  border-left: 4px solid #ccc;
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
#comments li.gruen { border-left-color: #4caf50; }
#comments li.gelb  { border-left-color: #f4c430; }
#comments li.rot   { border-left-color: #e74c3c; }

/* ───────────────────────── Session Sidebar ───────────────────────── */
.session-banner {
  position: sticky;
  top: 1rem;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

.session-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem 1rem;
  background: #fafafa;
  border: 0;
  border-bottom: 1px solid #eee;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #444;
  cursor: pointer;
}
.session-toggle:hover { background: #f3f3f3; }

.session-toggle .toggle-icon {
  display: inline-block;
  font-size: 1.2rem;
  line-height: 1;
  transition: transform 0.3s ease;
  transform: rotate(180deg); /* offen: zeigt nach links/innen */
}

.session-banner.collapsed .session-toggle {
  border-bottom: 0;
  padding: 0.75rem 0;
  justify-content: center;
}
.session-banner.collapsed .session-toggle .toggle-icon {
  transform: rotate(0deg);
}
.session-banner.collapsed .session-toggle .toggle-label {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  margin-top: 0.5rem;
}

.session-content {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.25rem;
  transition: opacity 0.2s ease;
}

.session-banner.collapsed .session-content {
  display: none;
}

.session-info-block {
  text-align: center;
}

.session-label {
  margin: 0;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #888;
}

.session-code {
  margin: 0.25rem 0 0;
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #222;
}

.session-qr {
  text-align: center;
}

.session-qr canvas {
  display: block;
  margin: 0 auto;
  border-radius: 8px;
  background: #fff;
  padding: 6px;
  border: 1px solid #eee;
  max-width: 100%;
  height: auto;
}

.qr-hint {
  margin: 0.5rem 0 0;
  font-size: 0.7rem;
  color: #888;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.session-meta {
  font-size: 0.85rem;
  color: #555;
  text-align: center;
  border-top: 1px solid #f0f0f0;
  padding-top: 1rem;
}

.session-meta p { margin: 0 0 0.5rem; }

.session-link a {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
  color: #2563eb;
  word-break: break-all;
}

.btn-secondary {
  display: inline-block;
  font-size: 0.85rem;
  padding: 0.45rem 0.9rem;
  background: #fff;
  color: #222;
  border: 1px solid #ccc;
  border-radius: 8px;
  cursor: pointer;
}
.btn-secondary:hover { background: #f3f3f3; }

.session-danger {
  border-top: 1px solid #f0f0f0;
  padding-top: 1rem;
  text-align: center;
}

.btn-danger {
  font-size: 0.85rem;
  padding: 0.5rem 1rem;
  background: #fff;
  color: #c0392b;
  border: 1px solid #e6b8b2;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.btn-danger:hover {
  background: #c0392b;
  color: #fff;
  border-color: #c0392b;
}

/* ───────────────────────── Responsive ───────────────────────── */
@media (max-width: 800px) {
  .dashboard-layout,
  .dashboard-layout.collapsed {
    grid-template-columns: 1fr;
  }

  .session-banner {
    position: static;
  }

  .session-banner.collapsed .session-toggle {
    padding: 0.75rem 1rem;
    justify-content: space-between;
  }
  .session-banner.collapsed .session-toggle .toggle-label {
    writing-mode: horizontal-tb;
    transform: none;
    margin-top: 0;
  }
  .session-banner.collapsed .session-toggle .toggle-icon {
    transform: rotate(-90deg);
  }
  .session-toggle .toggle-icon {
    transform: rotate(90deg);
  }

  .bar { height: 3.5rem; }
  .bar label { font-size: 1.2rem; }
}
