:root {
  --ink: #172436;
  --ink-soft: #24384F;
  --chalk: #F7F4EC;
  --card: #FFFFFF;
  --border: #E4DFD2;
  --court-blue: #2E6E95;
  --court-blue-dark: #1F4F6E;
  --ball-orange: #E2622E;
  --ball-orange-dark: #B94C21;
  --court-wood: #EFE2C8;
  --line-white: #FFFFFF;
  --text-muted: #6B7180;

  /* structural navy — always dark, independent of theme (sidebar / auth screen) */
  --navy: #172436;
  --navy-soft: #24384F;

  /* soft surface tints that need to flip in dark mode */
  --placeholder-bg: #EFE9DA;
  --placeholder-fg: #B7AF9B;
  --chip-blue-bg: #EAF1F6;
  --chip-orange-bg: #F6EEE6;
  --hover-bg: #F1EEE4;
  --disabled-fg: #CBC6B8;
  --danger: #B3261E;
  --overlay: rgba(23,36,54,0.5);
}

:root[data-theme="dark"] {
  --ink: #E7ECF3;
  --chalk: #10151D;
  --card: #1B2330;
  --border: #68727E;
  --text-muted: #94A0B4;

  --court-blue: #5FA1C7;
  --court-blue-dark: #8FC3E3;
  --ball-orange: #E08A5D;
  --ball-orange-dark: #F0AC85;

  --placeholder-bg: #29323F;
  --placeholder-fg: #6B7686;
  --chip-blue-bg: #1E2C3B;
  --chip-orange-bg: #33261D;
  --hover-bg: #232E3D;
  --disabled-fg: #445064;
  --danger: #E5766D;
  --overlay: rgba(0,0,0,0.6);
}

:root[data-theme="dark"] .exercise-card:hover,
:root[data-theme="dark"] .action-card:hover {
  box-shadow: 0 1px 8px rgba(0,0,0,0.4);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--court-blue);
  outline-offset: 2px;
  border-radius: 2px;
}
/* form controls with their own border radius get a tighter, matching ring */
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible {
  outline-offset: 1px;
}
.search-box:focus-within { outline: 2px solid var(--court-blue); outline-offset: 1px; }

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background: var(--chalk);
  color: var(--ink);
}

