:root {
  --orange: #E8622A;
  --teal: #2A7B8C;
  --midnight: #0D1B2A;
  --cream: #F5F2EC;
  --border: #DDD8CE;
  --text-muted: #6B6760;
}

* { box-sizing: border-box; }

html, body {
  overflow-x: hidden;
  max-width: 100%;
}

body {
  margin: 0;
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--cream);
  color: var(--midnight);
}

header {
  background: var(--midnight);
  color: var(--cream);
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}

.header-logo {
  height: 48px;
  width: auto;
  display: block;
  flex: none;
}

header h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.4rem;
  letter-spacing: 0.05em;
  margin: 0;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.header-logout {
  background: transparent;
  border: 1px solid rgba(245,242,236,0.4);
  color: var(--cream);
  border-radius: 6px;
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.header-logout:hover { background: rgba(245,242,236,0.12); }

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.25rem;
}

.controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.new-session-btn {
  background: var(--midnight);
  color: var(--cream);
  border: none;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}
.new-session-btn:hover { opacity: 0.92; }

.view-toggle {
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  width: fit-content;
}

.view-toggle button {
  background: white;
  border: none;
  padding: 0.45rem 1.2rem;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

.view-toggle button.active {
  background: var(--orange);
  color: white;
}

.date-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.date-nav button {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  font-size: 0.9rem;
}

.date-nav span {
  font-weight: 600;
  font-size: 1.05rem;
}

.session-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 0.75rem;
}

.session-card .top-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.4rem;
}

.session-time {
  font-weight: 600;
  font-size: 1.1rem;
}

/* Trainingsdauer als dezentes Badge neben der Uhrzeit (Tag- & Wochenansicht) */
.dauer-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
  background: rgba(13,27,42,0.07);
  color: var(--text-muted);
  white-space: nowrap;
  vertical-align: 2px;
}

.session-type {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-weight: 600;
}

.type-gruppe { background: rgba(42,123,140,0.12); color: var(--teal); }
.type-pt { background: rgba(232,98,42,0.12); color: var(--orange); }

