/* Klienten Dashboard — Shared Styles
 * Knie Athletics Branding: #004467 Dunkelblau, #0087B3 Petrol, #2ab5d7 Cyan
 * #ff6d09 Orange CTA, #f3eee7 Offwhite, #eef6f9 Ice Blue
 */

@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700;900&display=swap');

/* ─── CSS Variables ─── */
:root {
  /* Knie Athletics Colors */
  --ka-darkblue: #004467;
  --ka-petrol: #0087B3;
  --ka-cyan: #2ab5d7;
  --ka-orange: #ff6d09;
  --ka-yellow: #ffed00;
  --ka-offwhite: #f3eee7;
  --ka-iceblue: #eef6f9;

  /* Light Theme (default) */
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-card: #ffffff;
  --bg-hover: #f0f4f8;
  --border: #e2e8f0;
  --border-light: #edf2f7;
  --text-primary: #004467;
  --text-body: #2d3748;
  --text-meta: #718096;
  --text-on-dark: #ffffff;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 50px;

  /* Alert Colors */
  --alert-high: #e53e3e;
  --alert-high-bg: #fff5f5;
  --alert-medium: #dd6b20;
  --alert-medium-bg: #fffaf0;
  --alert-low: #38a169;
  --alert-low-bg: #f0fff4;

  /* Chart Colors */
  --chart-line1: #0087B3;
  --chart-line2: #ff6d09;
  --chart-line3: #38a169;
  --chart-line4: #805ad5;
  --chart-area: rgba(0, 135, 179, 0.1);
}

/* Dark Theme */
/* ─── Base ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: 'Roboto', sans-serif;
  font-weight: 400;
  color: var(--text-body);
  background: var(--bg-secondary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ─── Typography ─── */
h1, h2, h3, h4 {
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.3;
}
h1 { font-size: 1.8rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }

a { color: var(--ka-petrol); text-decoration: none; }
a:hover { color: var(--ka-cyan); }

/* ─── Layout ─── */
.page-wrapper {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}

/* ─── Hero / Header ─── */
.hero {
  background: linear-gradient(135deg, var(--ka-darkblue) 0%, var(--ka-petrol) 100%);
  color: var(--text-on-dark);
  padding: 1.5rem 2rem;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  margin-bottom: 1.5rem;
}
.hero-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.hero-title {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.hero-title img { height: 40px; }
.hero-title h1 { color: var(--text-on-dark); font-size: 1.5rem; font-weight: 700; }
.hero-meta { font-size: 0.85rem; opacity: 0.85; }
.hero-meta span + span::before { content: ' · '; }

/* ─── Navigation ─── */
.nav-bar {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  align-items: center;
}
.nav-link {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-meta);
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.nav-link:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-link.active {
  background: var(--ka-darkblue);
  color: var(--text-on-dark);
}

/* ─── Filter Bar ─── */
.filter-bar {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg-primary);
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}
.search-input {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  font-family: inherit;
  background: var(--bg-card);
  color: var(--text-body);
  width: 240px;
  transition: border-color 0.2s;
}
.search-input:focus { outline: none; border-color: var(--ka-petrol); }
.filter-pill {
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  color: var(--text-meta);
  cursor: pointer;
  font-size: 0.85rem;
  font-family: inherit;
  transition: all 0.2s;
}
.filter-pill:hover, .filter-pill.active {
  background: var(--ka-darkblue);
  color: var(--text-on-dark);
  border-color: var(--ka-darkblue);
}

/* ─── Absent Toggle ─── */
.absent-toggle {
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  color: var(--text-meta);
  cursor: pointer;
  font-size: 0.75rem;
  font-family: inherit;
  transition: all 0.2s;
}
.absent-toggle:hover { border-color: var(--alert-high); color: var(--alert-high); }
.absent-toggle.active {
  background: var(--alert-high);
  color: white;
  border-color: var(--alert-high);
}

/* ─── Summary Cards ─── */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.summary-card .label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-meta);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.25rem;
}
.summary-card .value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}
.summary-card .sub {
  font-size: 0.85rem;
  color: var(--text-meta);
  margin-top: 0.25rem;
}

/* ─── Coach Section ─── */
.coach-section {
  margin-bottom: 2.5rem;
}
.coach-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--ka-petrol);
}
.coach-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.coach-stats {
  font-size: 0.85rem;
  color: var(--text-meta);
}
.coach-stats span + span::before { content: ' · '; }

/* ─── Client Cards Grid ─── */
.clients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.client-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
  cursor: pointer;
  position: relative;
}
.client-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.client-card.has-high-alert {
  border-left: 4px solid var(--alert-high);
}
.client-card.has-medium-alert {
  border-left: 4px solid var(--alert-medium);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}
