/* ============================================================================
   Odysium Sport — Admin CRM
   Design system noir + jaune (Sport gold #d8b82e)
   Inspiré de l'architecture Odysium Care (cyan #1FC8D9)
   ========================================================================= */

:root {
  /* Couleur principale : gold Odysium Sport */
  --gold: #d8b82e;
  --gold-bright: #f0cd3a;
  --gold-dark: #a8910f;
  --gold-glow: rgba(216, 184, 46, 0.45);
  --gold-soft: rgba(216, 184, 46, 0.10);

  /* Palette sombre */
  --black: #07090D;
  --black-2: #0C0F14;
  --black-3: #141821;
  --black-elev: #1A1F2A;

  /* Palette claire */
  --white: #FFFFFF;
  --off-white: #F7F8FA;
  --surface-soft: #EEF0F4;
  --border: #E3E6EB;
  --border-soft: #EFF1F5;

  /* Texte */
  --text: #2B3240;
  --text-muted: #6A7280;
  --text-faint: #A0A7B4;
  --text-on-dark: #E8EBF0;
  --text-on-dark-muted: rgba(232, 235, 240, 0.62);
  --text-on-dark-faint: rgba(232, 235, 240, 0.42);

  /* Géométrie */
  --radius: 18px;
  --radius-sm: 12px;
  --radius-pill: 999px;

  /* Ombres */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --shadow-gold: 0 10px 28px rgba(216, 184, 46, 0.35);

  /* Layout */
  --max-w: 460px;
  --sidebar-w: 260px;

  /* Polices */
  --font-body: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Barlow Condensed', 'Oswald', var(--font-body);
}

/* Reset et base */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--black);
  color: var(--text-on-dark);
  font-size: 15px;
  line-height: 1.5;
}

html[data-theme="light"] body {
  background: var(--off-white);
  color: var(--text);
}

/* Boutons génériques */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--gold);
  color: var(--black);
}

.btn-primary:hover {
  background: var(--gold-bright);
  box-shadow: var(--shadow-gold);
}

.btn-ghost {
  background: transparent;
  color: var(--text-on-dark);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-ghost:hover {
  border-color: var(--gold);
  color: var(--gold);
}

html[data-theme="light"] .btn-ghost {
  color: var(--text);
  border-color: var(--border);
}

html[data-theme="light"] .btn-ghost:hover {
  color: var(--gold-dark);
  border-color: var(--gold);
}

/* Vues (système simple : .view + .hidden) */
.view {
  min-height: 100vh;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.view.hidden {
  display: none;
}

.muted { color: var(--text-on-dark-muted); }
html[data-theme="light"] .muted { color: var(--text-muted); }

.hidden { display: none !important; }

.error {
  color: #EF4444;
  font-size: 13px;
  margin: 8px 0 0;
}

/* ====================================================================
   LOADING VIEW
   ==================================================================== */
.brand {
  text-align: center;
  margin-bottom: 24px;
}

.brand h1 {
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 800;
  letter-spacing: 0.04em;
  margin: 0;
  color: var(--text-on-dark);
}

.brand h1 span {
  color: var(--gold);
}

html[data-theme="light"] .brand h1 { color: var(--text); }

/* ====================================================================
   LOGIN VIEW
   ==================================================================== */
.form {
  background: var(--black-2);
  border-radius: var(--radius);
  padding: 32px 28px;
  width: 100%;
  max-width: var(--max-w);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

html[data-theme="light"] .form {
  background: var(--white);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.form-title {
  margin: 0 0 20px;
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.02em;
}

.form label {
  display: block;
  margin-bottom: 14px;
}

.form label > span {
  display: block;
  font-size: 13px;
  margin-bottom: 6px;
  color: var(--text-on-dark-muted);
}

html[data-theme="light"] .form label > span { color: var(--text-muted); }

.form input,
.form select,
.form textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--black-3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  color: var(--text-on-dark);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.form input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
}

html[data-theme="light"] .form input,
html[data-theme="light"] .form select,
html[data-theme="light"] .form textarea {
  background: var(--white);
  border-color: var(--border);
  color: var(--text);
}

.form .btn {
  width: 100%;
  margin-top: 8px;
}

.foot-note {
  margin-top: 20px;
  font-size: 13px;
  text-align: center;
  color: var(--text-on-dark-muted);
}

.foot-note a { color: var(--gold); text-decoration: none; }
.foot-note a:hover { text-decoration: underline; }

/* ====================================================================
   APP SHELL — sidebar + main
   ==================================================================== */
.app-shell {
  display: flex;
  min-height: 100vh;
  background: var(--black);
}

html[data-theme="light"] .app-shell { background: var(--off-white); }

.app-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--black-2);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  padding: 20px 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

html[data-theme="light"] .app-sidebar {
  background: var(--white);
  border-right-color: var(--border);
}

.sidebar-brand {
  padding: 0 20px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 16px;
}

html[data-theme="light"] .sidebar-brand { border-bottom-color: var(--border); }

.sidebar-brand-text {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--gold);
  text-transform: uppercase;
}

.sidebar-brand-sub {
  font-size: 11px;
  color: var(--text-on-dark-faint);
  margin-top: 2px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

html[data-theme="light"] .sidebar-brand-sub { color: var(--text-faint); }

.sidebar-nav {
  flex: 1;
  padding: 0 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-on-dark-muted);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: all 0.15s ease;
}

.sidebar-nav-item:hover {
  background: rgba(216, 184, 46, 0.08);
  color: var(--text-on-dark);
}

.sidebar-nav-item.is-active {
  background: var(--gold);
  color: var(--black);
  font-weight: 600;
}

.sidebar-nav-item .nav-icon {
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
}

.sidebar-nav-item .nav-label {
  flex: 1;
}

.sidebar-nav-item .nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #e74c3c;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}

.sidebar-nav-item.is-active .nav-badge {
  background: #1a1a1a;
  color: var(--gold);
}

/* ============================================================================
   Propositions — onglet de validation des ressources sportif
   ========================================================================= */
.prop-list { display: flex; flex-direction: column; gap: 12px; }

.prop-card {
  display: flex;
  gap: 14px;
  padding: 14px 16px;
  background: var(--card-bg, var(--bg-card));
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.prop-card .prop-icon {
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
  width: 40px;
  text-align: center;
}

.prop-card .prop-body { flex: 1; min-width: 0; }

.prop-card .prop-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.prop-card .prop-head strong {
  font-size: 15px;
  margin-right: 6px;
}

.prop-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
  align-items: center;
}

html[data-theme="light"] .sidebar-nav-item { color: var(--text-muted); }
html[data-theme="light"] .sidebar-nav-item:hover {
  background: var(--gold-soft);
  color: var(--text);
}
html[data-theme="light"] .sidebar-nav-item.is-active {
  background: var(--gold);
  color: var(--black);
}

.sidebar-footer {
  padding: 16px 12px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

html[data-theme="light"] .sidebar-footer { border-top-color: var(--border); }

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--black-3);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
}

html[data-theme="light"] .sidebar-user { background: var(--surface-soft); }

.sidebar-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.sidebar-user-info strong {
  display: block;
  font-size: 13px;
  color: var(--text-on-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-info small {
  display: block;
  font-size: 11px;
  color: var(--text-on-dark-faint);
  margin-top: 1px;
}

html[data-theme="light"] .sidebar-user-info strong { color: var(--text); }
html[data-theme="light"] .sidebar-user-info small { color: var(--text-faint); }

.sidebar-action {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-on-dark-muted);
  font-family: var(--font-body);
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: all 0.15s ease;
}

.sidebar-action:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-on-dark);
}

.sidebar-action.is-danger:hover {
  color: #FCA5A5;
  background: rgba(239, 68, 68, 0.08);
}

html[data-theme="light"] .sidebar-action { color: var(--text-muted); }
html[data-theme="light"] .sidebar-action:hover {
  background: var(--surface-soft);
  color: var(--text);
}

/* Main content */
.app-main {
  flex: 1;
  padding: 28px 36px;
  overflow-x: auto;
}

.page-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0 0 8px;
  color: var(--text-on-dark);
  text-transform: uppercase;
}

html[data-theme="light"] .page-title { color: var(--text); }

.page-subtitle {
  margin: 0 0 24px;
  color: var(--text-on-dark-muted);
  font-size: 14px;
}

html[data-theme="light"] .page-subtitle { color: var(--text-muted); }

/* Cartes "À venir" pour les onglets pas encore implémentés */
.placeholder-card {
  background: var(--black-2);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  padding: 60px 30px;
  text-align: center;
  color: var(--text-on-dark-muted);
}

.placeholder-card .icon-big {
  font-size: 48px;
  margin-bottom: 16px;
  display: block;
}

.placeholder-card h2 {
  font-family: var(--font-display);
  font-size: 24px;
  text-transform: uppercase;
  margin: 0 0 8px;
  color: var(--text-on-dark);
}

.placeholder-card p {
  margin: 0;
  font-size: 14px;
}

html[data-theme="light"] .placeholder-card {
  background: var(--white);
  border-color: var(--border);
  color: var(--text-muted);
  box-shadow: var(--shadow-sm);
}

html[data-theme="light"] .placeholder-card h2 { color: var(--text); }

/* ====================================================================
   v2.92 : SKELETON LOADERS (au lieu des "Chargement…" basiques)
   ==================================================================== */
@keyframes skeleton-shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skeleton, .skeleton-line, .skeleton-card, .skeleton-circle {
  display: inline-block;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 0%,
    rgba(255, 255, 255, 0.10) 40%,
    rgba(255, 255, 255, 0.04) 80%
  );
  background-size: 800px 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
  border-radius: 6px;
  pointer-events: none;
  user-select: none;
}
.skeleton-line {
  display: block;
  height: 12px;
  width: 100%;
  margin-bottom: 8px;
}
.skeleton-line.short  { width: 40%; }
.skeleton-line.medium { width: 65%; }
.skeleton-line.long   { width: 90%; }
.skeleton-line.title  { height: 18px; margin-bottom: 12px; }
.skeleton-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}
.skeleton-card {
  background: var(--black-2);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  animation: none;  /* l'animation est sur les enfants */
}
.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
html[data-theme="light"] .skeleton,
html[data-theme="light"] .skeleton-line,
html[data-theme="light"] .skeleton-circle {
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.04) 0%,
    rgba(0, 0, 0, 0.10) 40%,
    rgba(0, 0, 0, 0.04) 80%
  );
  background-size: 800px 100%;
}
html[data-theme="light"] .skeleton-card {
  background: var(--white);
  border-color: var(--border);
}

