/* OTI Mentoring Portal. CI: Lato 800 für Überschriften, Lato 300 für Fließtext,
   Primär #297248, Button #F7E42C, Sekundär #F0F1F3, Schrift auf Grün weiß. */
:root {
  --green: #297248;
  --green-deep: #1d5535;
  --green-soft: #e3efe8;
  --yellow: #f7e42c;
  --yellow-deep: #e6d20f;
  --bg: #f0f1f3;
  --card: #ffffff;
  --ink: #16211b;
  --muted: #5b6962;
  --line: #dde2df;
  --red: #c8412e;
  --red-soft: #fbe9e6;
  --amber-soft: #fff7cf;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(22, 33, 27, .06), 0 4px 16px rgba(22, 33, 27, .06);
  --font: 'Lato', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-weight: 400; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-weight: 800; letter-spacing: -.01em; margin: 0; }
p { line-height: 1.55; }
a { color: var(--green); }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 16px; color: var(--ink); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- Kopfzeile ---------- */
.top { background: var(--green); color: #fff; display: flex; align-items: center; gap: 12px; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); position: sticky; top: 0; z-index: 20; }
.top img.logo { height: 30px; display: block; }
.top .hello { margin-left: auto; font-weight: 300; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .hello b { font-weight: 800; }

/* ---------- Grundlayout Mitglied ---------- */
.shell { display: flex; flex-direction: column; min-height: 100%; }
.main { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 16px 16px 96px; }
.nav { position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--line); display: flex; z-index: 30; padding-bottom: env(safe-area-inset-bottom); }
.nav button { flex: 1; background: none; border: 0; padding: 9px 4px 10px; display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--muted); font-size: 12px; font-weight: 700; }
.nav button svg { width: 24px; height: 24px; }
.nav button.on { color: var(--green); }
.nav button .dot { position: absolute; margin-left: 18px; margin-top: -2px; width: 9px; height: 9px; border-radius: 50%; background: var(--red); }
.page-title { font-size: 26px; margin: 4px 0 4px; }
.page-sub { margin: 0 0 16px; color: var(--muted); font-weight: 300; }