.client-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
}
.level-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.6rem;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  background: var(--ka-petrol);
  white-space: nowrap;
}
.level-badge.level-1 { background: #38a169; }
.level-badge.level-2 { background: #0087B3; }
.level-badge.level-3 { background: #805ad5; }
.level-badge.level-4 { background: #dd6b20; }
.level-badge.level-5 { background: #e53e3e; }
.level-badge.level-pause { background: #a0aec0; }
.level-badge.level-basis { background: #004467; }

.card-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem 1rem;
  font-size: 0.82rem;
  margin-bottom: 0.5rem;
}
.card-metric .metric-label { color: var(--text-meta); font-size: 0.75rem; }
.card-metric .metric-value { font-weight: 600; color: var(--text-body); }

.card-sparkline {
  height: 32px;
  margin: 0.5rem 0;
}
.card-sparkline canvas { width: 100%; height: 100%; }

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-light);
  font-size: 0.8rem;
  color: var(--text-meta);
}
.alert-dots { display: flex; gap: 4px; }
.alert-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
}
.alert-dot.high { background: var(--alert-high); }
.alert-dot.medium { background: var(--alert-medium); }
.alert-dot.low { background: var(--alert-low); }

/* Activity indicator */
.activity-ok { color: var(--alert-low); }
.activity-warn { color: var(--alert-medium); }
.activity-danger { color: var(--alert-high); }
.weeks-ok { color: var(--text-meta); }
.weeks-warn { color: var(--alert-medium); font-weight: 600; }
.weeks-danger { color: var(--alert-high); font-weight: 700; }

/* Trend arrows */
.trend-up { color: var(--alert-low); }
.trend-down { color: var(--alert-high); }
.trend-stable { color: var(--text-meta); }

/* ─── Tabs ─── */
.tab-nav {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1.5rem;
  overflow-x: auto;
}
.tab-btn {
  padding: 0.75rem 1.25rem;
  border: none;
  background: none;
  color: var(--text-meta);
  font-size: 0.9rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: all 0.2s;
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active {
  color: var(--ka-petrol);
  border-bottom-color: var(--ka-petrol);
  font-weight: 600;
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ─── Data Tables ─── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.data-table thead th,
.data-table .repeat-header td {
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 2px solid var(--border);
}
.data-table tbody td {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
.data-table tbody tr:hover { background: var(--bg-hover); }
.data-table tbody tr:last-child td { border-bottom: none; }

/* Clickable rows + text answers */
.clickable-row { cursor: pointer; }
.clickable-row:hover { background: var(--bg-hover); }
.hidden { display: none; }
.text-row td { padding: 0 !important; border-bottom: 2px solid var(--border) !important; }
.text-answers {
  padding: 0.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.text-date {
  font-size: 0.75rem;
  color: var(--text-meta);
  margin-bottom: 0.1rem;
  font-weight: 500;
}
.text-item {
  font-size: 0.82rem;
  line-height: 1.4;
}
.text-label {
  color: var(--ka-darkblue);
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 0.15rem;
}
.text-value { color: var(--text-body); font-size: 0.9rem; }

/* Color-coded cells */
.cell-good { background: rgba(56,161,105,0.1); color: #276749; }
.cell-warn { background: rgba(221,107,32,0.1); color: #9c4221; }
.cell-bad { background: rgba(229,62,62,0.1); color: #9b2c2c; }
[data-theme="dark"] .cell-good { color: #68d391; }
[data-theme="dark"] .cell-warn { color: #fbd38d; }
[data-theme="dark"] .cell-bad { color: #fc8181; }

/* ─── Key Metric Cards (Detail Page) ─── */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
  text-align: center;
}
.metric-card .mc-label {
  font-size: 0.75rem;
  color: var(--text-meta);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}
.metric-card .mc-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
}
.metric-card .mc-sub {
  font-size: 0.8rem;
  color: var(--text-meta);
  margin-top: 0.25rem;
}
.metric-card.highlight {
  border-color: var(--ka-petrol);
  border-width: 2px;
}

/* ─── Chart Containers ─── */
.chart-container {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}
.chart-container h3 {
  margin-bottom: 1rem;
  font-size: 1rem;
}
.chart-wrap { position: relative; height: 280px; }

/* ─── Alert Cards ─── */
.alert-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow-sm);
}
.alert-card.alert-high { border-left: 4px solid var(--alert-high); background: var(--alert-high-bg); }
.alert-card.alert-medium { border-left: 4px solid var(--alert-medium); background: var(--alert-medium-bg); }
.alert-card.alert-low { border-left: 4px solid var(--alert-low); background: var(--alert-low-bg); }
.alert-icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 1rem;
}
.alert-high .alert-icon { background: var(--alert-high); color: #fff; }
.alert-medium .alert-icon { background: var(--alert-medium); color: #fff; }
.alert-low .alert-icon { background: var(--alert-low); color: #fff; }
.alert-body { flex: 1; }
.alert-body .alert-client {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
}
.alert-body .alert-msg { font-size: 0.85rem; color: var(--text-body); margin-top: 0.15rem; }
.alert-body .alert-action {
  font-size: 0.8rem;
  color: var(--text-meta);
  margin-top: 0.35rem;
  font-style: italic;
}
.alert-body .alert-coach {
  font-size: 0.75rem;
  color: var(--text-meta);
  margin-top: 0.25rem;
}

/* ─── Client Group (Wochenfeedback) ─── */
.weekly-grouped { border-collapse: separate; border-spacing: 0 0.6rem; }
.weekly-grouped thead th { padding-bottom: 0.5rem; }
.client-group > tr:first-child > td { border-top: 1px solid var(--border); }
.client-group > tr:last-child > td { border-bottom: 1px solid var(--border); }
.client-group > tr > td:first-child { border-left: 1px solid var(--border); }
.client-group > tr > td:last-child { border-right: 1px solid var(--border); }
.client-group > tr:first-child > td:first-child { border-top-left-radius: var(--radius-md); }
.client-group > tr:first-child > td:last-child { border-top-right-radius: var(--radius-md); }
.client-group > tr:last-child > td:first-child { border-bottom-left-radius: var(--radius-md); }
.client-group > tr:last-child > td:last-child { border-bottom-right-radius: var(--radius-md); }
.client-group > tr > td { background: var(--bg-card); }
.client-group > tr > td.cell-good { background: rgba(56,161,105,0.1); }
.client-group > tr > td.cell-warn { background: rgba(221,107,32,0.1); }
.client-group > tr > td.cell-bad { background: rgba(229,62,62,0.1); }
.data-table .client-group .text-row > td { padding: 0.5rem 1.5rem; }

/* ─── Client Summary ─── */
.client-summary {
  background: var(--bg-hover);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.8rem;
  border-left: 3px solid var(--primary);
  font-size: 0.82rem;
}
.summary-points { display: flex; flex-direction: column; gap: 0.2rem; }
.summary-point { color: var(--text-body); line-height: 1.4; }
.summary-actions {
  margin-top: 0.4rem;
  padding-top: 0.4rem;
  border-top: 1px dashed var(--border-light);
  color: var(--primary);
  font-weight: 600;
  font-size: 0.78rem;
}
.summary-actions-label { color: var(--text-meta); font-weight: 400; }

/* ─── Training Today ─── */
.date-selector {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.date-btn {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  color: var(--text-body);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  transition: all 0.2s;
}
.date-btn:hover, .date-btn.active {
  background: var(--ka-darkblue);
  color: var(--text-on-dark);
  border-color: var(--ka-darkblue);
}

.training-card-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  margin-bottom: 0.5rem;
}
.training-card {
  display: grid;
  grid-template-columns: 200px 80px 1fr 120px 120px;
  gap: 1rem;
  align-items: center;
  padding: 0.75rem 1.25rem;
  font-size: 0.85rem;
}
.training-card .tc-name { font-weight: 600; color: var(--text-primary); }
.training-card .tc-coach { color: var(--text-meta); }

.bar-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.bar {
  height: 8px;
  border-radius: 4px;
  background: var(--border);
  flex: 1;
  overflow: hidden;
}
.bar-fill { height: 100%; border-radius: 4px; transition: width 0.3s; }
.bar-fill.anstrengung { background: var(--ka-petrol); }
.bar-fill.schwellung { background: var(--ka-orange); }

/* ─── Collapsible ─── */
.collapsible { cursor: pointer; }
.collapsible-content { display: none; padding: 0.75rem 0; }
.collapsible-content.open { display: block; }

/* ─── Breadcrumb ─── */
.breadcrumb {
  font-size: 0.85rem;
  color: var(--text-meta);
  margin-bottom: 1rem;
}
.breadcrumb a { color: var(--ka-petrol); }
.breadcrumb .sep { margin: 0 0.5rem; opacity: 0.5; }

/* ─── Empty State ─── */
.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--text-meta);
}
.empty-state .icon { font-size: 2.5rem; margin-bottom: 1rem; }

/* ─── Responsive ─── */
@media (max-width: 768px) {
  html { font-size: 14px; }
  .hero { padding: 1rem; }
  .hero-inner { flex-direction: column; align-items: flex-start; }
  .page-wrapper { padding: 0 1rem 2rem; }
  .clients-grid { grid-template-columns: 1fr; }
  .training-card { grid-template-columns: 1fr; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ─── Loading ─── */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: var(--text-meta);
}
.spinner {
  width: 24px; height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--ka-petrol);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 0.75rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── No-Data Message ─── */
.no-data { color: var(--text-meta); font-style: italic; font-size: 0.85rem; padding: 1rem 0; }

/* ─── Print Button ─── */
.print-btn {
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  color: var(--text-meta);
  cursor: pointer;
  font-size: 0.85rem;
  font-family: inherit;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.print-btn:hover { background: var(--ka-darkblue); color: var(--text-on-dark); border-color: var(--ka-darkblue); }

/* ─── Print Header (hidden on screen) ─── */
.print-header { display: none; }

/* ─── Print Styles ─── */
@media print {
  /* Reset */
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  html { font-size: 10px !important; }
  body { background: white !important; color: #222 !important; }

  /* Hide UI elements */
  .hero, .nav-bar, .filter-bar, .tab-nav, .date-selector,
  .print-btn, .absent-toggles, .summary-grid { display: none !important; }

  /* Show print header */
  .print-header {
    display: block !important;
    padding: 0.5rem 0 0.3rem;
    border-bottom: 2px solid #004467;
    margin-bottom: 0.5rem;
  }
  .print-header h2 {
    font-size: 1.4rem;
    color: #004467;
    margin: 0;
  }
  .print-header .print-meta {
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.1rem;
  }

  /* Page wrapper — etwas Padding damit nichts am Rand klebt */
  .page-wrapper { max-width: 100% !important; padding: 0 0.5cm !important; margin: 0 !important; }

  /* Show active tab only */
  .tab-panel { display: none !important; }
  .tab-panel.active { display: block !important; }

  /* Tables compact */
  .data-table { font-size: 0.7rem !important; box-shadow: none !important; }
  .data-table thead th,
  .data-table .repeat-header td {
    padding: 0.3rem 0.5rem !important;
    font-size: 0.65rem !important;
    background: #eee !important;
  }
  .data-table tbody td {
    padding: 0.25rem 0.5rem !important;
    border-bottom: 1px solid #ddd !important;
  }

  /* Client group — nicht zwischen Seiten umbrechen */
  .weekly-grouped { border-spacing: 0 0.3rem !important; }
  .client-group { page-break-inside: avoid !important; }

  /* Text answers compact */
  .text-answers { padding: 0.3rem 0 !important; gap: 0.25rem !important; }
  .text-label { font-size: 0.7rem !important; }
  .text-value { font-size: 0.72rem !important; }
  .text-date { font-size: 0.6rem !important; }
  .text-row td { padding: 0.3rem 0.8rem !important; }

  /* Training cards compact + nicht umbrechen */
  .training-card-wrapper { box-shadow: none !important; border: 1px solid #ddd !important; margin-bottom: 0.3rem !important; page-break-inside: avoid !important; }
  .training-card { padding: 0.4rem 0.8rem !important; font-size: 0.72rem !important; gap: 0.5rem !important; }
  .training-card .tc-texts { font-size: 0.68rem !important; }
  .training-card .tc-texts .tc-text-label { font-size: 0.65rem !important; }
  .training-card-wrapper > .text-answers { padding: 0.2rem 0.8rem 0.5rem !important; }

  /* Summary block compact */
  .client-summary { padding: 0.3rem 0.5rem !important; font-size: 0.68rem !important; }
  .summary-actions { font-size: 0.65rem !important; }

  /* ROM tables */
  .rom-table { font-size: 0.7rem !important; }
  .rom-table td, .rom-table th { padding: 0.2rem 0.4rem !important; }

  /* Color cells keep colors */
  .cell-good { background: rgba(56,161,105,0.15) !important; }
  .cell-warn { background: rgba(221,107,32,0.15) !important; }
  .cell-bad { background: rgba(229,62,62,0.15) !important; }

  /* Level badges */
  .level-badge { font-size: 0.6rem !important; padding: 0.1rem 0.4rem !important; }

  /* Links as text */
  a { color: #222 !important; text-decoration: none !important; }

  /* Page breaks */
  h2 { page-break-after: avoid; margin-bottom: 0.3rem !important; }
  .coach-section { page-break-inside: avoid; }

  /* "Kein Trainingsfeedback" im Print ausblenden (nicht relevant) */
  #notTrainedTitle, #notTrainedList { display: none !important; }

  /* Hidden in print */
  .hidden { display: none !important; }

  /* Force show text rows when printing (don't hide them) */
  .text-row { display: table-row !important; }
  .print-show { display: table-row !important; }

  /* No-data message */
  .no-data { font-size: 0.7rem !important; }

  /* Margins */
  @page {
    margin: 1cm;
    size: A4 portrait;
  }
  .scroll-top-btn { display: none !important; }
}

/* Back-to-Top Button */
.scroll-top-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #004467;
  color: white;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.scroll-top-btn.visible {
  opacity: 1;
  pointer-events: auto;
}