/* ====================================================================
   PAGE HEADER — titre + bouton action principal
   ==================================================================== */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.page-header .page-title { margin-bottom: 4px; }
.page-header .page-subtitle { margin-bottom: 0; }
.page-header .btn { flex-shrink: 0; }

/* ====================================================================
   MODALE générique
   ==================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
  animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: var(--black-2);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
  animation: slideUp 0.2s ease;
}

@keyframes slideUp {
  from { transform: translateY(12px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

html[data-theme="light"] .modal {
  background: var(--white);
  border-color: var(--border);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

html[data-theme="light"] .modal-head { border-bottom-color: var(--border); }

.modal-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-on-dark);
}

html[data-theme="light"] .modal-head h3 { color: var(--text); }

.modal-close {
  background: transparent;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: var(--text-on-dark-muted);
  cursor: pointer;
  padding: 0 4px;
  transition: color 0.15s ease;
}

.modal-close:hover { color: var(--text-on-dark); }
html[data-theme="light"] .modal-close { color: var(--text-muted); }
html[data-theme="light"] .modal-close:hover { color: var(--text); }

.modal-body {
  padding: 20px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-body label {
  display: block;
  margin: 0;
}

.modal-body label > span {
  display: block;
  font-size: 13px;
  margin-bottom: 6px;
  color: var(--text-on-dark-muted);
}

html[data-theme="light"] .modal-body label > span { color: var(--text-muted); }

.modal-body input,
.modal-body select,
.modal-body textarea {
  width: 100%;
  padding: 11px 14px;
  background: var(--black-3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  color: var(--text-on-dark);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.modal-body input:focus,
.modal-body select:focus,
.modal-body textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
}

html[data-theme="light"] .modal-body input,
html[data-theme="light"] .modal-body select,
html[data-theme="light"] .modal-body textarea {
  background: var(--white);
  border-color: var(--border);
  color: var(--text);
}

.modal-hint {
  font-size: 12px;
  margin: 0;
  line-height: 1.5;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 480px) {
  .form-row { grid-template-columns: 1fr; gap: 14px; }
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 8px;
}

.modal-actions .btn {
  flex: 0 0 auto;
  width: auto;
}

/* Bloc succès post-création (mot de passe temporaire) */
.success-box {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin: 4px 0;
}

.success-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #10B981;
  margin: 0 0 8px;
}

.temp-password {
  display: block;
  font-family: 'Courier New', monospace;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: var(--black-3);
  border: 1px dashed rgba(216, 184, 46, 0.4);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin: 0 0 8px;
  color: var(--gold);
  word-break: break-all;
}

html[data-theme="light"] .temp-password {
  background: #FEF9E7;
  color: var(--gold-dark);
  border-color: var(--gold);
}

.btn-mini {
  padding: 6px 12px;
  font-size: 12px;
}

/* Bouton danger (suppression) */
.btn-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #FCA5A5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #FECACA;
  border-color: rgba(239, 68, 68, 0.5);
}

html[data-theme="light"] .btn-danger {
  background: #FEF2F2;
  color: #B91C1C;
  border-color: #FCA5A5;
}

html[data-theme="light"] .btn-danger:hover {
  background: #FEE2E2;
  color: #991B1B;
}

/* Modale large pour édition (plus de contenu que création) */
.modal-large {
  max-width: 560px;
}

/* Actions séparées : danger à gauche, validation à droite */
.modal-actions-split {
  justify-content: space-between;
}

/* Box d'infos lecture seule en haut de la modale édition */
.info-box {
  background: var(--black-3);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 4px;
}

html[data-theme="light"] .info-box {
  background: var(--surface-soft);
  border-color: var(--border);
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 12px;
  gap: 12px;
}

.info-row + .info-row {
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

html[data-theme="light"] .info-row + .info-row {
  border-top-color: var(--border-soft);
}

.info-row strong {
  font-weight: 600;
  color: var(--text-on-dark-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 11px;
}

.info-row span,
.info-row code {
  color: var(--text-on-dark);
  text-align: right;
}

html[data-theme="light"] .info-row strong { color: var(--text-faint); }
html[data-theme="light"] .info-row span,
html[data-theme="light"] .info-row code { color: var(--text); }

.info-uid {
  font-family: 'Courier New', monospace;
  font-size: 11px;
  background: var(--black-2);
  padding: 2px 6px;
  border-radius: 4px;
  word-break: break-all;
}

html[data-theme="light"] .info-uid { background: var(--white); }

/* Curseur sur les lignes user (cliquables) */
.users-table-row {
  cursor: pointer;
}

/* ====================================================================
   ONGLET CONSTRUCTEUR — sous-onglets + Exercices
   ==================================================================== */
.sub-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  overflow-x: auto;
  scrollbar-width: thin;
}

html[data-theme="light"] .sub-tabs { border-bottom-color: var(--border); }

.sub-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-on-dark-muted);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.sub-tab:hover {
  color: var(--text-on-dark);
}

.sub-tab.is-active {
  color: var(--gold);
  border-bottom-color: var(--gold);
  font-weight: 600;
}

html[data-theme="light"] .sub-tab { color: var(--text-muted); }
html[data-theme="light"] .sub-tab:hover { color: var(--text); }
html[data-theme="light"] .sub-tab.is-active { color: var(--gold-dark); border-bottom-color: var(--gold); }

/* Toolbar Exercices */
.exercices-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.exercices-toolbar-left {
  display: flex;
  gap: 10px;
  flex: 1;
  min-width: 280px;
}

.exercices-search { flex: 1; max-width: 360px; }

.exercices-search input {
  width: 100%;
  padding: 10px 14px;
  background: var(--black-2);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  color: var(--text-on-dark);
  font-family: var(--font-body);
  font-size: 13px;
  outline: none;
}

.exercices-search input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
}

/* Tous les <select> dans la toolbar du constructeur (Exercices, Séances, etc.) */
.exercices-toolbar select,
#exercices-folder-filter {
  padding: 10px 14px;
  background: var(--black-2);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  color: var(--text-on-dark);
  font-family: var(--font-body);
  font-size: 13px;
  cursor: pointer;
  outline: none;
  /* Désactive le rendu natif blanc du <select> sur Chromium et Firefox */
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  /* Petite flèche dorée dessinée en SVG inline */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' fill='none' stroke='%23d8b82e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.exercices-toolbar select:focus,
#exercices-folder-filter:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
}

/* Les <option> dans le dropdown ouvert (le navigateur affiche son propre menu,
   on force juste le fond sombre pour la cohérence) */
.exercices-toolbar select option,
#exercices-folder-filter option {
  background: var(--black-2);
  color: var(--text-on-dark);
}

html[data-theme="light"] .exercices-search input,
html[data-theme="light"] .exercices-toolbar select,
html[data-theme="light"] #exercices-folder-filter {
  background: var(--white);
  border-color: var(--border);
  color: var(--text);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' fill='none' stroke='%23877830' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.exercices-toolbar-right {
  display: flex;
  gap: 10px;
}

/* Liste des exercices regroupés par dossier */
.exercice-folder {
  background: var(--black-2);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}

html[data-theme="light"] .exercice-folder {
  background: var(--white);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.exercice-folder-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: var(--black-3);
  cursor: pointer;
  font-size: 14px;
  user-select: none;
  transition: background 0.12s ease;
}

.exercice-folder-head:hover {
  background: rgba(216, 184, 46, 0.08);
}

html[data-theme="light"] .exercice-folder-head { background: var(--surface-soft); }
html[data-theme="light"] .exercice-folder-head:hover { background: var(--gold-soft); }

.exercice-folder.is-collapsed .exercice-folder-body {
  display: none;
}

.exercice-folder.is-empty .exercice-folder-head {
  opacity: 0.85;
}

.folder-empty-hint {
  margin: 0;
  padding: 12px;
  font-size: 12px;
  font-style: italic;
  text-align: center;
}

/* Badge orange "⚠ vidéo: 22 · étiquettes: 25 · desc: 1" affiché à côté
   du nom du dossier pour indiquer les manques sans avoir à ouvrir.
   Hover = tooltip détaillé.
   Cliquable visuellement neutre (pas de cursor pointer) car informatif. */
.folder-warning-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 8px;
  padding: 3px 10px;
  background: rgba(249, 115, 22, 0.15);
  border: 1px solid rgba(249, 115, 22, 0.45);
  color: #fb923c;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  cursor: help;
}

html[data-theme="light"] .folder-warning-badge {
  background: #fff7ed;
  border-color: #fdba74;
  color: #c2410c;
}

/* Boutons d'action dossier (Renommer / Supprimer) — côte à côte à droite
   du nom du dossier. Visibles, taille confortable, labels textuels. */
.folder-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}

.folder-actions .btn {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
  white-space: nowrap;
  transition: all 0.15s ease;
}

/* Renommer : neutre, accent gold au hover */
.folder-actions .folder-rename-btn {
  color: var(--text-on-dark-muted, rgba(255,255,255,.7));
  background: rgba(255, 255, 255, 0.04);
}
.folder-actions .folder-rename-btn:hover {
  background: rgba(216, 184, 46, 0.15);
  border-color: var(--gold);
  color: var(--gold);
}

/* Supprimer (= archiver) : rouge accentué pour la dangerosité */
.folder-actions .folder-delete-btn {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.25);
}
.folder-actions .folder-delete-btn:hover {
  background: rgba(239, 68, 68, 0.20);
  border-color: rgba(239, 68, 68, 0.55);
  color: #ffffff;
}