@media (min-width: 900px) {
  .shell { flex-direction: row; }
  .top { display: none; }
  .nav { position: sticky; top: 0; height: 100vh; width: 240px; flex-direction: column; border-top: 0; border-right: 1px solid var(--line); padding: 20px 12px; background: var(--green); gap: 4px; }
  .nav .brand { display: block !important; padding: 4px 8px 20px; }
  .nav .brand img { width: 180px; }
  .nav .brand .who { color: #fff; font-weight: 300; margin-top: 14px; font-size: 15px; }
  .nav .brand .who b { font-weight: 800; }
  .nav button { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; font-size: 15px; padding: 11px 12px; border-radius: 10px; color: rgba(255, 255, 255, .82); }
  .nav button.on { background: rgba(255, 255, 255, .14); color: #fff; }
  .nav button .dot { position: static; margin: 0 0 0 auto; }
  .main { padding: 32px 36px 48px; }
  .page-title { font-size: 32px; }
}
.nav .brand { display: none; }

/* ---------- Karten, Knöpfe ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.btn { border: 0; border-radius: 999px; padding: 12px 20px; font-weight: 800; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn-yellow { background: var(--yellow); color: var(--ink); }
.btn-yellow:hover { background: var(--yellow-deep); }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: var(--green-deep); }
.btn-ghost { background: transparent; color: var(--green); border: 1.5px solid var(--green); }
.btn-small { padding: 7px 13px; font-size: 13px; }
.btn[disabled] { opacity: .55; cursor: default; }
.chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--green-soft); color: var(--green-deep); }
.chip.gray { background: #eceeed; color: var(--muted); }
.chip.yellow { background: var(--amber-soft); color: #6b5c00; }
.chip.red { background: var(--red-soft); color: var(--red); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.filter { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px; }
.filter button { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 14px; font-weight: 700; font-size: 14px; color: var(--muted); white-space: nowrap; }
.filter button.on { border-color: var(--green); background: var(--green); color: #fff; }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty h3 { color: var(--ink); margin-bottom: 6px; }
.banner { background: var(--amber-soft); border-radius: 12px; padding: 12px 14px; font-size: 14px; margin-bottom: 14px; display: flex; gap: 10px; align-items: flex-start; }
.banner button { margin-left: auto; background: none; border: 0; font-size: 18px; color: var(--muted); }
.loading { padding: 40px; text-align: center; color: var(--muted); }

/* ---------- Chat ---------- */
.chat { display: flex; flex-direction: column; gap: 10px; padding-bottom: 8px; }
.day { text-align: center; font-size: 12px; color: var(--muted); font-weight: 700; margin: 10px 0 2px; }
.bubble { max-width: 82%; padding: 10px 13px; border-radius: 16px; line-height: 1.45; font-size: 15.5px; white-space: pre-wrap; word-wrap: break-word; box-shadow: 0 1px 1px rgba(0, 0, 0, .04); }
.bubble .meta { display: block; font-size: 11.5px; color: var(--muted); margin-top: 5px; white-space: nowrap; }
.bubble.me { align-self: flex-end; background: var(--green); color: #fff; border-bottom-right-radius: 5px; }
.bubble.me .meta { color: rgba(255, 255, 255, .75); }
.bubble.them { align-self: flex-start; background: #fff; border-bottom-left-radius: 5px; }
.bubble .author { display: block; font-weight: 800; font-size: 12.5px; color: var(--green); margin-bottom: 2px; }
.bubble.note { align-self: stretch; max-width: 100%; background: var(--amber-soft); border: 1px dashed #d8c24a; }
.bubble.note .author { color: #6b5c00; }
.bubble.marker { align-self: center; background: none; box-shadow: none; font-size: 12.5px; color: var(--muted); padding: 2px; }
.media { margin: 2px 0 6px; border-radius: 12px; overflow: hidden; background: #0e1511; position: relative; aspect-ratio: 16 / 10; width: 280px; max-width: 100%; }
.media img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: .9; }
.media iframe { width: 100%; height: 100%; border: 0; display: block; }
.media .play { position: absolute; inset: 0; margin: auto; width: 56px; height: 56px; border-radius: 50%; background: var(--yellow); border: 0; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 14px rgba(0, 0, 0, .3); }
.media .fname { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 10px 7px; background: linear-gradient(transparent, rgba(0, 0, 0, .7)); color: #fff; font-size: 12px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pending { align-self: flex-end; width: 260px; background: #fff; border-radius: 14px; padding: 12px; box-shadow: var(--shadow); font-size: 14px; }
.bar { height: 7px; border-radius: 99px; background: var(--line); overflow: hidden; margin-top: 8px; }
.bar i { display: block; height: 100%; width: 0; background: var(--green); transition: width .2s; }

.composer { position: sticky; bottom: 72px; background: var(--bg); padding: 10px 0 6px; }
.composer .row { display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { flex: 1; resize: none; border: 1.5px solid var(--line); border-radius: 22px; padding: 11px 16px; min-height: 46px; max-height: 160px; background: #fff; line-height: 1.35; }
.composer textarea:focus { outline: none; border-color: var(--green); }
.round { width: 46px; height: 46px; border-radius: 50%; border: 0; display: flex; align-items: center; justify-content: center; flex: none; }
.round.send { background: var(--green); color: #fff; }
.video-cta { width: 100%; margin-bottom: 10px; padding: 16px; font-size: 17px; border-radius: 16px; box-shadow: 0 2px 10px rgba(247, 228, 44, .45); }
.chat-locked { text-align: center; }
@media (min-width: 900px) { .composer { bottom: 0; } }

/* ---------- Your Game ---------- */
.analysis { margin-bottom: 16px; }
.analysis h3 { font-size: 19px; margin: 8px 0 4px; }
.analysis .media { width: 100%; max-width: 640px; }
.analysis .notes { white-space: pre-wrap; font-weight: 300; font-size: 15.5px; }
.recs { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.recs h4 { margin: 0 0 8px; font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--green); }

/* ---------- Kurse ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.course { cursor: pointer; display: flex; flex-direction: column; gap: 8px; border: 0; text-align: left; font: inherit; color: inherit; }
.course h3 { font-size: 18px; }
.course .chip { align-self: flex-start; }
.course .desc { font-weight: 300; font-size: 14.5px; color: var(--muted); margin: 0; }
.lesson-list { display: flex; flex-direction: column; gap: 8px; }
.lesson { display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 12px; padding: 10px 12px; box-shadow: var(--shadow); cursor: pointer; border: 0; text-align: left; font: inherit; color: inherit; width: 100%; }
.lesson .thumb { width: 96px; aspect-ratio: 16 / 9; border-radius: 8px; background: #0e1511 center / cover; flex: none; position: relative; }
.lesson .t { font-weight: 700; font-size: 15px; line-height: 1.3; }
.back { background: none; border: 0; color: var(--green); font-weight: 800; font-size: 15px; padding: 0; margin-bottom: 12px; }
.player { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #000; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.lesson-body { font-weight: 300; font-size: 16px; }
.player.dyn { aspect-ratio: auto; background: none; overflow: visible; }
.search { width: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; background: #fff; }
.search:focus { outline: none; border-color: var(--green); }
.section-title { font-size: 15px; text-transform: uppercase; letter-spacing: .05em; color: var(--green); margin: 22px 0 10px; }
.lesson-body h1, .lesson-body h2, .lesson-body h3 { margin: 18px 0 8px; font-size: 19px; }
.lesson-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; }

/* ---------- Events ---------- */
.event { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.event img { width: 100%; aspect-ratio: 16 / 8; object-fit: cover; display: block; }
.event .in { padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.event h3 { font-size: 20px; }
.event .facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; font-size: 14.5px; }
.event .facts b { color: var(--green); }
.event p { margin: 0; font-weight: 300; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; background: rgba(10, 20, 14, .55); z-index: 100; display: flex; align-items: flex-end; justify-content: center; }
.modal .sheet { background: #fff; width: 100%; max-width: 640px; max-height: 92vh; overflow: auto; border-radius: 18px 18px 0 0; padding: 18px; }
@media (min-width: 700px) { .modal { align-items: center; } .modal .sheet { border-radius: 18px; } }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.field input, .field select, .field textarea { border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; }
.field textarea { min-height: 90px; resize: vertical; }

/* ---------- Coach-Portal ---------- */
body.coach { height: 100vh; overflow: hidden; }
body.coach .top { position: static; display: flex; height: 52px; padding-top: 10px; }
.ctabs { display: flex; gap: 4px; margin-left: 18px; }
.ctabs button { background: none; border: 0; color: rgba(255, 255, 255, .8); font-weight: 800; font-size: 15px; padding: 8px 12px; border-radius: 8px; }
.ctabs button.on { background: rgba(255, 255, 255, .16); color: #fff; }
.capp { display: grid; grid-template-columns: 340px 1fr 330px; height: calc(100vh - 52px); }
.pane { overflow: auto; min-height: 0; }
.list-pane { background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.list-head { padding: 12px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; position: sticky; top: 0; background: #fff; z-index: 2; }
.list-head select, .list-head input { border: 1.5px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 14px; width: 100%; background: #fff; }
.list-head .filter { margin: 0; }
.list-head .filter { gap: 5px; }
.list-head .filter button { padding: 5px 9px; font-size: 12.5px; }
.mrow { display: flex; gap: 10px; padding: 11px 12px; border-bottom: 1px solid #eef1ef; cursor: pointer; align-items: flex-start; }
.mrow:hover { background: #f7f9f8; }
.mrow.on { background: var(--green-soft); }
.mrow .av { width: 36px; height: 36px; border-radius: 50%; background: var(--green); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; flex: none; }
.mrow .nm { font-weight: 800; font-size: 14.5px; }
.mrow .sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.mrow .tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 5px; }
.mrow .tags .chip { font-size: 11px; padding: 2px 8px; }
.mrow .wait { margin-left: auto; font-size: 12px; font-weight: 800; color: var(--muted); white-space: nowrap; }
.mrow .wait.alt { color: var(--red); }
.thread-pane { display: flex; flex-direction: column; background: var(--bg); }
.thread-head { background: #fff; border-bottom: 1px solid var(--line); padding: 10px 16px; display: flex; align-items: center; gap: 10px; }
.thread-head h2 { font-size: 18px; }
.thread-body { flex: 1; overflow: auto; padding: 16px; }
.thread-foot { background: #fff; border-top: 1px solid var(--line); padding: 10px 14px 12px; }
.modes { display: flex; gap: 6px; margin-bottom: 8px; align-items: center; }
.modes button { border: 0; background: #eef1ef; border-radius: 8px; padding: 6px 12px; font-weight: 800; font-size: 13px; color: var(--muted); }
.modes button.on { background: var(--green); color: #fff; }
.modes button.on.note { background: #e3c831; color: var(--ink); }
.thread-foot textarea { width: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; min-height: 84px; resize: vertical; }
.thread-foot.note textarea { background: var(--amber-soft); border-color: #e3c831; }
.foot-row { display: flex; gap: 8px; margin-top: 8px; align-items: center; flex-wrap: wrap; }
.info-pane { background: #fff; border-left: 1px solid var(--line); padding: 16px; }
.info-pane h3 { font-size: 20px; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 7px 10px; font-size: 14px; margin: 14px 0; }
.kv b { color: var(--muted); font-weight: 700; }
.kv select { border: 1.5px solid var(--line); border-radius: 8px; padding: 5px 8px; font-size: 14px; width: 100%; }
.info-pane .actions { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.coachpick { display: flex; flex-wrap: wrap; gap: 5px; }
.coachpick button { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; font-size: 12px; font-weight: 700; padding: 3px 9px; color: var(--muted); }
.coachpick button.on { background: var(--green); border-color: var(--green); color: #fff; }
.notes-box { font-size: 13.5px; color: var(--muted); white-space: pre-wrap; background: #f7f9f8; border-radius: 10px; padding: 10px; }
.mini-an { border-top: 1px solid var(--line); padding: 8px 0; font-size: 14px; }
.placeholder { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--muted); text-align: center; padding: 30px; }
.checkins { padding: 20px; overflow: auto; height: calc(100vh - 52px); }
.checkins table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); font-size: 14px; }
.checkins th, .checkins td { text-align: left; padding: 10px 12px; border-bottom: 1px solid #eef1ef; }
.checkins th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: #f7f9f8; }
.pick-list { max-height: 260px; overflow: auto; border: 1.5px solid var(--line); border-radius: 10px; }
.pick-list label { display: flex; gap: 8px; align-items: flex-start; padding: 7px 10px; border-bottom: 1px solid #eef1ef; font-size: 14px; cursor: pointer; }
.pick-list label small { color: var(--muted); }
.mob-only { display: none !important; }
.info-btn { display: none !important; }
html:has(body.coach) { overflow: hidden; }
@media (max-width: 1100px) { .capp { grid-template-columns: 300px 1fr; } .info-pane { display: none; } .capp.info .info-pane { display: block; position: fixed; right: 0; top: 52px; bottom: 0; width: 340px; z-index: 40; box-shadow: -8px 0 30px rgba(0, 0, 0, .15); } .info-btn { display: inline-flex !important; } }
@media (max-width: 760px) {
  .ctabs { margin-left: auto; }
  .top .hello.coachname { display: none; }
  .capp { grid-template-columns: 1fr; }
  .capp .thread-pane { display: none; }
  .capp.thread .list-pane { display: none; }
  .capp.thread .thread-pane { display: flex; }
  .capp.info .info-pane { width: 100%; }
  .mob-only { display: inline-flex !important; }
}
