/* ── Staffel Type Selector ──────────────────────────────── */
.staffel-type-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #e8e8e8;
  border-radius: 9px;
  cursor: pointer;
  background: #fff;
  margin-bottom: 7px;
  touch-action: manipulation;
}

.staffel-type-item.active {
  border: 1.5px solid #1e3a5f;
  background: #eff6ff;
}

.staffel-type-label {
  font-size: 13px;
  font-weight: 600;
}

.staffel-type-sub {
  font-size: 10px;
  color: #999;
}

/* ── Metrics ─────────────────────────────────────────────── */
.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.metric {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 8px 10px;
  border: 1px solid #e8e8e8;
}

.metric-label {
  font-size: 10px;
  color: #888;
  margin-bottom: 3px;
}

.metric-value {
  font-size: 15px;
  font-weight: 600;
}

.metric-value.good {
  color: #1D9E75;
}

.metric-value.bad {
  color: #D85A30;
}

/* ── Swimmer Table ──────────────────────────────────────── */
.heat-green {
  background: #d4edda;
  color: #155724;
}

.heat-yellow {
  background: #fff3cd;
  color: #856404;
}

.heat-red {
  background: #f8d7da;
  color: #721c24;
}

.heat-gray {
  background: #f0f0f0;
  color: #999;
}

/* ── Staffel List ───────────────────────────────────────── */
.staffel-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 12px;
}

.staffel-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 10px;
  padding: 9px 10px;
  cursor: pointer;
  touch-action: manipulation;
}

.staffel-row.optimal {
  border: 1.5px solid #1D9E75;
  background: #f0fdf4;
}

.staffel-row.suboptimal {
  border: 1.5px solid #D85A30;
  background: #fff7ed;
}

.staffel-row.sel {
  border: 2px dashed #3b82f6;
  background: #eff6ff;
}

.row-num {
  font-size: 10px;
  color: #aaa;
  min-width: 18px;
  text-align: center;
}

.row-lage {
  font-size: 10px;
  min-width: 80px;
  color: inherit;
  opacity: 0.75;
}

.row-name {
  font-size: 13px;
  font-weight: 600;
  flex: 1;
}

.row-time {
  font-size: 11px;
  color: inherit;
  opacity: 0.85;
  min-width: 52px;
  text-align: right;
}

.move-btns {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.move-btn {
  width: 26px;
  height: 20px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #f5f5f5;
  color: #666;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}

/* ── Pool ───────────────────────────────────────────────── */
.pool-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pool-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f9f9f9;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  padding: 8px 10px;
}

.pool-name {
  font-size: 13px;
  flex: 1;
}

/* ── Optimal List ───────────────────────────────────────── */
.opt-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.opt-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f0fdf4;
  border: 1.5px solid #1D9E75;
  border-radius: 10px;
  padding: 9px 10px;
}

.opt-lage {
  font-size: 10px;
  color: #166534;
  min-width: 80px;
}

.opt-name {
  font-size: 13px;
  font-weight: 600;
  color: #14532d;
  flex: 1;
}

.opt-time {
  font-size: 11px;
  color: #166534;
  min-width: 52px;
  text-align: right;
}

/* ── Swimmer Cards ──────────────────────────────────────── */
.swimmer-card {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 10px;
  margin-bottom: 8px;
  overflow: hidden;
}

.swimmer-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  cursor: pointer;
  touch-action: manipulation;
}

.swimmer-name-cell {
  font-size: 13px;
  font-weight: 600;
  flex: 1;
}

.swimmer-body {
  display: none;
  padding: 0 12px 10px;
  border-top: 1px solid #f0f0f0;
}

.swimmer-body.open {
  display: block;
}

.time-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.time-cell-card {
  background: #f9f9f9;
  border-radius: 7px;
  padding: 7px 9px;
}

.time-cell-label {
  font-size: 10px;
  color: #999;
  margin-bottom: 4px;
}

.time-row-inner {
  display: flex;
  align-items: center;
  gap: 6px;
}

.time-input {
  width: 72px;
  padding: 4px 6px;
  border: 1px solid #ddd;
  border-radius: 5px;
  background: #fff;
  color: #111;
  font-size: 12px;
}

.time-input:disabled {
  opacity: 0.35;
  background: #f0f0f0;
}

.time-toggle {
  width: 32px;
  height: 18px;
  border-radius: 9px;
  background: #ddd;
  border: none;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: background 0.15s;
}

.time-toggle.on {
  background: #1D9E75;
}

.time-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  transition: left 0.15s;
}

.time-toggle.on::after {
  left: 16px;
}

/* ── Optimierung Progress ───────────────────────────────── */
.opt-progress {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 12px;
  color: #0369a1;
  display: none;
}

/* ── Staffel-Tabs (inline extrahiert) ──────────────────── */
.tabs {
  display: flex;
  border-bottom: 1px solid #ddd;
  margin-bottom: 14px;
}

.tab {
  flex: 1;
  padding: 10px 4px;
  font-size: 12px;
  cursor: pointer;
  border: none;
  background: none;
  color: #888;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  text-align: center;
  touch-action: manipulation;
}

.tab.active {
  color: #1e3a5f;
  border-bottom: 2px solid #1e3a5f;
  font-weight: 600;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.warn {
  background: #fef9c3;
  color: #854d0e;
  border: 1px solid #fde047;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  margin-bottom: 10px;
}

.section-label {
  font-size: 11px;
  color: #999;
  margin-bottom: 6px;
}

/* ── Gruppen-Chips (Staffel-Seite) ─────────────────────── */
.group-chip-btn {
  padding: 4px 11px;
  border-radius: 14px;
  border: 1.5px solid #cbd5e1;
  background: #fff;
  color: #475569;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.13s;
  white-space: nowrap;
}

.group-chip-btn:hover {
  border-color: #1e3a5f;
  color: #1e3a5f;
  background: #f0f5ff;
}

.group-chip-btn.active {
  background: #1e3a5f;
  border-color: #1e3a5f;
  color: #fff;
}