html[data-theme="light"] .folder-actions .folder-rename-btn {
  color: var(--text-muted);
  background: var(--surface-soft);
}
html[data-theme="light"] .folder-actions .folder-rename-btn:hover {
  background: var(--gold-soft);
  border-color: var(--gold);
  color: var(--gold-dark);
}
html[data-theme="light"] .folder-actions .folder-delete-btn {
  color: #b91c1c;
  background: #fee2e2;
  border-color: #fca5a5;
}
html[data-theme="light"] .folder-actions .folder-delete-btn:hover {
  background: #fecaca;
  border-color: #ef4444;
  color: #7f1d1d;
}

/* Empêche les clics sur les boutons de fermer/ouvrir l'accordéon */
.folder-actions { z-index: 2; }

.exercice-folder-body {
  padding: 12px 18px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.exercice-card {
  background: var(--black-3);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.exercice-card:hover {
  border-color: var(--gold);
  background: rgba(216, 184, 46, 0.04);
}

html[data-theme="light"] .exercice-card {
  background: var(--surface-soft);
  border-color: var(--border-soft);
}

html[data-theme="light"] .exercice-card:hover {
  border-color: var(--gold);
  background: var(--gold-soft);
}

.exercice-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.exercice-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--gold);
  color: var(--black);
  font-weight: 700;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.exercice-name {
  font-size: 14px;
  color: var(--text-on-dark);
}

html[data-theme="light"] .exercice-name { color: var(--text); }

.exercice-desc {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--text-on-dark-muted);
  line-height: 1.5;
}

html[data-theme="light"] .exercice-desc { color: var(--text-muted); }

.exercice-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 11px;
}

.exercice-cat { font-size: 11px; }

/* Indicateur "exercice incomplet" : icône ⚠ + liste rouge des manques.
   Triggered par renderExerciseCard quand des champs essentiels sont vides
   (étiquettes musc/artic, description, commentaires, vidéo). */
.exercice-warning-icon {
  font-size: 14px;
  margin-left: 4px;
  cursor: help;
}
.exercice-card.is-incomplete {
  border-left: 3px solid #ef4444;
}
.exercice-missing-list {
  margin: 4px 0 4px 4px;
  padding-left: 18px;
  font-size: 11px;
  color: #ef4444;
  font-weight: 500;
}
.exercice-missing-list li { margin: 2px 0; }
html[data-theme="light"] .exercice-missing-list { color: #dc2626; }

.exercice-tags { display: inline-flex; gap: 4px; flex-wrap: wrap; }

.tag-pill {
  display: inline-block;
  padding: 2px 8px;
  background: var(--gold-soft);
  color: var(--gold);
  border: 1px solid rgba(216, 184, 46, 0.3);
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

html[data-theme="light"] .tag-pill { color: var(--gold-dark); }

/* Variante : étiquette articulation (bleu clair) — distingue visuellement
   les zones musculaires (gold) des zones articulaires (bleu) sur les cartes. */
.tag-pill.tag-pill-joint {
  background: rgba(96, 165, 250, 0.12);
  color: #93c5fd;
  border-color: rgba(96, 165, 250, 0.35);
}
html[data-theme="light"] .tag-pill.tag-pill-joint {
  background: rgba(59, 130, 246, 0.10);
  color: #2563eb;
  border-color: rgba(59, 130, 246, 0.40);
}

/* Modale exercice — étiquettes en grid */
.tags-fieldset {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin: 0;
}

html[data-theme="light"] .tags-fieldset { border-color: var(--border); }

.tags-fieldset legend {
  padding: 0 8px;
  font-size: 12px;
  color: var(--text-on-dark-muted);
}

html[data-theme="light"] .tags-fieldset legend { color: var(--text-muted); }

.tags-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

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

.tag-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--black-3);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.12s ease;
}

.tag-checkbox:has(input:checked) {
  background: rgba(216, 184, 46, 0.12);
  border-color: var(--gold);
  color: var(--gold);
}

/* Variante : checkboxes du fieldset "Zones articulaires" en bleu pour
   distinguer visuellement des "Zones musculaires" (gold). */
.tags-fieldset-joint .tag-checkbox:has(input:checked) {
  background: rgba(96, 165, 250, 0.12);
  border-color: #60a5fa;
  color: #93c5fd;
}
html[data-theme="light"] .tags-fieldset-joint .tag-checkbox:has(input:checked) {
  background: rgba(59, 130, 246, 0.08);
  border-color: #2563eb;
  color: #2563eb;
}

.tag-checkbox input { width: auto; padding: 0; margin: 0; }

/* ====================================================================
   VIDÉO de démonstration des exercices
   ==================================================================== */
.video-fieldset {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin: 0;
}

html[data-theme="light"] .video-fieldset { border-color: var(--border); }

.video-fieldset legend {
  padding: 0 8px;
  font-size: 12px;
  color: var(--text-on-dark-muted);
}

html[data-theme="light"] .video-fieldset legend { color: var(--text-muted); }

.video-preview {
  width: 100%;
  max-height: 240px;
  background: var(--black);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.video-actions {
  margin-bottom: 12px;
}

.video-upload-label {
  display: block;
  margin-top: 6px;
}

.video-upload-label > span:first-child {
  display: block;
  font-size: 13px;
  margin-bottom: 6px;
  color: var(--text-on-dark-muted);
}

html[data-theme="light"] .video-upload-label > span:first-child {
  color: var(--text-muted);
}

.video-upload-label input[type="file"] {
  display: block;
  width: 100%;
  padding: 10px;
  background: var(--black-3);
  border: 1px dashed rgba(216, 184, 46, 0.3);
  border-radius: var(--radius-sm);
  color: var(--text-on-dark);
  font-size: 13px;
  cursor: pointer;
}

html[data-theme="light"] .video-upload-label input[type="file"] {
  background: var(--surface-soft);
  color: var(--text);
  border-color: var(--gold);
}

.video-progress {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.video-progress-bar {
  flex: 1;
  height: 8px;
  background: var(--black-3);
  border-radius: 4px;
  overflow: hidden;
}

.video-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--gold);
  transition: width 0.18s ease;
}

.video-progress-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--gold);
  min-width: 44px;
  text-align: right;
}

/* Icône 📹 sur la carte exercice quand vidéo dispo */
.exercice-video-icon {
  margin-left: auto;
  font-size: 14px;
  flex-shrink: 0;
}

/* ====================================================================
   SOUS-ONGLET SÉANCES — grille de cards + tableau d'exercices
   ==================================================================== */
.sessions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.session-card {
  background: var(--black-2);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.12s ease;
}

.session-card:hover {
  border-color: var(--gold);
  transform: translateY(-1px);
}

html[data-theme="light"] .session-card {
  background: var(--white);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.session-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.session-type-badge {
  font-size: 18px;
  flex-shrink: 0;
}

.session-name {
  font-size: 14px;
  color: var(--text-on-dark);
  line-height: 1.3;
}

html[data-theme="light"] .session-name { color: var(--text); }

.session-desc {
  font-size: 12px;
  margin: 0 0 10px;
  line-height: 1.5;
}

.session-meta {
  display: flex;
  gap: 14px;
  font-size: 11px;
}

/* Modale séance — fieldset exercices */
.exercises-fieldset {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin: 0;
}

html[data-theme="light"] .exercises-fieldset { border-color: var(--border); }

.exercises-fieldset legend {
  padding: 0 8px;
  font-size: 12px;
  color: var(--text-on-dark-muted);
}

html[data-theme="light"] .exercises-fieldset legend { color: var(--text-muted); }

.btn-add-exercise {
  display: block;
  width: 100%;
  margin-top: 10px;
  border: 1px dashed rgba(216, 184, 46, 0.4);
}

.btn-add-exercise:hover {
  border-color: var(--gold);
  background: var(--gold-soft);
  color: var(--gold);
}

html[data-theme="light"] .btn-add-exercise:hover { color: var(--gold-dark); }

.session-exercise-row {
  background: var(--black-3);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 8px;
}

html[data-theme="light"] .session-exercise-row {
  background: var(--surface-soft);
  border-color: var(--border-soft);
}

.session-row-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.session-row-num {
  font-weight: 700;
  color: var(--gold);
  flex-shrink: 0;
  font-size: 13px;
}

.session-row-select {
  flex: 1;
  padding: 7px 10px;
  background: var(--black-2);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: var(--text-on-dark);
  font-family: var(--font-body);
  font-size: 12px;
  outline: none;
}

.session-row-select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px var(--gold-soft);
}

html[data-theme="light"] .session-row-select {
  background: var(--white);
  border-color: var(--border);
  color: var(--text);
}

.session-row-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.row-action-btn {
  width: 28px;
  height: 28px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: var(--text-on-dark-muted);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.row-action-btn:hover:not([disabled]) {
  border-color: var(--gold);
  color: var(--gold);
}

.row-action-btn[disabled] {
  opacity: 0.3;
  cursor: not-allowed;
}

.row-action-danger:hover:not([disabled]) {
  border-color: rgba(239, 68, 68, 0.5);
  color: #FCA5A5;
  background: rgba(239, 68, 68, 0.08);
}

html[data-theme="light"] .row-action-btn { border-color: var(--border); color: var(--text-muted); }

.session-row-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.session-row-field-wide { grid-column: 1 / -1; }

.session-row-field {
  display: flex;
  flex-direction: column;
}

.session-row-field span {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-on-dark-faint);
  margin-bottom: 3px;
}

html[data-theme="light"] .session-row-field span { color: var(--text-faint); }

.session-row-field input {
  padding: 6px 8px;
  background: var(--black-2);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  color: var(--text-on-dark);
  font-family: var(--font-body);
  font-size: 12px;
  outline: none;
  width: 100%;
  box-sizing: border-box;
}

.session-row-field input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px var(--gold-soft);
}

html[data-theme="light"] .session-row-field input {
  background: var(--white);
  border-color: var(--border);
  color: var(--text);
}

