/* ── App Layout ─────────────────────────────────────────── */
.app {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 56px);
  overflow: hidden;
}

/* ── KW-Navigation ──────────────────────────────────────── */
.kw-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 10px 16px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.kw-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s;
}
.kw-btn:hover { background: #1e3a5f; color: #fff; border-color: #1e3a5f; }

.kw-label {
  font-size: 15px;
  font-weight: 700;
  color: #1e3a5f;
  min-width: 140px;
  text-align: center;
}

/* ── Session-Tabs ───────────────────────────────────────── */
.session-tabs {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  background: #f8f9fa;
  border-bottom: 1px solid #e5e7eb;
  overflow-x: auto;
  flex-shrink: 0;
  -webkit-overflow-scrolling: touch;
}

.session-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, border-color 0.12s;
  flex-shrink: 0;
}
.session-tab:hover      { background: #f0f4f8; border-color: #1e3a5f; }
.session-tab.active     { background: #1e3a5f; border-color: #1e3a5f; color: #fff; }
.session-tab.cancelled  { opacity: 0.45; }

.tab-date  { font-size: 12px; font-weight: 600; }
.tab-time  { font-size: 11px; opacity: 0.75; }
.tab-badge {
  font-size: 10px;
  font-weight: 700;
  background: #d1fae5;
  color: #065f46;
  padding: 1px 6px;
  border-radius: 8px;
  margin-top: 2px;
}
.session-tab.active .tab-badge { background: rgba(255,255,255,0.25); color: #fff; }

/* ── Attendance Main ────────────────────────────────────── */
.attendance-main {
  flex: 1;
  overflow-y: auto;
  background: #fff;
  display: flex;
  flex-direction: column;
}

.attendance-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 12px 16px 10px;
  border-bottom: 1px solid #f3f4f6;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 2;
}

.attendance-title {
  font-size: 14px;
  font-weight: 700;
  color: #1e3a5f;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.attendance-subtitle {
  display: flex;
  gap: 5px;
  margin-top: 3px;
  flex-wrap: wrap;
}

.attendance-actions {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  align-items: center;
}

/* ── Buttons ────────────────────────────────────────────── */
.btn-secondary {
  padding: 5px 10px;
  font-size: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #f9fafb;
  color: #374151;
  cursor: pointer;
  transition: background 0.12s;
  white-space: nowrap;
}
.btn-secondary:hover { background: #f3f4f6; }
.btn-secondary.active-cancel { background: #fee2e2; border-color: #fca5a5; color: #991b1b; }

.btn-save {
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  background: #1e3a5f;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}
.btn-save:hover { background: #0f2a4f; }
.btn-save.dirty { background: #059669; }

.btn-link {
  background: none;
  border: none;
  color: #1e3a5f;
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

/* ── Abgesagt ────────────────────────────────────────────── */
.cancelled-banner {
  background: #fee2e2;
  color: #991b1b;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 16px;
  text-align: center;
  flex-shrink: 0;
}

/* ── Tabelle ─────────────────────────────────────────────── */
.attendance-table-wrap {
  flex: 1;
  overflow-y: auto;
}

.attendance-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.attendance-table th {
  position: sticky;
  top: 0;
  background: #f9fafb;
  padding: 7px 16px;
  text-align: left;
  font-size: 11px;
  color: #6b7280;
  font-weight: 700;
  border-bottom: 2px solid #e5e7eb;
}

.attendance-table td {
  padding: 6px 16px;
  border-bottom: 1px solid #f9fafb;
  vertical-align: middle;
}

.attendance-table tr:hover td { background: #f9fafb; }

.ath-name  { font-weight: 500; color: #1e3a5f; }
.ath-year  { font-size: 10px; color: #9ca3af; margin-left: 4px; font-weight: 400; }
.ath-toggle { text-align: right; }

/* ── Toggle ─────────────────────────────────────────────── */
.toggle-group {
  display: inline-flex;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  overflow: hidden;
}

.toggle-btn {
  padding: 5px 16px;
  font-size: 14px;
  font-weight: 700;
  border: none;
  background: #fff;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.toggle-btn + .toggle-btn { border-left: 1px solid #e5e7eb; }
.toggle-present:hover, .toggle-present.active { background: #d1fae5; color: #065f46; }
.toggle-absent:hover,  .toggle-absent.active  { background: #fee2e2; color: #991b1b; }

/* ── Statistik ──────────────────────────────────────────── */
.stat-bar {
  flex: 1;
  height: 8px;
  background: #f3f4f6;
  border-radius: 4px;
  overflow: hidden;
  min-width: 60px;
}
.stat-bar-fill { height: 100%; border-radius: 4px; }

.attendance-stats-link {
  padding: 10px 16px;
  border-top: 1px solid #f3f4f6;
  text-align: right;
  flex-shrink: 0;
}

/* ── Kombinierte Trainings ──────────────────────────────── */
.tab-groups {
  font-size: 9px;
  font-weight: 700;
  color: #6b7280;
  letter-spacing: 0.03em;
}
.session-tab.active .tab-groups { color: rgba(255,255,255,0.75); }

.ath-group-tag {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  color: #5b21b6;
  background: #ede9fe;
  padding: 1px 6px;
  border-radius: 6px;
  margin-left: 6px;
  vertical-align: middle;
}
