/* ── CrossFit Link — Coach Dashboard ── */

:root {
  --red:     #E8302A;
  --red-h:   #c9201a;
  --bg:      #111111;
  --bg2:     #181818;
  --bg3:     #1e1e1e;
  --cream:   #F7F3EE;
  --warm:    #EFEBE4;
  --border:  rgba(247,243,238,.08);
  --border2: rgba(247,243,238,.15);
  --muted:   rgba(247,243,238,.48);
  --text-secondary: rgba(247,243,238,.85);
  --dim:     rgba(247,243,238,.28);
  --nav-h:   58px;

  /* Aliases used by newer components (admin, tasks, FAQ, etc.) */
  --surface:   #181818;
  --surface-2: #1e1e1e;
  --card:      #181818;
  --text:      #F7F3EE;
  --accent:    #E8302A;
  --surface-hover: rgba(247,243,238,.04);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--cream);
  font-family: 'Instrument Sans', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

/* ─── NAV ────────────────────────────────────────────────────────────────── */

.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  background: rgba(17,17,17,.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1400px; margin: 0 auto;
  height: 100%; padding: 0 24px;
  display: flex; align-items: center; gap: 32px;
}
.nav-logo {
  display: flex; align-items: center; gap: 8px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px; letter-spacing: 2px;
  flex-shrink: 0;
}
.nav-logo-dot {
  width: 8px; height: 8px;
  background: var(--red); border-radius: 50%;
}
.nav-logo-accent { color: var(--red); }

.nav-links {
  display: flex; align-items: center; gap: 4px;
  flex: 1;
}
.nav-link {
  padding: 6px 12px;
  font-size: 11px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--muted); border-radius: 4px;
  transition: all .2s;
}
.nav-link:hover { color: var(--cream); background: var(--bg3); }
.nav-link.active { color: var(--cream); }
.nav-link-admin { color: var(--red) !important; opacity: .7; }
.nav-link-admin:hover, .nav-link-admin.active { opacity: 1; }

.nav-user {
  display: flex; align-items: center; gap: 12px;
  flex-shrink: 0;
}
.nav-user-name {
  font-size: 12px; font-weight: 600;
  color: var(--muted); text-transform: uppercase; letter-spacing: 1px;
}
.nav-logout {
  font-size: 11px; color: var(--dim);
  padding: 4px 10px; border: 1px solid var(--border);
  border-radius: 3px; transition: all .2s;
}
.nav-logout:hover { color: var(--cream); border-color: var(--border2); }

.nav-mobile-toggle {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 4px;
}
.nav-mobile-toggle span {
  width: 22px; height: 2px; background: var(--cream); border-radius: 1px;
}
.nav-mobile-menu {
  display: none; flex-direction: column;
  background: var(--bg2); border-top: 1px solid var(--border);
  padding: 8px 0;
}
.nav-mobile-menu.open { display: flex; }
.nav-mobile-link {
  padding: 12px 24px; font-size: 13px; font-weight: 600;
  letter-spacing: 1px; text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}

/* ─── MAIN ──────────────────────────────────────────────────────────────── */

.main {
  padding-top: var(--nav-h);
  min-height: 100vh;
}

/* ─── BUTTONS ───────────────────────────────────────────────────────────── */

.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 32px;
  background: var(--red); color: #fff;
  font-size: 11px; font-weight: 700; letter-spacing: 2px;
  text-transform: uppercase; border-radius: 2px; border: none;
  cursor: pointer; transition: all .2s;
}
.btn-primary:hover { background: var(--red-h); transform: translateY(-1px); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn-ghost {
  display: inline-flex; align-items: center;
  padding: 12px 28px; border: 1px solid var(--border2);
  color: var(--muted); font-size: 11px; font-weight: 600;
  letter-spacing: 2px; text-transform: uppercase; border-radius: 2px;
  cursor: pointer; background: none; transition: all .2s;
}
.btn-ghost:hover { color: var(--cream); border-color: rgba(247,243,238,.4); }

.btn-sm { padding: 8px 18px; font-size: 10px; }
.btn-danger-sm {
  padding: 5px 12px; background: rgba(232,48,42,.12); color: var(--red);
  border: 1px solid rgba(232,48,42,.3); border-radius: 3px;
  font-size: 11px; cursor: pointer; transition: all .2s;
}
.btn-danger-sm:hover { background: rgba(232,48,42,.2); }
.btn-danger-sm:disabled { opacity: .3; cursor: not-allowed; }

/* ─── PAGE COMMON ────────────────────────────────────────────────────────── */

.page-header {
  max-width: 1400px; margin: 0 auto;
  padding: 48px 32px 32px;
}
.page-tag {
  display: flex; align-items: center; gap: 10px;
  font-size: 10px; font-weight: 700; letter-spacing: 3px;
  text-transform: uppercase; color: var(--red);
  margin-bottom: 12px;
}
.tag-line { width: 28px; height: 1px; background: var(--red); flex-shrink: 0; }

.page-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(36px, 5vw, 72px);
  line-height: .92; letter-spacing: 2px; color: var(--cream);
}
.page-subtitle {
  margin-top: 12px; font-size: 14px; color: var(--muted);
}

.section-label {
  display: flex; align-items: center; gap: 10px;
  font-size: 10px; font-weight: 700; letter-spacing: 3px;
  text-transform: uppercase; color: var(--red);
  margin-bottom: 20px;
}

/* ─── LOGIN ─────────────────────────────────────────────────────────────── */

.login-body {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; position: relative; overflow: hidden;
}
.login-grid-bg {
  position: fixed; inset: 0; z-index: 0;
  background-image:
    linear-gradient(rgba(232,48,42,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232,48,42,.04) 1px, transparent 1px);
  background-size: 64px 64px;
}
.login-container {
  position: relative; z-index: 1;
  width: 380px; padding: 48px 40px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 4px;
}
.login-logo {
  display: flex; align-items: center; gap: 12px; margin-bottom: 28px;
}
.login-logo-bar { width: 3px; height: 40px; background: var(--red); }
.login-logo-text {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 32px; letter-spacing: 4px;
}
.login-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 42px; line-height: .92;
  letter-spacing: 2px; margin-bottom: 8px;
}
.login-subtitle {
  font-size: 12px; color: var(--muted);
  letter-spacing: 1px; margin-bottom: 32px;
}
.login-error {
  background: rgba(232,48,42,.1); border: 1px solid rgba(232,48,42,.3);
  color: #ff7a75; padding: 10px 14px; border-radius: 3px;
  font-size: 13px; margin-bottom: 20px;
}
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-btn { width: 100%; justify-content: center; margin-top: 8px; }
.login-footer {
  text-align: center; margin-top: 28px;
  font-size: 11px; color: var(--dim);
  letter-spacing: 2px; text-transform: uppercase;
}

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label {
  font-size: 10px; font-weight: 700; letter-spacing: 2px;
  text-transform: uppercase; color: var(--muted);
}
.form-input {
  background: var(--bg3); border: 1px solid var(--border2);
  color: var(--cream); padding: 11px 14px;
  font-size: 14px; border-radius: 3px;
  font-family: 'Instrument Sans', sans-serif;
  transition: border-color .2s;
}
.form-input:focus { outline: none; border-color: rgba(232,48,42,.5); }
select.form-input { cursor: pointer; }

/* ─── WOD PAGE ───────────────────────────────────────────────────────────── */

.page-wod {
  max-width: 1100px; margin: 0 auto;
  padding: 32px 24px 80px;
}

.wod-nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 32px;
}
.wod-nav-btn {
  padding: 8px 18px; border: 1px solid var(--border2);
  color: var(--muted); font-size: 12px; font-weight: 600;
  border-radius: 2px; transition: all .2s; white-space: nowrap;
}
.wod-nav-btn:hover { color: var(--cream); border-color: var(--border2); }
.wod-nav-center {
  display: flex; align-items: center; gap: 12px; flex: 1; justify-content: center;
}
.wod-today-badge {
  background: var(--red); color: #fff;
  font-size: 10px; font-weight: 700; letter-spacing: 2px;
  padding: 4px 10px; border-radius: 2px;
}
.wod-date-input {
  background: var(--bg3); border: 1px solid var(--border2);
  color: var(--cream); padding: 7px 12px; border-radius: 3px;
  font-family: 'Instrument Sans', sans-serif; font-size: 13px;
  cursor: pointer;
}
.wod-date-input::-webkit-calendar-picker-indicator { filter: invert(1); opacity: .5; }
.wod-week-badge {
  font-size: 11px; color: var(--muted);
  padding: 4px 10px; border: 1px solid var(--border);
  border-radius: 2px;
}

.wod-header {
  background: var(--bg2); border-left: 3px solid var(--wod-color);
  padding: 28px 32px; margin-bottom: 24px; border-radius: 0 4px 4px 0;
}
.wod-header-tag {
  display: flex; align-items: center; gap: 10px;
  font-size: 10px; font-weight: 700; letter-spacing: 3px;
  text-transform: uppercase; color: var(--wod-color, var(--red));
  margin-bottom: 10px;
}
.wod-type-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(32px, 5vw, 56px);
  line-height: .92; letter-spacing: 2px; color: var(--cream);
  margin-bottom: 4px;
}
.wod-label {
  font-size: 13px; color: var(--muted); font-style: italic;
  margin-bottom: 14px;
}
.wod-movements { display: flex; flex-wrap: wrap; gap: 6px; }
.movement-badge {
  background: rgba(247,243,238,.06);
  border: 1px solid var(--border);
  padding: 3px 10px; border-radius: 2px;
  font-size: 11px; font-weight: 600; letter-spacing: .5px;
}

.wod-body {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 20px;
  align-items: start;
}

.wod-sections { display: flex; flex-direction: column; gap: 16px; }

.wod-section {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 4px; overflow: hidden;
}
.wod-section-metcon {
  border-color: var(--wod-color, var(--border));
}
.section-header {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 20px; border-bottom: 1px solid var(--border);
  background: rgba(247,243,238,.02);
}
.section-icon { font-size: 16px; }
.section-title {
  font-size: 11px; font-weight: 700; letter-spacing: 2px;
  text-transform: uppercase; flex: 1;
}
.section-badge {
  font-size: 10px; font-weight: 700; letter-spacing: 1.5px;
  padding: 3px 9px; border-radius: 2px;
}
.section-content {
  padding: 18px 20px; font-size: 13.5px; line-height: 1.75;
  color: var(--text-secondary, rgba(247,243,238,.85));
}
.section-metcon-content {
  font-size: 14px;
}

/* Warmup panel */
.warmup-panel {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 4px; padding: 20px; position: sticky; top: 80px;
}
.warmup-panel-header {
  margin-bottom: 16px;
}
.warmup-panel-title {
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
}
.warmup-panel-title h3 {
  font-size: 11px; font-weight: 700; letter-spacing: 2px;
  text-transform: uppercase;
}
.warmup-btn { width: 100%; justify-content: center; }
.warmup-content { margin-top: 16px; }
.warmup-loading {
  display: flex; flex-direction: column; align-items: center;
  gap: 12px; padding: 24px;
}
.loading-dots {
  display: flex; gap: 6px;
}
.loading-dots span {
  width: 8px; height: 8px; background: var(--red);
  border-radius: 50%; animation: dotBounce 1.2s infinite;
}
.loading-dots span:nth-child(2) { animation-delay: .2s; }
.loading-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes dotBounce {
  0%, 80%, 100% { transform: scale(0.8); opacity: .5; }
  40% { transform: scale(1.2); opacity: 1; }
}

.warmup-sections { display: flex; flex-direction: column; gap: 14px; }
.warmup-section {
  border-left: 2px solid var(--border2);
  padding-left: 12px;
}
.warmup-section-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 4px;
}
.warmup-icon { font-size: 14px; }
.warmup-duration {
  margin-left: auto; font-size: 11px; color: var(--muted);
  background: var(--bg3); padding: 2px 8px; border-radius: 2px;
}
.warmup-section p { font-size: 13px; color: rgba(247,243,238,.75); line-height: 1.6; }
.warmup-coach-tip {
  margin-top: 14px; padding: 12px;
  background: rgba(232,48,42,.06); border: 1px solid rgba(232,48,42,.2);
  border-radius: 3px; font-size: 12px; color: var(--cream);
  display: none;
}
.warmup-coach-tip span { color: var(--red); font-weight: 600; }

.warmup-links { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.warmup-links-label { font-size: 11px; color: var(--dim); margin-bottom: 8px; }
.yt-link {
  display: block; padding: 6px 10px; margin-bottom: 4px;
  background: rgba(255,0,0,.06); border: 1px solid rgba(255,0,0,.15);
  border-radius: 3px; font-size: 11px; color: #ff7a75;
  transition: all .2s; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.yt-link:hover { background: rgba(255,0,0,.12); }

.wod-empty {
  min-height: 50vh; display: flex; align-items: center; justify-content: center;
}
.wod-empty-inner { text-align: center; }
.wod-empty-icon { font-size: 48px; margin-bottom: 16px; }
.wod-empty-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 36px; letter-spacing: 2px; margin-bottom: 12px;
}
.wod-empty-text { color: var(--muted); margin-bottom: 24px; }

/* ─── WEEK PAGE ──────────────────────────────────────────────────────────── */

.page-week { max-width: 1400px; margin: 0 auto; padding: 0 24px 80px; }

.week-nav-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}

.week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px; padding: 0 0 32px;
}

.week-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-top: 2px solid var(--wod-color, var(--border));
  border-radius: 4px; padding: 16px;
  transition: transform .2s, border-color .2s;
  display: flex; flex-direction: column; gap: 10px;
}
.week-card:hover { transform: translateY(-2px); }
.week-card-today { border: 1px solid rgba(232,48,42,.4); border-top: 2px solid var(--red); }
.week-card-empty { border-top-color: var(--border); opacity: .5; }

.week-card-header {
  display: flex; align-items: center; justify-content: space-between;
}
.week-day-name {
  font-size: 10px; font-weight: 700; letter-spacing: 2px;
}
.week-date { font-size: 12px; color: var(--muted); }
.today-dot {
  width: 6px; height: 6px; background: var(--red);
  border-radius: 50%; flex-shrink: 0;
}

.wod-type-pill {
  font-size: 10px; font-weight: 700; letter-spacing: 1px;
  padding: 3px 9px; border-radius: 2px; border: 1px solid transparent;
}
.scaling-pill {
  font-size: 9px; font-weight: 700; letter-spacing: 1px;
  padding: 2px 7px; background: rgba(247,243,238,.06);
  border: 1px solid var(--border); border-radius: 2px;
}

.week-card-label { font-size: 11px; color: var(--muted); font-style: italic; }
.week-card-preview {
  font-size: 11.5px; color: var(--dim); line-height: 1.5; flex: 1;
}
.week-card-movements { display: flex; flex-wrap: wrap; gap: 4px; }
.movement-badge-sm {
  font-size: 9px; padding: 2px 7px; border-radius: 2px;
  background: rgba(247,243,238,.04); border: 1px solid var(--border);
}
.week-card-cta {
  font-size: 11px; color: var(--red); font-weight: 600;
  letter-spacing: .5px; margin-top: auto;
}
.week-card-rest {
  flex: 1; display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--dim);
}

.week-summary {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 4px; padding: 16px 20px;
}
.week-summary-inner { display: flex; flex-wrap: wrap; gap: 20px; }
.week-summary-item { display: flex; align-items: center; gap: 8px; }
.week-summary-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.week-summary-day { font-size: 10px; font-weight: 700; letter-spacing: 1px; color: var(--muted); }
.week-summary-type { font-size: 12px; }

/* ─── PROGRAMME PAGE ─────────────────────────────────────────────────────── */

.page-program { max-width: 1400px; margin: 0 auto; padding: 0 24px 80px; }

.program-stats { margin-bottom: 48px; }
.stats-bar-container {
  height: 24px; display: flex; border-radius: 4px; overflow: hidden;
  margin-bottom: 16px;
}
.stats-bar-segment { transition: opacity .2s; }
.stats-bar-segment:hover { opacity: .8; }
.stats-legend { display: flex; flex-wrap: wrap; gap: 12px; }
.stats-legend-item { display: flex; align-items: center; gap: 6px; }
.stats-legend-dot { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }
.stats-legend-name { font-size: 12px; }
.stats-legend-pct { font-size: 12px; font-weight: 700; }
.stats-legend-count { font-size: 11px; color: var(--dim); }

.wod-types-section { margin-bottom: 48px; }
.wod-types-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.wod-type-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-left: 3px solid var(--tc); padding: 20px;
  border-radius: 0 4px 4px 0;
}
.wod-type-card-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 8px;
}
.wod-type-card-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 18px; letter-spacing: 1px;
}
.wod-type-card-pct {
  font-family: 'Bebas Neue', sans-serif; font-size: 22px;
}
.wod-type-card-meta {
  display: flex; gap: 12px; margin-bottom: 8px;
  font-size: 11px; color: var(--muted);
}
.wod-type-card-desc { font-size: 12.5px; color: var(--dim); line-height: 1.5; }