@media (max-width: 600px) {
  .session-row-grid { grid-template-columns: repeat(2, 1fr); }
  .session-row-field-wide { grid-column: 1 / -1; }
}

.session-row-tempo-toggle {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-on-dark-muted);
  cursor: pointer;
}

html[data-theme="light"] .session-row-tempo-toggle { color: var(--text-muted); }

.session-row-tempo-toggle input[type="checkbox"] {
  width: auto;
  margin: 0;
}

/* ====================================================================
   SOUS-ONGLET SEMAINES TYPE
   ==================================================================== */
.weeks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}

.week-card {
  background: var(--black-2);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.12s ease;
}

.week-card:hover {
  border-color: var(--gold);
  transform: translateY(-1px);
}

html[data-theme="light"] .week-card {
  background: var(--white);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.week-card-head { margin-bottom: 6px; }

.week-name {
  font-size: 14px;
  color: var(--text-on-dark);
  line-height: 1.3;
}

html[data-theme="light"] .week-name { color: var(--text); }

.week-desc {
  font-size: 12px;
  margin: 0 0 10px;
  line-height: 1.5;
}

.week-card-mini {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 10px;
}

.week-mini-day {
  position: relative;
  aspect-ratio: 1;
  background: var(--black-3);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-on-dark-faint);
}

.week-mini-day.has-sessions {
  background: var(--gold-soft);
  border-color: var(--gold);
  color: var(--gold);
}

html[data-theme="light"] .week-mini-day {
  background: var(--surface-soft);
  border-color: var(--border-soft);
  color: var(--text-faint);
}

html[data-theme="light"] .week-mini-day.has-sessions {
  background: var(--gold-soft);
  border-color: var(--gold);
  color: var(--gold-dark);
}

.week-mini-day-count {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--gold);
  color: var(--black);
  font-size: 9px;
  font-weight: 700;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.week-meta {
  display: flex;
  gap: 14px;
  font-size: 11px;
}

/* Modale semaine type — grille 7 jours */
.modal-xlarge {
  max-width: 1100px;
}

.week-days-fieldset {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin: 0;
}

html[data-theme="light"] .week-days-fieldset { border-color: var(--border); }

.week-days-fieldset legend {
  padding: 0 8px;
  font-size: 12px;
  color: var(--text-on-dark-muted);
}

html[data-theme="light"] .week-days-fieldset legend { color: var(--text-muted); }

.week-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

@media (max-width: 900px) {
  .week-days-grid { grid-template-columns: repeat(2, 1fr); }
}

.week-day-col {
  background: var(--black-3);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 140px;
}

html[data-theme="light"] .week-day-col {
  background: var(--surface-soft);
  border-color: var(--border-soft);
}

.week-day-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: center;
  color: var(--gold);
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(216, 184, 46, 0.2);
}

.week-day-sessions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.week-session-card {
  background: var(--black-2);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}

html[data-theme="light"] .week-session-card {
  background: var(--white);
  border-color: var(--border);
}

.week-session-icon { font-size: 14px; flex-shrink: 0; }

.week-session-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-on-dark);
}

html[data-theme="light"] .week-session-name { color: var(--text); }

.week-session-remove {
  width: 18px;
  height: 18px;
  background: transparent;
  border: none;
  color: var(--text-on-dark-faint);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  border-radius: 4px;
  flex-shrink: 0;
}

.week-session-remove:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #FCA5A5;
}

html[data-theme="light"] .week-session-remove { color: var(--text-faint); }
html[data-theme="light"] .week-session-remove:hover { color: #B91C1C; background: #FEE2E2; }

.week-add-session {
  background: transparent;
  border: 1px dashed rgba(216, 184, 46, 0.3);
  border-radius: 6px;
  padding: 6px 8px;
  color: var(--gold);
  font-size: 11px;
  cursor: pointer;
  font-family: var(--font-body);
  transition: all 0.12s ease;
}

.week-add-session:hover {
  background: var(--gold-soft);
  border-color: var(--gold);
  border-style: solid;
}

/* Picker de séance (overlay au-dessus de la modale semaine) */
.picker-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.picker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--black-3);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.12s ease;
}

.picker-item:hover {
  border-color: var(--gold);
  background: rgba(216, 184, 46, 0.05);
}

html[data-theme="light"] .picker-item { background: var(--surface-soft); border-color: var(--border); }
html[data-theme="light"] .picker-item:hover { background: var(--gold-soft); border-color: var(--gold); }

.picker-item-icon { font-size: 18px; flex-shrink: 0; }

.picker-item-name {
  flex: 1;
  font-size: 13px;
  color: var(--text-on-dark);
}

html[data-theme="light"] .picker-item-name { color: var(--text); }

.picker-item-meta { font-size: 11px; flex-shrink: 0; }

/* ====================================================================
   SOUS-ONGLETS CYCLES & ANNÉES TYPE
   ==================================================================== */
.cycles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}

.cycle-card {
  background: var(--black-2);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.12s ease;
}

.cycle-card:hover {
  border-color: var(--gold);
  transform: translateY(-1px);
}

html[data-theme="light"] .cycle-card {
  background: var(--white);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.cycle-card-head { margin-bottom: 6px; }

.cycle-name {
  font-size: 14px;
  color: var(--text-on-dark);
  line-height: 1.3;
}

html[data-theme="light"] .cycle-name { color: var(--text); }

.cycle-desc {
  font-size: 12px;
  margin: 0 0 10px;
}

.cycle-weeks-mini {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 10px;
  min-height: 28px;
  align-items: center;
}

.cycle-week-mini {
  background: var(--gold-soft);
  border: 1px solid rgba(216, 184, 46, 0.3);
  color: var(--gold);
  font-size: 10px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
  letter-spacing: 0.04em;
}

html[data-theme="light"] .cycle-week-mini { color: var(--gold-dark); }

.cycle-meta {
  display: flex;
  gap: 14px;
  font-size: 11px;
  flex-wrap: wrap;
}

/* Modale cycle/année — fieldset semaines/cycles */
.cycle-weeks-fieldset {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin: 0;
}

html[data-theme="light"] .cycle-weeks-fieldset { border-color: var(--border); }

.cycle-weeks-fieldset legend {
  padding: 0 8px;
  font-size: 12px;
  color: var(--text-on-dark-muted);
}

html[data-theme="light"] .cycle-weeks-fieldset legend { color: var(--text-muted); }

.cycle-week-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--black-3);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
}

html[data-theme="light"] .cycle-week-row {
  background: var(--surface-soft);
  border-color: var(--border-soft);
}

.cycle-week-pos {
  font-weight: 700;
  color: var(--gold);
  font-size: 12px;
  flex-shrink: 0;
  min-width: 28px;
}

.cycle-week-name {
  flex: 1;
  font-size: 13px;
  color: var(--text-on-dark);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html[data-theme="light"] .cycle-week-name { color: var(--text); }

.cycle-week-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

/* ====================================================================
   SOUS-ONGLET ASSIGNATION
   ==================================================================== */
.assignments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}

.assignment-card {
  background: var(--black-2);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.12s ease;
}

.assignment-card:hover {
  border-color: var(--gold);
  transform: translateY(-1px);
}

html[data-theme="light"] .assignment-card {
  background: var(--white);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.assignment-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.assignment-user {
  font-size: 14px;
  color: var(--text-on-dark);
}

html[data-theme="light"] .assignment-user { color: var(--text); }

.assignment-year {
  font-size: 12px;
  margin: 0 0 8px;
}

.assignment-meta {
  display: flex;
  gap: 14px;
  font-size: 11px;
  flex-wrap: wrap;
}

/* ====================================================================
   ONGLET TÂCHES — liste de cards avec checkbox
   ==================================================================== */
.tasks-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.task-row {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  background: var(--black-2);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease;
}

.task-row:hover { border-color: var(--gold); }

html[data-theme="light"] .task-row {
  background: var(--white);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.task-row.is-done {
  opacity: 0.6;
}

.task-row.is-done .task-title {
  text-decoration: line-through;
}

.task-row.is-overdue {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.04);
}

.task-checkbox-label {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  padding-top: 2px;
}

.task-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--gold);
}

.task-row-body {
  flex: 1;
  cursor: pointer;
  min-width: 0;
}

.task-row-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.task-title {
  font-size: 14px;
  color: var(--text-on-dark);
}

html[data-theme="light"] .task-title { color: var(--text); }

.task-due {
  font-size: 11px;
  color: var(--text-on-dark-muted);
  background: var(--black-3);
  padding: 2px 8px;
  border-radius: 4px;
}

.task-due.is-overdue {
  color: #FCA5A5;
  background: rgba(239, 68, 68, 0.1);
  font-weight: 600;
}

html[data-theme="light"] .task-due { background: var(--surface-soft); color: var(--text-muted); }
html[data-theme="light"] .task-due.is-overdue { background: #FEE2E2; color: #B91C1C; }

.task-desc {
  margin: 0 0 6px;
  font-size: 12px;
  line-height: 1.5;
}

.task-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 11px;
}

/* Sous-onglets compteur (pour tâches) */
.sub-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 18px;
  margin-left: 6px;
  padding: 0 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-weight: 700;
}

.sub-tab.is-active .sub-tab-count {
  background: var(--gold);
  color: var(--black);
}

html[data-theme="light"] .sub-tab-count { background: rgba(0, 0, 0, 0.06); }

/* Badge "Urgent" rouge */
.role-badge.role-red {
  background: rgba(239, 68, 68, 0.15);
  color: #FCA5A5;
}

html[data-theme="light"] .role-badge.role-red { color: #B91C1C; }

/* ====================================================================
   ONGLET CALENDRIER — créneaux par jour
   ==================================================================== */
.day-block {
  margin-bottom: 24px;
}

.day-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 10px;
  color: var(--gold);
}

.day-empty {
  font-size: 12px;
  font-style: italic;
  margin: 0 0 12px;
}

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