/* Klassentyp-Farben — Blau-Nuancen */
.type-functional { background: rgba(42,123,140,0.14); color: #2A7B8C; }  /* Teal-Blau */
.type-strength   { background: rgba(22,62,89,0.14);   color: #163E59; }  /* Tiefes Navy */
.type-jugend     { background: rgba(58,141,190,0.18); color: #2C7AA8; }  /* Helles Sky-Blau */
.type-hyrox      { background: rgba(13,27,42,0.10);    color: #0D3B66; }  /* Kräftiges Tiefblau */

.chip-group { display: flex; align-items: center; gap: 0.4rem; }

.team-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: var(--midnight);
  color: var(--cream);
}

.notiz-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: #f4c430;
  color: var(--midnight);
  white-space: nowrap;
}

.sms-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: #2a8c5a;
  color: white;
  white-space: nowrap;
}

/* Notiz-Hinweis im Neue-Session-Dialog */
.ns-notiz-hint {
  background: #fff7e0;
  border: 1px solid #f4c430;
  border-radius: 7px;
  padding: 0.5rem 0.7rem;
  margin: 0.2rem 0 0.4rem;
  font-size: 0.9rem;
  color: var(--midnight);
}
.ns-notiz-row { margin: 0.1rem 0; }

.session-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.session-subtle {
  font-size: 0.8rem;
  color: var(--text-muted);
  opacity: 0.85;
  margin-bottom: 0.5rem;
}

.plan-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot-ok { background: var(--teal); }
.dot-missing { background: var(--orange); }

.generate-btn {
  background: var(--orange);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
  cursor: pointer;
  font-weight: 600;
}

.generate-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.plan-content {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  white-space: pre-wrap;
  line-height: 1.5;
}

/* Kundensicht */
.kunde-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.kunde-bar .kunde-search { min-width: 180px; }

.kunde-label { font-weight: 600; }

.kunde-select,
.kunde-search {
  flex: 1;
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: white;
}

/* Vorschlagsliste in der Kundensicht: volle Breite unter der Suchleiste */
.kunde-suggest { margin-top: -0.6rem; margin-bottom: 1rem; }

/* „+ Neuer Kunde" klar von „+ Neue Session" (midnight) abheben → Teal-Akzent */
.kunde-neu-btn { white-space: nowrap; background: var(--teal); }

/* Kunden-Header + Unter-Tabs */
.kunde-header { margin-bottom: 0.75rem; }
.kunde-name { font-size: 1.25rem; font-weight: 700; color: var(--midnight); }
.kunde-sub { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.15rem; display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.kunde-level-lbl { display: inline-flex; align-items: center; gap: 0.3rem; }
.kunde-level { font-size: 0.85rem; padding: 0.1rem 0.3rem; }
.kunde-status { color: var(--text-muted); }
.kunde-level-hint { font-size: 0.8rem; }
.kunde-level-hint.saved { color: #2a8c5a; }
.kunde-level-hint.error { color: #c0392b; }

/* Ziele-Sektion */
.ziele-panel {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.7rem 0.8rem;
  margin-bottom: 1rem;
}
.ziele-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.35rem; }
.ziele-label { font-size: 0.82rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.ziele-edit { font-size: 0.85rem; }
.ziele-text { font-size: 0.92rem; color: var(--midnight); white-space: pre-wrap; }
.ziele-text.empty { color: var(--text-muted); font-style: italic; }
.ziele-ta {
  width: 100%;
  font-family: inherit;
  font-size: 0.92rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  box-sizing: border-box;
}
.ziele-actions { display: flex; align-items: center; gap: 0.6rem; margin-top: 0.5rem; }
.ziele-hint { font-size: 0.85rem; }
.ziele-hint.error { color: #c0392b; }

/* Sprache & Erinnerung Panel */
.kontakt-panel {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.7rem 0.8rem;
  margin-bottom: 1rem;
}
.kontakt-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem 1.2rem; margin-bottom: 0.5rem; }
.kontakt-lang, .kontakt-tel { font-size: 0.82rem; font-weight: 600; color: var(--text-muted); }
.kontakt-telefon,
.kontakt-sprache {
  display: block;
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-top: 0.2rem;
}
.kontakt-wa { align-self: flex-end; }

/* Geleistet (Kraft) im PT-Plan */
.leistung-section { border-top: 1px solid var(--border); margin-top: 0.8rem; padding-top: 0.7rem; }
.leistung-rows { margin-bottom: 0.5rem; }
.lf-empty { font-size: 0.85rem; color: var(--text-muted); }
.lf-row { display: flex; align-items: center; gap: 0.6rem; font-size: 0.9rem; padding: 0.2rem 0; }
.lf-row .lf-r-ueb { font-weight: 600; }
.lf-row .lf-r-kunde { color: var(--text-muted); font-size: 0.82rem; }
.lf-row .lf-del { margin-left: auto; color: var(--orange); }
.leistung-form { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.leistung-form select, .leistung-form input { font-family: inherit; font-size: 0.9rem; padding: 0.35rem 0.5rem; border: 1px solid var(--border); border-radius: 6px; }
.leistung-form .lf-last, .leistung-form .lf-wdh { width: 4.5rem; }
.lf-lastmal { font-size: 0.82rem; color: var(--orange); margin-top: 0.4rem; min-height: 1em; }
.lf-hint { font-size: 0.82rem; color: #c0392b; }

/* Druck-/PDF-Overlay (In-App, mobil mit Schliessen-Button statt gefangenem Fenster) */
.print-overlay { position: fixed; inset: 0; z-index: 2000; background: white; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.print-overlay-toolbar { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 0.8rem; background: var(--midnight); color: var(--cream); }
.print-overlay-title { flex: 1; text-align: center; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.print-close { background: none; border: 1px solid rgba(255,255,255,0.5); color: var(--cream); border-radius: 6px; padding: 0.35rem 0.7rem; font-family: inherit; font-size: 0.9rem; cursor: pointer; white-space: nowrap; }
.print-do { white-space: nowrap; }
.print-overlay-body { max-width: 820px; margin: 0 auto; padding: 1rem 1.2rem 3rem; color: #1a2332; line-height: 1.55; }
.print-overlay-body h1, .print-overlay-body h2, .print-overlay-body h3, .print-overlay-body h4 { color: #1a2332; margin: 0.8rem 0 0.4rem; }
.print-overlay-body table { border-collapse: collapse; width: 100%; margin: 0.5rem 0; }
.print-overlay-body th, .print-overlay-body td { border: 1px solid #bbb; padding: 4px 8px; text-align: left; font-size: 0.9rem; }
.print-overlay-body th { background: #f2efe9; }
.print-overlay-body blockquote { border-left: 3px solid var(--orange); margin: 0.5rem 0; padding: 0.2rem 0.8rem; color: #555; }
.print-overlay-body ul { margin: 0.3rem 0 0.3rem 1.2rem; }
.print-overlay-body section + section { margin-top: 1.5rem; border-top: 2px dashed #ccc; padding-top: 1rem; }
body.print-open { overflow: hidden; }

@media print {
  body.print-open > *:not(.print-overlay) { display: none !important; }
  body.print-open .print-overlay { position: static; overflow: visible; }
  body.print-open .print-overlay-toolbar { display: none !important; }
  body.print-open .print-overlay-body { max-width: none; margin: 0; padding: 0; }
  body.print-open .print-overlay-body section + section { page-break-before: always; border-top: none; margin-top: 0; padding-top: 0; }
}

/* Programme-Ansicht */
.programme-new { border: 1px dashed var(--border); border-radius: 8px; padding: 0.7rem 0.8rem; margin-bottom: 1rem; }
.programme-form-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.6rem; margin-top: 0.4rem; }
.programme-form-row label { font-size: 0.82rem; font-weight: 600; color: var(--text-muted); }
.programme-form-row input, .programme-form-row select { display: block; font-family: inherit; font-size: 0.9rem; padding: 0.4rem 0.5rem; border: 1px solid var(--border); border-radius: 6px; margin-top: 0.2rem; }
.programme-form-row .pg-tage, .programme-form-row .pg-dauer { width: 5rem; }
.pg-hinweise-label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--text-muted); margin-top: 0.5rem; }
.pg-hinweise { display: block; width: 100%; font-family: inherit; font-size: 0.9rem; padding: 0.4rem 0.5rem; border: 1px solid var(--border); border-radius: 6px; margin-top: 0.2rem; resize: vertical; }
.pg-hint { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.4rem; }

.plan-gen-info { font-size: 0.8rem; color: var(--text-muted); font-style: italic; }

.coach-aktionen { display: flex; align-items: center; gap: 0.5rem; }
.refresh-btn {
  background: white; border: 1px solid var(--border); border-radius: 8px;
  padding: 0.4rem 0.7rem; font-family: inherit; font-size: 0.82rem; font-weight: 600;
  color: var(--teal); cursor: pointer; white-space: nowrap;
}
.refresh-btn:hover { background: var(--cream); }
.refresh-btn:disabled { opacity: 0.6; cursor: default; }
.refresh-btn.laedt { color: var(--text-muted); }

.push-leiste {
  background: rgba(42,123,140,0.10); border: 1px solid rgba(42,123,140,0.25);
  border-radius: 8px; padding: 0.6rem 0.8rem; margin-bottom: 0.9rem;
  font-size: 0.88rem; color: var(--midnight); line-height: 1.45;
}
.push-leiste .link-btn { padding: 0; font-size: 0.9rem; }

/* Coach-Ansicht (coach.html) */
.coach-titel { font-weight: 700; font-size: 1.05rem; color: var(--midnight); }
.coach-tag-head {
  font-weight: 700; color: var(--midnight); margin: 1.1rem 0 0.5rem;
  padding-bottom: 0.3rem; border-bottom: 2px solid var(--border);
}
.coach-tag-head:first-child { margin-top: 0; }
.coach-tools { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 0.5rem; }
.coach-hint-inline { font-size: 0.85rem; color: var(--text-muted); font-style: italic; }
.coach-form { border-top: 1px solid var(--border); margin-top: 0.7rem; padding-top: 0.7rem; }
.coach-form-row { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.4rem; }
.coach-form-row label, .coach-full { font-size: 0.82rem; font-weight: 600; color: var(--text-muted); flex: 1; min-width: 8rem; }
.coach-full { display: block; margin-top: 0.5rem; }
.coach-form input, .coach-form select, .coach-form textarea {
  display: block; width: 100%; font-family: inherit; font-size: 0.9rem;
  padding: 0.4rem 0.5rem; border: 1px solid var(--border); border-radius: 6px;
  margin-top: 0.2rem; background: white;
}
.coach-form-actions { display: flex; align-items: center; gap: 0.6rem; margin-top: 0.7rem; flex-wrap: wrap; }
.kf-hint { font-size: 0.85rem; }
.kf-hint.saved { color: #2a8c5a; }
.kf-hint.error { color: #c0392b; }

/* Stunden-Übersicht */
.std-leiste { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin-bottom: 0.9rem; }
.std-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.std-filter label { font-size: 0.82rem; font-weight: 600; color: var(--text-muted); display: inline-flex; align-items: center; gap: 0.3rem; }
.std-filter input {
  font-family: inherit; font-size: 0.9rem; padding: 0.35rem 0.5rem;
  border: 1px solid var(--border); border-radius: 6px; background: white;
}
.std-zeitraum { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.std-kopf { font-size: 1.05rem; color: var(--midnight); margin-bottom: 0.6rem; }
.std-zeitraum-info { font-size: 0.85rem; color: var(--text-muted); margin-left: 0.5rem; }
.std-warnung {
  background: rgba(232,98,42,0.10); border: 1px solid rgba(232,98,42,0.35);
  border-radius: 6px; padding: 0.5rem 0.7rem; margin-bottom: 0.7rem; font-size: 0.86rem;
}
.std-karte { border: 1px solid var(--border); border-radius: 8px; background: white; padding: 0.8rem 1rem; margin-bottom: 0.7rem; }
.std-karte.std-ohne { background: var(--cream); border-style: dashed; }
.std-karte-kopf { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.6rem; }
.std-name { font-weight: 700; color: var(--midnight); font-size: 1rem; }
.std-summe { color: var(--text-muted); font-size: 0.9rem; }
.std-karte-kopf .std-auf { margin-left: auto; }
.std-arten { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.35rem; }
.std-art { font-size: 0.82rem; color: var(--text-muted); background: var(--cream); border-radius: 4px; padding: 0.1rem 0.45rem; }
.std-detail { margin-top: 0.6rem; }
.std-detail table { font-size: 0.84rem; }
.std-detail tr.std-fehlt td { color: #c0392b; }
.stunden-bereich { border: 1px solid var(--border); border-radius: 8px; padding: 0.9rem 1rem; margin-bottom: 1rem; background: rgba(255,255,255,0.6); }

/* Coach-Verwaltung (Admin) */
.coach-hinweis { font-size: 0.85rem; color: var(--text-muted); margin: 0.2rem 0 0.9rem; }
.coach-card { border: 1px solid var(--border); border-radius: 8px; background: white; padding: 0.9rem 1rem; margin-bottom: 0.8rem; }
.coach-row { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: flex-end; margin-bottom: 0.5rem; }
.coach-row label { font-size: 0.82rem; font-weight: 600; color: var(--text-muted); flex: 1; min-width: 9rem; }
.coach-row input, .coach-row select {
  display: block; width: 100%; font-family: inherit; font-size: 0.9rem;
  padding: 0.4rem 0.5rem; border: 1px solid var(--border); border-radius: 6px; margin-top: 0.2rem;
}
.coach-row .co-aktiv-wrap { flex: 0 0 auto; min-width: 0; align-self: center; }
.coach-row .co-aktiv { width: auto; display: inline-block; margin: 0; }
.coach-actions { display: flex; align-items: center; gap: 0.6rem; }
.co-hint { font-size: 0.85rem; }
.co-hint.saved { color: #2a8c5a; }
.co-hint.error { color: #c0392b; }
.programme-card { border: 1px solid var(--border); border-radius: 8px; margin-bottom: 0.9rem; background: white; }
.programme-head { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--border); }
.programme-titel { font-weight: 700; color: var(--midnight); }
.programme-meta { font-size: 0.82rem; color: var(--text-muted); }
.programme-actions { margin-left: auto; display: flex; gap: 0.6rem; }
.programme-del { color: var(--orange); }
.programme-day { border-bottom: 1px solid var(--border); }
.programme-day:last-child { border-bottom: none; }
.programme-day-bar { display: flex; align-items: center; gap: 0.8rem; padding: 0.5rem 0.8rem; }
.programme-day-nr { font-weight: 600; }
.programme-day-bar .programme-del { margin-left: auto; }
.programme-day-content { padding: 0 0.8rem; }
.programme-export { display: flex; align-items: center; flex-wrap: wrap; gap: 0.6rem; padding: 0.45rem 0.8rem; border-bottom: 1px solid var(--border); background: #faf8f4; }
.programme-export-label { font-size: 0.82rem; font-weight: 700; color: var(--text-muted); }
.programme-export-hint { font-size: 0.78rem; color: var(--text-muted); }
.pg-day-check { margin: 0; }

/* Kraft-Tab Kundenansicht */
.kraft-card { border: 1px solid var(--border); border-radius: 8px; padding: 0.6rem 0.8rem; margin-bottom: 0.6rem; background: white; }
.kraft-ueb { font-weight: 700; color: var(--midnight); margin-bottom: 0.3rem; }
.kraft-row { display: flex; justify-content: space-between; font-size: 0.9rem; padding: 0.15rem 0; }
.kraft-row .kraft-d { color: var(--text-muted); }

.subtabs {
  display: flex;
  gap: 0.4rem;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1rem;
}
.subtab {
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.5rem 0.9rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  color: var(--text-muted);
  cursor: pointer;
}
.subtab.active { color: var(--orange); border-bottom-color: var(--orange); }
.subtab:hover { color: var(--midnight); }

/* Verletzungskarten */
.inj-add { margin-bottom: 1rem; }
.inj-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.8rem;
  margin-bottom: 0.8rem;
  background: white;
}
.inj-card .inj-row { display: flex; gap: 0.6rem; }
.inj-card .inj-row label { flex: 1; }
.inj-card label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--text-muted); margin-bottom: 0.5rem; }
.inj-card select,
.inj-card textarea {
  width: 100%;
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-top: 0.2rem;
  box-sizing: border-box;
}
.inj-check { display: flex !important; align-items: center; gap: 0.4rem; font-weight: 600; }
.inj-check input { margin: 0; }
.inj-actions { display: flex; align-items: center; gap: 0.6rem; margin-top: 0.2rem; }
.inj-delete { color: var(--orange); margin-left: auto; }
.inj-hint { font-size: 0.85rem; }
.inj-hint.saved { color: #2a8c5a; }
.inj-hint.error { color: #c0392b; }

/* Neuer-Kunde-Formular */
.nc-checks { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.6rem; }
.nc-check { display: flex; align-items: center; gap: 0.35rem; font-size: 0.9rem; }
.nc-check input { margin: 0; }

/* Wiederholen / Serie */
.ns-repeat { border: 1px dashed var(--border); border-radius: 8px; padding: 0.6rem 0.7rem; margin-top: 0.2rem; }
.ns-repeat #ns-repeat-opts { margin-top: 0.5rem; }
.ns-weeks-input { width: 4rem; }
.ns-repeat-hint { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.4rem; }

/* 1RM-Panel (Kundensicht) */
.rm-panel { background: white; border: 1px solid var(--border); border-radius: 10px; padding: 1rem; margin-bottom: 1rem; }
.rm-head { font-weight: 700; margin-bottom: 0.6rem; }
.rm-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem 0.7rem; }
.rm-grid label { display: block; font-size: 0.78rem; font-weight: 600; color: var(--text-muted); }
.rm-grid input { width: 100%; margin-top: 0.2rem; font-family: inherit; font-size: 0.95rem; padding: 0.4rem 0.5rem; border: 1px solid var(--border); border-radius: 6px; }
.rm-actions { display: flex; align-items: center; gap: 0.7rem; margin-top: 0.8rem; }
.rm-hint { font-size: 0.82rem; font-weight: 600; }
.rm-hint.saved { color: var(--teal); }
.rm-hint.error { color: var(--orange); }
@media (max-width: 600px) { .rm-grid { grid-template-columns: 1fr; } }

/* Editierbarer Plan */
.plan-edit {
  width: 100%;
  max-width: 100%;
  margin-top: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: white;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.82rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-x: hidden;
  word-break: break-word;
  resize: vertical;
  min-height: 220px;
  color: var(--midnight);
}

/* Formatierte Plan-Leseansicht */
.plan-view {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.plan-html { font-size: 0.9rem; line-height: 1.55; overflow-wrap: anywhere; }
.plan-html .plan-h { margin: 0.9rem 0 0.4rem; line-height: 1.25; }
.plan-html h2.plan-h { font-size: 1.1rem; }
.plan-html h3.plan-h { font-size: 1rem; }
.plan-html h4.plan-h, .plan-html h5.plan-h, .plan-html h6.plan-h { font-size: 0.92rem; }
.plan-html p { margin: 0.4rem 0; }
.plan-html ul { margin: 0.4rem 0; padding-left: 1.2rem; }
.plan-html li { margin: 0.15rem 0; }
.plan-html hr { border: none; border-top: 1px solid var(--border); margin: 0.8rem 0; }
.plan-html code { background: rgba(13,27,42,0.06); padding: 0.05rem 0.3rem; border-radius: 4px; font-size: 0.85em; }
.plan-html blockquote {
  margin: 0.5rem 0; padding: 0.4rem 0.7rem;
  border-left: 3px solid var(--orange); background: rgba(232,98,42,0.06);
  border-radius: 0 6px 6px 0; font-size: 0.88rem;
}

/* Tabellen: füllen die Breite, brechen um; bei Bedarf scrollt NUR die Tabelle, nicht die Seite */
.plan-table-wrap { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0.5rem 0; }
.plan-html table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.plan-html th, .plan-html td {
  border: 1px solid var(--border);
  padding: 0.35rem 0.45rem;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}
.plan-html th { background: rgba(13,27,42,0.05); font-weight: 700; }

/* Strukturierter Plan: WOD-Items, Format, Scaling, Tagesziel */
.plan-html .plan-min { font-weight: 400; color: var(--text-muted); font-size: 0.85em; }
.plan-html .plan-coachnotiz { color: var(--text-muted); font-size: 0.9em; }
.plan-html .plan-begleit { display: inline-block; font-size: 0.75em; font-weight: 600; color: var(--text-muted); border: 1px solid currentColor; border-radius: 4px; padding: 0 4px; margin-right: 2px; vertical-align: 1px; white-space: nowrap; }
.plan-html .plan-ziel { margin: 0.3rem 0 0.6rem; }
.plan-html .plan-kunde { margin: -0.3rem 0 0.6rem; }
.plan-html .plan-meta { color: var(--text-muted); }
.plan-html .plan-wod-format { margin: 0.5rem 0 0.2rem; }
.plan-html ul.plan-wod { margin: 0.2rem 0 0.5rem; }
.plan-html .plan-wod-ziel { margin: 0.2rem 0 0.5rem; font-size: 0.85rem; color: var(--text-muted); font-style: italic; }
.plan-html .plan-scaling { margin: 0.5rem 0; padding: 0.4rem 0.7rem; background: rgba(42,123,140,0.07); border-left: 3px solid var(--teal); border-radius: 0 6px 6px 0; font-size: 0.88rem; }
.plan-html .plan-scaling ul { margin: 0.2rem 0 0; }
/* Kompakt/Voll-Umschalter hervorheben */
.plan-compact-toggle { font-weight: 700; }

.plan-view-actions { margin-top: 0.6rem; display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; align-items: center; }

/* Mobil: kompakter, kein seitliches Scrollen */
@media (max-width: 600px) {
  main { padding: 1rem 0.8rem; }
  header { padding: 0.85rem 1rem; }
  header h1 { font-size: 1.2rem; }
  .header-logo { height: 38px; }
  .header-brand { gap: 0.5rem; }
  .session-card { padding: 0.85rem; }
  .plan-html { font-size: 0.86rem; }
  .plan-html table { font-size: 0.74rem; }
  .plan-html th, .plan-html td { padding: 0.28rem 0.34rem; }
  .week-session-title { width: 100%; order: 5; }
  /* Der Spacer schiebt die Plan-Leiste auf dem Desktop nach rechts. Bricht die
     Zeile aber um, landet er MIT um und rückt die Leiste ein (sichtbar ab ca.
     390px Breite). Auf dem Handy darum weg — die Leiste bekommt ihre eigene,
     linksbündige Zeile. */
  .week-session-spacer { display: none; }
  .week-session-row .plan-status { width: 100%; }
  /* Aktions-Buttons kompakter auf dem Handy (Neue Session / Neuer Kunde) */
  .controls-row { gap: 0.5rem; }
  .new-session-btn { padding: 0.4rem 0.7rem; font-size: 0.82rem; }

  /* Reiterleiste: passt nicht in eine Zeile (wurde vorher abgeschnitten).
     Umbruch statt Raster — so bleibt es bei JEDER Reiteranzahl korrekt, und die
     Reiter der letzten Zeile füllen die Breite selbst aus. Die Trennlinien sind
     Schatten statt Rahmen: Die äusseren schneidet `overflow: hidden` sauber weg. */
  .view-toggle {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
  }
  .view-toggle button {
    flex: 1 1 auto;
    min-width: 5.5rem;
    padding: 0.5rem 0.4rem;
    font-size: 0.85rem;
    border: none;
    box-shadow: 1px 0 0 var(--border), 0 1px 0 var(--border);
  }
}

/* Modal: Neue Session */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(13,27,42,0.55);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 1.5rem 1rem; z-index: 1000; overflow-y: auto;
}
.modal-card {
  background: var(--cream); border-radius: 14px; width: 100%; max-width: 480px;
  box-shadow: 0 20px 60px rgba(13,27,42,0.3); margin: auto;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem; border-bottom: 1px solid var(--border);
}
.modal-head h2 { margin: 0; font-family: 'Bebas Neue', sans-serif; letter-spacing: 0.03em; font-size: 1.3rem; }
.modal-close { background: none; border: none; font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--text-muted); }
.modal-body { padding: 1.1rem 1.25rem; display: flex; flex-direction: column; gap: 0.8rem; }
.modal-body > label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--text-muted); }
.modal-body input[type=text], .modal-body input[type=date], .modal-body input[type=time], .modal-body select {
  width: 100%; margin-top: 0.25rem; font-family: inherit; font-size: 0.95rem;
  padding: 0.5rem 0.6rem; border: 1px solid var(--border); border-radius: 7px; background: white; color: var(--midnight);
}
.form-row { display: flex; gap: 0.7rem; }
.form-row > label { flex: 1; }
.ns-check { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; color: var(--midnight); }
.ns-check input { width: auto; margin: 0; }
.ns-hint { font-weight: 400; color: var(--text-muted); }
.ns-teilnehmer .opt-label { font-size: 0.82rem; font-weight: 600; color: var(--text-muted); }
.ns-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.4rem 0; }
.ns-chip { display: inline-flex; align-items: center; gap: 0.35rem; background: rgba(42,123,140,0.14); color: var(--teal); border-radius: 14px; padding: 0.2rem 0.3rem 0.2rem 0.6rem; font-size: 0.85rem; font-weight: 600; }
.ns-chip button { background: none; border: none; color: var(--teal); cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 0.2rem; }
.ns-suggest { border: 1px solid var(--border); border-radius: 7px; margin-top: 0.3rem; max-height: 180px; overflow-y: auto; background: white; }
.ns-suggest:empty { display: none; }
.ns-suggest-row { display: block; width: 100%; text-align: left; background: none; border: none; border-bottom: 1px solid var(--border); padding: 0.5rem 0.6rem; cursor: pointer; font-size: 0.9rem; color: var(--midnight); }
.ns-suggest-row:hover { background: rgba(42,123,140,0.08); }
.ns-suggest-row:last-child { border-bottom: none; }
.ns-suggest-empty { padding: 0.5rem 0.6rem; color: var(--text-muted); font-size: 0.85rem; }
.ns-error { color: var(--orange); font-weight: 600; font-size: 0.85rem; min-height: 1rem; }
.modal-actions { display: flex; align-items: center; gap: 0.8rem; padding: 1rem 1.25rem; border-top: 1px solid var(--border); }
.ns-delete { color: var(--orange); margin-left: auto; }

.plan-edit-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.plan-save-hint { font-size: 0.82rem; font-weight: 600; }
.plan-save-hint.saved { color: var(--teal); }
.plan-save-hint.error { color: var(--orange); }

/* Anzeigen / Optimieren — dezente Text-Buttons */
.link-btn {
  background: none;
  border: none;
  color: var(--teal);
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  padding: 0.2rem 0.3rem;
}

.link-btn:hover { text-decoration: underline; }
.link-btn:disabled { opacity: 0.5; cursor: default; }

/* Optimieren-Formular */
.optimize-form {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.opt-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.optimize-form textarea,
.optimize-form select {
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--cream);
  resize: vertical;
}

.optimize-form select { width: auto; }

.opt-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

/* Wochenansicht */
.bulk-bar {
  margin-bottom: 1rem;
  display: flex;
}

.bulk-bar .generate-btn {
  width: 100%;
  padding: 0.6rem 1rem;
  font-size: 0.95rem;
}

.week-day {
  margin-bottom: 1rem;
}

.week-day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.35rem 0.6rem;
  background: var(--midnight);
  color: var(--cream);
  border-radius: 6px 6px 0 0;
}

.week-day-today .week-day-header {
  background: var(--orange);
}

.week-day-count {
  font-size: 0.75rem;
  opacity: 0.8;
}

.week-day-right {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.week-add-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.4rem;
  padding: 0;
  font-size: 1.1rem;
  line-height: 1;
  font-weight: 700;
  color: inherit;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  cursor: pointer;
}

.week-add-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.week-empty {
  color: var(--text-muted);
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 6px 6px;
  background: white;
}

.week-session {
  border: 1px solid var(--border);
  border-top: none;
  background: white;
  padding: 0.5rem 0.6rem;
}

.week-day .week-session:last-child {
  border-radius: 0 0 6px 6px;
}

.week-session-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.week-session-time {
  font-weight: 600;
  min-width: 3rem;
}

.week-session-title {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Coach in der Wochenansicht — analog zur Tagesansicht, nur kompakter */
.week-session-coach {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.week-session-spacer {
  flex: 1;
}

/* Drag & Drop */
.week-session-row[draggable="true"] { cursor: grab; }
.week-session-row[draggable="true"]:active { cursor: grabbing; }
.week-session.dragging { opacity: 0.45; }
.week-day.drop-target { outline: 2px dashed var(--orange); outline-offset: -3px; border-radius: 8px; }

.plan-ok-label {
  font-size: 0.8rem;
  color: var(--teal);
  font-weight: 600;
}

.generate-btn-sm {
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem 1rem;
}

.loading {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem 1rem;
}

/* Zyklus-Zustand je Track (Wochenansicht, Admin) */
.zyklus-bar { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 0.75rem; }
.zyklus-chip { font-size: 0.8rem; padding: 0.25rem 0.6rem; border-radius: 999px; background: white; border: 1px solid var(--border); color: var(--text-muted); }
.zyklus-chip.zyklus-deload { border-color: var(--teal); color: var(--teal); font-weight: 600; }
.zyklus-chip.zyklus-abgelaufen { background: var(--orange); border-color: var(--orange); color: white; font-weight: 600; }

/* Buchungsplattform: Freigeben & Sende-Status am Trainingsplan */
.plattform-bar {
  display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
  margin-top: 0.75rem; padding-top: 0.6rem; border-top: 1px solid var(--border);
}
.plattform-stand { font-size: 0.85rem; color: var(--text-muted); }
.plattform-stand.ist-freigegeben { color: #2a8c5a; font-weight: 600; }
.plattform-btn { font-weight: 600; }
.plattform-hinweise { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.35rem; }
.plattform-hinweise ul { margin: 0.2rem 0 0; padding-left: 1.1rem; }
.plattform-hinweise .plattform-fehler { color: #c0392b; }
.type-rookie     { background: rgba(91,107,168,0.16); color: #4A5A96; }  /* Indigo — verwandt mit Strength (Navy) */

/* Kunden-Spiegel */
.kunde-sync-btn { margin-left: 0.4rem; }
.kunde-sync-hint { font-size: 0.85rem; color: var(--text-muted); margin: 0.3rem 0 0.6rem; }
.kunde-sync-hint.saved { color: #2a8c5a; }
.kunde-sync-hint.error { color: #c0392b; }
.stammdaten { display: grid; grid-template-columns: max-content 1fr; gap: 0.25rem 0.9rem; margin: 0.4rem 0 0; font-size: 0.9rem; }
.stammdaten dt { color: var(--text-muted); }
.stammdaten dd { margin: 0; overflow-wrap: anywhere; }
.kontakt-info { font-size: 0.9rem; color: var(--text-muted); }

/* PT-Termine auf der Buchungsplattform */
.pf-badge { display: inline-block; font-size: 0.72rem; border-radius: 10px; padding: 0.05rem 0.45rem; margin-left: 0.25rem; white-space: nowrap; border: 1px solid var(--border); background: var(--cream); color: var(--text-muted); }
.pf-badge.pf-ok { color: #2a8c5a; border-color: rgba(42,140,90,0.35); background: rgba(42,140,90,0.08); }
.pf-badge.pf-warn { color: #9a5b00; border-color: rgba(232,150,42,0.5); background: rgba(232,150,42,0.12); }
.pf-badge.pf-err { color: #c0392b; border-color: rgba(192,57,43,0.4); background: rgba(192,57,43,0.08); }
.pf-probleme { border: 1px solid rgba(192,57,43,0.35); background: rgba(192,57,43,0.06); border-radius: 8px; padding: 0.55rem 0.8rem; margin-bottom: 0.8rem; font-size: 0.88rem; }
.pf-probleme summary { cursor: pointer; font-weight: 600; color: #c0392b; }
.pf-probleme ul { margin: 0.4rem 0 0; padding-left: 1.1rem; }
.pf-frist { color: #c0392b; font-weight: 600; }
.pf-erklaerung { margin: 0.4rem 0 0; padding-left: 1.1rem; font-size: 0.9rem; line-height: 1.5; }

/* Neukunden an die Plattform (E104) */
.nc-hinweis { font-size: 0.85rem; color: var(--text-muted); line-height: 1.45; margin: 0 0 0.6rem; }
.nk-form { border: 1px solid var(--border); border-radius: 8px; padding: 0.7rem 0.8rem; margin: 0.5rem 0; }
.ns-error.ok { color: #2a8c5a; }


/* Wertung je Workout-Teil (Anpassung 13) */
.wertung-panel { margin: 0.5rem 0; font-size: 0.9rem; }
.wertung-panel summary { cursor: pointer; color: var(--text-muted); }
.wertung-offen { color: #b45309; font-weight: 600; }
.wertung-liste { display: flex; flex-direction: column; gap: 0.35rem; margin-top: 0.4rem; }
.wertung-zeile { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.6rem; }
.wertung-name { flex: 1 1 12rem; min-width: 0; }
.wertung-auto, .wertung-info { color: var(--text-muted); font-size: 0.85em; }
.wertung-select { max-width: 100%; }