.calendar-section { margin-bottom: 48px; }
.calendar-legend {
  display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px;
}
.cal-legend-item {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; color: var(--muted);
}
.cal-dot { width: 8px; height: 8px; border-radius: 2px; }
.calendar-grid {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.cal-week {
  display: flex; flex-direction: column; gap: 4px; align-items: flex-start;
}
.cal-week-label { font-size: 9px; color: var(--dim); }
.cal-week-days { display: flex; gap: 2px; }
.cal-day {
  width: 14px; height: 14px; border-radius: 2px;
  display: block; transition: transform .15s, opacity .15s;
}
.cal-day:hover { transform: scale(1.4); opacity: .8; }

.tests-section { margin-bottom: 48px; }
.tests-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.test-card {
  background: var(--bg2); border: 1px solid var(--border);
  padding: 24px; border-radius: 4px;
}
.test-card-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 18px; letter-spacing: 1px;
  margin-bottom: 16px; color: var(--red);
}
.test-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.test-list li { font-size: 13px; color: rgba(247,243,238,.8); padding-left: 14px; position: relative; }
.test-list li::before {
  content: '→'; position: absolute; left: 0; color: var(--red);
}

.specials-section { margin-bottom: 48px; }
.specials-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.special-item {
  background: var(--bg2); border: 1px solid var(--border);
  padding: 20px 24px; border-radius: 4px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-width: 120px;
}
.special-num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 40px; color: var(--red); line-height: 1;
}
.special-name { font-size: 12px; font-weight: 700; letter-spacing: 1px; }
.special-freq { font-size: 11px; color: var(--dim); }

.phases-section { margin-bottom: 48px; }
.phases-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.phase-card {
  background: var(--bg2); border: 1px solid var(--border);
  padding: 24px; border-radius: 4px;
}
.phase-card h3 { font-family: 'Bebas Neue', sans-serif; font-size: 22px; letter-spacing: 2px; margin-bottom: 4px; }
.phase-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 4px;
  font-size: 12px; font-weight: 700; margin-bottom: 8px;
  background: var(--red); color: #fff;
}
.phase-foundation .phase-badge { background: #7ab0f0; color: #111; }
.phase-ss .phase-badge { background: var(--red); }
.phase-weeks { font-size: 11px; color: var(--muted); margin-bottom: 10px; }
.phase-card p { font-size: 13px; color: var(--dim); line-height: 1.6; margin-bottom: 8px; }
.phase-scaling { font-size: 12px !important; }

/* ─── CONDI ANALYTICS ────────────────────────────────────────────────────── */

.condi-analytics { margin-bottom: 48px; }
.condi-analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 768px) { .condi-analytics-grid { grid-template-columns: 1fr; } }

/* Effort bars */
.effort-bars { display: flex; flex-direction: column; gap: 10px; padding: 4px 0; }
.effort-bar-row { display: flex; align-items: center; gap: 10px; }
.effort-bar-label {
  width: 130px; flex-shrink: 0;
  font-size: 11.5px; color: rgba(247,243,238,.65);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.effort-bar-track {
  flex: 1; height: 6px; background: rgba(247,243,238,.06);
  border-radius: 3px; overflow: hidden;
}
.effort-bar-fill {
  height: 100%; border-radius: 3px;
  transition: width .4s ease;
}
.effort-bar-count {
  width: 28px; text-align: right;
  font-size: 11px; color: var(--muted);
}

/* Machine bubbles */
.machine-bubbles {
  display: flex; flex-wrap: wrap;
  align-items: center; justify-content: center;
  gap: 14px; padding: 12px 0;
}
.machine-bubble {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  border-radius: 50%; border: 1.5px solid rgba(106,204,192,.35);
  background: rgba(106,204,192,.06);
  text-align: center; cursor: default; line-height: 1.2;
  transition: transform .2s;
}
.machine-bubble:hover { transform: scale(1.06); }
.machine-bubble-name {
  font-size: .8em; font-weight: 700; letter-spacing: .5px;
  color: #6accc0;
}
.machine-bubble-count {
  font-size: .7em; color: var(--muted);
}
.machine-bubble-count small { display: block; font-size: .8em; }

/* ─── FBB ANALYTICS ──────────────────────────────────────────────────────── */

.fbb-analytics { margin-bottom: 48px; }
.fbb-analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 768px) { .fbb-analytics-grid { grid-template-columns: 1fr; } }

.fbb-radar-card, .fbb-pattern-card { min-height: 280px; }

/* Pattern list */
.fbb-pattern-list { display: flex; flex-direction: column; gap: 11px; padding: 4px 0; }
.fbb-pattern-row { display: flex; align-items: center; gap: 10px; }
.fbb-pattern-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.fbb-pattern-name {
  width: 90px; flex-shrink: 0;
  font-size: 11.5px; color: rgba(247,243,238,.65);
}
.fbb-pattern-bar-track {
  flex: 1; height: 8px; background: rgba(247,243,238,.06);
  border-radius: 3px; overflow: hidden;
}
.fbb-pattern-bar-fill {
  height: 100%; border-radius: 3px;
  transition: width .4s ease;
}
.fbb-pattern-count {
  width: 24px; text-align: right;
  font-size: 12px; font-weight: 700; color: rgba(247,243,238,.7);
}
.fbb-pattern-note {
  margin-top: 14px; font-size: 10.5px;
  color: var(--dim); font-style: italic;
}

/* ─── LIBRARY PAGE ───────────────────────────────────────────────────────── */

.page-library { max-width: 1400px; margin: 0 auto; padding: 0 24px 80px; }

.library-controls { margin-bottom: 28px; }
.library-search-wrap { position: relative; margin-bottom: 16px; max-width: 420px; }
.library-search {
  width: 100%; background: var(--bg2); border: 1px solid var(--border2);
  color: var(--cream); padding: 12px 16px 12px 40px;
  font-size: 14px; border-radius: 3px;
  font-family: 'Instrument Sans', sans-serif;
}
.library-search:focus { outline: none; border-color: rgba(232,48,42,.5); }
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); opacity: .4; }

.library-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.filter-btn {
  padding: 7px 16px; background: var(--bg3);
  border: 1px solid var(--border); border-radius: 2px;
  font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  color: var(--muted); cursor: pointer; transition: all .2s;
}
.filter-btn:hover { color: var(--cream); border-color: var(--border2); }
.filter-btn.active { background: var(--red); color: #fff; border-color: var(--red); }

.library-pattern-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-pill {
  padding: 5px 14px; background: none;
  border: 1px solid var(--border); border-radius: 20px;
  font-size: 11px; color: var(--muted); cursor: pointer; transition: all .2s;
}
.filter-pill:hover { color: var(--cream); border-color: var(--border2); }
.filter-pill.active { border-color: rgba(232,48,42,.5); color: var(--red); background: rgba(232,48,42,.06); }

.exercise-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.exercise-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 4px; padding: 20px;
  display: flex; flex-direction: column; gap: 10px;
  transition: border-color .2s, transform .2s;
}
.exercise-card:hover { border-color: var(--border2); transform: translateY(-1px); }