.slot-card {
  background: var(--black-2);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.slot-card:hover { border-color: var(--gold); }

.slot-card.is-inactive { opacity: 0.5; }

html[data-theme="light"] .slot-card {
  background: var(--white);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.slot-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.slot-icon { font-size: 18px; }
.slot-time { font-size: 14px; color: var(--text-on-dark); }

html[data-theme="light"] .slot-time { color: var(--text); }

.slot-name { font-size: 12px; margin: 0 0 8px; }

.slot-meta { margin-bottom: 8px; }

.slot-fill { display: flex; align-items: center; gap: 8px; font-size: 11px; }
.slot-fill-bar {
  flex: 1;
  height: 6px;
  background: var(--black-3);
  border-radius: 3px;
  overflow: hidden;
}

html[data-theme="light"] .slot-fill-bar { background: var(--surface-soft); }

.slot-fill-bar-inner {
  height: 100%;
  background: #10B981;
  transition: width 0.18s ease;
}

.slot-fill-orange .slot-fill-bar-inner { background: #F59E0B; }
.slot-fill-red .slot-fill-bar-inner    { background: #EF4444; }

.slot-coaches {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.slot-coach-chip {
  background: var(--gold-soft);
  color: var(--gold);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-weight: 600;
}

html[data-theme="light"] .slot-coach-chip { color: var(--gold-dark); }

.slot-enrolled-list { display: flex; flex-direction: column; gap: 4px; }

.slot-enrolled-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--black-3);
  border-radius: 6px;
  font-size: 13px;
}

html[data-theme="light"] .slot-enrolled-row { background: var(--surface-soft); }

/* ====================================================================
   ONGLET SUPPORT — liste tickets
   ==================================================================== */
.tickets-list { display: flex; flex-direction: column; gap: 8px; }

.ticket-row {
  background: var(--black-2);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.ticket-row:hover { border-color: var(--gold); }

html[data-theme="light"] .ticket-row {
  background: var(--white);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.ticket-row-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.ticket-subject { font-size: 14px; color: var(--text-on-dark); }
html[data-theme="light"] .ticket-subject { color: var(--text); }

.ticket-msg { font-size: 12px; margin: 0 0 6px; line-height: 1.5; }
.ticket-meta { display: flex; gap: 10px; font-size: 11px; }

/* ====================================================================
   ONGLET DASHBOARD — cards de stats
   ==================================================================== */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.dashboard-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--black-2);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  padding: 18px 20px;
  cursor: pointer;
  /* v2.91 : transitions fluides cubic-bezier (Linear-style) */
  transition:
    transform 0.28s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.18s ease,
    box-shadow 0.28s ease;
  position: relative;
  overflow: hidden;
}

/* v2.91 : glow doré subtil au hover */
.dashboard-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(216, 184, 46, 0.12), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.dashboard-card:hover {
  border-color: var(--gold);
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 10px 28px rgba(216, 184, 46, 0.18), 0 3px 10px rgba(0, 0, 0, 0.35);
}

.dashboard-card:hover::before {
  opacity: 1;
}

.dashboard-card:active {
  transform: translateY(-1px) scale(1);
  transition-duration: 0.08s;
}

html[data-theme="light"] .dashboard-card:hover {
  box-shadow: 0 10px 28px rgba(216, 184, 46, 0.22), 0 3px 10px rgba(0, 0, 0, 0.10);
}

/* ====================================================================
   v2.94 : POLISH UX général admin (hover lift sur rows + sub-tabs animées)
   ==================================================================== */

/* Lift au hover sur les rows de listes (utilisateurs, tickets, prospects, etc.) */
.user-row,
.ticket-row,
.lead-row,
.task-row,
.compta-row,
.resource-row {
  transition:
    transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.22s ease,
    background-color 0.18s ease;
}

.user-row:hover,
.ticket-row:hover,
.lead-row:hover,
.task-row:hover,
.compta-row:hover,
.resource-row:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(216, 184, 46, 0.10), 0 2px 6px rgba(0, 0, 0, 0.20);
}

html[data-theme="light"] .user-row:hover,
html[data-theme="light"] .ticket-row:hover,
html[data-theme="light"] .lead-row:hover,
html[data-theme="light"] .task-row:hover,
html[data-theme="light"] .compta-row:hover,
html[data-theme="light"] .resource-row:hover {
  box-shadow: 0 6px 18px rgba(216, 184, 46, 0.18), 0 2px 6px rgba(0, 0, 0, 0.06);
}

/* Sub-tabs : animation fluide de transition active state */
.sub-tabs .sub-tab {
  position: relative;
  transition: color 0.18s ease;
}

.sub-tabs .sub-tab::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--gold);
  transform: translateX(-50%);
  transition: width 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.sub-tabs .sub-tab.is-active::after {
  width: 80%;
}

/* Boutons primary : ripple pulse subtil au hover + active feedback */
.btn-primary,
.btn,
button.btn {
  transition:
    transform 0.18s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.18s ease,
    filter 0.18s ease;
}

.btn-primary:hover {
  filter: brightness(1.08);
  box-shadow: 0 4px 14px rgba(216, 184, 46, 0.25);
}

.btn-primary:active {
  transform: scale(0.97);
  transition-duration: 0.06s;
}

/* Sidebar nav-item active : indicator gold à gauche */
.sidebar-nav-item {
  position: relative;
  transition:
    background-color 0.18s ease,
    color 0.18s ease,
    padding-left 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-nav-item.is-active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 3px;
  background: var(--gold);
  border-radius: 0 3px 3px 0;
}

/* Toast container plus haut sur mobile pour éviter de chevaucher la nav */
@media (max-width: 768px) {
  #odysium-toast-container {
    bottom: 80px !important;
  }
}

/* v2.95 : animations transitions modales admin (modal-overlay) */
@keyframes modal-fade-in {
  from { opacity: 0; backdrop-filter: blur(0); }
  to   { opacity: 1; backdrop-filter: blur(4px); }
}
@keyframes modal-content-in {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-overlay,
[id$="-modal"][class*="overlay"] {
  animation: modal-fade-in 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-overlay > .modal,
.modal-overlay > div {
  animation: modal-content-in 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

/* v2.95 : page-header subtle gradient gold glow (signature visuelle Odysium) */
.page-header {
  position: relative;
}
.page-header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), transparent);
  border-radius: 2px;
}

/* v2.95 : input/select focus avec ring gold subtil (cohérence) */
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--gold) !important;
  box-shadow: 0 0 0 3px rgba(216, 184, 46, 0.15);
}

/* ====================================================================
   v2.96 : MESSAGERIE (Sprint 1.3 Chantier B)
   ==================================================================== */
/* v4.9.41 — Feedback Théo : "que ça prenne toute la place sous les onglets".
   Hauteur élargie au max possible sous le topbar + le page-header compact. */