.icon, .icon-sm {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon { width: 17px; height: 17px; }
.icon-sm { width: 15px; height: 15px; }
.action-icon { width: 20px; height: 20px; stroke: var(--ball-orange); margin-bottom: 10px; }

.app {
  display: flex;
  min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
  background: var(--navy);
  width: 232px;
  min-width: 232px;
  color: #fff;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
}
.brand { display: flex; align-items: center; gap: 8px; padding: 24px 20px 0; }
.brand-mark {
  background: var(--ball-orange);
  width: 32px; height: 32px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 14px;
}
.brand-name {
  font-family: 'Oswald', sans-serif;
  font-size: 18px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-weight: 500;
}
.brand-sub { padding: 4px 20px 20px; font-size: 12px; color: #8C9AAE; }

.nav { flex: 1; padding: 0 12px; display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 6px;
  border: none;
  border-left: 3px solid transparent;
  background: transparent;
  color: #B7C0CE;
  font-size: 14px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.nav-item:hover { background: var(--navy-soft); color: #fff; }
.nav-item.active {
  background: var(--navy-soft);
  color: #fff;
  border-left-color: var(--ball-orange);
}
.sidebar-footer {
  padding: 14px 20px;
  font-size: 12px;
  color: #66738A;
  border-top: 1px solid var(--navy-soft);
  display: flex; flex-direction: column; gap: 8px;
}
#auth-status-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.footer-btns { display: flex; gap: 6px; }
.btn-tiny { padding: 4px 8px; font-size: 11px; flex: 1; justify-content: center; }

.auth-gate {
  display: none;
  position: fixed; inset: 0; z-index: 50;
  background: var(--navy);
  align-items: center; justify-content: center;
}
.auth-gate.active { display: flex; }
.auth-gate { overflow-y: auto; padding: 24px 0; }
.auth-card { margin: auto; flex-shrink: 0; }
.mobile-menu-links { display: grid; gap: 10px; }
.action-card { color: var(--ink); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
.auth-card { background: var(--card); border-radius: 12px; padding: 32px; width: 360px; max-width: 90vw; }
.auth-brand { padding: 0 0 20px; justify-content: center; }
.auth-brand-name { color: var(--ink); }
.auth-tabs { display: flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin-bottom: 18px; }
.auth-tab { flex: 1; padding: 8px; border: none; background: var(--card); color: var(--text-muted); font-family: inherit; font-size: 13px; cursor: pointer; }
.auth-tab.active { background: var(--navy); color: #fff; }
.auth-hint { font-size: 12px; color: var(--text-muted); margin-top: 10px; text-align: center; }

/* MAIN CONTENT */
.content { flex: 1; overflow: auto; }
.view { display: none; padding: 32px; max-width: 1180px; }
.view.active { display: block; }

.page-title { font-family: 'Oswald', sans-serif; font-weight: 500; font-size: 28px; margin: 0 0 4px; }
.page-sub { color: var(--text-muted); margin: 0 0 24px; font-size: 14px; }

.view-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.view-header .page-title { margin-bottom: 4px; }
.view-header .page-sub { margin-bottom: 0; }

/* DASHBOARD */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 36px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.stat-value { font-family: 'Oswald', sans-serif; color: var(--court-blue-dark); font-size: 30px; font-weight: 500; }
.stat-label { color: var(--text-muted); font-size: 12px; margin-top: 4px; }

.action-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.action-card {
  text-align: left;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  cursor: pointer;
  font-family: inherit;
  transition: box-shadow 0.15s ease;
}
.action-card:hover { box-shadow: 0 1px 6px rgba(23,36,54,0.08); }
.action-title { font-weight: 500; margin-bottom: 4px; }
.action-desc { color: var(--text-muted); font-size: 13px; }

/* TOOLBAR / BUTTONS */
.toolbar { display: flex; align-items: center; gap: 8px; row-gap: 10px; flex-wrap: wrap; }
.toolbar-divider { width: 1px; height: 22px; background: var(--border); }
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
}
.btn:hover { background: var(--hover-bg); }
.btn.active-mode { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn-primary { background: var(--court-blue); color: #fff; border-color: var(--court-blue); }
.btn-primary:hover { background: var(--court-blue-dark); }
.btn-block { width: 100%; justify-content: center; margin-top: 14px; }
.btn:disabled { background: #B9C6D2; border-color: #B9C6D2; color: #fff; cursor: not-allowed; }

.color-label, .width-label { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
.color-label input[type="color"] { width: 30px; height: 26px; border: 1px solid var(--border); border-radius: 4px; padding: 0; background: none; }
.width-label input[type="range"] { width: 80px; }

/* TACTICS BOARD */
.board-layout { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.board-canvas-wrap { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--card); line-height: 0; }
#board { display: block; width: 800px; max-width: 100%; height: auto; touch-action: none; cursor: default; }

.board-side { width: 260px; display: flex; flex-direction: column; gap: 16px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.card-title { font-weight: 500; font-size: 14px; margin-bottom: 10px; }
.legend-row { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 6px; }
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; vertical-align: -1px; }
.dot-a { background: var(--court-blue); }
.dot-b { background: var(--ball-orange); }

.card-hint { font-size: 12px; color: var(--text-muted); margin: 0 0 12px; line-height: 1.5; }
.frame-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.frame-chip { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 12px; }
.frame-chip button.link { background: none; border: none; color: var(--court-blue-dark); cursor: pointer; font-size: 12px; padding: 0; font-family: inherit; flex: 1; text-align: left; font-weight: 500; }
.frame-chip button.link:hover { text-decoration: underline; }
.frame-chip .frame-order { display: flex; gap: 2px; }
.frame-chip .frame-order button { background: none; border: none; cursor: pointer; color: var(--ink); padding: 0; }
.frame-chip .frame-order button:disabled { color: var(--disabled-fg); cursor: default; }
.frame-chip .icon-x { background: none; border: none; cursor: pointer; color: var(--text-muted); }
.frame-actions { display: flex; gap: 8px; margin-bottom: 10px; }
.frame-actions #btn-add-frame { flex: 1; justify-content: center; }
.board-side.playing .card, .board-side.playing .btn { opacity: 0.55; pointer-events: none; }

.formations-list { display: flex; flex-direction: column; gap: 8px; }
.formation-row { display: flex; align-items: center; justify-content: space-between; font-size: 13px; gap: 6px; flex-wrap: wrap; }
.formation-row button.link { background: none; border: none; color: var(--court-blue-dark); cursor: pointer; font-size: 13px; padding: 0; font-family: inherit; text-align: left; flex: 1; min-width: 0; }
.formation-row button.link:hover { text-decoration: underline; }
.formation-row button.icon-x, .formation-row button.icon-play, .formation-row button.icon-info { background: none; border: none; cursor: pointer; color: var(--text-muted); display: flex; }
.formation-row button.icon-play svg, .formation-row button.icon-info svg { width: 14px; height: 14px; }
.formation-cat-chip { font-size: 10px; padding: 1px 6px; border-radius: 5px; background: var(--chip-blue-bg); color: var(--court-blue-dark); white-space: nowrap; }

.empty-hint { color: var(--text-muted); font-size: 13px; }

.plan-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.plan-col-title { font-weight: 500; font-size: 14px; margin-bottom: 10px; }
.plan-list { display: flex; flex-direction: column; gap: 10px; }
.plan-card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 14px; }
.plan-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.plan-name { font-weight: 500; }
.plan-date { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.plan-meta { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.plan-items { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.plan-item-row { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.plan-item-row .item-min { margin-left: auto; color: var(--text-muted); font-size: 11px; }

.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-charts { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; margin-bottom: 20px; }
.admin-table th { text-align: left; color: var(--text-muted); font-weight: 500; font-size: 12px; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.admin-table td { padding: 8px; border-bottom: 1px solid var(--border); }

.follow-counts { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }

.author-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.author-avatar { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; background: var(--placeholder-bg); flex-shrink: 0; }
.author-avatar-placeholder {
  width: 26px; height: 26px; border-radius: 50%; background: var(--placeholder-bg); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; color: var(--placeholder-fg);
}
.author-avatar-placeholder svg { width: 14px; height: 14px; }
.author-name { font-size: 12px; color: var(--ink); font-weight: 500; flex: 1; }
.follow-btn { font-size: 11px; padding: 3px 9px; border-radius: 6px; border: 1px solid var(--border); background: var(--card); cursor: pointer; font-family: inherit; }
.follow-btn.following { background: var(--navy); color: #fff; border-color: var(--navy); }

/* LIBRARY */
.filter-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.search-box { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--border); border-radius: 6px; padding: 8px 12px; flex: 1; min-width: 200px; }
.search-box input { border: none; outline: none; font-size: 13px; flex: 1; background: transparent; font-family: inherit; }
.search-box input:focus-visible { outline: none; }
select {
  padding: 8px 10px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--card); font-family: inherit; font-size: 13px; color: var(--ink);
}

.exercise-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.exercise-card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 16px; display: flex; flex-direction: column; cursor: pointer; transition: box-shadow 0.15s ease; }
.exercise-card:hover { box-shadow: 0 1px 6px rgba(23,36,54,0.08); }
.ex-thumb { width: 100%; height: 130px; border-radius: 8px; object-fit: cover; margin-bottom: 12px; background: var(--placeholder-bg); }
.ex-thumb-placeholder {
  width: 100%; height: 130px; border-radius: 8px; margin-bottom: 12px;
  background: var(--placeholder-bg); display: flex; align-items: center; justify-content: center; color: var(--placeholder-fg);
}
.ex-thumb-placeholder svg { width: 28px; height: 28px; }

.image-upload-row { display: flex; align-items: center; gap: 12px; }
.image-preview {
  width: 80px; height: 60px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--placeholder-bg); display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0; color: var(--placeholder-fg);
}
.image-preview img { width: 100%; height: 100%; object-fit: cover; }
.image-upload-actions { display: flex; gap: 8px; }
.image-upload-actions label.btn { margin: 0; }

.thumb-sm { width: 34px; height: 34px; border-radius: 6px; object-fit: cover; flex-shrink: 0; background: var(--placeholder-bg); }
.thumb-sm-placeholder {
  width: 34px; height: 34px; border-radius: 6px; flex-shrink: 0; background: var(--placeholder-bg);
  display: flex; align-items: center; justify-content: center; color: var(--placeholder-fg);
}
.thumb-sm-placeholder svg { width: 16px; height: 16px; }

.tag-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.tag { font-size: 11px; padding: 2px 8px; border-radius: 5px; }
.tag-category { background: var(--chip-blue-bg); color: var(--court-blue-dark); }
.tag-level { background: var(--chip-orange-bg); color: var(--ball-orange-dark); }
.tag-duration { margin-left: auto; font-size: 11px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
.ex-title { font-weight: 500; margin-bottom: 6px; }
.ex-desc { color: var(--text-muted); font-size: 13px; flex: 1; margin-bottom: 10px; }
.ex-author { font-size: 11px; color: var(--text-muted); margin-bottom: 10px; }
.ex-footer { display: flex; align-items: center; justify-content: space-between; }
.ex-social { display: flex; align-items: center; gap: 12px; }
.like-btn, .save-btn, .delete-btn { background: none; border: none; display: flex; align-items: center; gap: 4px; font-size: 13px; cursor: pointer; color: var(--text-muted); font-family: inherit; }
.like-btn svg, .save-btn svg, .delete-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.delete-btn:hover { color: var(--danger); }
.like-btn.liked { color: var(--ball-orange-dark); }
.like-btn.liked svg { fill: var(--ball-orange); }
.save-btn.saved { color: var(--court-blue); }
.save-btn.saved svg { fill: var(--court-blue); }
.add-session-btn { display: flex; align-items: center; gap: 4px; font-size: 12px; padding: 6px 10px; border-radius: 6px; border: 1px solid var(--border); background: var(--card); cursor: pointer; font-family: inherit; }

/* SESSIONS */
.sessions-layout { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; align-items: start; }
.draft-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.draft-header input { flex: 1; padding: 8px 12px; border-radius: 6px; border: 1px solid var(--border); font-family: inherit; font-size: 13px; }
.draft-header input[type="date"] { flex: 0 0 150px; }
.duration-badge { font-size: 13px; color: var(--text-muted); white-space: nowrap; }
.draft-list { display: flex; flex-direction: column; gap: 8px; }
.draft-item { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--border); border-radius: 8px; }
.draft-item .order-btns { display: flex; flex-direction: column; }
.draft-item .order-btns button { background: none; border: none; cursor: pointer; color: var(--ink); padding: 0; }
.draft-item .order-btns button:disabled { color: var(--disabled-fg); cursor: default; }
.draft-item .item-main { flex: 1; }
.draft-item .item-title { font-size: 13px; font-weight: 500; }
.draft-item .item-cat { font-size: 11px; color: var(--text-muted); }
.draft-item input[type="number"] { width: 54px; padding: 4px 6px; text-align: center; border-radius: 6px; border: 1px solid var(--border); font-family: inherit; }
.draft-item .item-min { font-size: 11px; color: var(--text-muted); }
.draft-item .remove-btn { background: none; border: none; cursor: pointer; color: var(--text-muted); }

.picker-title { font-weight: 500; font-size: 14px; margin: 20px 0 10px; }
.picker-list { display: flex; flex-direction: column; gap: 8px; max-height: 300px; overflow: auto; padding-right: 4px; }
.picker-item { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--card); cursor: pointer; font-size: 13px; font-family: inherit; }
.picker-item:hover { background: var(--hover-bg); }

.sessions-list { display: flex; flex-direction: column; gap: 10px; }
.session-card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 14px; cursor: pointer; }
.session-top { display: flex; align-items: center; justify-content: space-between; }
.session-name { font-weight: 500; }
.session-date { font-size: 11px; color: var(--text-muted); }
.session-meta { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.session-items { margin-top: 10px; display: flex; flex-direction: column; gap: 5px; }
.session-item-row { display: flex; align-items: center; justify-content: space-between; font-size: 13px; }

/* MODALS */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: var(--overlay);
  align-items: center; justify-content: center;
  z-index: 20;
}
.modal-overlay.active { display: flex; }
.modal { background: var(--card); border-radius: 10px; padding: 24px; width: 440px; max-width: 90vw; }
.modal-sm { width: 340px; }
.modal-detail { width: 560px; max-width: 92vw; }
.detail-visual { margin-bottom: 14px; }
.detail-visual img { display: block; width: 100%; max-height: 420px; object-fit: contain; background: var(--placeholder-bg); border-radius: 8px; }
.detail-visual .detail-placeholder {
  width: 100%; height: 220px; border-radius: 8px; background: var(--placeholder-bg);
  display: flex; align-items: center; justify-content: center; color: var(--placeholder-fg);
}
.detail-visual .detail-placeholder svg { width: 32px; height: 32px; }
.detail-canvas-wrap { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; line-height: 0; background: var(--card); }
.detail-canvas-wrap canvas { display: block; width: 100%; height: auto; }
.detail-play-row { display: flex; justify-content: center; margin-top: 10px; }
.detail-description { color: var(--ink); font-size: 14px; line-height: 1.6; margin: 0 0 10px; white-space: pre-wrap; }
.detail-author { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-title { font-weight: 500; }
.icon-btn { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text-muted); line-height: 1; }
.form-row { margin-bottom: 12px; display: flex; flex-direction: column; gap: 4px; }
.form-row label { font-size: 12px; color: var(--text-muted); }
.form-row input, .form-row select, .form-row textarea {
  width: 100%; padding: 8px 10px; border-radius: 6px; border: 1px solid var(--border); font-family: inherit; font-size: 13px;
}
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 0.8fr; gap: 10px; }
.form-row-3 > div { min-width: 0; }
.form-error { color: var(--danger); font-size: 12px; min-height: 16px; margin-bottom: 4px; }
.checkbox-label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink); cursor: pointer; }
.checkbox-label input { width: auto; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }

/* THEME TOGGLE */
.btn-theme { width: 100%; justify-content: center; background: var(--navy-soft); color: #fff; border-color: var(--navy-soft); }
.btn-theme:hover { background: #2E4560; }

/* LINK-STYLE BUTTONS (profile follow counts, etc.) */
.link-btn { background: none; border: none; padding: 0; font-family: inherit; font-size: 12px; color: var(--court-blue-dark); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.follow-counts { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.follow-counts-sep { color: var(--text-muted); font-size: 12px; }

/* SAMMLUNGEN (collections) */
.collections-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.collection-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 20px 16px; text-align: left; cursor: pointer; font-family: inherit;
  display: flex; flex-direction: column; gap: 6px; transition: box-shadow 0.15s ease;
}
.collection-card:hover { box-shadow: 0 1px 6px rgba(23,36,54,0.08); }
.collection-card-icon { color: var(--court-blue); }
.collection-card-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.collection-card-name { font-weight: 500; }
.collection-card-count { font-size: 12px; color: var(--text-muted); }

.collection-picker-list { display: flex; flex-direction: column; gap: 4px; max-height: 260px; overflow: auto; }
.collection-pick-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-radius: 8px; cursor: pointer; font-size: 13px;
}
.collection-pick-row:hover { background: var(--hover-bg); }
.collection-pick-row input { width: auto; margin: 0; }
.collection-pick-name { flex: 1; }
.collection-pick-count { font-size: 11px; color: var(--text-muted); }

/* FOLLOW LIST MODAL */
.follow-list-items { display: flex; flex-direction: column; gap: 10px; max-height: 340px; overflow: auto; margin-top: 12px; }
.follow-list-row { display: flex; align-items: center; gap: 10px; }
.follow-list-row .author-name { flex: 1; font-size: 13px; }

/* ADMIN */
.admin-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.admin-tab {
  background: none; border: none; font-family: inherit; font-size: 13px; color: var(--text-muted);
  padding: 8px 4px; margin-right: 14px; cursor: pointer; border-bottom: 2px solid transparent;
}
.admin-tab:hover { color: var(--ink); }
.admin-tab.active { color: var(--ink); font-weight: 500; border-bottom-color: var(--ball-orange); }
.admin-panel { display: none; }
.admin-panel.active { display: block; }
.stat-grid-admin { grid-template-columns: repeat(3, 1fr); margin-bottom: 24px; }

.storage-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.storage-tile { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--card); display: flex; flex-direction: column; }
.storage-tile img { width: 100%; height: 100px; object-fit: cover; background: var(--placeholder-bg); }
.storage-tile-meta { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; font-size: 11px; color: var(--text-muted); }
.storage-tile-delete { width: calc(100% - 16px); margin: 0 8px 8px; justify-content: center; font-size: 12px; padding: 6px; }
.storage-tile-delete:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

@media (max-width: 900px) {
  .action-grid, .exercise-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .sessions-layout { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .app { flex-direction: column; }
  .collections-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-grid-admin { grid-template-columns: repeat(2, 1fr); }
}

.bottom-nav { display: none; }

@media (max-width: 680px) {
  .sidebar { display: none; }

  .bottom-nav {
    display: flex;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 40;
    background: var(--navy);
    border-top: 1px solid var(--navy-soft);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  .bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 58px;
    background: none;
    border: none;
    color: #9AA6B8;
    font-family: inherit;
    font-size: 10px;
    cursor: pointer;
  }
  .bottom-nav-item .icon { width: 20px; height: 20px; }
  .bottom-nav-item.active { color: #fff; }

  .content { padding-bottom: 72px; }
}

/* ---------- Toast notifications ---------- */
.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 320px;
}
.toast {
  background: var(--ink);
  color: #fff;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.4;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  display: flex;
  align-items: flex-start;
  gap: 8px;
  animation: toast-in 0.15s ease-out;
}
.toast.toast-error { border-left: 3px solid var(--danger, #E5766D); }
.toast.toast-success { border-left: 3px solid #4CAF7D; }
.toast.toast-fading { opacity: 0; transition: opacity 0.25s ease; }
.toast-close { background: none; border: none; color: #ffffffaa; cursor: pointer; padding: 0; margin-left: auto; font-size: 15px; line-height: 1; }
.toast-close:hover { color: #fff; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 680px) {
  .toast-container { left: 12px; right: 12px; top: auto; bottom: 84px; max-width: none; }
}

/* ---------- Trainingseinheiten: erweiterte Detailfelder ---------- */
.session-details-toggle { display: inline-block; font-size: 12px; color: var(--court-blue); margin: 2px 0 10px; }
.session-details-fields { border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin-bottom: 14px; background: var(--chalk); }
.session-details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin-bottom: 10px; }
.session-details-grid .form-row { margin-bottom: 0; }
.session-meta-row { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.session-meta-row span { white-space: nowrap; }
.session-notes { font-size: 12px; color: var(--text-muted); margin-top: 6px; font-style: italic; }

@media (max-width: 680px) {
  .session-details-grid { grid-template-columns: 1fr; }
}

/* ---------- Nächstes Training (Dashboard + Trainingsplan) ---------- */
.next-session-card {
  background: linear-gradient(135deg, var(--court-blue) 0%, var(--court-blue-dark) 100%);
  color: #fff;
  border-radius: 12px;
  padding: 20px 22px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.next-session-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.85; margin-bottom: 4px; }
.next-session-name { font-family: 'Oswald', sans-serif; font-size: 22px; font-weight: 500; margin-bottom: 6px; }
.next-session-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; opacity: 0.95; }
.next-session-empty {
  background: var(--card); border: 1px dashed var(--border); border-radius: 12px;
  padding: 18px 22px; margin-bottom: 20px; color: var(--text-muted); font-size: 13px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.next-session-cta { background: rgba(255,255,255,0.18); border: 1px solid rgba(255,255,255,0.4); color: #fff; padding: 8px 14px; border-radius: 6px; font-size: 13px; font-family: inherit; cursor: pointer; white-space: nowrap; }
.next-session-cta:hover { background: rgba(255,255,255,0.28); }

.week-overview { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-bottom: 24px; }
.week-day {
  border: 1px solid var(--border); border-radius: 8px; padding: 10px 6px;
  text-align: center; background: var(--card); min-height: 64px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
}
.week-day-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; }
.week-day-num { font-size: 14px; font-weight: 500; color: var(--ink); }
.week-day.has-session { background: var(--chip-blue-bg); border-color: var(--court-blue); }
.week-day.is-today .week-day-num { color: var(--court-blue-dark); font-weight: 700; }
.week-day-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--court-blue); }

@media (max-width: 680px) {
  .week-overview { grid-template-columns: repeat(7, 1fr); gap: 4px; }
  .week-day { padding: 6px 2px; min-height: 52px; }
  .next-session-card { flex-direction: column; align-items: flex-start; }
}

.rotate-buttons { display: flex; gap: 8px; }
.rotate-buttons .btn { flex: 1; justify-content: center; }
#player-color-reset { display: block; margin: -4px 0 14px; font-size: 12px; }

.toast-action {
  background: rgba(255,255,255,0.18); border: 1px solid rgba(255,255,255,0.4); color: #fff;
  padding: 4px 10px; border-radius: 5px; font-size: 12px; font-family: inherit; cursor: pointer; white-space: nowrap;
}
.toast-action:hover { background: rgba(255,255,255,0.3); }

/* ---------- Workflow-Kette auf dem Dashboard ---------- */
.workflow-guide { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; margin-bottom: 20px; }
.workflow-title { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 12px; }
.workflow-chain { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.workflow-step {
  display: flex; align-items: center; gap: 8px;
  background: none; border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 12px; font-family: inherit; font-size: 12px; color: var(--ink); cursor: pointer;
}
.workflow-step:hover { background: var(--chip-blue-bg); border-color: var(--court-blue); }
.workflow-step-num {
  width: 18px; height: 18px; border-radius: 50%; background: var(--court-blue); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 600; flex-shrink: 0;
}
.workflow-arrow { color: var(--text-muted); font-size: 13px; }

@media (max-width: 680px) {
  .workflow-chain { flex-direction: column; align-items: stretch; }
  .workflow-step { justify-content: flex-start; }
  .workflow-arrow { transform: rotate(90deg); align-self: center; }
}

.collection-card-actions { display: flex; gap: 6px; }
.collection-card-actions .btn { font-size: 12px; padding: 6px 10px; }

/* ---------- Öffentliches Coach-Profil ---------- */
.coach-header { display: flex; align-items: center; gap: 14px; padding-bottom: 14px; margin-bottom: 8px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.coach-avatar { width: 64px; height: 64px; border-radius: 50%; background: var(--placeholder-bg); overflow: hidden; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: var(--text-muted); }
.coach-avatar img { width: 100%; height: 100%; object-fit: cover; }
.coach-avatar svg { width: 28px; height: 28px; }
.coach-info { flex: 1; min-width: 0; }
.coach-name { font-family: 'Oswald', sans-serif; font-size: 20px; font-weight: 500; }
.coach-club { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.coach-stats { display: flex; gap: 14px; font-size: 12px; color: var(--text-muted); }
.coach-stats .link-btn { color: var(--court-blue); font-size: 12px; }
.coach-exercise-list { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow: auto; }
.coach-exercise-row { display: flex; align-items: center; gap: 10px; padding: 8px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; background: var(--card); text-align: left; font-family: inherit; width: 100%; }
.coach-exercise-row:hover { background: var(--chip-blue-bg); }
.coach-exercise-row .cx-title { flex: 1; font-size: 13px; min-width: 0; }
.coach-exercise-row .cx-meta { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.author-name.clickable { cursor: pointer; text-decoration: underline; text-decoration-color: transparent; }
.author-name.clickable:hover { text-decoration-color: currentColor; }
.ex-author.clickable { cursor: pointer; }
.ex-author.clickable:hover { text-decoration: underline; }

.discover-tabs { margin-bottom: 16px; }

/* ---------- Admin: Benutzer / Übungen / Meldungen ---------- */
.badge-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--danger, #E5766D); color: #fff; font-size: 10px; font-weight: 600; margin-left: 4px;
}
.admin-table .role-badge { font-size: 10px; padding: 2px 6px; border-radius: 5px; background: var(--chip-blue-bg); color: var(--court-blue-dark); }
.admin-table .status-badge-ok { font-size: 10px; padding: 2px 6px; border-radius: 5px; background: #1E3A2A; color: #6FCF97; }
.admin-table .status-badge-banned { font-size: 10px; padding: 2px 6px; border-radius: 5px; background: #3A1E22; color: #E5766D; }
.admin-table .btn { font-size: 11px; padding: 4px 8px; margin-right: 4px; }
.admin-reports-list { display: flex; flex-direction: column; gap: 10px; }
.report-row { border: 1px solid var(--border); border-radius: 8px; padding: 12px; }
.report-top { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 4px; font-size: 13px; }
.report-reason { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.report-actions { display: flex; gap: 6px; }
.report-status { font-size: 10px; padding: 2px 6px; border-radius: 5px; }
.report-status.open { background: #3A2E1E; color: #E8A94A; }
.report-status.resolved { background: #1E3A2A; color: #6FCF97; }
.report-status.dismissed { background: var(--chip-blue-bg); color: var(--text-muted); }

.report-category-chip { display: inline-block; font-size: 10px; padding: 2px 7px; border-radius: 5px; background: var(--chip-orange-bg); color: var(--ball-orange-dark); margin-bottom: 6px; }

/* ---------- Teams ---------- */
.teams-list { display: flex; flex-direction: column; gap: 10px; }
.team-card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.team-card:hover { background: var(--chip-blue-bg); }
.team-card-name { font-weight: 500; }
.team-card-meta { font-size: 12px; color: var(--text-muted); }
.team-owner-chip { font-size: 10px; padding: 2px 7px; border-radius: 5px; background: var(--chip-blue-bg); color: var(--court-blue-dark); }

.team-members-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; max-height: 260px; overflow: auto; }
.team-member-row { display: flex; align-items: center; gap: 10px; padding: 8px; border: 1px solid var(--border); border-radius: 8px; }
.team-member-name { flex: 1; font-size: 13px; }
.team-member-role { font-size: 11px; color: var(--text-muted); }
.team-add-member-row { position: relative; }
.team-add-member-row input { width: 100%; padding: 8px 10px; border-radius: 6px; border: 1px solid var(--border); font-family: inherit; font-size: 13px; }
.team-member-suggestions { position: absolute; top: 100%; left: 0; right: 0; background: var(--card); border: 1px solid var(--border); border-radius: 8px; margin-top: 4px; max-height: 180px; overflow: auto; z-index: 5; }
.team-member-suggestions button { display: block; width: 100%; text-align: left; padding: 8px 10px; background: none; border: none; font-family: inherit; font-size: 13px; cursor: pointer; }
.team-member-suggestions button:hover { background: var(--chip-blue-bg); }