.exercise-card-header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.exercise-cat-badge {
  font-size: 9px; font-weight: 700; letter-spacing: 1.5px;
  padding: 3px 9px; border-radius: 2px; text-transform: uppercase;
}
.exercise-cat-gymnastics { background: rgba(255,122,117,.12); color: #ff7a75; }
.exercise-cat-weightlifting { background: rgba(122,176,240,.12); color: #7ab0f0; }
.exercise-cat-strength { background: rgba(212,168,71,.12); color: #d4a847; }
.exercise-cat-kettlebell { background: rgba(106,204,192,.12); color: #6accc0; }
.exercise-cat-mono_structural { background: rgba(176,159,216,.12); color: #b09fd8; }
.exercise-cat-hyrox { background: rgba(255,122,0,.12); color: #FF7A00; }

.exercise-pattern-tag {
  margin-left: auto; font-size: 10px; color: var(--dim); letter-spacing: .5px;
}
.exercise-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px; letter-spacing: 1px; line-height: 1;
}
.exercise-desc { font-size: 12.5px; color: var(--muted); line-height: 1.5; }

.exercise-scaling { margin-top: 4px; }
.scaling-toggle {
  background: none; border: none; color: var(--red);
  font-size: 11px; font-weight: 600; letter-spacing: .5px;
  cursor: pointer; padding: 0;
}
.scaling-levels { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.scaling-level {
  padding: 10px 12px; border-radius: 3px;
  border-left: 2px solid var(--border);
}
.scaling-level-1 { border-left-color: #6accc0; }
.scaling-level-2 { border-left-color: #7ab0f0; }
.scaling-level-3 { border-left-color: #d4a847; }
.scaling-level-4 { border-left-color: var(--red); }
.scaling-level-5 { border-left-color: #ff7a75; }
.scaling-level-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.scaling-level-num { font-size: 9px; font-weight: 700; letter-spacing: 1px; color: var(--dim); text-transform: uppercase; }
.scaling-level-name { font-size: 12px; font-weight: 600; }
.scaling-level-desc { font-size: 12px; color: var(--dim); line-height: 1.5; }

.exercise-yt-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; margin-top: 4px;
  background: rgba(255,0,0,.06); border: 1px solid rgba(255,0,0,.15);
  border-radius: 3px; font-size: 12px; color: #ff7a75;
  transition: all .2s; align-self: flex-start;
}
.exercise-yt-link:hover { background: rgba(255,0,0,.12); }
.yt-icon { font-size: 10px; }

.no-results { text-align: center; padding: 48px; color: var(--muted); }

/* ─── SCALING PAGE ───────────────────────────────────────────────────────── */

.page-scaling { max-width: 1200px; margin: 0 auto; padding: 0 24px 80px; }

.scaling-intro { margin-bottom: 40px; }
.scaling-intro-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.scaling-intro-card {
  background: var(--bg2); border: 1px solid var(--border);
  padding: 20px; border-radius: 4px;
}
.scaling-intro-card h3 {
  display: flex; align-items: center; gap: 8px;
  font-family: 'Bebas Neue', sans-serif; font-size: 18px;
  letter-spacing: 1px; margin-bottom: 8px;
}
.bias-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 3px;
  font-size: 11px; font-weight: 700; font-family: 'Instrument Sans', sans-serif;
  background: var(--red); color: #fff;
}
.scaling-f .bias-badge { background: #7ab0f0; color: #111; }
.scaling-intro-card p { font-size: 13px; color: var(--dim); line-height: 1.6; margin-bottom: 8px; }
.example { font-size: 11.5px; color: var(--muted); border-left: 2px solid var(--border2); padding-left: 10px; }

.scaling-versions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13px; }
.ver { padding: 4px 12px; border-radius: 2px; font-size: 11px; font-weight: 700; }
.ver1 { background: rgba(106,204,192,.12); color: #6accc0; }
.ver2 { background: rgba(122,176,240,.12); color: #7ab0f0; }
.ver3 { background: rgba(212,168,71,.12); color: #d4a847; }

.scaling-pattern-section {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 4px; overflow: hidden; margin-bottom: 16px;
}
.scaling-pattern-header {
  padding: 20px 24px; cursor: pointer;
  display: flex; align-items: center; gap: 16px;
  border-bottom: 1px solid var(--border);
  transition: background .2s;
}
.scaling-pattern-header:hover { background: rgba(247,243,238,.02); }
.scaling-pattern-title {
  display: flex; align-items: center; gap: 12px;
}
.scaling-pattern-title h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px; letter-spacing: 2px;
}
.scaling-pattern-icon { font-size: 20px; }
.scaling-pattern-desc { font-size: 13px; color: var(--dim); flex: 1; }
.scaling-toggle-icon { color: var(--muted); font-size: 16px; flex-shrink: 0; }

.scaling-pattern-body { padding: 0 24px 24px; }
.scaling-levels-table { margin-top: 16px; }
.scaling-table-header {
  display: grid; grid-template-columns: 220px 140px 1fr 200px;
  gap: 12px; padding: 10px 0; margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
  font-size: 10px; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--muted);
}
.scaling-table-row {
  display: grid; grid-template-columns: 220px 140px 1fr 200px;
  gap: 12px; padding: 12px 0;
  border-bottom: 1px solid rgba(247,243,238,.04);
  transition: background .15s;
}
.scaling-table-row:hover { background: rgba(247,243,238,.02); }
.st-col { font-size: 13px; }
.st-name { font-weight: 600; }
.level-badge {
  display: inline-block; padding: 3px 10px; border-radius: 2px;
  font-size: 10px; font-weight: 700; letter-spacing: 1px;
}
.level-1 { background: rgba(106,204,192,.12); color: #6accc0; }
.level-2 { background: rgba(122,176,240,.12); color: #7ab0f0; }
.level-3 { background: rgba(212,168,71,.12); color: #d4a847; }
.level-4 { background: rgba(232,48,42,.12); color: #ff7a75; }
.level-5 { background: rgba(255,180,50,.12); color: #ffb84d; }
.st-desc { color: var(--dim); line-height: 1.5; }
.cues-list { list-style: none; }
.cues-list li {
  font-size: 12px; color: var(--dim); padding-left: 10px;
  position: relative; margin-bottom: 3px;
}
.cues-list li::before { content: '·'; position: absolute; left: 0; color: var(--red); }

.murph-section {
  background: rgba(232,48,42,.04); border: 1px solid rgba(232,48,42,.2);
  border-radius: 4px; overflow: hidden; margin-bottom: 24px;
}
.murph-phases { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.murph-phase {
  background: var(--bg2); border: 1px solid var(--border);
  padding: 16px; border-radius: 3px;
}
.murph-phase-header { margin-bottom: 8px; }
.murph-week { font-size: 12px; font-weight: 700; display: block; }
.murph-format { font-size: 11px; color: var(--red); }
.murph-content { font-size: 12px; color: var(--dim); line-height: 1.6; margin-bottom: 8px; }
.murph-stimulus { font-size: 11.5px; color: var(--muted); font-style: italic; }
.murph-tips { background: var(--bg3); padding: 16px 20px; border-radius: 3px; }
.murph-tips h4 { font-size: 11px; font-weight: 700; letter-spacing: 2px; margin-bottom: 10px; }
.murph-tips ul { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.murph-tips li { font-size: 13px; color: var(--dim); padding-left: 14px; position: relative; }
.murph-tips li::before { content: '→'; position: absolute; left: 0; color: var(--red); }

.quick-ref-section { margin-top: 32px; }
.rpe-table {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 4px; overflow: hidden;
}
.rpe-row {
  display: grid; grid-template-columns: 80px 140px 80px 1fr;
  gap: 12px; padding: 11px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.rpe-header {
  font-size: 10px; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--muted);
  background: rgba(247,243,238,.02);
}
.rpe-max { border-bottom: none; }
.rpe-val { font-family: 'Bebas Neue', sans-serif; font-size: 18px; color: var(--red); }

/* ─── ADMIN PAGE ─────────────────────────────────────────────────────────── */

.page-admin { max-width: 900px; margin: 0 auto; padding: 0 24px 80px; }

.admin-stats {
  display: flex; gap: 16px; margin-bottom: 40px; flex-wrap: wrap;
}
.admin-stat {
  background: var(--bg2); border: 1px solid var(--border);
  padding: 20px 28px; border-radius: 4px; text-align: center;
  display: flex; flex-direction: column; gap: 4px;
}
.admin-stat-wide { flex: 1; }
.admin-stat-val {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 40px; color: var(--red); line-height: 1;
}
.admin-stat-date { font-size: 20px; }
.admin-stat-label { font-size: 11px; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; }

.admin-section {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 4px; padding: 24px; margin-bottom: 20px;
}
.admin-section-title {
  font-family: 'Bebas Neue', sans-serif; font-size: 20px; letter-spacing: 2px;
  margin-bottom: 10px; color: var(--cream);
}
.admin-section-desc { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.admin-actions { display: flex; align-items: center; gap: 16px; }
.admin-status { font-size: 13px; }
.admin-note {
  margin-top: 12px; font-size: 12px; color: var(--dim);
  background: var(--bg3); padding: 10px 14px; border-radius: 3px;
}
.admin-note code { font-family: monospace; background: rgba(247,243,238,.08); padding: 2px 6px; border-radius: 2px; }

.users-table { border: 1px solid var(--border); border-radius: 3px; overflow: hidden; margin-bottom: 20px; }
.users-header {
  display: grid; grid-template-columns: 1fr 1fr 80px 100px;
  gap: 12px; padding: 10px 16px;
  background: rgba(247,243,238,.03);
  font-size: 10px; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--muted);
}
.users-row {
  display: grid; grid-template-columns: 1fr 1fr 80px 100px;
  gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border);
  align-items: center; font-size: 13px;
}
.user-username { font-weight: 600; }
.user-role {
  font-size: 10px; font-weight: 700; letter-spacing: 1px;
  padding: 2px 8px; border-radius: 2px;
  text-transform: uppercase; display: inline-block;
}
.user-role-admin { background: rgba(232,48,42,.12); color: var(--red); }
.user-role-coach { background: rgba(122,176,240,.12); color: #7ab0f0; }

.add-user-title { font-size: 13px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 12px; color: var(--muted); }
.add-form-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.add-form-row .form-group { flex: 1; min-width: 120px; }
.add-form-row .btn-primary { height: 42px; margin-top: 20px; }
.change-pwd-form { display: flex; align-items: flex-end; gap: 16px; }
.change-pwd-form .form-group { max-width: 280px; }

/* ─── EMPTY STATE ────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 80px 24px;
  color: var(--muted); display: flex; flex-direction: column;
  align-items: center; gap: 16px;
}

/* ─── TRACK SELECTOR ─────────────────────────────────────────────────────── */
.track-selector {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 20px; padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.track-pill {
  padding: 5px 14px; border-radius: 20px;
  font-size: 11px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; border: 1px solid var(--border);
  color: var(--muted); background: none; text-decoration: none;
  transition: all .2s;
}
.track-pill:hover { color: var(--cream); border-color: var(--border2); }
.track-pill.active { color: #fff; border-color: transparent; }
.track-pill.unavailable { opacity: .35; cursor: not-allowed; pointer-events: none; }

/* ─── WOD TEXT FORMATTING ────────────────────────────────────────────────── */
.wod-line { margin: 2px 0; line-height: 1.7; color: rgba(247,243,238,.85); }
.wod-line-header {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 15px; letter-spacing: 1.5px;
  color: var(--cream); margin: 14px 0 6px;
  padding-bottom: 4px; border-bottom: 1px solid var(--border);
}
.wod-line-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px; letter-spacing: 2px;
  color: var(--cream); margin: 16px 0 10px;
}
/* "Min 1-2 :" interval block */
.wod-line-interval {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 10px 0 4px;
  font-size: 11px; font-weight: 700; letter-spacing: 2px;
  text-transform: uppercase; color: var(--wod-color, var(--red));
  padding: 3px 10px 3px 0;
  border-left: 2px solid var(--wod-color, var(--red));
  padding-left: 8px;
}
/* reps line: "15 Thrusters" */
.wod-line-reps {
  display: flex; align-items: baseline; gap: 10px;
  margin: 5px 0; line-height: 1.6;
  padding-left: 4px;
}
.wod-reps-num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px; line-height: 1;
  color: var(--wod-color, var(--red));
  min-width: 36px; flex-shrink: 0; text-align: right;
}
.wod-line-bullet {
  padding-left: 16px; margin: 3px 0;
  color: rgba(247,243,238,.8); line-height: 1.65;
  position: relative;
}
.wod-line-bullet::before {
  content: ''; position: absolute; left: 4px; top: 10px;
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--wod-color, var(--red)); opacity: .6;
}
/* FBB superset: "A1 Bench Press…" */
.wod-line-superset {
  margin: 8px 0 3px; padding: 8px 12px;
  background: rgba(247,243,238,.03); border-left: 2px solid var(--border2);
  border-radius: 0 3px 3px 0; font-size: 13px;
  color: rgba(247,243,238,.9); line-height: 1.65;
}
/* "Repos : …" lines */
.wod-line-rest {
  font-size: 11.5px; color: var(--dim); margin: 3px 0 3px 4px;
  font-style: italic;
}
.wod-spacer { height: 10px; }

/* ─── FBB SPECIFIC ───────────────────────────────────────────────────────── */
.fbb-intent {
  background: rgba(176,159,216,.06); border: 1px solid rgba(176,159,216,.2);
  border-radius: 3px; padding: 12px 16px; margin-bottom: 16px;
  font-size: 13px; color: rgba(247,243,238,.8); line-height: 1.6;
}
.fbb-intent-label { font-size: 10px; font-weight: 700; letter-spacing: 2px; color: #b09fd8; margin-bottom: 4px; }
.fbb-meta {
  display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 8px;
}
.fbb-meta-item {
  font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 5px;
}

/* ─── CHART SECTION ──────────────────────────────────────────────────────── */
.charts-row {
  display: grid; grid-template-columns: 320px 1fr; gap: 20px;
  margin-bottom: 24px; align-items: start;
}
.chart-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 4px; padding: 24px;
}
.chart-card-title {
  font-size: 10px; font-weight: 700; letter-spacing: 3px;
  text-transform: uppercase; color: var(--red);
  margin-bottom: 20px; display: flex; align-items: center; gap: 10px;
}
.chart-canvas-wrap { position: relative; }

/* ─── SCALING PANEL (WOD page) ───────────────────────────────────────────── */

.scaling-panel {
  max-width: 1100px; margin: 28px auto 0;
  border: 1px solid rgba(247,243,238,.1);
  border-radius: 4px;
  overflow: hidden;
}

.scaling-panel-toggle {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 14px 20px;
  background: rgba(247,243,238,.03);
  border: none; cursor: pointer; text-align: left;
  transition: background .15s;
}
.scaling-panel-toggle:hover { background: rgba(247,243,238,.06); }
.scaling-panel-icon { font-size: 15px; }
.scaling-panel-label {
  flex: 1;
  font-size: 11px; font-weight: 700; letter-spacing: 2px;
  text-transform: uppercase; color: rgba(247,243,238,.6);
}
.scaling-panel-chevron { font-size: 14px; color: var(--dim); }

.scaling-panel-body { padding: 20px; border-top: 1px solid rgba(247,243,238,.06); }

.scaling-moves-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.scaling-move-card {
  background: var(--bg2);
  border: 1px solid rgba(247,243,238,.07);
  border-radius: 4px;
  padding: 14px;
}
.scaling-move-header {
  margin-bottom: 12px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
}
.scaling-move-cat {
  font-size: 9px; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; padding: 2px 7px; border-radius: 3px;
}
.scaling-move-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 18px; letter-spacing: 1px;
  color: var(--cream); flex-basis: 100%;
  margin-top: 2px;
}
.scaling-move-pattern {
  font-size: 10px; color: var(--dim);
  padding: 2px 6px; border: 1px solid rgba(247,243,238,.1);
  border-radius: 3px;
}

/* Level rows */
.scaling-move-levels { display: flex; flex-direction: column; gap: 7px; }
.scaling-lv {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 7px 10px;
  background: rgba(247,243,238,.02);
  border-radius: 3px;
  border-left: 2px solid transparent;
}
.scaling-lv-1 { border-left-color: #6accc0; }
.scaling-lv-2 { border-left-color: #7ab0f0; }
.scaling-lv-3 { border-left-color: #d4a847; }
.scaling-lv-4 { border-left-color: var(--red); }
.scaling-lv-5 { border-left-color: #ff7a75; }

.scaling-lv-num {
  flex-shrink: 0;
  width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: rgba(247,243,238,.08);
  font-size: 10px; font-weight: 700; color: var(--muted);
}
.scaling-lv-info { flex: 1; min-width: 0; }
.scaling-lv-name { font-size: 12px; font-weight: 600; color: var(--cream); display: block; }
.scaling-lv-desc { font-size: 11.5px; color: var(--dim); line-height: 1.5; margin-top: 2px; }

.scaling-yt-link {
  display: inline-flex; align-items: center; gap: 5px;
  margin-top: 10px; font-size: 11px; color: #ff7a75;
  opacity: .7; transition: opacity .15s;
}
.scaling-yt-link:hover { opacity: 1; }

/* ─── FAQ FLOATING SYSTEM ────────────────────────────────────────────────── */

/* FAB Button */
.faq-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0,0,0,.45);
  z-index: 1100;
  transition: transform .2s, background .2s, box-shadow .2s;
}
.faq-fab:hover { transform: scale(1.08); box-shadow: 0 6px 28px rgba(0,0,0,.55); }
.faq-fab-open { background: #555; }
.faq-fab-icon { font-size: 20px; line-height: 1; }

/* Panel */
.faq-panel {
  position: fixed;
  bottom: 92px;
  right: 28px;
  width: 380px;
  max-height: 560px;
  background: #181818;
  border: 1px solid rgba(247,243,238,.10);
  border-radius: 16px;
  box-shadow: 0 12px 50px rgba(0,0,0,.7);
  z-index: 1099;
  flex-direction: column;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.faq-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}
.faq-panel-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 16px;
  letter-spacing: .08em;
  color: var(--accent);
}
.faq-panel-header-right { display: flex; align-items: center; gap: 8px; }
.faq-close-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 6px;
  border-radius: 6px;
  transition: background .15s;
}
.faq-close-btn:hover { background: var(--border); color: var(--text); }

/* Gaps badge button */
.faq-gaps-btn {
  position: relative;
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 8px;
  border-radius: 6px;
  transition: background .15s;
}
.faq-gaps-btn:hover { background: var(--border); }
.faq-gaps-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #E8302A;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Panel body */
.faq-panel-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

/* Search bar */
.faq-search-wrap {
  display: flex;
  gap: 8px;
  padding: 12px 12px 8px;
  flex-shrink: 0;
}
.faq-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 8px 12px;
  font-size: 13px;
  font-family: 'Instrument Sans', sans-serif;
  outline: none;
  transition: border-color .15s;
}
.faq-input:focus { border-color: var(--accent); }
.faq-send-btn {
  background: var(--accent);
  border: none;
  color: #fff;
  border-radius: 10px;
  padding: 0 14px;
  font-size: 16px;
  cursor: pointer;
  transition: opacity .15s;
}
.faq-send-btn:hover { opacity: .85; }

/* Quick chips */
.faq-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 12px 10px;
  flex-shrink: 0;
}
.faq-chip {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 11px;
  cursor: pointer;
  transition: all .15s;
  font-family: 'Instrument Sans', sans-serif;
}
.faq-chip:hover { border-color: var(--accent); color: var(--accent); }

/* Messages */
.faq-messages {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}
.faq-msg {
  max-width: 92%;
  padding: 10px 13px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.55;
}
.faq-msg-user {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
  border-radius: 12px 12px 4px 12px;
}
.faq-msg-bot {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px 12px 12px 12px;
  color: var(--text);
}
.faq-msg-gap {
  border-color: #d4a847;
  background: rgba(212,168,71,.08);
}

/* Sources */
.faq-sources {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}
.faq-source-tag {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 10px;
}

/* Loading dots */
.faq-loading {
  align-self: flex-start;
  display: flex;
  gap: 5px;
  padding: 8px 12px;
  flex-shrink: 0;
}
.faq-loading-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  animation: faqDotPulse 1.2s infinite ease-in-out;
}
.faq-loading-dot:nth-child(2) { animation-delay: .2s; }
.faq-loading-dot:nth-child(3) { animation-delay: .4s; }
@keyframes faqDotPulse {
  0%, 80%, 100% { transform: scale(.8); opacity: .4; }
  40% { transform: scale(1.1); opacity: 1; }
}

/* ── FAQ Gaps Modal (admin) ── */
.faq-gaps-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.faq-gaps-modal-inner {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 600px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.faq-gaps-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.faq-gaps-modal-header h3 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 18px;
  letter-spacing: .07em;
  color: var(--accent);
  margin: 0;
}
.faq-gaps-modal-header button {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
}
.faq-gaps-list {
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.faq-gaps-empty { color: var(--muted); text-align: center; padding: 24px 0; }
.faq-gap-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.faq-gap-meta { display: flex; gap: 12px; font-size: 11px; color: var(--muted); }
.faq-gap-from { font-weight: 600; }
.faq-gap-q { font-size: 14px; font-weight: 600; color: var(--text); margin: 0; }
.faq-gap-answer {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 10px 12px;
  font-size: 12.5px;
  font-family: 'Instrument Sans', sans-serif;
  resize: vertical;
  outline: none;
  box-sizing: border-box;
}
.faq-gap-answer:focus { border-color: var(--accent); }
.faq-gap-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.faq-gap-draft-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: all .15s;
}
.faq-gap-draft-btn:hover { border-color: #b09fd8; color: #b09fd8; }
.faq-gap-validate-btn {
  background: var(--accent);
  border: none;
  color: #fff;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 12px;
  cursor: pointer;
  transition: opacity .15s;
}
.faq-gap-validate-btn:hover { opacity: .85; }

/* Mobile adjustments */
@media (max-width: 640px) {
  .faq-panel { width: calc(100vw - 32px); right: 16px; bottom: 80px; max-height: 480px; }
  .faq-fab { bottom: 20px; right: 16px; }
}

/* ─── RESPONSIVE ─────────────────────────────────────────────────────────── */

@media (max-width: 1024px) {
  .week-grid { grid-template-columns: repeat(4, 1fr); }
  .scaling-table-header,
  .scaling-table-row { grid-template-columns: 160px 120px 1fr; }
  .sth-col:last-child, .st-col.st-cues { display: none; }
  .murph-phases { grid-template-columns: 1fr 1fr; }
  .charts-row { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .nav-links, .nav-user { display: none; }
  .nav-mobile-toggle { display: flex; margin-left: auto; }
  .nav-mobile-menu { display: none; position: absolute; top: var(--nav-h); left: 0; right: 0; }

  .week-grid { grid-template-columns: 1fr 1fr; }
  .wod-body { grid-template-columns: 1fr; }
  .tests-grid, .phases-grid, .scaling-intro-grid { grid-template-columns: 1fr; }
  .murph-phases { grid-template-columns: 1fr; }
  .rpe-row { grid-template-columns: 60px 1fr 1fr; }
  .rpe-row > :nth-child(3) { display: none; }
  .scaling-table-header, .scaling-table-row { grid-template-columns: 1fr 100px 1fr; }
  .page-header { padding: 32px 20px 24px; }
  .exercise-grid { grid-template-columns: 1fr; }
  .charts-row { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .week-grid { grid-template-columns: 1fr; }
  .wod-nav { flex-wrap: wrap; }
  .wod-nav-center { width: 100%; order: -1; }
  .stats-bar-container { height: 16px; }
}

/* ─── Admin Refresh Grid ─────────────────────────────────────────────────── */
.admin-refresh-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.admin-refresh-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.admin-refresh-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  font-weight: 600;
}
.btn-sm { padding: 8px 14px; font-size: 13px; }

/* ─── Hyrox / Haltero Analytics ─────────────────────────────────────────── */
.hyrox-analytics,
.haltero-analytics {
  margin: 40px 0;
}
.hyrox-analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 280px;
  gap: 20px;
  align-items: start;
}

@media (max-width: 900px) {
  .admin-refresh-grid { grid-template-columns: 1fr; }
  .hyrox-analytics-grid { grid-template-columns: 1fr; }
}

/* ─── Spider / Radar analytics grid ─────────────────────────────────────── */
.spider-analytics-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 20px;
  align-items: start;
}
.spider-card { min-height: 360px; display: flex; flex-direction: column; justify-content: center; }

@media (max-width: 860px) {
  .spider-analytics-grid { grid-template-columns: 1fr; }
  .spider-card { min-height: 300px; }
}

/* ══════════════════════════════════════════════════════════════════
   PLANNING MODULE
   ══════════════════════════════════════════════════════════════════ */

/* ── Page ── */
.page-planning { padding: 24px 0 60px; }

/* ── Week nav ── */
.planning-nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 16px;
}
.planning-nav-center {
  display: flex; align-items: center; gap: 12px; flex: 1; justify-content: center;
}
.planning-week-label {
  font-family: 'Bebas Neue', sans-serif; font-size: 18px; letter-spacing: .06em;
  color: var(--text);
}
.planning-nav-btn {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 6px;
  color: var(--muted); font-size: 13px; padding: 8px 16px; cursor: pointer;
  transition: border-color .2s, color .2s; white-space: nowrap;
}
.planning-nav-btn:hover { border-color: var(--accent); color: var(--text); }
.planning-today-btn {
  background: transparent; border: 1px solid var(--border); border-radius: 4px;
  color: var(--muted); font-size: 12px; padding: 4px 10px; cursor: pointer;
}
.planning-today-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── Legend ── */
.planning-legend {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px;
}
.legend-chip {
  font-size: 11px; padding: 3px 8px; border-radius: 4px;
  border: 1px solid; font-weight: 500; letter-spacing: .03em;
}

/* ── Grid ── */
.planning-grid-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.planning-grid-loading { text-align: center; padding: 60px; color: var(--muted); }
.planning-spinner { color: var(--muted); font-size: 14px; }

.planning-grid {
  min-width: 900px;
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
}

/* Header row */
.planning-header-row {
  display: grid;
  grid-template-columns: 64px repeat(7, 1fr);
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
}
.planning-time-th { padding: 12px 8px; }
.planning-day-th {
  padding: 12px 8px; text-align: center;
  border-left: 1px solid var(--border);
}
.planning-day-th.today {
  background: rgba(232,48,42,.06);
}
.planning-day-name {
  font-family: 'Bebas Neue', sans-serif; font-size: 15px; letter-spacing: .06em;
  color: var(--text);
}
.planning-day-date { font-size: 11px; color: var(--muted); margin-top: 2px; }
.planning-day-th.today .planning-day-name { color: var(--accent); }

/* Time rows */
.planning-row {
  display: grid;
  grid-template-columns: 64px repeat(7, 1fr);
  border-bottom: 1px solid var(--border);
  min-height: 64px;
}
.planning-row:last-child { border-bottom: none; }

.planning-time-td {
  padding: 10px 8px; font-size: 12px; color: var(--muted);
  font-weight: 600; letter-spacing: .04em;
  display: flex; align-items: flex-start; justify-content: flex-end;
  border-right: 1px solid var(--border);
  white-space: nowrap;
}

.planning-cell {
  padding: 4px; border-left: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 3px;
  background: var(--bg);
}
.planning-cell-empty { flex: 1; }

/* Slot cards */
.slot-card {
  border-radius: 5px; padding: 5px 7px;
  border-left: 3px solid var(--slot-color, #888);
  background: color-mix(in srgb, var(--slot-color, #888) 8%, var(--bg2));
  cursor: pointer; transition: background .15s, opacity .15s;
  min-height: 52px;
}
.slot-card:hover { background: color-mix(in srgb, var(--slot-color, #888) 16%, var(--bg2)); }

.slot-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 3px; }
.slot-type-badge {
  font-size: 9px; font-weight: 700; letter-spacing: .08em;
  padding: 2px 5px; border-radius: 3px; text-transform: uppercase;
}
.slot-label { font-size: 11px; font-weight: 600; color: var(--text); line-height: 1.2; }
.slot-note { font-size: 10px; color: var(--muted); display: block; }
.slot-time { font-size: 10px; color: var(--muted); margin-top: 2px; }
.slot-coach-name {
  font-size: 11px; color: var(--text); font-weight: 500;
  margin-top: 3px; display: block;
}
.slot-coach-name.unassigned { color: var(--muted); }
.slot-coach-name.cancelled { color: #ff7a75; text-decoration: line-through; }
.slot-add-btn {
  font-size: 11px; color: var(--accent); font-weight: 600;
  margin-top: 3px; display: block; opacity: .7;
}
.slot-card:hover .slot-add-btn { opacity: 1; }

.slot-unassigned {
  border-left-color: var(--border) !important;
  background: transparent !important;
  border: 1px dashed var(--border);
  opacity: .6;
}
.slot-unassigned:hover { opacity: 1; border-color: var(--accent); }
.slot-cancelled { opacity: .35; cursor: default; }
.slot-mine { box-shadow: 0 0 0 1px var(--slot-color, #888); }
.slot-override-dot { font-size: 8px; color: #ffb84d; }

.slot-free-access {
  background: var(--bg2) !important; border: none !important;
  border-radius: 4px; display: flex; align-items: center;
  padding: 4px 6px; cursor: default; min-height: 28px;
}
.slot-fa-label { font-size: 10px; color: var(--muted); font-style: italic; }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
}
.modal-box {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 12px; width: 420px; max-width: 95vw;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.modal-title { font-family:'Bebas Neue',sans-serif; font-size:18px; letter-spacing:.06em; }
.modal-close {
  background: none; border: none; color: var(--muted);
  font-size: 16px; cursor: pointer; padding: 4px;
}
.modal-close:hover { color: var(--text); }
.modal-body { padding: 20px; }
.modal-slot-info {
  background: var(--bg3); border-radius: 6px; padding: 10px 12px;
  font-size: 13px; color: var(--text); margin-bottom: 16px;
  display: flex; flex-direction: column; gap: 4px;
}
.assign-type-toggle { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.assign-type-option {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  font-size: 13px; color: var(--muted); padding: 6px;
  border-radius: 5px; border: 1px solid var(--border);
}
.assign-type-option:has(input:checked) {
  border-color: var(--accent); color: var(--text);
  background: rgba(232,48,42,.06);
}
.assign-type-option input { accent-color: var(--accent); }
.modal-actions { display: flex; justify-content: space-between; margin-top: 20px; align-items: center; }

/* ── Report ── */
.planning-report-wrap { margin-top: 12px; }
.report-table { display: flex; flex-direction: column; gap: 0; }
.report-header {
  display: grid; grid-template-columns: 160px 80px 1fr;
  padding: 8px 12px; font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em;
  border-bottom: 1px solid var(--border);
}
.report-row {
  display: grid; grid-template-columns: 160px 80px 1fr;
  padding: 10px 12px; border-bottom: 1px solid var(--border);
  align-items: center;
}
.report-row:last-child { border-bottom: none; }
.report-name { font-weight: 600; font-size: 13px; }
.report-total { font-family: 'Bebas Neue', sans-serif; font-size: 16px; color: var(--accent); }
.report-weeks { display: flex; flex-wrap: wrap; gap: 6px; }
.report-week-chip {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 4px; font-size: 11px; color: var(--muted);
  padding: 2px 7px;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .planning-nav { flex-direction: column; }
  .planning-grid { min-width: 700px; }
  .report-header, .report-row { grid-template-columns: 130px 60px 1fr; }
}

/* ══════════════════════════════════════════════════════════════════
   PLANNING MODULE
   ══════════════════════════════════════════════════════════════════ */

/* ── Page ── */
.page-planning { padding: 24px 0 60px; }

/* ── Week nav ── */
.planning-nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 16px;
}
.planning-nav-center {
  display: flex; align-items: center; gap: 12px; flex: 1; justify-content: center;
}
.planning-week-label {
  font-family: 'Bebas Neue', sans-serif; font-size: 18px; letter-spacing: .06em;
  color: var(--text);
}
.planning-nav-btn {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 6px;
  color: var(--muted); font-size: 13px; padding: 8px 16px; cursor: pointer;
  transition: border-color .2s, color .2s; white-space: nowrap;
}
.planning-nav-btn:hover { border-color: var(--accent); color: var(--text); }
.planning-today-btn {
  background: transparent; border: 1px solid var(--border); border-radius: 4px;
  color: var(--muted); font-size: 12px; padding: 4px 10px; cursor: pointer;
}
.planning-today-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── Legend ── */
.planning-legend {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px;
}
.legend-chip {
  font-size: 11px; padding: 3px 8px; border-radius: 4px;
  border: 1px solid; font-weight: 500; letter-spacing: .03em;
}

/* ── Grid ── */
.planning-grid-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.planning-grid-loading { text-align: center; padding: 60px; color: var(--muted); }
.planning-spinner { color: var(--muted); font-size: 14px; }

.planning-grid {
  min-width: 900px;
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
}

/* Header row */
.planning-header-row {
  display: grid;
  grid-template-columns: 64px repeat(7, 1fr);
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
}
.planning-time-th { padding: 12px 8px; }
.planning-day-th {
  padding: 12px 8px; text-align: center;
  border-left: 1px solid var(--border);
}
.planning-day-th.today {
  background: rgba(232,48,42,.06);
}
.planning-day-name {
  font-family: 'Bebas Neue', sans-serif; font-size: 15px; letter-spacing: .06em;
  color: var(--text);
}
.planning-day-date { font-size: 11px; color: var(--muted); margin-top: 2px; }
.planning-day-th.today .planning-day-name { color: var(--accent); }

/* Time rows */
.planning-row {
  display: grid;
  grid-template-columns: 64px repeat(7, 1fr);
  border-bottom: 1px solid var(--border);
  min-height: 64px;
}
.planning-row:last-child { border-bottom: none; }

.planning-time-td {
  padding: 10px 8px; font-size: 12px; color: var(--muted);
  font-weight: 600; letter-spacing: .04em;
  display: flex; align-items: flex-start; justify-content: flex-end;
  border-right: 1px solid var(--border);
  white-space: nowrap;
}

.planning-cell {
  padding: 4px; border-left: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 3px;
  background: var(--bg);
}
.planning-cell-empty { flex: 1; }

/* Slot cards */
.slot-card {
  border-radius: 5px; padding: 5px 7px;
  border-left: 3px solid var(--slot-color, #888);
  background: color-mix(in srgb, var(--slot-color, #888) 8%, var(--bg2));
  cursor: pointer; transition: background .15s, opacity .15s;
  min-height: 52px;
}
.slot-card:hover { background: color-mix(in srgb, var(--slot-color, #888) 16%, var(--bg2)); }

.slot-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 3px; }
.slot-type-badge {
  font-size: 9px; font-weight: 700; letter-spacing: .08em;
  padding: 2px 5px; border-radius: 3px; text-transform: uppercase;
}
.slot-label { font-size: 11px; font-weight: 600; color: var(--text); line-height: 1.2; }
.slot-note { font-size: 10px; color: var(--muted); display: block; }
.slot-time { font-size: 10px; color: var(--muted); margin-top: 2px; }
.slot-coach-name {
  font-size: 11px; color: var(--text); font-weight: 500;
  margin-top: 3px; display: block;
}
.slot-coach-name.unassigned { color: var(--muted); }
.slot-coach-name.cancelled { color: #ff7a75; text-decoration: line-through; }
.slot-add-btn {
  font-size: 11px; color: var(--accent); font-weight: 600;
  margin-top: 3px; display: block; opacity: .7;
}
.slot-card:hover .slot-add-btn { opacity: 1; }

.slot-unassigned {
  border-left-color: var(--border) !important;
  background: transparent !important;
  border: 1px dashed var(--border);
  opacity: .6;
}
.slot-unassigned:hover { opacity: 1; border-color: var(--accent); }
.slot-cancelled { opacity: .35; cursor: default; }
.slot-mine { box-shadow: 0 0 0 1px var(--slot-color, #888); }
.slot-override-dot { font-size: 8px; color: #ffb84d; }

.slot-free-access {
  background: var(--bg2) !important; border: none !important;
  border-radius: 4px; display: flex; align-items: center;
  padding: 4px 6px; cursor: default; min-height: 28px;
}
.slot-fa-label { font-size: 10px; color: var(--muted); font-style: italic; }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
}
.modal-box {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 12px; width: 420px; max-width: 95vw;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.modal-title { font-family:'Bebas Neue',sans-serif; font-size:18px; letter-spacing:.06em; }
.modal-close {
  background: none; border: none; color: var(--muted);
  font-size: 16px; cursor: pointer; padding: 4px;
}
.modal-close:hover { color: var(--text); }
.modal-body { padding: 20px; }
.modal-slot-info {
  background: var(--bg3); border-radius: 6px; padding: 10px 12px;
  font-size: 13px; color: var(--text); margin-bottom: 16px;
  display: flex; flex-direction: column; gap: 4px;
}
.assign-type-toggle { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.assign-type-option {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  font-size: 13px; color: var(--muted); padding: 6px;
  border-radius: 5px; border: 1px solid var(--border);
}
.assign-type-option:has(input:checked) {
  border-color: var(--accent); color: var(--text);
  background: rgba(232,48,42,.06);
}
.assign-type-option input { accent-color: var(--accent); }
.modal-actions { display: flex; justify-content: space-between; margin-top: 20px; align-items: center; }

/* ── Report ── */
.planning-report-wrap { margin-top: 12px; }
.report-table { display: flex; flex-direction: column; gap: 0; }
.report-header {
  display: grid; grid-template-columns: 160px 80px 1fr;
  padding: 8px 12px; font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em;
  border-bottom: 1px solid var(--border);
}
.report-row {
  display: grid; grid-template-columns: 160px 80px 1fr;
  padding: 10px 12px; border-bottom: 1px solid var(--border);
  align-items: center;
}
.report-row:last-child { border-bottom: none; }
.report-name { font-weight: 600; font-size: 13px; }
.report-total { font-family: 'Bebas Neue', sans-serif; font-size: 16px; color: var(--accent); }
.report-weeks { display: flex; flex-wrap: wrap; gap: 6px; }
.report-week-chip {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 4px; font-size: 11px; color: var(--muted);
  padding: 2px 7px;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .planning-nav { flex-direction: column; }
  .planning-grid { min-width: 700px; }
  .report-header, .report-row { grid-template-columns: 130px 60px 1fr; }
}

/* ══════════════════════════════════════════════════════════════════
   ABSENCE + NOTIFICATION SYSTEM
   ══════════════════════════════════════════════════════════════════ */

/* ── Notification bell ── */
.notif-bell {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 12px; cursor: pointer;
  font-size: 16px; position: relative; transition: border-color .2s;
}
.notif-bell:hover { border-color: var(--accent); }
.notif-badge {
  position: absolute; top: 4px; right: 4px;
  background: var(--accent); color: #fff; font-size: 10px;
  font-weight: 700; border-radius: 10px; padding: 1px 5px;
  min-width: 16px; text-align: center;
}
.notif-panel {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 10px; padding: 0; margin-bottom: 16px;
  max-height: 320px; overflow-y: auto;
}
.notif-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  font-size: 13px; font-weight: 600;
}
.notif-read-btn {
  background: none; border: none; color: var(--muted);
  font-size: 12px; cursor: pointer;
}
.notif-read-btn:hover { color: var(--accent); }
.notif-item { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.notif-item:last-child { border-bottom: none; }
.notif-msg { font-size: 13px; color: var(--text); line-height: 1.4; }
.notif-time { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* ── Open slots panel ── */
.open-slots-panel {
  background: var(--bg2); border: 1px solid #FF7A0044;
  border-radius: 10px; margin-bottom: 20px; overflow: hidden;
}
.open-slots-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: rgba(255,122,0,.06);
  border-bottom: 1px solid #FF7A0033;
}
.open-slots-title {
  font-family:'Bebas Neue',sans-serif; font-size:15px;
  letter-spacing:.06em; color:#FF7A00;
}
.open-slots-list { padding: 8px 12px; display: flex; flex-direction: column; gap: 8px; }
.open-slot-card {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; background: var(--bg3);
  border-radius: 6px; gap: 12px;
}
.open-slot-left { display: flex; align-items: center; gap: 10px; flex: 1; }
.open-slot-title { font-size: 13px; font-weight: 600; color: var(--text); }
.open-slot-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.open-slot-applied { font-size: 12px; color: #6accc0; font-weight: 600; white-space: nowrap; }

/* ── Absence declare btn ── */
.absence-declare-btn { white-space: nowrap; }

/* ── Absence calendar ── */
.absence-calendar { display: flex; flex-direction: column; gap: 8px; }
.absence-week-row { display: flex; align-items: center; gap: 6px; }
.absence-week-label {
  font-size: 11px; color: var(--muted); width: 70px; flex-shrink: 0;
  font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
}
.absence-day-btn {
  flex: 1; background: var(--bg3); border: 1px solid var(--border);
  border-radius: 6px; padding: 6px 4px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  transition: border-color .15s, background .15s;
}
.absence-day-btn:hover:not(:disabled) { border-color: var(--accent); }
.absence-day-btn.selected {
  background: rgba(232,48,42,.12); border-color: var(--accent);
}
.absence-day-btn.past { opacity: .35; cursor: default; }
.abd-day { font-size: 10px; color: var(--muted); font-weight: 600; text-transform: uppercase; }
.abd-date { font-size: 12px; color: var(--text); font-weight: 600; }
.absence-day-btn.selected .abd-date { color: var(--accent); }

/* ── Admin absence cards ── */
.admin-abs-card {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 8px; margin-bottom: 12px; overflow: hidden;
}
.admin-abs-header {
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
  background: rgba(255,122,0,.04);
}
.admin-abs-slot {
  padding: 10px 16px; border-bottom: 1px solid var(--border);
}
.admin-abs-slot:last-child { border-bottom: none; }
.admin-abs-slot.covered { opacity: .6; }
.admin-abs-slot-info {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
}
.admin-abs-apps { display: flex; flex-direction: column; gap: 6px; }
.admin-abs-app {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg2); border-radius: 6px; padding: 8px 12px;
}
.admin-abs-applicant { font-size: 13px; font-weight: 500; }
.admin-abs-app-btns { display: flex; gap: 6px; }

/* ── Toast ── */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 8px; padding: 12px 18px;
  font-size: 13px; color: var(--text);
  box-shadow: 0 4px 24px rgba(0,0,0,.4);
  transform: translateY(20px); opacity: 0;
  transition: transform .3s, opacity .3s;
  max-width: 380px;
}
.toast.toast-show { transform: translateY(0); opacity: 1; }
.toast.toast-success { border-color: #6accc044; }
.toast.toast-warn    { border-color: #ffb84d44; }
.toast.toast-error   { border-color: #ff7a7544; }

/* ── Planning: new abs calendar month view ─────────── */
.abs-cal-wrap { user-select: none; }
.abs-cal-header {
  display: grid; grid-template-columns: repeat(7,1fr);
  gap: 2px; margin-bottom: 6px;
}
.abs-cal-dh {
  text-align: center; font-size: .72rem; font-weight: 600;
  color: var(--muted); padding: 4px 0; text-transform: uppercase;
}
.abs-cal-body {
  display: grid; grid-template-columns: repeat(7,1fr); gap: 3px;
}
.abs-cal-cell {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  border-radius: 8px; font-size: .82rem; cursor: pointer;
  transition: all .15s; border: 1px solid transparent;
}
.abs-cal-day:hover { background: rgba(247,243,238,.08); border-color: rgba(247,243,238,.15); }
.abs-cal-past   { color: var(--muted); cursor: default; opacity: .38; }
.abs-cal-today  { border-color: #E8302A55; color: #E8302A; }
.abs-cal-sel    { background: #E8302A22 !important; border-color: #E8302A88 !important; color: #E8302A !important; font-weight: 700; }
.abs-cal-empty  { cursor: default; }
.cal-nav .planning-nav-btn { padding: 4px 12px; font-size: .9rem; }

/* ── My hours section ── */
#myHoursSection .admin-stat { padding: 10px 16px; min-width: 110px; text-align: center; }
#chartMyHours { max-height: 160px; }
.open-slot-absent { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ── Hours evolution ── */
#chartEvolution { width: 100% !important; }

/* ── Notif item read state ── */
.notif-item { padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: .82rem; line-height: 1.5; }
.notif-item:last-child { border-bottom: none; }
.notif-read { opacity: .5; }
.notif-item strong { color: var(--fg); }
.notif-time { display: block; font-size: .72rem; color: var(--muted); margin-top: 3px; }

/* ── Absence cards admin ── */
.abs-coach-header { display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 14px; border-bottom: 1px solid var(--border); background: rgba(255,122,0,.04); }
.abs-note { font-size: .78rem; color: var(--muted); font-style: italic; }
.abs-slot-row { padding: 8px 14px; border-bottom: 1px solid var(--border); font-size: .82rem; }
.abs-slot-row:last-child { border-bottom: none; }
.abs-app-row { display: flex; align-items: center; justify-content: space-between;
  padding: 6px 0; }

/* ── Slot management ── */
.slots-table { display:flex; flex-direction:column; gap:0; border:1px solid var(--border); border-radius:8px; overflow:hidden; }
.slots-header { display:grid; grid-template-columns:120px 80px 70px 1fr 1fr 160px; gap:8px; padding:10px 14px; background:var(--surface-2); font-size:11px; font-weight:600; letter-spacing:.05em; color:var(--muted); text-transform:uppercase; }
.slots-row { display:grid; grid-template-columns:120px 80px 70px 1fr 1fr 160px; gap:8px; padding:10px 14px; border-top:1px solid var(--border); align-items:center; font-size:13px; transition:background .15s; }
.slots-row:hover { background:var(--surface-2); }
.slot-row-inactive { opacity:.5; }
.slots-inactive-header { padding:8px 14px; font-size:11px; text-transform:uppercase; color:var(--muted); letter-spacing:.05em; background:var(--surface-2); border-top:1px solid var(--border); }
.slot-actions { display:flex; gap:6px; }
.btn-edit { background:transparent; border:1px solid var(--muted); color:var(--muted); border-radius:6px; padding:4px 10px; font-size:12px; cursor:pointer; transition:all .15s; }
.btn-edit:hover { border-color:var(--text); color:var(--text); }
.btn-sm { background:transparent; border:1px solid var(--border); color:var(--text); border-radius:6px; padding:4px 10px; font-size:12px; cursor:pointer; transition:all .15s; }
.dow-checkboxes { display:flex; gap:8px; flex-wrap:wrap; margin-top:6px; }
.dow-cb { display:flex; align-items:center; gap:4px; font-size:13px; cursor:pointer; padding:5px 10px; border:1px solid var(--border); border-radius:6px; transition:all .15s; }
.dow-cb:has(input:checked) { border-color:var(--accent); background:var(--accent)22; color:var(--accent); }
.dow-cb input { display:none; }
.slots-list { margin-bottom:0; }

/* ── Enhanced assignment modal ── */
.assign-type-grid { display:grid; grid-template-columns:1fr 1fr; gap:6px; margin-top:6px; }
.assign-type-grid .assign-type-option { display:flex; align-items:center; gap:8px; padding:8px 12px; border:1px solid var(--border); border-radius:6px; cursor:pointer; font-size:13px; transition:all .15s; }
.assign-type-grid .assign-type-option:has(input:checked) { border-color:var(--accent); background:var(--accent)15; }
.assign-type-grid .assign-type-option input[type=radio] { accent-color:var(--accent); width:14px; height:14px; }
.assign-type-toggle .assign-type-option { display:flex; align-items:center; gap:8px; padding:8px 12px; border:1px solid var(--border); border-radius:6px; cursor:pointer; font-size:13px; transition:all .15s; margin-bottom:4px; }
.assign-type-toggle .assign-type-option:has(input:checked) { border-color:var(--accent); background:var(--accent)15; }
.assign-type-toggle .assign-type-option input[type=radio] { accent-color:var(--accent); width:14px; height:14px; }

/* ── FAQ markdown rendering ── */
.faq-heading { display:block; font-weight:700; font-size:13px; margin:10px 0 4px; letter-spacing:.02em; color:var(--text); }
.faq-li { display:flex; gap:7px; padding:2px 0; font-size:13px; line-height:1.5; }
.faq-li::before { content:'•'; color:var(--accent); flex-shrink:0; font-weight:700; }
.faq-callout { display:block; padding:6px 10px; margin:6px 0; background:var(--surface-2); border-left:3px solid var(--accent); border-radius:0 6px 6px 0; font-size:12px; line-height:1.5; }
.faq-para-break { height:8px; }
.faq-msg strong { font-weight:700; }
.faq-msg em { font-style:italic; color:var(--muted); }
.faq-h1 { font-size:15px; margin-top:4px; }
.faq-h1 { font-size:15px; margin-top:4px; }

/* ── My absences list ── */
.my-absence-row { display:flex; align-items:center; gap:12px; padding:9px 0; border-bottom:1px solid var(--border); flex-wrap:wrap; }
.my-absence-row:last-child { border-bottom:none; }
.my-absence-dates { font-size:13px; font-weight:500; min-width:160px; }
.my-absence-note { font-size:12px; color:var(--muted); flex:1; font-style:italic; }
.my-absence-status { font-size:11px; padding:3px 8px; border-radius:20px; border:1px solid; font-weight:600; white-space:nowrap; }
.my-absence-slots { font-size:12px; white-space:nowrap; }
/* ── Section collapse ── */
.section-collapse-header { display:flex; align-items:center; justify-content:space-between; cursor:pointer; user-select:none; }
.section-collapse-header:hover .admin-section-title { color:var(--accent); }
.section-collapse-arrow { font-size:13px; color:var(--muted); transition:transform .2s; }
/* ── Slot form grid ── */
.new-slot-grid { display:flex; gap:12px; flex-wrap:wrap; }

/* ── Admin absence panel ── */
.admin-abs-card { background:var(--surface-2); border:1px solid var(--border); border-radius:10px; padding:14px 16px; margin-bottom:12px; }
.admin-abs-card:last-child { margin-bottom:0; }
.abs-coach-header { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:10px; }
.absence-date-range { font-size:12px; color:var(--muted); }
.abs-slot-row { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; padding:8px 0; border-top:1px solid var(--border); flex-wrap:wrap; }
.abs-slot-info { display:flex; align-items:center; gap:8px; flex-wrap:wrap; font-size:13px; }
.abs-slot-actions { display:flex; flex-direction:column; gap:6px; align-items:flex-end; }
.abs-app-row { display:flex; align-items:center; gap:8px; }
.abs-app-name { font-size:13px; }
.abs-direct-assign { display:flex; align-items:center; gap:6px; }
.abs-coach-sel { min-width:140px; }
.abs-no-slots { font-size:12px; color:var(--muted); font-style:italic; margin:4px 0; }
.absence-count-badge { display:inline-block; background:#FF7A00; color:#000; font-size:11px; font-weight:700; padding:2px 7px; border-radius:20px; }
/* ── Open slots panel ── */
.open-slots-panel { background:var(--surface-2); border:1px solid #FF7A0044; border-radius:10px; padding:14px 16px; margin-bottom:20px; }

/* ── Admin absence table (compact) ── */
.abs-table-header { display:grid; grid-template-columns:1fr 70px 1fr auto; gap:8px 12px; padding:6px 12px; font-size:10px; font-weight:700; letter-spacing:.08em; color:var(--muted); text-transform:uppercase; border-bottom:1px solid var(--border); margin-bottom:2px; }
.abs-table-row { display:grid; grid-template-columns:1fr 70px 1fr auto; gap:6px 12px; align-items:center; padding:8px 12px; border-bottom:1px solid var(--border); transition:background .15s; }
.abs-table-row:last-child { border-bottom:none; }
.abs-table-row:hover { background:var(--surface-hover,rgba(255,255,255,.03)); }
.abs-row-noslot { opacity:.65; }
.abs-col-coach { font-size:13px; font-weight:600; }
.abs-col-date { font-size:12px; color:var(--muted); white-space:nowrap; }
.abs-col-slot { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.abs-col-actions { display:flex; align-items:center; gap:6px; justify-content:flex-end; flex-wrap:wrap; }
.abs-col-actions select { height:28px; padding:0 6px; font-size:12px; background:var(--surface-2); border:1px solid var(--border); color:var(--text); border-radius:5px; cursor:pointer; min-width:130px; }
.abs-validate-btn { background:transparent; border:1px solid #2DB67D; color:#2DB67D; padding:3px 8px; border-radius:5px; font-size:11px; font-weight:700; cursor:pointer; white-space:nowrap; }
.abs-validate-btn:hover { background:#2DB67D22; }

/* ── ClubPlanner sections ── */
.cp-section { border-left: 3px solid #E8302A; }
.cp-live-badge { font-size: 10px; color: #E8302A; font-weight: 700; letter-spacing: .05em; animation: cpPulse 2s infinite; }
@keyframes cpPulse { 0%,100%{opacity:1} 50%{opacity:.4} }
.cp-refresh-btn { font-size: .75rem; padding: 4px 10px; }

.cp-kpi-row { display: flex; gap: 12px; flex-wrap: wrap; }
.cp-kpi-card {
  flex: 1 1 120px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 16px; min-width: 110px;
}
.cp-kpi-card.cp-loading { color: var(--muted); font-size: 13px; flex: none; width: auto; }
.cp-kpi-card.cp-kpi-green { border-color: #6accc044; }
.cp-kpi-card.cp-kpi-gold  { border-color: #D4A01744; }
.cp-kpi-val   { font-family: 'Bebas Neue', sans-serif; font-size: 2rem; line-height: 1; color: var(--text); }
.cp-kpi-label { font-size: 11px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; margin-top: 4px; }
.cp-kpi-green .cp-kpi-val { color: #6accc0; }
.cp-kpi-gold  .cp-kpi-val { color: #D4A017; }

.cp-charts-row { display: flex; gap: 16px; flex-wrap: wrap; }
.cp-chart-box { flex: 1 1 260px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 14px; min-width: 220px; }
.cp-chart-title { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }

.cp-table { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.cp-table-header { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; padding: 8px 14px; font-size: 10px; font-weight: 700; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; border-bottom: 1px solid var(--border); }
.cp-table-row { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; padding: 9px 14px; border-bottom: 1px solid var(--border); font-size: 13px; align-items: center; }
.cp-table-row:last-child { border-bottom: none; }
.cp-table-row:hover { background: var(--surface-hover, rgba(255,255,255,.02)); }
/* 2-col tables */
.cp-table.cp-table-2 .cp-table-header,
.cp-table.cp-table-2 .cp-table-row { grid-template-columns: 1fr auto; }

.cp-error-card { background: #ff7a7511; border: 1px solid #ff7a7533; border-radius: 10px; padding: 14px 16px; color: #ff7a75; font-size: 13px; }

/* ── Stock ── */
.stock-cat-title { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 16px 0 8px; }
.stock-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.stock-card {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px; position: relative; transition: border-color .15s;
}
.stock-card.stock-low { border-color: #ff7a7555; background: #ff7a7508; }
.stock-card-name { font-size: .85rem; font-weight: 600; margin-bottom: 4px; line-height: 1.2; }
.stock-card-meta { display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted); margin-bottom: 10px; }
.stock-qty-row { display: flex; align-items: center; justify-content: center; gap: 10px; }
.stock-btn { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 1rem; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all .15s; }
.stock-btn:hover { border-color: var(--accent); color: var(--accent); }
.stock-btn-plus:hover { border-color: #6accc0; color: #6accc0; }
.stock-qty { font-family: 'Bebas Neue', sans-serif; font-size: 1.5rem; min-width: 36px; text-align: center; }
.stock-qty-low   { color: #ffb84d; }
.stock-qty-empty { color: #ff7a75; }
.stock-delete-btn { position: absolute; top: 6px; right: 6px; background: none; border: none; color: var(--muted); cursor: pointer; font-size: 11px; opacity: .5; padding: 2px 4px; }
.stock-delete-btn:hover { color: #ff7a75; opacity: 1; }
.stock-add-details summary::-webkit-details-marker { display: none; }

@media (max-width: 640px) {
  .cp-kpi-row { gap: 8px; }
  .cp-kpi-card { flex: 1 1 calc(50% - 8px); padding: 10px 12px; }
  .cp-kpi-val { font-size: 1.6rem; }
  .cp-charts-row { flex-direction: column; }
  .stock-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE — CFL Dashboard  (appended — complète les règles existantes)
   Mobile  : ≤ 640px
   Tablet  : 641 – 1024px
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Tablet (641–1024px) ── */
@media (max-width: 1024px) {

  /* Planning grid: scroll horizontal si trop serré */
  .planning-grid-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .planning-grid      { min-width: 640px; }

  /* Absence table: 3 colonnes sur tablette */
  .abs-table-header,
  .abs-table-row { grid-template-columns: 130px 1fr auto; }
  .abs-col-date  { display: none; }

  /* Charts planning */
  .planning-charts { flex-direction: column !important; }
  .planning-chart-box { width: 100% !important; }

  /* Admin stats */
  .admin-stats { flex-wrap: wrap; }
  .admin-stat  { flex: 1 1 140px; }
}

/* ── Mobile (≤ 640px) ── */
@media (max-width: 640px) {

  /* ── Base ── */
  .main { padding: 16px 12px 88px; } /* marge bas pour FAB */
  .page-title { font-size: clamp(1.8rem, 9vw, 2.6rem); }
  .page-header { margin-bottom: 20px; }

  /* ── Planning nav ── */
  .planning-nav {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .planning-nav-btn    { font-size: .82rem; padding: 9px 12px; text-align: center; }
  .planning-nav-center { flex-direction: column; align-items: center; gap: 6px; }
  .planning-week-label { font-size: .82rem; text-align: center; }

  /* ── Planning grid ── */
  .planning-grid-wrap  { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 10px; }
  .planning-grid       { min-width: 520px; font-size: .72rem; }
  .planning-time-td    { font-size: .7rem; min-width: 44px; padding: 6px 4px; }
  .planning-cell       { min-width: 68px; padding: 3px; }
  .planning-day-name   { font-size: .7rem; }
  .planning-day-date   { font-size: .66rem; }
  .planning-day-th     { padding: 6px 4px; }
  .slot-card           { padding: 5px; border-radius: 6px; }
  .slot-label          { font-size: .7rem; line-height: 1.2; }
  .slot-time           { font-size: .62rem; }
  .slot-type-badge     { font-size: .62rem; padding: 1px 4px; }
  .slot-coach-name     { font-size: .68rem; }
  .slot-add-btn        { font-size: .68rem; }

  /* ── Planning legend ── */
  .planning-legend { gap: 5px; flex-wrap: wrap; }
  .legend-chip     { font-size: .7rem; padding: 3px 7px; }

  /* ── Planning: section header (absent·e / horaires) ── */
  .planning-section-hdr { flex-direction: column; gap: 6px; align-items: flex-start; }

  /* ── Absence table → cartes empilées ── */
  .abs-table-header { display: none !important; }
  .abs-table-row {
    display: flex !important;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 8px;
  }
  .abs-col-date    { display: block !important; font-size: .78rem; color: var(--muted); }
  .abs-col-coach   { font-size: .9rem; font-weight: 700; }
  .abs-col-slot    { font-size: .82rem; }
  .abs-col-actions {
    display: flex !important;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 2px;
  }
  .abs-col-actions select  { flex: 1 1 120px; height: 34px; font-size: .82rem; }
  .abs-col-actions .btn-primary,
  .abs-col-actions .btn-danger-sm { flex-shrink: 0; }

  /* ── Open slots panel ── */
  .open-slots-panel { padding: 12px; }
  .open-slot-card   { flex-direction: column; align-items: flex-start; gap: 8px; }
  .open-slot-left   { flex-wrap: wrap; }

  /* ── Mes absences ── */
  .my-absence-row   { flex-direction: column; gap: 4px; align-items: flex-start; }

  /* ── Modal ── */
  .modal-overlay { padding: 12px; align-items: flex-end; }
  .modal-box {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 88vh;
    overflow-y: auto;
    border-radius: 14px 14px 0 0;
    padding: 18px 16px;
  }
  .assign-type-grid  { grid-template-columns: 1fr !important; }
  .modal-actions     { flex-direction: column; gap: 8px; }
  .modal-actions button { width: 100%; }

  /* ── Admin stats ── */
  .admin-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .admin-stat-wide { grid-column: 1 / -1; }

  /* ── Admin refresh grid ── */
  .admin-refresh-grid { grid-template-columns: 1fr !important; }

  /* ── Users table → lignes simplifiées ── */
  .users-header { display: none; }
  .users-row    { display: flex; flex-wrap: wrap; gap: 6px 12px; padding: 10px 12px; align-items: center; }
  .user-username { width: 100%; font-size: .75rem; color: var(--muted); }
  .user-name     { flex: 1; font-size: .9rem; font-weight: 600; }
  .user-role     { font-size: .75rem; }
  .add-form-row  { flex-direction: column !important; }
  .add-form-row .form-group { width: 100%; }

  /* ── Charts ── */
  .planning-charts,
  .charts-row { flex-direction: column !important; gap: 12px; }
  .planning-chart-box,
  .chart-card { width: 100% !important; min-width: 0 !important; }

  /* ── FAQ panel : largeur pleine écran ── */
  #faqPanel {
    width: calc(100vw - 16px) !important;
    right: 8px !important;
    left: 8px !important;
    bottom: 78px !important;
    max-height: 62vh !important;
  }

  /* ── Notification panel ── */
  #notifPanel {
    width: calc(100vw - 24px) !important;
    right: 12px !important;
    max-height: 70vh !important;
    overflow-y: auto;
  }

  /* ── Toast : au-dessus du FAB ── */
  #toastContainer {
    bottom: 80px !important;
    right: 12px !important;
    left: 12px !important;
    align-items: stretch !important;
  }

  /* ── FAQ admin gaps ── */
  .faq-gap-actions { flex-direction: column; gap: 8px; }
  .faq-gap-actions button { width: 100%; }

  /* ── Rapport horaires ── */
  .report-header { font-size: .75rem; }
  .report-row    { font-size: .8rem; flex-wrap: wrap; }
  .report-weeks  { flex-wrap: wrap; gap: 4px; }
  .report-week-chip { font-size: .7rem; }

  /* ── Tap targets : 44px min ── */
  .btn-primary,
  .btn-danger-sm,
  .planning-nav-btn,
  .planning-today-btn,
  .btn-ghost,
  .filter-btn,
  .filter-pill { min-height: 40px; }

  /* ── Semaine (week view) ── */
  .week-nav-row { flex-direction: column; align-items: center; gap: 8px; }

  /* ── Library ── */
  .library-controls { flex-direction: column; gap: 10px; }
  .library-search-wrap { width: 100%; }
  .library-filters,
  .library-pattern-filters { gap: 6px; flex-wrap: wrap; }
  .filter-btn, .filter-pill { font-size: .78rem; padding: 6px 10px; }

  /* ── WOD nav ── */
  .wod-nav     { flex-wrap: wrap; gap: 6px; }
  .wod-nav-btn { font-size: .82rem; padding: 8px 12px; }
  .track-selector { gap: 6px; flex-wrap: wrap; }
  .track-pill { font-size: .78rem; padding: 5px 10px; }
}

/* ── Très petits écrans (≤ 380px) ── */
@media (max-width: 380px) {
  .page-title    { font-size: 1.6rem; }
  .planning-grid { min-width: 460px; }
  .modal-box     { padding: 14px 12px; }
}

/* ═══════════════════════════════════════════════════════════════════
   ADMIN SHELL — layout sidebar + main
   ═══════════════════════════════════════════════════════════════════ */
.admin-shell {
  display: flex;
  min-height: calc(100vh - var(--nav-h, 56px));
}

/* ── Sidebar ── */
.admin-sidebar {
  width: 220px; flex-shrink: 0;
  background: var(--surface, #111);
  border-right: 1px solid var(--border, #222);
  position: sticky; top: var(--nav-h, 56px);
  height: calc(100vh - var(--nav-h, 56px));
  overflow-y: auto; display: flex; flex-direction: column;
  z-index: 50;
}
.sidebar-logo {
  padding: 18px 16px 12px;
  font-family: 'Bebas Neue', sans-serif; font-size: 1.3rem;
  border-bottom: 1px solid var(--border); letter-spacing: .06em;
}
.sidebar-logo-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #E8302A; margin-right: 6px; }
.sidebar-nav { padding: 12px 8px; flex: 1; }
.sidebar-group-label { font-size: 9px; font-weight: 700; letter-spacing: .12em; color: var(--muted); padding: 6px 10px 4px; }
.snav {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 9px 12px; border-radius: 8px; border: none; background: none;
  color: var(--text); font-size: .82rem; font-weight: 500; cursor: pointer;
  text-align: left; transition: background .15s; position: relative;
}
.snav span:first-child { font-size: 1rem; }
.snav:hover { background: var(--surface-2); }
.snav.active { background: #E8302A18; color: #E8302A; font-weight: 700; }
.snav-badge { margin-left: auto; background: #E8302A; color: #fff; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 20px; display: none; }
.sidebar-footer {
  padding: 14px 16px; border-top: 1px solid var(--border);
  font-size: .8rem; color: var(--muted); display: flex; align-items: center; gap: 8px;
}
.sidebar-user-dot { width: 7px; height: 7px; border-radius: 50%; background: #2DB67D; flex-shrink: 0; }

/* ── Main ── */
.admin-main { flex: 1; overflow-y: auto; padding: 28px 28px 60px; min-width: 0; }

/* ── Sections ── */
.asection { display: none; }
.asection.active { display: block; }
.asection-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 24px; gap: 16px; flex-wrap: wrap;
}
.asection-title { font-family: 'Bebas Neue', sans-serif; font-size: 2rem; margin: 0; letter-spacing: .04em; }
.asection-sub { font-size: .82rem; color: var(--muted); margin: 2px 0 0; }

/* ── CP KPI progress ── */
.cp-progress-bar { height: 4px; background: var(--border); border-radius: 4px; margin-top: 6px; }
.cp-progress-fill { height: 100%; border-radius: 4px; background: #6accc0; transition: width .4s; }

/* ═══════════════════════════════════════════════════════════════════
   PROJECTS
   ═══════════════════════════════════════════════════════════════════ */
.projects-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px;
}
.proj-card {
  background: var(--surface-2); border: 1px solid var(--border);
  border-top: 3px solid var(--proj-color, #888);
  border-radius: 12px; padding: 16px; cursor: pointer;
  transition: box-shadow .15s, transform .1s;
}
.proj-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,.3); transform: translateY(-1px); }
.proj-card-top { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.proj-color-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.proj-status { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 20px; margin-right: auto; }
.proj-status-active { background: #2DB67D22; color: #2DB67D; }
.proj-status-paused { background: #ffb84d22; color: #ffb84d; }
.proj-status-completed { background: #6accc022; color: #6accc0; }
.proj-edit-btn { background: none; border: none; cursor: pointer; font-size: 13px; opacity: .5; padding: 2px 4px; }
.proj-edit-btn:hover { opacity: 1; }
.proj-title { font-family: 'Bebas Neue', sans-serif; font-size: 1.2rem; margin: 0 0 6px; letter-spacing: .03em; }
.proj-desc { font-size: .78rem; color: var(--muted); margin: 0 0 10px; line-height: 1.4; }
.proj-due { font-size: .75rem; color: var(--muted); margin-bottom: 8px; }
.proj-stats { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.proj-stat { font-size: .72rem; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 2px 8px; color: var(--muted); }
.proj-stat-urgent { border-color: #ff7a7544; color: #ff7a75; background: #ff7a7511; }
.proj-okrs { margin-bottom: 10px; display: flex; flex-direction: column; gap: 6px; }
.proj-okr-row { display: flex; flex-direction: column; gap: 2px; }
.proj-okr-title { font-size: .72rem; color: var(--muted); }
.proj-okr-bar { height: 4px; background: var(--border); border-radius: 4px; }
.proj-okr-fill { height: 100%; border-radius: 4px; transition: width .4s; }
.proj-okr-pct { font-size: .7rem; font-weight: 700; }
.proj-progress-bar { height: 3px; background: var(--border); border-radius: 3px; margin-top: 8px; }
.proj-progress-fill { height: 100%; border-radius: 3px; transition: width .4s; }
.proj-progress-label { font-size: .7rem; color: var(--muted); margin-top: 4px; }

/* ── Kanban ── */
.kanban-header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.kanban-title { font-family: 'Bebas Neue', sans-serif; font-size: 1.4rem; flex: 1; }
.kanban-board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; align-items: start; }
.kbn-col { background: var(--surface-2); border-radius: 10px; padding: 12px; min-height: 200px; }
.kbn-col-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border); font-size: .75rem; font-weight: 700; letter-spacing: .08em; }
.kbn-count { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 1px 7px; font-size: 11px; }
.kbn-cards { display: flex; flex-direction: column; gap: 8px; min-height: 40px; }
.kbn-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px; cursor: pointer; transition: border-color .15s; }
.kbn-card:hover { border-color: #E8302A44; }
.kbn-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.kbn-prio { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.kbn-avatar { width: 22px; height: 22px; border-radius: 50%; font-size: 10px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.kbn-avatar-victor { background: #E8302A33; color: #E8302A; }
.kbn-avatar-nico   { background: #6accc033; color: #6accc0; }
.kbn-card-title { font-size: .82rem; font-weight: 600; line-height: 1.3; margin-bottom: 6px; }
.kbn-card-footer { display: flex; justify-content: space-between; align-items: center; font-size: .7rem; color: var(--muted); }
.kbn-due { }
.kbn-overdue { color: #ff7a75; font-weight: 700; }
.kbn-notes-icon { font-size: 11px; }
.kbn-card-actions { display: flex; gap: 4px; margin-top: 6px; justify-content: flex-end; }
.kbn-move-btn { background: none; border: 1px solid var(--border); border-radius: 4px; padding: 1px 6px; cursor: pointer; color: var(--muted); font-size: 11px; }
.kbn-move-btn:hover { border-color: var(--accent); color: var(--accent); }
.kbn-add-btn { width: 100%; margin-top: 8px; background: none; border: 1px dashed var(--border); border-radius: 8px; padding: 8px; cursor: pointer; color: var(--muted); font-size: .78rem; transition: border-color .15s; }
.kbn-add-btn:hover { border-color: #E8302A; color: #E8302A; }

/* ═══════════════════════════════════════════════════════════════════
   TASKS SECTION
   ═══════════════════════════════════════════════════════════════════ */
.task-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.tasks-dual-pane { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.tasks-pane { background: var(--surface-2); border-radius: 12px; padding: 14px; }
.tasks-pane-header { display: flex; align-items: center; gap: 8px; font-size: .72rem; font-weight: 800; letter-spacing: .1em; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.tp-dot { width: 8px; height: 8px; border-radius: 50%; }
.tp-dot-v { background: #E8302A; }
.tp-dot-n { background: #6accc0; }
.tasks-list { display: flex; flex-direction: column; gap: 6px; }
.task-row {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  cursor: pointer; transition: border-color .15s;
}
.task-row:hover { border-color: #E8302A44; }
.task-done { opacity: .45; }
.task-prio-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.task-row-content { flex: 1; min-width: 0; }
.task-row-title { font-size: .84rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-row-meta { display: flex; gap: 6px; margin-top: 3px; flex-wrap: wrap; align-items: center; }
.task-proj-badge { font-size: .68rem; padding: 1px 6px; border-radius: 20px; font-weight: 600; }
.task-due { font-size: .7rem; color: var(--muted); }
.task-overdue { color: #ff7a75; font-weight: 700; }
.task-status-badge { font-size: .67rem; font-weight: 700; letter-spacing: .05em; padding: 1px 6px; border-radius: 20px; }
.task-status-todo   { background: #88888822; color: #888; }
.task-status-doing  { background: #7ab0f022; color: #7ab0f0; }
.task-status-review { background: #ffb84d22; color: #ffb84d; }
.task-status-done   { background: #2DB67D22; color: #2DB67D; }
.task-done-btn { background: none; border: 1px solid var(--border); border-radius: 6px; padding: 3px 7px; cursor: pointer; color: var(--muted); font-size: 12px; flex-shrink: 0; }
.task-done-btn:hover { border-color: #2DB67D; color: #2DB67D; }

/* ── Link rows in modal ── */
.link-row { display: flex; gap: 8px; margin-bottom: 6px; align-items: center; }

/* ═══════════════════════════════════════════════════════════════════
   CALENDAR
   ═══════════════════════════════════════════════════════════════════ */
.cal-legend { display: flex; gap: 8px; margin-bottom: 10px; }
.cal-chip { font-size: .72rem; padding: 3px 8px; border-radius: 20px; font-weight: 600; }
.cal-chip-v      { background: #E8302A22; color: #E8302A; }
.cal-chip-n      { background: #6accc022; color: #6accc0; }
.cal-chip-urgent { background: #ff7a7522; color: #ff7a75; }
.cal-grid-header { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 4px; }
.cal-grid-header > div { text-align: center; font-size: .72rem; font-weight: 700; letter-spacing: .06em; color: var(--muted); padding: 4px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-cell { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; min-height: 90px; padding: 6px; }
.cal-cell-empty { background: transparent; border: none; }
.cal-today { border-color: #E8302A; background: #E8302A0a; }
.cal-has-overdue { border-color: #ff7a7544; }
.cal-day-num { font-size: .78rem; font-weight: 700; color: var(--muted); display: block; margin-bottom: 4px; }
.cal-today .cal-day-num { color: #E8302A; }
.cal-day-tasks { display: flex; flex-direction: column; gap: 2px; }
.cal-task-chip { font-size: .64rem; padding: 2px 5px; border-radius: 4px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-chip-victor { background: #E8302A22; color: #E8302A; }
.cal-chip-nico   { background: #6accc022; color: #6accc0; }
.cal-urgent      { outline: 1px solid #ff7a75; }

/* ═══════════════════════════════════════════════════════════════════
   INSIGHTS
   ═══════════════════════════════════════════════════════════════════ */
.insight-alerts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.insight-alert { background: #ff7a7511; border: 1px solid #ff7a7533; border-radius: 8px; padding: 8px 14px; font-size: .84rem; color: #ff7a75; }
.insight-ok { background: #2DB67D11; border-color: #2DB67D33; color: #2DB67D; }
.insight-box { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.insight-box-title { font-size: .72rem; font-weight: 800; letter-spacing: .1em; color: var(--muted); margin-bottom: 12px; }
.matrix-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.matrix-cell { border-radius: 8px; padding: 10px; min-height: 100px; }
.matrix-do-now  { background: #ff7a7511; border: 1px solid #ff7a7533; }
.matrix-plan    { background: #ffb84d11; border: 1px solid #ffb84d33; }
.matrix-delegate{ background: #6accc011; border: 1px solid #6accc033; }
.matrix-drop    { background: #88888811; border: 1px solid #88888833; }
.matrix-label   { font-size: .68rem; font-weight: 700; margin-bottom: 8px; line-height: 1.3; }
.matrix-task { font-size: .75rem; display: flex; align-items: center; gap: 6px; padding: 4px 6px; background: rgba(0,0,0,.2); border-radius: 6px; margin-bottom: 4px; cursor: pointer; }
.matrix-task:hover { background: rgba(255,255,255,.05); }
.matrix-due { margin-left: auto; font-size: .65rem; color: var(--muted); }
.workload-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.workload-name { font-size: .8rem; display: flex; align-items: center; gap: 6px; width: 90px; flex-shrink: 0; }
.workload-bar-wrap { flex: 1; height: 8px; background: var(--border); border-radius: 8px; }
.workload-bar { height: 100%; border-radius: 8px; transition: width .4s; }
.workload-count { font-size: .78rem; font-weight: 700; width: 60px; text-align: right; }
.health-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: .82rem; border: 1px solid var(--border); margin-bottom: 6px; }
.health-row:hover { background: var(--surface); }
.health-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.health-title { flex: 1; font-weight: 600; }
.health-stats { font-size: .72rem; color: var(--muted); }

/* ── Modal wide ── */
.modal-box-wide { max-width: 680px; }

/* ── Mobile sidebar ── */
@media (max-width: 768px) {
  .admin-sidebar { width: 56px; }
  .sidebar-logo { padding: 14px 12px; font-size: 1rem; }
  .sidebar-logo span:last-child, .sidebar-logo span:nth-child(2) { display: none; }
  .snav span:nth-child(2) { display: none; }
  .snav { justify-content: center; padding: 10px; }
  .snav-badge { position: absolute; top: 4px; right: 4px; }
  .sidebar-group-label, .sidebar-footer span { display: none; }
  .admin-main { padding: 16px 12px; }
  .kanban-board { grid-template-columns: 1fr; }
  .tasks-dual-pane { grid-template-columns: 1fr; }
  .matrix-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
}


/* ── Pending absence pill on slot card ── */
.slot-pending-pill {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 18px; height: 18px;
  background: #FF7A00; color: #fff;
  border-radius: 50%; font-size: 11px; font-weight: 800;
  margin-left: auto;
  cursor: pointer;
  animation: pulsePill 1.8s infinite;
  box-shadow: 0 0 0 0 rgba(255,122,0,0.6);
  transition: transform .15s;
}
.slot-pending-pill:hover { transform: scale(1.15); }
@keyframes pulsePill {
  0%   { box-shadow: 0 0 0 0 rgba(255,122,0,0.6); }
  70%  { box-shadow: 0 0 0 8px rgba(255,122,0,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,122,0,0); }
}
.slot-top { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }


/* ── Validated application badge ── */
.abs-validated-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: #2DB67D22; color: #2DB67D;
  border: 1px solid #2DB67D55;
  padding: 3px 9px; border-radius: 5px;
  font-size: 11px; font-weight: 700;
  white-space: nowrap;
}
.abs-col-actions .btn-danger-sm {
  padding: 3px 8px; font-size: 11px; line-height: 1; height: 28px;
}


/* ── Project tag on global Kanban cards ── */
.kbn-proj-tag {
  font-size: 9px; font-weight: 700;
  padding: 2px 6px; border-radius: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 100px;
  margin: 0 6px 0 4px;
}
.kbn-card-top { gap: 4px; }

/* Filter button: align avatar properly */
.task-filters .filter-btn { display: inline-flex; align-items: center; gap: 6px; }


/* ═══════════════════════════════════════════════════════════════════
   TASK MODAL — improved styling + mobile responsive
   ═══════════════════════════════════════════════════════════════════ */

/* Form grid: 2 cols on desktop, 1 on mobile */
.tm-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 640px) {
  .tm-form-grid { grid-template-columns: 1fr; gap: 10px; }
  .tm-form-grid .form-group[style*="grid-column"] { grid-column: 1 !important; }
}

/* Action bar */
.tm-modal-actions {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.tm-modal-actions-right { display: flex; gap: 8px; }
@media (max-width: 640px) {
  .tm-modal-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .tm-modal-actions-right { flex-direction: column; gap: 8px; }
  .tm-modal-actions-right button { width: 100%; min-height: 44px; }
  .tm-modal-actions > button:not(.tm-modal-actions-right) { width: 100%; min-height: 44px; }
}

/* Modal box wide on mobile = full screen with bottom sheet feel */
@media (max-width: 640px) {
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal-box-wide,
  .modal-box {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 92vh !important;
    border-radius: 16px 16px 0 0;
    margin: 0;
    overflow-y: auto;
    padding: 18px 16px 24px;
  }
  .modal-header {
    position: sticky; top: 0;
    background: var(--surface); z-index: 5;
    margin: -18px -16px 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
  }
  .modal-title { font-size: 1.05rem; }
  .form-input, select.form-input, textarea.form-input { font-size: 16px; min-height: 44px; }
  textarea.form-input { min-height: auto; }
  input[type="date"].form-input { min-height: 44px; }
}

/* Modal: better labels + spacing */
.modal-box .form-label {
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 5px;
  display: block;
}
.modal-box .form-input,
.modal-box select.form-input,
.modal-box textarea.form-input {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: .92rem;
  color: var(--text);
  width: 100%;
  transition: border-color .15s;
}
.modal-box .form-input:focus { border-color: #E8302A66; outline: none; }
.modal-box select.form-input { cursor: pointer; }

/* Link rows */
.link-row { display: flex; gap: 6px; margin-bottom: 6px; }
.link-row .form-input { font-size: .85rem; padding: 7px 10px; }
.link-row .btn-danger-sm { flex-shrink: 0; }

/* ── Attachments ── */
.tm-attachments-list {
  display: flex; flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}
.tm-attach-empty {
  font-size: .78rem; color: var(--muted); font-style: italic;
  padding: 8px 10px; background: var(--surface-2); border-radius: 6px;
  text-align: center;
}
.tm-attach-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.tm-attach-icon { font-size: 1.1rem; flex-shrink: 0; }
.tm-attach-name {
  flex: 1; font-size: .82rem; color: var(--text);
  text-decoration: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tm-attach-name:hover { color: #E8302A; text-decoration: underline; }
.tm-attach-size { font-size: .72rem; color: var(--muted); flex-shrink: 0; }
.tm-attach-row .btn-danger-sm { padding: 3px 8px; font-size: 11px; flex-shrink: 0; }

.tm-upload-wrap { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.tm-upload-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  font-size: .82rem; font-weight: 600;
  cursor: pointer;
  background: var(--surface-2);
  transition: border-color .15s, color .15s;
}
.tm-upload-btn:hover { border-color: #E8302A; color: #E8302A; }
.tm-upload-hint { font-size: .72rem; color: var(--muted); }
@media (max-width: 640px) {
  .tm-upload-btn { width: 100%; justify-content: center; padding: 12px; }
}


/* ═══════════════════════════════════════════════════════════════════
   MOBILE OPTIMIZATION (≤ 640px) — exhaustive pass
   ═══════════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {

  /* ── Body & main ── */
  body { font-size: 14.5px; -webkit-text-size-adjust: 100%; }
  .main { padding-bottom: 80px; }

  /* ── Headers / titles ── */
  .page-header { padding: 22px 16px 18px; }
  .page-title  { font-size: clamp(1.7rem, 7vw, 2.4rem); line-height: 1.05; }
  .page-subtitle { font-size: .82rem; line-height: 1.4; }
  .page-tag { font-size: .65rem; }

  /* ── FAQ ── */
  .faq-panel {
    width: calc(100vw - 12px) !important;
    right: 6px !important;
    left: 6px !important;
    bottom: 76px !important;
    max-height: 70vh !important;
    border-radius: 14px !important;
    background: #181818 !important;
  }
  .faq-panel-header { padding: 12px 14px 10px; }
  .faq-panel-title  { font-size: 14px; }
  .faq-search-wrap  { padding: 10px 12px; gap: 6px; }
  .faq-input        { font-size: 16px; padding: 9px 12px; min-height: 40px; }
  .faq-send-btn     { min-width: 40px; min-height: 40px; }
  .faq-shortcuts    { gap: 5px; padding: 8px 12px; }
  .faq-chip         { font-size: .72rem; padding: 5px 10px; }
  .faq-messages     { padding: 10px 12px; gap: 8px; }
  .faq-msg          { font-size: 13px; padding: 9px 11px; max-width: 95%; }
  .faq-fab          { bottom: 16px !important; right: 12px !important; width: 50px; height: 50px; }
  .faq-fab-icon     { font-size: 18px; }

  /* ── Toast ── */
  #toastContainer {
    bottom: 76px !important;
    right: 8px !important;
    left: 8px !important;
    align-items: stretch !important;
  }

  /* ── Inputs : éviter zoom auto iOS ── */
  input[type=text], input[type=password], input[type=email], input[type=number],
  input[type=date], input[type=time], select, textarea, .form-input {
    font-size: 16px !important;
  }

  /* ── Tap targets ≥ 44px ── */
  .btn-primary, .btn-ghost, .btn-danger-sm, .btn-edit,
  .filter-btn, .filter-pill, .nav-link, .planning-nav-btn,
  .planning-today-btn, .snav { min-height: 42px; }

  /* ── Track selector / pills ── */
  .track-selector { gap: 6px; flex-wrap: wrap; padding: 12px 16px 0; }
  .track-pill { font-size: .76rem; padding: 5px 10px; border-radius: 6px; }

  /* ── WOD page ── */
  .wod-nav { padding: 12px; gap: 8px; flex-wrap: wrap; }
  .wod-nav-btn { font-size: .8rem; padding: 8px 12px; min-height: 38px; }
  .wod-nav-center { width: 100%; order: -1; flex-direction: row; justify-content: center; gap: 10px; }
  .wod-date-input { font-size: 16px; min-height: 36px; }
  .wod-header { padding: 24px 16px 18px; }
  .wod-type-title { font-size: clamp(1.6rem, 8vw, 2.4rem); }
  .wod-label { font-size: 1rem; }
  .wod-movements { gap: 5px; flex-wrap: wrap; }
  .movement-badge { font-size: .72rem; padding: 4px 8px; }
  .wod-body { padding: 16px; grid-template-columns: 1fr; }
  .wod-section { padding: 14px; border-radius: 10px; }
  .section-title { font-size: .85rem; }
  .section-content { font-size: .9rem; line-height: 1.55; }
  .fbb-intent, .fbb-meta { padding: 12px; }
  .fbb-meta { grid-template-columns: 1fr; }

  /* ── Semaine ── */
  .week-grid { grid-template-columns: 1fr; gap: 10px; padding: 0 12px; }
  .week-card { padding: 14px; }
  .week-nav-row { flex-direction: column; gap: 10px; align-items: center; padding: 0 16px; }

  /* ── Programme ── */
  .programme-grid { grid-template-columns: 1fr; gap: 12px; padding: 0 12px; }

  /* ── Library ── */
  .library-controls { padding: 0 12px; flex-direction: column; gap: 10px; }
  .library-search-wrap { width: 100%; }
  .library-filters, .library-pattern-filters { gap: 5px; flex-wrap: wrap; }
  .filter-btn, .filter-pill { font-size: .74rem; padding: 6px 10px; }
  .exercise-grid { grid-template-columns: 1fr; padding: 0 12px; gap: 12px; }
  .exercise-card { padding: 14px; }

  /* ── Scaling ── */
  .scaling-intro-grid { grid-template-columns: 1fr; padding: 0 12px; gap: 12px; }
  .scaling-pattern-section { padding: 0 12px; }
  .scaling-table-header, .scaling-table-row { font-size: .78rem; grid-template-columns: 1fr 80px 1fr; }
  .scaling-table-header .sth-col:nth-child(n+4),
  .scaling-table-row .st-col:nth-child(n+4) { display: none; }

  /* ── Planning ── */
  .planning-grid-wrap { padding: 0 8px; }
  .planning-grid { min-width: 540px; font-size: .72rem; border-radius: 8px; }
  .planning-time-td { min-width: 42px; padding: 6px 3px; font-size: .68rem; }
  .planning-cell { min-width: 68px; padding: 3px; }
  .planning-day-name { font-size: .66rem; }
  .planning-day-date { font-size: .62rem; }
  .planning-nav { flex-direction: column; align-items: stretch; gap: 8px; padding: 0 12px; }
  .planning-nav-btn { width: 100%; }
  .planning-nav-center { flex-direction: column; gap: 6px; align-items: center; }
  .slot-card { padding: 5px; border-radius: 6px; }
  .slot-label { font-size: .68rem; line-height: 1.15; }
  .slot-time, .slot-coach-name { font-size: .62rem; }
  .slot-type-badge { font-size: .58rem; padding: 1px 4px; }

  /* ── Admin shell ── */
  .admin-shell { flex-direction: row; }
  .admin-sidebar { width: 54px; position: sticky; }
  .admin-main { padding: 16px 12px 80px; }
  .asection-title { font-size: 1.5rem; }
  .asection-header { gap: 8px; }
  .asection-sub { font-size: .76rem; }

  /* Admin sidebar : icons only + center */
  .sidebar-logo { padding: 14px 8px; font-size: 0; }
  .sidebar-logo-dot { display: inline-block; margin: 0; width: 12px; height: 12px; }
  .sidebar-logo span:nth-child(2), .sidebar-logo span:last-child { display: none; }
  .snav { justify-content: center; padding: 12px 6px; gap: 0; font-size: 0; }
  .snav span:first-child { font-size: 18px; line-height: 1; }
  .snav span:nth-child(2) { display: none; }
  .snav-badge { position: absolute; top: 4px; right: 4px; padding: 0 5px; font-size: 9px; }
  .sidebar-group-label { display: none; }
  .sidebar-footer { padding: 10px 6px; font-size: 0; justify-content: center; }
  .sidebar-footer span:last-child { display: none; }

  /* Admin sections : stats, refresh grid, etc. */
  .admin-stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .admin-stat-wide { grid-column: 1 / -1; }
  .admin-stat-val { font-size: 1.6rem; }
  .admin-stat-date { font-size: 1rem !important; }
  .admin-refresh-grid { grid-template-columns: 1fr; gap: 8px; }
  .admin-section { padding: 16px 14px; }
  .admin-section-title { font-size: .82rem; }
  .admin-section-desc { font-size: .8rem; }

  /* ── Projects grid ── */
  .projects-grid { grid-template-columns: 1fr; gap: 12px; }
  .proj-card { padding: 14px; }
  .proj-title { font-size: 1.05rem; }

  /* ── Kanban : 1 col scroll vertical ── */
  .kanban-board { grid-template-columns: 1fr; gap: 12px; }
  .kbn-col { padding: 10px; }
  .kbn-col-header { font-size: .7rem; padding-bottom: 8px; margin-bottom: 10px; }
  .kbn-card { padding: 9px; }
  .kbn-card-title { font-size: .78rem; }
  .kbn-card-top { gap: 4px; }
  .kbn-proj-tag { font-size: 8px; padding: 1px 5px; }
  .kbn-avatar { width: 20px; height: 20px; font-size: 9px; }

  /* ── Tasks filters ── */
  .task-filters { gap: 6px; flex-wrap: wrap; }
  .task-filters .filter-btn { font-size: .72rem; padding: 6px 9px; }

  /* ── Calendar (semaine-only sur mobile via scroll-x) ── */
  .cal-grid-header { gap: 3px; }
  .cal-grid-header > div { font-size: .65rem; padding: 3px; }
  .cal-grid { gap: 3px; }
  .cal-cell { min-height: 70px; padding: 4px; border-radius: 6px; }
  .cal-day-num { font-size: .72rem; margin-bottom: 2px; }
  .cal-task-chip { font-size: .56rem; padding: 1px 3px; }
  .cal-legend { gap: 5px; }
  .cal-chip { font-size: .68rem; padding: 2px 7px; }

  /* ── Insights matrix ── */
  .matrix-grid { grid-template-columns: 1fr; gap: 8px; }
  .matrix-cell { min-height: 80px; padding: 8px; }
  .matrix-label { font-size: .65rem; }
  .matrix-task { font-size: .72rem; padding: 4px 5px; }

  /* Workload */
  .workload-name { width: 75px; font-size: .76rem; }
  .workload-count { width: 55px; font-size: .74rem; }

  /* ── Stock ── */
  .stock-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stock-card { padding: 10px; }
  .stock-card-name { font-size: .8rem; }
  .stock-qty { font-size: 1.3rem; }

  /* ── ClubPlanner sections ── */
  .cp-kpi-row { gap: 8px; }
  .cp-kpi-card { flex: 1 1 calc(50% - 4px); padding: 11px 12px; min-width: 0; }
  .cp-kpi-val { font-size: 1.55rem; }
  .cp-kpi-label { font-size: 10px; }
  .cp-charts-row { flex-direction: column; gap: 10px; }
  .cp-chart-box { padding: 12px; min-width: 0; }
  .cp-chart-title { font-size: 10px; }
  .cp-table-header, .cp-table-row { padding: 7px 12px; font-size: .78rem; }

  /* ── Tables admin (users, slots) ── */
  .users-header, .slots-header { display: none; }
  .users-row {
    display: flex; flex-direction: column; gap: 4px;
    padding: 10px 12px; border-bottom: 1px solid var(--border);
  }
  .user-username { font-size: .72rem; color: var(--muted); }
  .user-name { font-size: .9rem; font-weight: 600; }
  .user-role { font-size: .7rem; }
  .users-row > span:last-child { margin-top: 4px; align-self: flex-start; }
  .slots-row { font-size: .78rem; padding: 8px 12px; gap: 4px; }

  /* ── Add user / add slot forms ── */
  .add-form-row { flex-direction: column !important; gap: 8px !important; }
  .add-form-row .form-group { width: 100%; min-width: 0 !important; }

  /* ── Modals ── */
  .modal-overlay { padding: 0 !important; align-items: flex-end !important; }
  .modal-box {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 92vh !important;
    border-radius: 16px 16px 0 0 !important;
    margin: 0;
    overflow-y: auto;
    padding: 16px 14px 24px !important;
  }
  .modal-header {
    position: sticky; top: 0; z-index: 5;
    background: var(--surface, #181818);
    margin: -16px -14px 12px;
    padding: 14px;
    border-bottom: 1px solid var(--border);
  }
  .modal-title { font-size: 1rem; }
  .modal-actions, .tm-modal-actions { flex-direction: column-reverse; align-items: stretch !important; gap: 8px !important; }
  .modal-actions button, .tm-modal-actions button,
  .tm-modal-actions-right button { width: 100%; min-height: 44px; }
  .tm-modal-actions-right { display: flex; flex-direction: column; gap: 8px; width: 100%; }

  /* Forms inside modals */
  .tm-form-grid { grid-template-columns: 1fr; gap: 10px; }

  /* ── Absences admin table mobile ── */
  .abs-table-header { display: none !important; }
  .abs-table-row {
    display: flex !important; flex-direction: column; gap: 6px;
    padding: 12px; background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 10px; margin-bottom: 8px;
  }
  .abs-col-date { display: block !important; font-size: .76rem; color: var(--muted); }
  .abs-col-coach { font-size: .9rem; font-weight: 700; }
  .abs-col-actions { display: flex !important; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
  .abs-col-actions select { flex: 1 1 130px; height: 38px; font-size: .85rem; }

  /* ── Open slots panel ── */
  .open-slots-panel { padding: 12px; }
  .open-slot-card { flex-direction: column; align-items: flex-start; gap: 8px; }

  /* ── Notification panel ── */
  #notifPanel {
    width: calc(100vw - 24px) !important;
    right: 12px !important;
    max-height: 70vh !important;
    overflow-y: auto;
  }
}

/* ── Très petits écrans (≤ 380px) ── */
@media (max-width: 380px) {
  .page-title    { font-size: 1.5rem; }
  .planning-grid { min-width: 460px; }
  .modal-box     { padding: 12px 10px 20px !important; }
  .cp-kpi-val    { font-size: 1.35rem; }
  .stock-grid    { grid-template-columns: 1fr; }
  .cal-cell      { min-height: 60px; }
}


/* ── PT Admin ── */
.pt-user-list { display: flex; flex-direction: column; gap: 6px; }
.pt-user-row { display: grid; grid-template-columns: 1fr 2fr auto; gap: 10px; align-items: center; font-size: .82rem; }
.pt-user-name { font-weight: 600; }
.pt-user-bar-wrap { height: 6px; background: var(--border); border-radius: 6px; overflow: hidden; }
.pt-user-bar { height: 100%; background: linear-gradient(90deg,#7ab0f0,#6accc0); border-radius: 6px; transition: width .4s; }
.pt-user-count { font-size: .75rem; color: var(--muted); min-width: 70px; text-align: right; }

.pt-recent-list { margin-top: 6px; }
.pt-table { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.pt-table-header { display: grid; grid-template-columns: 110px 130px 130px 100px 1fr 1fr; gap: 10px; padding: 8px 14px; font-size: 10px; font-weight: 700; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; border-bottom: 1px solid var(--border); }
.pt-table-row { display: grid; grid-template-columns: 110px 130px 130px 100px 1fr 1fr; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--border); font-size: 13px; align-items: center; }
.pt-table-row:last-child { border-bottom: none; }
.pt-table-row:hover { background: var(--surface-hover, rgba(255,255,255,.02)); }
.zone-pill { padding: 2px 8px; border-radius: 6px; font-size: .72rem; font-weight: 700; white-space: nowrap; }

@media (max-width: 768px) {
  .pt-table-header { display: none; }
  .pt-table-row { display: flex; flex-direction: column; gap: 4px; padding: 12px; align-items: flex-start; }
}


/* ── Slot creation mode toggle (recurring vs oneoff) ── */
.ns-mode-toggle { display: flex; gap: 8px; flex-wrap: wrap; }
.ns-mode-btn {
  flex: 1; min-width: 180px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: .85rem; font-weight: 600;
  color: var(--text); cursor: pointer;
  transition: all .15s;
}
.ns-mode-btn:hover { border-color: var(--accent); }
.ns-mode-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
@media (max-width: 640px) {
  .ns-mode-btn { flex-basis: 100%; padding: 11px 12px; font-size: .82rem; }
}

/* ── Kanban Drag & Drop (SortableJS) ──────────────────────────────────────── */
.kbn-card { cursor: grab; }
.kbn-card:active { cursor: grabbing; }
.kbn-card-ghost { opacity: 0.4; background: #E8302A22; }
.kbn-card-chosen { transform: scale(1.02); box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.kbn-card-drag { transform: rotate(2deg); }
.kbn-cards { min-height: 100px; transition: background .2s; }
.kbn-cards.sortable-active { background: rgba(232,48,42,.05); }
.kbn-quick-done {
  background: rgba(45,182,125,.15);
  border: 1px solid rgba(45,182,125,.4);
  color: #2DB67D;
}
.kbn-quick-done:hover {
  background: rgba(45,182,125,.3);
}

/* ═══════════════════════════════════════════════════════════════════
   PRINT — adaptation pour impression A4 portrait
   ═══════════════════════════════════════════════════════════════════ */
@media print {
  body { background: white !important; color: black !important; font-size: 11pt; }

  /* Cacher la nav, FABs, modals, toasts, sidebars */
  .nav, .nav-mobile-menu, .nav-mobile-toggle,
  .faq-fab, .faq-panel, #pwaInstallBtn,
  #toastContainer, .modal-overlay,
  .admin-sidebar, .sidebar-footer,
  .bar-tabs, .maint-tabs,
  button, .btn-primary, .btn-ghost, .btn-danger-sm, .btn-edit,
  .planning-nav, .pt-nav,
  .nav-link, .nav-logo, .nav-user, .nav-logout,
  .filter-btn, .filter-pill,
  .stock-btn, .stock-delete-btn,
  .cp-refresh-btn, .cp-live-badge {
    display: none !important;
  }

  /* Layout général pour print */
  .main { padding: 0 !important; }
  .admin-main { padding: 0 !important; margin-left: 0 !important; }
  .admin-shell { display: block !important; }

  .asection { display: block !important; page-break-inside: avoid; }

  /* Cards et tableaux : fond blanc, bordures noires */
  .cp-kpi-card, .cp-chart-box, .proj-card, .kbn-card,
  .maint-card, .maint-task-card,
  .users-row, .slots-row, .abs-table-row,
  .pos-product, .bar-stock-card, .stock-card,
  .admin-section {
    background: white !important;
    border: 1px solid #ddd !important;
    color: black !important;
    box-shadow: none !important;
  }

  /* Titres */
  h1, h2, h3, .page-title, .asection-title, .bar-section-title {
    color: black !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .page-title { font-size: 24pt; margin-bottom: 8mm; }
  .asection-title, .bar-section-title { font-size: 16pt; margin-top: 8mm; margin-bottom: 4mm; }

  /* Tableaux */
  table, .cp-table, .users-table, .slots-table {
    width: 100% !important;
    border-collapse: collapse;
    page-break-inside: avoid;
  }
  .cp-table-header, .cp-table-row { display: grid !important; }
  .cp-table-row { border-bottom: 1px solid #ddd !important; }

  /* Charts : laisser respirer */
  canvas { max-height: 200px !important; page-break-inside: avoid; }

  /* Cartes Kanban : compact */
  .kbn-card { page-break-inside: avoid; margin-bottom: 4mm; }

  /* Page break utilities */
  .page-break-before { page-break-before: always; }
  .page-break-after { page-break-after: always; }
  .no-print { display: none !important; }

  /* Cacher éléments dynamiques (charts pas critiques pour impression) */
  .chart-card, .cp-chart-box { page-break-inside: avoid; }

  /* Calendrier maintenance/admin : forcer grille même imprimée */
  .cal-grid { display: grid !important; grid-template-columns: repeat(7, 1fr) !important; gap: 2mm; }
  .cal-cell { border: 1px solid #ccc !important; padding: 2mm !important; min-height: 20mm; }
  .cal-day-num { color: black !important; }

  /* Liens : URL inline */
  a[href]:after {
    content: "";  /* Ne pas afficher l'URL pour ne pas polluer */
  }
}

/* Print helpers usable dans templates */
.print-only { display: none; }
@media print { .print-only { display: block; } }



/* ═══════════════════════════════════════════════════════════════════
   LIGHT THEME — toggle via data-theme="light" on <html>
   ═══════════════════════════════════════════════════════════════════ */
html[data-theme="light"] {
  --text-secondary: rgba(26,26,26,.78);
  --bg:        #F7F3EE;
  --bg2:       #FFFFFF;
  --bg3:       #F0EBE3;
  --cream:     #1A1A1A;
  --warm:      #2A2A2A;
  --border:    rgba(0,0,0,.08);
  --border2:   rgba(0,0,0,.15);
  --muted:     rgba(0,0,0,.50);
  --dim:       rgba(0,0,0,.28);
  --surface:   #FFFFFF;
  --surface-2: #F7F3EE;
  --card:      #FFFFFF;
  --text:      #1A1A1A;
  --accent:    #E8302A;
  --surface-hover: rgba(0,0,0,.04);
}

html[data-theme="light"] body {
  background: #F7F3EE;
  color: #1A1A1A;
}

/* Adjustments per element in light mode */
html[data-theme="light"] .nav { background: rgba(255,255,255,.85); backdrop-filter: blur(20px); border-bottom: 1px solid rgba(0,0,0,.08); }
html[data-theme="light"] .nav-link { color: rgba(0,0,0,.65); }
html[data-theme="light"] .nav-link.active { color: #E8302A; }
html[data-theme="light"] .nav-user-name { color: #1A1A1A; }
html[data-theme="light"] .nav-logo { color: #1A1A1A; }

html[data-theme="light"] .admin-sidebar { background: #FFFFFF; border-right: 1px solid rgba(0,0,0,.08); }
html[data-theme="light"] .snav { color: #2A2A2A; }
html[data-theme="light"] .snav.active { background: #E8302A11; color: #E8302A; }
html[data-theme="light"] .snav:hover { background: #00000005; }

html[data-theme="light"] .modal-overlay { background: rgba(0,0,0,.4); }
html[data-theme="light"] .modal-box { background: #FFFFFF; }
html[data-theme="light"] .form-input,
html[data-theme="light"] select.form-input,
html[data-theme="light"] textarea.form-input { background: #FFFFFF; border-color: rgba(0,0,0,.12); color: #1A1A1A; }

/* Charts in light mode: re-style grids */
html[data-theme="light"] canvas { filter: none; }

/* Buttons: keep red accent */
html[data-theme="light"] .btn-primary { background: #E8302A; color: #fff; border-color: #E8302A; }
html[data-theme="light"] .btn-ghost { color: #1A1A1A; border-color: rgba(0,0,0,.15); }
html[data-theme="light"] .btn-ghost:hover { background: rgba(0,0,0,.04); }

/* Cards / surfaces */
html[data-theme="light"] .cp-kpi-card,
html[data-theme="light"] .cp-chart-box,
html[data-theme="light"] .admin-section,
html[data-theme="light"] .proj-card,
html[data-theme="light"] .kbn-card,
html[data-theme="light"] .kbn-col,
html[data-theme="light"] .maint-card,
html[data-theme="light"] .maint-task-card,
html[data-theme="light"] .bar-stock-card,
html[data-theme="light"] .stock-card,
html[data-theme="light"] .pos-product,
html[data-theme="light"] .users-row,
html[data-theme="light"] .slots-row,
html[data-theme="light"] .pos-cart-row,
html[data-theme="light"] .pt-table-row,
html[data-theme="light"] .cp-table-row,
html[data-theme="light"] .abs-table-row,
html[data-theme="light"] .open-slot-card {
  background: #FFFFFF !important;
  border-color: rgba(0,0,0,.08) !important;
}

html[data-theme="light"] .planning-time-th,
html[data-theme="light"] .planning-day-th,
html[data-theme="light"] .planning-row,
html[data-theme="light"] .planning-cell,
html[data-theme="light"] .pt-cell,
html[data-theme="light"] .pt-day-th,
html[data-theme="light"] .cal-cell { background: #FFFFFF; border-color: rgba(0,0,0,.06); }

html[data-theme="light"] .slot-card { background: rgba(255,255,255,.7); border-color: rgba(0,0,0,.08); }
html[data-theme="light"] .pos-left,
html[data-theme="light"] .pos-right,
html[data-theme="light"] .pos-cart { background: #FFFFFF; }

/* Texts */
html[data-theme="light"] .page-title,
html[data-theme="light"] .asection-title,
html[data-theme="light"] .bar-section-title,
html[data-theme="light"] .maint-section-title,
html[data-theme="light"] .cp-kpi-val { color: #1A1A1A; }

html[data-theme="light"] .cp-kpi-label,
html[data-theme="light"] .page-subtitle,
html[data-theme="light"] .asection-sub,
html[data-theme="light"] .form-label,
html[data-theme="light"] .admin-section-title,
html[data-theme="light"] .admin-section-desc,
html[data-theme="light"] .admin-stat-label,
html[data-theme="light"] .sidebar-group-label,
html[data-theme="light"] .maint-card-meta,
html[data-theme="light"] .maint-task-meta { color: rgba(0,0,0,.55); }

/* FAQ panel in light mode */
html[data-theme="light"] .faq-panel { background: #FFFFFF !important; border-color: rgba(0,0,0,.10) !important; }
html[data-theme="light"] .faq-msg-bot { background: #F7F3EE; border-color: rgba(0,0,0,.08); color: #1A1A1A; }
html[data-theme="light"] .faq-input { background: #FFFFFF; border-color: rgba(0,0,0,.12); color: #1A1A1A; }
html[data-theme="light"] .faq-chip { background: #F7F3EE; border-color: rgba(0,0,0,.10); color: #1A1A1A; }

/* Theme toggle button styling */
.theme-toggle {
  background: transparent; border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 10px;
  font-size: .85rem; cursor: pointer; color: var(--text);
  display: inline-flex; align-items: center; gap: 6px;
  transition: all .15s;
}
.theme-toggle:hover { border-color: var(--accent); }


/* ── Capabilities grid in coach modal ── */
.caps-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}
.cap-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  font-size: .82rem;
  cursor: pointer;
  border-radius: 4px;
}
.cap-row:hover { background: rgba(255,255,255,.03); }
.cap-row input[type="checkbox"] {
  width: 16px; height: 16px;
  cursor: pointer;
  accent-color: #E8302A;
}
.cap-icon { font-size: 1rem; }
.cap-label { flex: 1; line-height: 1.3; }
.cap-override { color: #FF7A00; font-size: 10px; }

@media (max-width: 640px) {
  .caps-grid { grid-template-columns: 1fr; }
}


/* ── Bar Checklist ── */
.checklist-alert {
  background: #ffb84d22;
  border: 1px solid #ffb84d55;
  color: #ffb84d;
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-weight: 600;
  font-size: .9rem;
}
.checklist-alert-ok {
  background: #2db67d22;
  border-color: #2db67d55;
  color: #2db67d;
}

.checklist-phase { margin-bottom: 24px; }
.phase-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.phase-title { font-family: 'Bebas Neue', sans-serif; font-size: 1.15rem; letter-spacing: .04em; margin: 0; }
.phase-before-title { color: #6accc0; }
.phase-idle-title { color: #ffb84d; }
.phase-closing-title { color: #ff7a75; }
.phase-counter {
  font-size: .85rem;
  font-weight: 700;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 20px;
  color: var(--muted);
}
.phase-counter.counter-all-done {
  background: #2db67d22;
  border-color: #2db67d55;
  color: #2db67d;
}

.phase-tasks { display: flex; flex-direction: column; gap: 6px; }
.bt-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: opacity .2s;
}
.bt-card.bt-done { opacity: .55; }
.bt-checkbox-wrap { flex-shrink: 0; padding-top: 2px; }
.bt-checkbox {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 2px solid var(--border);
  background: var(--surface);
  color: #2db67d;
  cursor: pointer;
  font-size: 16px;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.bt-card.bt-done .bt-checkbox {
  background: #2db67d22;
  border-color: #2db67d;
}
.bt-checkbox:hover {
  border-color: #2db67d;
}
.bt-content { flex: 1; min-width: 0; }
.bt-title-row { display: flex; align-items: center; gap: 8px; }
.bt-icon { font-size: 1.1rem; }
.bt-title { flex: 1; font-size: .9rem; font-weight: 600; }
.bt-prio { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.bt-meta {
  display: flex; gap: 8px; align-items: center;
  font-size: .72rem; color: var(--muted);
  margin-top: 3px;
}
.bt-by { color: #6accc0; font-weight: 600; }
.bt-note { cursor: help; }
.bt-instructions {
  margin-top: 6px;
  font-size: .78rem;
}
.bt-instructions summary {
  cursor: pointer;
  color: var(--muted);
  user-select: none;
}
.bt-instructions p {
  margin-top: 6px;
  color: var(--text);
  background: var(--surface);
  padding: 6px 10px;
  border-radius: 6px;
  border-left: 2px solid var(--accent);
}

/* Restock modal */
.restock-product-list {
  max-height: 50vh;
  overflow-y: auto;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
}
.restock-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background .12s;
}
.restock-row:hover { background: var(--surface); }
.restock-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: #FF7A00; }
.restock-name { font-size: .85rem; }
.restock-qty {
  font-size: .72rem;
  color: var(--muted);
  background: var(--surface);
  padding: 1px 8px;
  border-radius: 12px;
  border: 1px solid var(--border);
}
.restock-low .restock-qty { color: #ffb84d; border-color: #ffb84d55; }
.restock-empty .restock-qty { color: #ff7a75; border-color: #ff7a7555; }

@media (max-width: 640px) {
  .bt-card { padding: 8px 10px; }
  .bt-title { font-size: .85rem; }
}


/* ── Fix: bar tabs overlap header on mobile ── */
@media (max-width: 640px) {
  .bar-shell { padding-top: 6px !important; }
  .bar-tabs {
    position: sticky;
    top: var(--nav-h, 58px);
    background: var(--bg, #111);
    z-index: 40;
    padding: 8px 4px 0;
    margin: -4px -8px 12px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  .bar-tab { flex-shrink: 0; }
  .bar-section { padding-top: 8px; }
  /* Ensure stock header / pos search not hidden */
  .stock-header { padding-top: 4px; }
  .pos-search { margin-top: 8px; }
}


/* ── Birthdays ── */
.bd-today-banner {
  background: #FF7A0011;
  border: 1px solid #FF7A0055;
  color: #FF7A00;
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 12px;
  font-weight: 700;
  font-size: .9rem;
  text-align: center;
}
.bd-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 8px;
}
.bd-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.bd-card.bd-today {
  background: #FF7A0011;
  border-color: #FF7A0055;
}
.bd-day {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2rem;
  min-width: 40px;
  text-align: center;
  color: var(--accent);
  line-height: 1;
}
.bd-info { flex: 1; min-width: 0; }
.bd-name { font-weight: 700; font-size: .9rem; }
.bd-meta { font-size: .72rem; color: var(--muted); margin-top: 2px; }


/* ── Fix: modal too tall, make scrollable on desktop too ── */
.modal-overlay {
  overflow-y: auto;
  padding: 20px;
}
.modal-box {
  max-height: 88vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.modal-box .modal-header {
  position: sticky;
  top: 0;
  background: var(--surface, #181818);
  z-index: 10;
  margin: -16px -16px 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.modal-box .modal-body {
  flex: 1;
  min-height: 0;
}
/* Sticky action bar at bottom */
.modal-box .tm-modal-actions {
  position: sticky;
  bottom: 0;
  background: var(--surface, #181818);
  margin: 16px -16px -16px;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  z-index: 10;
}

/* Make capability grid more compact */
.caps-grid {
  grid-template-columns: 1fr 1fr;
  gap: 2px 10px;
  padding: 8px 10px;
}
.cap-row {
  padding: 5px 4px;
  font-size: .78rem;
}
.cap-icon { font-size: .95rem; }

@media (max-width: 640px) {
  .modal-overlay { padding: 0; }
  .modal-box { max-height: 92vh; }
  .caps-grid { grid-template-columns: 1fr; }
}


/* Zone-block chips */
.zb-chip { display:inline-flex; align-items:center; gap:6px; padding:6px 10px; background:var(--surface-2); border:1px solid var(--border); border-radius:18px; font-size:.78rem; cursor:pointer; user-select:none; }
.zb-chip input { margin:0; }
.zb-chip:has(input:checked) { background: rgba(255,179,71,.15); border-color:#ffb347; }

html[data-theme="light"] .section-content,
html[data-theme="light"] .section-metcon-content { color: var(--text-secondary); }
html[data-theme="light"] .section-title { color: #1A1A1A; }
html[data-theme="light"] .wod-section { background: #FFFFFF; border-color: rgba(0,0,0,.08); }
html[data-theme="light"] .wod-section-metcon { background: #FFF8F7; border-color: #E8302A40; }
html[data-theme="light"] .warmup-panel { background: #FAFAFA; border-color: rgba(0,0,0,.08); }
html[data-theme="light"] .wod-empty-text { color: rgba(0,0,0,.55); }
html[data-theme="light"] .week-date,
html[data-theme="light"] .week-card-label,
html[data-theme="light"] .week-summary-day { color: rgba(0,0,0,.55); }
html[data-theme="light"] .faq-msg-bot { background: #F4F4F4; color: #1A1A1A; }
/* end-light */