.messagerie-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 12px;
  height: calc(100vh - 140px);
  min-height: 480px;
}
.messagerie-list {
  background: var(--black-2);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  overflow-y: auto;
  padding: 6px;
}
html[data-theme="light"] .messagerie-list {
  background: var(--white);
  border-color: var(--border);
}
.messagerie-conv-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.18s ease, transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  margin-bottom: 4px;
  position: relative;
}
.messagerie-conv-row:hover {
  background: rgba(216, 184, 46, 0.06);
}
.messagerie-conv-row.is-active {
  background: rgba(216, 184, 46, 0.14);
  border-left: 3px solid var(--gold);
  padding-left: 9px;
}
.messagerie-conv-icon {
  /* v4.9.59 — Avatar circulaire gold (style WhatsApp) */
  font-size: 17px;
  font-weight: 700;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(216,184,46,0.30), rgba(216,184,46,0.10));
  border: 1px solid rgba(216,184,46,0.35);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(216,184,46,0.10);
}
.messagerie-conv-body {
  flex: 1;
  min-width: 0;
}
.messagerie-conv-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
}
.messagerie-conv-head strong {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.messagerie-conv-sub {
  font-size: 11px;
  color: var(--text-on-dark-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
html[data-theme="light"] .messagerie-conv-sub { color: var(--text-muted); }
.messagerie-unread-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #e74c3c;
  flex-shrink: 0;
}
.messagerie-conv-row.is-unread strong { font-weight: 800; color: var(--gold); }

.messagerie-detail {
  background: var(--black-2);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
html[data-theme="light"] .messagerie-detail {
  background: var(--white);
  border-color: var(--border);
}
.messagerie-detail-head {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}
.messagerie-detail-head h3 { margin: 0 0 4px; font-size: 16px; }
.messagerie-detail-meta { font-size: 11px; }
.messagerie-detail-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
/* v4.9.46 — Tailles agrandies (feedback Théo : style WhatsApp).
   v4.9.59 — Refonte chat admin : bulles WhatsApp-like avec radius asymétrique
   (coin pointu vers l'auteur, simulant la "tail" de WhatsApp). Hover subtil. */
.messagerie-msg {
  background: var(--black-3, rgba(255,255,255,0.05));
  padding: 12px 16px;
  border-radius: 18px 18px 18px 4px;  /* coin bas-gauche pointu (their side) */
  max-width: 78%;
  align-self: flex-start;
  box-shadow: 0 1px 2px rgba(0,0,0,0.10);
  transition: background-color 0.15s ease;
  position: relative;
}
.messagerie-msg.mine {
  align-self: flex-end;
  background: rgba(216, 184, 46, 0.18);
  border-radius: 18px 18px 4px 18px;  /* coin bas-droit pointu (my side) */
  box-shadow: 0 1px 2px rgba(216, 184, 46, 0.12);
}
.messagerie-msg:hover { background: rgba(255,255,255,0.07); }
.messagerie-msg.mine:hover { background: rgba(216, 184, 46, 0.24); }
.messagerie-msg.callback {
  background: rgba(231, 76, 60, 0.20);
  border-left: 3px solid #e74c3c;
  border-radius: 4px 18px 18px 18px;
}
.messagerie-msg.announcement {
  background: rgba(216, 184, 46, 0.10);
  border-left: 3px solid var(--gold);
  align-self: stretch;
  max-width: 100%;
  border-radius: 4px 18px 18px 4px;
}
.messagerie-msg-meta { font-size: 11.5px; margin-bottom: 5px; opacity: 0.85; }
.messagerie-msg-content { font-size: 15px; line-height: 1.55; word-break: break-word; white-space: pre-wrap; }

.messagerie-detail-input {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
  align-items: center;
}
.messagerie-detail-input input {
  flex: 1;
  background: var(--black-3, rgba(255,255,255,0.04));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 13px 18px;
  color: inherit;
  font-size: 15px;
}
/* v4.9.126 — Mode clair : fond + bordure adaptés pour rendre le texte lisible */
html[data-theme="light"] .messagerie-detail-input input {
  background: var(--surface-soft, #fff);
  border: 1px solid var(--border, #D7DAE1);
  color: var(--text, #2B3240);
}
html[data-theme="light"] .messagerie-detail-input input::placeholder {
  color: var(--text-muted, #6A7280);
}
.messagerie-detail-readonly {
  padding: 14px;
  text-align: center;
  font-size: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Responsive : sur mobile, on empile */
@media (max-width: 900px) {
  .messagerie-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 220px 1fr;
    height: calc(100vh - 110px);
    gap: 8px;
  }
}

/* v2.95 : scroll-bar custom (gold tint) sur webkit */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(216, 184, 46, 0.20);
  border-radius: 6px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background-color: rgba(216, 184, 46, 0.40); background-clip: padding-box; }
html[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: rgba(160, 136, 21, 0.25);
  background-clip: padding-box;
}

/* v2.91 : fade-in échelonné des cards au load (effet cascade) */
@keyframes dashboard-card-fade-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.dashboard-card {
  animation: dashboard-card-fade-in 0.45s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}
/* Délai progressif pour effet cascade (1ère card 0ms, 2e 50ms, ...) */
.dashboard-grid .dashboard-card:nth-child(1) { animation-delay: 0ms; }
.dashboard-grid .dashboard-card:nth-child(2) { animation-delay: 60ms; }
.dashboard-grid .dashboard-card:nth-child(3) { animation-delay: 120ms; }
.dashboard-grid .dashboard-card:nth-child(4) { animation-delay: 180ms; }
.dashboard-grid .dashboard-card:nth-child(5) { animation-delay: 240ms; }
.dashboard-grid .dashboard-card:nth-child(6) { animation-delay: 300ms; }
.dashboard-grid .dashboard-card:nth-child(7) { animation-delay: 360ms; }
.dashboard-grid .dashboard-card:nth-child(8) { animation-delay: 420ms; }
.dashboard-grid .dashboard-card:nth-child(9) { animation-delay: 480ms; }

html[data-theme="light"] .dashboard-card {
  background: var(--white);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.dashboard-card-icon {
  font-size: 32px;
  flex-shrink: 0;
}

.dashboard-card-body { flex: 1; }

.dashboard-card-value {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
  color: var(--gold);
  margin-bottom: 4px;
}

.dashboard-card-label {
  font-size: 12px;
  color: var(--text-on-dark-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

html[data-theme="light"] .dashboard-card-label { color: var(--text-muted); }

.dashboard-section {
  background: var(--black-2);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  padding: 20px;
}

html[data-theme="light"] .dashboard-section {
  background: var(--white);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.dashboard-section + .dashboard-section { margin-top: 20px; }

.dashboard-section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
  margin: 0 0 14px;
}

/* Section "À traiter" */
.dashboard-todo {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.todo-empty {
  text-align: center;
  padding: 30px 16px;
  color: var(--text-muted);
}
.todo-empty .icon-big { font-size: 36px; display: block; margin-bottom: 8px; color: #00c96e; }

.todo-block {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.todo-block:hover {
  border-color: var(--gold);
  background: rgba(216, 184, 46, 0.04);
}

html[data-theme="light"] .todo-block {
  background: var(--bg-card);
  border-color: var(--border);
}

.todo-block-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.todo-count {
  background: var(--gold);
  color: var(--black);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  min-width: 22px;
  text-align: center;
}

.todo-block-list {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.todo-item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 6px 0;
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.04);
}
.todo-item:last-child { border-bottom: none; }
.todo-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 6px;
}
.todo-item-body { flex: 1; min-width: 0; }
.todo-item-body strong {
  display: block;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.todo-item-body small {
  display: block;
  font-size: 11px;
  margin-top: 2px;
}
.todo-block-cta {
  margin-top: 10px;
  text-align: right;
}

/* ============================================================================
   Vue Performance d'un sportif (modale)
   ========================================================================= */
.perf-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.perf-kpi {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: center;
}
.perf-kpi-value {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
}
.perf-kpi-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
html[data-theme="light"] .perf-kpi {
  background: var(--bg-card);
}

.perf-criteria {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}
.perf-crit {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 6px;
}
.perf-crit-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.perf-crit-label {
  flex: 1;
  font-size: 12px;
}
.perf-crit-val {
  font-weight: 700;
  font-size: 13px;
}

.perf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-top: 8px;
}
.perf-table th, .perf-table td {
  padding: 6px 8px;
  text-align: left;
  border-bottom: 0.5px solid var(--border);
}
.perf-table th {
  background: rgba(255, 255, 255, 0.02);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.05em;
}
.perf-table tbody tr:hover {
  background: rgba(216, 184, 46, 0.04);
}

/* ─────────────────────────────────────────────────────────────────────────
   Bulle "?" d'aide contextuelle + modale d'aide (porté depuis Care, en gold)
   ───────────────────────────────────────────────────────────────────────── */
.help-bubble {
  position: fixed;
  top: 22px;
  right: 22px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #FFFFFF;
  color: var(--gold);
  border: 2px solid var(--gold);
  font-size: 22px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.20);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  z-index: 9990;
  padding: 0;
  line-height: 1;
}
.help-bubble:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.25);
  background: rgba(216, 184, 46, 0.12);
}
.help-bubble:active { transform: scale(0.96); }
.help-bubble.hidden { display: none; }
@media (max-width: 600px) {
  .help-bubble { top: 14px; right: 14px; width: 38px; height: 38px; font-size: 18px; }
}

/* Alias modal-backdrop / modal-panel pour compatibilité avec help.js + pwa-install.js
   (Care utilise ces classes ; Sport a .modal-overlay/.modal mais on ajoute les alias) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-panel {
  background: var(--black-2, #1a1a1a);
  border: 1px solid var(--border, #333);
  border-radius: 12px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
html[data-theme="light"] .modal-panel {
  background: #FFFFFF;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 0.5px solid var(--border);
}
.modal-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}
.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}
.modal-close:hover { color: var(--gold); }
.modal-footer {
  padding: 12px 20px;
  border-top: 0.5px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Modale d'aide */
.help-panel { max-width: 620px; max-height: 90vh; }
.help-body { padding: 18px 22px 22px; }

.help-summary {
  background: linear-gradient(135deg, rgba(216, 184, 46, 0.12), rgba(216, 184, 46, 0.04));
  border: 1px solid rgba(216, 184, 46, 0.24);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 18px;
}
.help-summary p { margin: 0; font-size: 14px; line-height: 1.65; }

.help-section { margin-bottom: 18px; }
.help-section:last-child { margin-bottom: 0; }
.help-section-title {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--gold);
}

.help-steps { margin: 0; padding-left: 28px; list-style: decimal; }
.help-steps li { margin-bottom: 12px; font-size: 13.5px; line-height: 1.55; }
.help-steps li strong { font-weight: 700; }
.help-steps li p { margin: 4px 0 0; font-size: 13px; line-height: 1.6; color: var(--text-muted); }

.help-tips { margin: 0; padding-left: 22px; list-style: none; }
.help-tips li { position: relative; margin-bottom: 8px; font-size: 13.5px; line-height: 1.55; }
.help-tips li::before {
  content: "✦";
  position: absolute;
  left: -18px;
  color: var(--gold);
  font-size: 13px;
}

.help-faq { display: flex; flex-direction: column; gap: 6px; }
.help-faq-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 0 14px;
  transition: border-color 0.15s;
}
.help-faq-item:hover { border-color: rgba(216, 184, 46, 0.30); }
.help-faq-item summary {
  cursor: pointer;
  padding: 12px 0;
  font-size: 13.5px;
  font-weight: 600;
  list-style: none;
  position: relative;
  padding-right: 28px;
}
.help-faq-item summary::after {
  content: "+";
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gold);
  font-size: 18px;
  font-weight: 700;
}
.help-faq-item[open] summary::after { content: "−"; }
.help-faq-item summary::-webkit-details-marker { display: none; }
.help-faq-item p { margin: 0; padding: 0 0 14px; font-size: 13px; color: var(--text-muted); line-height: 1.65; }

.help-footer-tip {
  margin-top: 22px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  font-size: 12.5px;
  line-height: 1.65;
}
.help-footer-tip a { color: var(--gold); text-decoration: none; }

/* ─────────────────────────────────────────────────────────────────────────
   Modale didacticiel d'installation PWA (porté depuis Care, en gold)
   ───────────────────────────────────────────────────────────────────────── */
.pwa-install-panel { max-width: 520px; }

.pwa-install-benefits {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pwa-install-benefits li { font-size: 13.5px; line-height: 1.5; }
.pwa-install-benefits li strong { font-weight: 700; }

.pwa-install-card {
  background: rgba(216, 184, 46, 0.08);
  border: 1px solid rgba(216, 184, 46, 0.20);
  border-radius: 12px;
  padding: 16px 18px;
  margin: 0 0 6px;
}
.pwa-install-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 10px;
}
.pwa-install-warning {
  background: rgba(245, 158, 11, 0.10);
  border-color: rgba(245, 158, 11, 0.40);
}
.pwa-install-warning .pwa-install-card-title { color: #F59E0B; }

.pwa-install-steps {
  margin: 0;
  padding: 0 0 0 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pwa-install-steps li { font-size: 13.5px; line-height: 1.55; }
.pwa-install-steps li strong { font-weight: 700; }

.pwa-icon-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  margin: 0 2px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  font-size: 13px;
  line-height: 1;
  vertical-align: middle;
}

/* Table Finance > Stripe — liste abonnements */
.finance-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.finance-table thead th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}
.finance-table tbody td {
  padding: 10px;
  border-bottom: 0.5px solid var(--border);
  vertical-align: top;
}
.finance-table tbody tr:hover {
  background: rgba(216, 184, 46, 0.05);
}
.finance-table small {
  font-size: 11px;
  color: var(--text-muted);
}

/* ============================================================================
   Paramètres > Mises à jour & Historique
   Visuel inspiré de Care, adapté en gold.
   ========================================================================= */

/* Bandeau KPIs en haut de l'historique */
.history-banner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin: 14px 0 22px;
  padding: 18px 16px;
  background: linear-gradient(135deg, rgba(216, 184, 46, 0.10), rgba(255, 200, 0, 0.04));
  border: 1px solid rgba(216, 184, 46, 0.25);
  border-radius: 12px;
}
.history-banner-cell { text-align: center; }
.history-banner-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--gold);
  font-family: var(--font-display, inherit);
}
.history-banner-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Groupes de suggestions / catégories d'historique */
.suggestions-group {
  margin: 18px 0 14px;
}
.suggestions-cat {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 10px;
}
.suggestions-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.suggestions-list > li {
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 0.5px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.6;
}
.suggestions-list > li strong {
  font-weight: 700;
}
html[data-theme="light"] .suggestions-list > li {
  background: var(--bg-card);
}

/* Badges de statut (livré, en cours, en attente) */
.sug-status {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-right: 8px;
  vertical-align: middle;
}
.sug-status-done {
  background: rgba(0, 201, 110, 0.15);
  color: #00c96e;
  border: 1px solid rgba(0, 201, 110, 0.30);
}
.sug-status-progress {
  background: rgba(255, 152, 0, 0.15);
  color: #ff9800;
  border: 1px solid rgba(255, 152, 0, 0.30);
}

.suggestions-footer {
  font-size: 12px;
  margin-top: 14px;
  padding: 10px 12px;
  background: rgba(216, 184, 46, 0.05);
  border-radius: 8px;
  border-left: 3px solid var(--gold);
}

/* Modale Abonnement Stripe — fieldsets par ligne */
.sub-line-fieldset {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  margin-top: 14px;
}
.sub-line-fieldset > legend {
  font-size: 12px;
  color: var(--gold);
  padding: 0 6px;
  font-weight: 600;
}
.sub-line-fieldset > legend + label,
.sub-line-fieldset > label:first-of-type {
  margin-top: 0;
}

/* Liste des vacances (paramètres) */
.vacation-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.vacation-row {
  display: flex;
  background: var(--black-2);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.vacation-row:hover { border-color: var(--gold); }

html[data-theme="light"] .vacation-row {
  background: var(--white);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.vacation-row-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.vacation-row-body strong { color: var(--text-on-dark); font-size: 14px; }
html[data-theme="light"] .vacation-row-body strong { color: var(--text); }
.vacation-row-body span { font-size: 12px; }

/* Changelog (Paramètres → Mises à jour) */
.changelog-list { display: flex; flex-direction: column; gap: 16px; }

.changelog-entry {
  border-left: 3px solid var(--gold);
  padding: 12px 16px;
  background: var(--black-3);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

html[data-theme="light"] .changelog-entry {
  background: var(--surface-soft);
}

.changelog-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
}

.changelog-version {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--gold);
  letter-spacing: 0.04em;
}

.changelog-changes {
  margin: 0;
  padding-left: 18px;
  list-style: none;
}

.changelog-changes li {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-on-dark);
  position: relative;
}

.changelog-changes li::before {
  content: '·';
  position: absolute;
  left: -14px;
  color: var(--gold);
  font-weight: 700;
}

html[data-theme="light"] .changelog-changes li { color: var(--text); }

/* ====================================================================
   SOUS-ONGLET QUESTIONNAIRES (vue documentaire)
   ==================================================================== */
.q-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.q-card {
  background: var(--black-2);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  padding: 14px 16px;
}

html[data-theme="light"] .q-card {
  background: var(--white);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.q-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.q-num {
  background: var(--gold);
  color: var(--black);
  font-weight: 700;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.04em;
}

.q-icon { font-size: 20px; }

.q-name {
  font-size: 14px;
  color: var(--text-on-dark);
  flex: 1;
}

html[data-theme="light"] .q-name { color: var(--text); }

.q-card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
}

.q-line strong {
  color: var(--gold);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.q-line code {
  font-family: 'Courier New', monospace;
  font-size: 11px;
  background: var(--black-3);
  padding: 1px 6px;
  border-radius: 3px;
  color: var(--gold);
}

html[data-theme="light"] .q-line code { background: var(--surface-soft); color: var(--gold-dark); }

/* ====================================================================
   ONGLET RESSOURCES
   ==================================================================== */
.resources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}

.resource-card {
  display: flex;
  gap: 14px;
  background: var(--black-2);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.12s ease;
}

.resource-card:hover {
  border-color: var(--gold);
  transform: translateY(-1px);
}

html[data-theme="light"] .resource-card {
  background: var(--white);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.resource-icon {
  font-size: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
}

.resource-body { flex: 1; min-width: 0; }

.resource-title {
  font-size: 14px;
  color: var(--text-on-dark);
  display: block;
  margin-bottom: 2px;
}

html[data-theme="light"] .resource-title { color: var(--text); }

.resource-author {
  font-size: 11px;
  margin: 0 0 6px;
  font-style: italic;
}

.resource-desc {
  font-size: 12px;
  margin: 0 0 8px;
  line-height: 1.5;
}

.resource-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.resource-link {
  font-size: 11px;
  color: var(--gold);
  text-decoration: none;
  font-weight: 600;
}

.resource-link:hover { text-decoration: underline; }

/* Filtre catégorie ressources */
#resources-cat-filter {
  padding: 10px 14px;
  background: var(--black-2);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  color: var(--text-on-dark);
  font-family: var(--font-body);
  font-size: 13px;
  cursor: pointer;
}

html[data-theme="light"] #resources-cat-filter {
  background: var(--white);
  border-color: var(--border);
  color: var(--text);
}

/* ====================================================================
   SOUS-ONGLET QUESTIONNAIRES
   ==================================================================== */
.qtmpl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}

.qtmpl-card {
  background: var(--black-2);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.qtmpl-card:hover { border-color: var(--gold); }

.qtmpl-card.is-active {
  border-left: 4px solid #10B981;
}

html[data-theme="light"] .qtmpl-card {
  background: var(--white);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.qtmpl-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.qtmpl-name {
  font-size: 14px;
  color: var(--text-on-dark);
}

html[data-theme="light"] .qtmpl-name { color: var(--text); }

.qtmpl-desc {
  font-size: 12px;
  margin: 0 0 8px;
}

.qtmpl-meta {
  font-size: 11px;
}

/* Question row dans la modale */
.question-row {
  background: var(--black-3);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 8px;
}

html[data-theme="light"] .question-row {
  background: var(--surface-soft);
  border-color: var(--border-soft);
}

.question-row-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ====================================================================
   ONGLET PROSPECTS — table avec colonnes spécifiques
   ==================================================================== */
.prospects-table-head,
.prospects-table-row {
  grid-template-columns: 60px 1.4fr 1.6fr 1fr 1fr 0.9fr;
}

@media (max-width: 768px) {
  .prospects-table-head { display: none; }
  .prospects-table-row {
    grid-template-columns: 48px 1fr;
    grid-template-rows: auto auto auto auto;
  }
  .prospects-table-row > div:first-child { grid-row: 1 / span 4; }
}

html[data-theme="light"] .tag-checkbox { background: var(--surface-soft); }
html[data-theme="light"] .tag-checkbox:has(input:checked) {
  background: var(--gold-soft);
  color: var(--gold-dark);
}

/* ====================================================================
   ONGLET UTILISATEURS — table + filtres + recherche
   ==================================================================== */
.users-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.users-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--black-2);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-pill);
  color: var(--text-on-dark-muted);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-pill:hover {
  border-color: var(--gold);
  color: var(--text-on-dark);
}

.filter-pill.is-active {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--black);
  font-weight: 600;
}

.filter-pill-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
}

.filter-pill.is-active .filter-pill-count {
  background: rgba(0, 0, 0, 0.18);
  color: var(--black);
}

html[data-theme="light"] .filter-pill {
  background: var(--white);
  border-color: var(--border);
  color: var(--text-muted);
}
html[data-theme="light"] .filter-pill:hover { color: var(--text); }
html[data-theme="light"] .filter-pill.is-active {
  background: var(--gold);
  color: var(--black);
}
html[data-theme="light"] .filter-pill-count { background: rgba(0, 0, 0, 0.06); }

.users-search {
  flex: 1;
  max-width: 320px;
}

.users-search input {
  width: 100%;
  padding: 10px 14px;
  background: var(--black-2);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  color: var(--text-on-dark);
  font-family: var(--font-body);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s ease;
}

.users-search input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
}

html[data-theme="light"] .users-search input {
  background: var(--white);
  border-color: var(--border);
  color: var(--text);
}

/* Table users */
.users-table {
  background: var(--black-2);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  overflow: hidden;
}

html[data-theme="light"] .users-table {
  background: var(--white);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.users-table-head,
.users-table-row {
  display: grid;
  /* v4.9.84 — +1 colonne "Droit image" (70px) à gauche de Contrat */
  grid-template-columns: 60px 1.5fr 2fr 1.1fr 1.4fr 70px 70px 70px;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
}

/* Tablette : on cache l'email pour gagner de la place */
@media (max-width: 1100px) {
  .users-table-head,
  .users-table-row {
    grid-template-columns: 50px 1.4fr 1.1fr 1.3fr 60px 60px 60px;
  }
  .users-col-email { display: none; }
}

/* Mobile : on cache aussi le rôle (visible via avatar coloré) */
@media (max-width: 768px) {
  .users-table-head,
  .users-table-row {
    grid-template-columns: 44px 1fr 1.1fr 50px 50px 50px;
    gap: 8px;
    padding: 10px 12px;
  }
  .users-col-role { display: none; }
}

/* v4.9.84 — Cellule Droit image (icône ✓ / ✗ / ⚠ centrée) */
.users-col-image-rights {
  text-align: center;
  font-size: 16px;
  line-height: 1;
}

.users-table-head {
  background: var(--black-3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-on-dark-faint);
}

html[data-theme="light"] .users-table-head {
  background: var(--surface-soft);
  border-bottom-color: var(--border);
  color: var(--text-faint);
}

/* v4.9.128 — Homogénéise les headers de colonnes : les classes .users-col-XXX
 * sont aussi appliquées sur les cellules de ligne (où elles imposent des
 * font-size 13/16px) ce qui rendait les titres de colonnes incohérents.
 * On force ici une typo uniforme pour TOUS les enfants directs du header. */
.users-table-head > div {
  font-size: 11px !important;
  font-weight: 600 !important;
  color: var(--text-on-dark-faint) !important;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: left;
  line-height: 1.3;
  overflow: visible;
  white-space: normal;
}
html[data-theme="light"] .users-table-head > div {
  color: var(--text-faint) !important;
}

.users-table-row {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.12s ease;
}

.users-table-row:last-child { border-bottom: none; }

.users-table-row:hover {
  background: rgba(216, 184, 46, 0.05);
}

html[data-theme="light"] .users-table-row { border-bottom-color: var(--border-soft); }
html[data-theme="light"] .users-table-row:hover { background: var(--gold-soft); }

.users-col-name strong {
  color: var(--text-on-dark);
  font-weight: 600;
  font-size: 14px;
}

html[data-theme="light"] .users-col-name strong { color: var(--text); }

.users-col-email {
  color: var(--text-on-dark-muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html[data-theme="light"] .users-col-email { color: var(--text-muted); }

.users-col-date {
  color: var(--text-on-dark-faint);
  font-size: 12px;
}

html[data-theme="light"] .users-col-date { color: var(--text-faint); }

/* Avatar coloré par rôle (avec icône emoji du rôle au lieu des initiales) */
.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px; /* taille augmentée pour mieux lire l'emoji */
}

/* Status badges contrat + SEPA */
.users-col-contract,
.users-col-sepa {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}
.user-status-ok {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.18);
  color: #10b981;
  font-weight: 800;
  font-size: 14px;
}
.user-status-ko {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.18);
  color: #ef4444;
  font-weight: 800;
  font-size: 14px;
}
.user-status-na {
  color: var(--text-on-dark-faint);
  font-size: 14px;
}
html[data-theme="light"] .user-status-na { color: var(--text-faint); }

.user-avatar.avatar-gold   { background: var(--gold);    color: var(--black); }
.user-avatar.avatar-orange { background: #F59E0B;        color: var(--black); }
.user-avatar.avatar-blue   { background: #3B82F6;        color: var(--white); }
.user-avatar.avatar-green  { background: #10B981;        color: var(--white); }
.user-avatar.avatar-grey   { background: #6B7280;        color: var(--white); }

/* Badges de rôle */
.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.role-badge.role-gold   { background: rgba(216, 184, 46, 0.15); color: var(--gold); }
.role-badge.role-orange { background: rgba(245, 158, 11, 0.15); color: #F59E0B; }
.role-badge.role-blue   { background: rgba(59, 130, 246, 0.15); color: #3B82F6; }
.role-badge.role-green  { background: rgba(16, 185, 129, 0.15); color: #10B981; }
.role-badge.role-grey   { background: rgba(107, 114, 128, 0.15); color: #9CA3AF; }

/* Responsive : table compacte sur mobile */
@media (max-width: 768px) {
  .users-toolbar { flex-direction: column; align-items: stretch; }
  .users-search { max-width: none; }
  .users-table-head { display: none; }
  .users-table-row {
    grid-template-columns: 48px 1fr;
    grid-template-rows: auto auto auto;
    gap: 4px 12px;
  }
  .users-col-avatar { grid-row: 1 / span 3; }
  .users-col-name { grid-column: 2; grid-row: 1; }
  .users-col-email { grid-column: 2; grid-row: 2; font-size: 12px; }
  .users-col-role { grid-column: 2; grid-row: 3; }
  .users-col-date { display: none; }
}

/* ====================================================================
   RESPONSIVE — mobile (sidebar collapsible)
   ==================================================================== */
@media (max-width: 768px) {
  .app-shell { flex-direction: column; }

  .app-sidebar {
    width: 100%;
    height: auto;
    position: relative;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 12px 0;
  }

  html[data-theme="light"] .app-sidebar { border-bottom-color: var(--border); }

  .sidebar-brand { padding: 0 16px 12px; margin-bottom: 8px; }

  .sidebar-nav {
    flex-direction: row;
    overflow-x: auto;
    padding: 0 12px;
    gap: 4px;
    scrollbar-width: none;
  }

  .sidebar-nav::-webkit-scrollbar { display: none; }

  .sidebar-nav-item {
    flex-direction: column;
    padding: 8px 12px;
    min-width: 70px;
    font-size: 11px;
    flex-shrink: 0;
  }

  .sidebar-nav-item .nav-icon { font-size: 18px; margin-bottom: 2px; }

  .sidebar-footer { display: none; }

  .app-main { padding: 18px 14px; }
}

/* ─────────────────────────────────────────────────────────────────────────
 * v2.99 — ALERTES STANDARDISÉES (.alert)
 *
 * Remplace les bandeaux colorés inline disséminés dans les modules JS
 * (comptabilite, settings, finance, users, etc.). Usage :
 *
 *   <div class="alert alert-warning">
 *     <strong class="alert-title">Titre court</strong>
 *     <p class="alert-body">Corps explicatif…</p>
 *   </div>
 *
 * Variantes : warning (orange), danger (rouge), success (vert), info (bleu),
 * gold (doré, alignement marque).
 * ──────────────────────────────────────────────────────────────────────── */
.alert {
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 14px;
  border: 1px solid transparent;
  font-size: 13px;
  line-height: 1.45;
}
.alert .alert-title {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 4px;
}
.alert .alert-body {
  font-size: 12px;
  color: var(--muted, #aaa);
  margin: 0;
}
.alert .alert-body code {
  background: rgba(255,255,255,.06);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 11px;
}
.alert .alert-body strong { color: inherit; }

/* Variantes colorées */
.alert.alert-warning { background: rgba(251,146,60,.10); border-color: rgba(251,146,60,.35); }
.alert.alert-warning .alert-title { color: #fb923c; }
.alert.alert-danger  { background: rgba(239,68,68,.10);  border-color: rgba(239,68,68,.40); }
.alert.alert-danger  .alert-title { color: #fca5a5; }
.alert.alert-success { background: rgba(34,197,94,.10);  border-color: rgba(34,197,94,.35); }
.alert.alert-success .alert-title { color: #86efac; }
.alert.alert-info    { background: rgba(59,130,246,.10); border-color: rgba(59,130,246,.40); }
.alert.alert-info    .alert-title { color: #93c5fd; }
.alert.alert-gold    { background: rgba(216,184,46,.10); border-color: rgba(216,184,46,.40); }
.alert.alert-gold    .alert-title { color: var(--gold, #d8b82e); }

/* ─────────────────────────────────────────────────────────────────────────
 * v2.99 — SOUS-EN-TÊTES (.sub-header)
 *
 * Header secondaire utilisé quand un module est embarqué dans une page
 * (vs. .page-header qui est l'en-tête principal d'une page). Permet d'avoir
 * un titre + sous-titre + bouton à droite, en typographie plus compacte.
 * ──────────────────────────────────────────────────────────────────────── */
.sub-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}
.sub-header > div { min-width: 0; flex: 1; }
.sub-header h2,
.sub-header .sub-header-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}
.sub-header p,
.sub-header .sub-header-subtitle {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted, #aaa);
}

/* ─────────────────────────────────────────────────────────────────────────
 * v2.99 — EMPTY STATES STANDARDISÉS (.empty-state-card)
 *
 * Remplace les <p>Aucune donnée</p> bruts par une carte aérée avec icône,
 * titre, message et CTA optionnel. Utilisé par renderEmpty() dans utils.js.
 *
 * Exemple :
 *   <div class="empty-state-card">
 *     <div class="empty-state-icon">🎫</div>
 *     <h3 class="empty-state-title">Aucun ticket</h3>
 *     <p class="empty-state-message">Aucun ticket n'a été créé pour le moment.</p>
 *     <button class="btn btn-primary btn-sm empty-state-cta">+ Nouveau</button>
 *   </div>
 * ──────────────────────────────────────────────────────────────────────── */
.empty-state-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 36px 20px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px dashed rgba(255, 255, 255, 0.10);
  border-radius: 12px;
  margin: 18px 0;
  gap: 8px;
}
.empty-state-icon {
  font-size: 38px;
  line-height: 1;
  opacity: 0.85;
  margin-bottom: 4px;
  filter: grayscale(0.15);
}
.empty-state-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text, #fff);
  letter-spacing: 0.01em;
}
.empty-state-message {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted, #aaa);
  max-width: 380px;
  line-height: 1.5;
}
.empty-state-cta {
  margin-top: 10px;
}

/* Variante compacte pour les sections imbriquées */
.empty-state-card.empty-state-compact {
  padding: 22px 16px;
  margin: 10px 0;
}
.empty-state-card.empty-state-compact .empty-state-icon { font-size: 28px; }
.empty-state-card.empty-state-compact .empty-state-title { font-size: 13px; }

/* Mode jour : ajustement du fond */
body.light .empty-state-card {
  background: rgba(0, 0, 0, 0.025);
  border-color: rgba(0, 0, 0, 0.10);
}

