/* FTS-NAV.CSS — navigation membre partagée */
:root {
  --nav-bg: rgba(10,10,10,.96);
  --nav-border: rgba(255,255,255,.08);
}

.fts-bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 120;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-height: 62px;
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--nav-bg);
  border-top: 1px solid var(--nav-border);
  box-shadow: 0 -12px 30px rgba(0,0,0,.32);
  backdrop-filter: blur(16px);
}

.fts-nav-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--muted, #888);
  text-decoration: none;
  font-family: var(--font-body, 'DM Sans', sans-serif);
  font-size: .6rem;
  line-height: 1;
  letter-spacing: .08em;
  text-transform: uppercase;
  -webkit-tap-highlight-color: transparent;
  transition: color .18s ease, background .18s ease;
}

.fts-nav-item:hover { color: var(--white, #f5f2ee); }
.fts-nav-item.active { color: var(--white, #f5f2ee); }
.fts-nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  width: 28px;
  height: 2px;
  border-radius: 999px;
  background: var(--red, #f8e702);
}

.fts-nav-icon-wrap { position: relative; display: inline-flex; line-height: 1; }
.fts-nav-icon { font-size: 1.24rem; line-height: 1; }
.fts-nav-label { white-space: nowrap; }

.fts-nav-badge {
  position: absolute;
  top: -8px;
  right: -12px;
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--red, #f8e702);
  color: var(--brand-ink, #050505);
  border: 2px solid #0a0a0a;
  font-size: .58rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
}

.fts-nav-badge.is-on { display: inline-flex; }
.fts-bottom-spacer { height: calc(78px + env(safe-area-inset-bottom)); }

@media (min-width: 860px) {
  .fts-bottom-nav {
    left: 50%;
    transform: translateX(-50%);
    right: auto;
    width: min(520px, calc(100% - 32px));
    bottom: 14px;
    border: 1px solid var(--nav-border);
    border-radius: 999px;
    overflow: hidden;
    min-height: 58px;
    padding-bottom: 0;
  }
  .fts-bottom-spacer { height: 92px; }
}


/* FTS role nav compact — garde la topbar sur une seule ligne */
.fts-bottom-nav.fts-nav-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fts-bottom-nav.fts-nav-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.fts-bottom-nav.fts-nav-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.fts-role-nav[style*="display:none"] { display: none !important; }

@media (max-width: 520px) {
  .fts-bottom-nav { min-height: 56px; }
  .fts-nav-item {
    min-width: 0;
    gap: 2px;
    font-size: .54rem;
    letter-spacing: .055em;
    padding: 4px 1px 3px;
  }
  .fts-nav-icon { font-size: 1.12rem; }
  .fts-nav-label {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .fts-nav-badge {
    top: -7px;
    right: -10px;
    min-width: 17px;
    height: 17px;
    font-size: .55rem;
  }
}



/* FTS role nav v3 — une seule ligne, même avec Prof + Admin */
.fts-bottom-nav {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
}
.fts-bottom-nav.fts-nav-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fts-bottom-nav.fts-nav-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.fts-bottom-nav.fts-nav-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.fts-role-nav[hidden] { display: none !important; }
.fts-role-nav[aria-hidden="true"] { display: none !important; }

@media (max-width: 420px) {
  .fts-bottom-nav.fts-nav-5 .fts-nav-item {
    font-size: .49rem;
    letter-spacing: .035em;
    padding-left: 0;
    padding-right: 0;
  }
  .fts-bottom-nav.fts-nav-5 .fts-nav-icon { font-size: 1.02rem; }
  .fts-bottom-nav.fts-nav-5 .fts-nav-label { max-width: 46px; }
}

/* FTS nav v16 — bouton documents + badge messages sur Membres */
.fts-nav-button {
  appearance: none;
  border: 0;
  margin: 0;
  background: transparent;
  cursor: pointer;
}

.fts-docs-modal {
  position: fixed;
  inset: 0;
  z-index: 260;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 14px;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(10px);
}
.fts-docs-modal.hidden { display: none !important; }
.fts-docs-box {
  width: min(720px, 100%);
  max-height: min(82vh, 760px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(26,26,26,.98), rgba(8,8,8,.98));
  color: var(--white, #f5f2ee);
  box-shadow: 0 24px 70px rgba(0,0,0,.55);
}
.fts-docs-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 12px;
}
.fts-docs-kicker {
  color: var(--gold, #c9a84c);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .16em;
  font-weight: 800;
}
.fts-docs-head h2 {
  margin: 3px 0 0;
  font-size: 1.45rem;
  line-height: 1;
}
.fts-docs-close {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  color: inherit;
  font-size: 1.1rem;
}
.fts-docs-tools { padding: 0 20px 12px; }
.fts-docs-tools input {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px;
  padding: 0 14px;
  background: rgba(255,255,255,.07);
  color: inherit;
  font: inherit;
  outline: none;
}
.fts-docs-list {
  overflow: auto;
  padding: 0 14px 18px;
}
.fts-doc-group {
  margin: 10px 0 14px;
}
.fts-doc-group h3 {
  margin: 0 6px 8px;
  font-size: .86rem;
  color: rgba(255,255,255,.72);
}
.fts-doc-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(92px, 112px);
  gap: 8px;
  align-items: stretch;
  margin: 8px 0;
}
.fts-doc-open, .fts-doc-dl {
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
  color: inherit;
  text-decoration: none;
}
.fts-doc-open {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 17px;
}
.fts-doc-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 12px;
  background: rgba(201,168,76,.14);
  color: var(--gold, #c9a84c);
  font-weight: 900;
  gap: 4px;
  font-size: .78rem;
}
.fts-doc-dl span { display: inline; }
.fts-doc-open strong {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .94rem;
}
.fts-doc-open small {
  display: block;
  margin-top: 3px;
  color: rgba(255,255,255,.58);
  font-size: .78rem;
}
.fts-doc-dl {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 15px;
  font-weight: 900;
}
.fts-docs-empty {
  margin: 18px 6px;
  padding: 16px;
  border: 1px dashed rgba(255,255,255,.16);
  border-radius: 18px;
  color: rgba(255,255,255,.68);
  text-align: center;
}
.fts-docs-empty strong, .fts-docs-empty span { display: block; }
.fts-docs-empty span { margin-top: 4px; font-size: .86rem; }

@media (max-width: 420px) {
  .fts-doc-row { grid-template-columns: minmax(0, 1fr) 48px; }
  .fts-doc-dl span { display: none; }
}

@media (min-width: 760px) {
  .fts-docs-modal { align-items: center; }
}


/* ================================================================
   PATCH UX NAV v25 — polish premium prudent
   ================================================================ */

.fts-bottom-nav {
  box-shadow: 0 -16px 42px rgba(0,0,0,.42);
}

.fts-nav-item.active {
  background: linear-gradient(180deg, rgba(248,231,2,.10), transparent);
}

.fts-nav-item.active::before {
  width: 34px;
  height: 3px;
  box-shadow: 0 0 16px rgba(248,231,2,.45);
}

.fts-nav-icon {
  transition: transform .18s ease, filter .18s ease;
}

.fts-nav-item.active .fts-nav-icon {
  transform: translateY(-1px);
  filter: drop-shadow(0 0 8px rgba(248,231,2,.34));
}

.fts-nav-badge {
  box-shadow: 0 0 0 2px rgba(0,0,0,.85), 0 0 16px rgba(248,231,2,.35);
}

@media (prefers-reduced-motion: reduce) {
  .fts-nav-icon,
  .fts-nav-item {
    transition: none !important;
  }
}



/* ================================================================
   PATCH 40 — bottom nav admin mobile-first
   ================================================================ */
.fts-admin-pagehead {
  width: min(1180px, calc(100% - 28px));
  margin: 14px auto 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 22px;
  background: rgba(255,255,255,.055);
  box-shadow: 0 14px 38px rgba(0,0,0,.20);
  backdrop-filter: blur(14px);
}
.fts-admin-pagehead .fts-admin-brand { min-width: 0; }
.fts-admin-pagehead .fts-admin-logo {
  font-family: var(--font-title, 'Bebas Neue', sans-serif);
  font-size: clamp(1.45rem, 5vw, 2rem);
  line-height: .95;
  letter-spacing: .03em;
  color: var(--white, #fff);
}
.fts-admin-pagehead .fts-admin-logo span { color: var(--gold, #f8e702); }
.fts-admin-pagehead .fts-admin-sub {
  margin-top: 4px;
  font-size: .82rem;
  color: var(--muted, rgba(255,255,255,.62));
}
.fts-admin-pagehead .fts-admin-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.fts-admin-pagehead .fts-admin-actions a,
.fts-admin-pagehead .fts-admin-actions button {
  min-height: 38px;
}

.fts-admin-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 180;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(5,5,5,.72), rgba(5,5,5,.98));
  border-top: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 -16px 42px rgba(0,0,0,.46);
  backdrop-filter: blur(16px);
}
.fts-admin-bottom-track {
  width: min(760px, 100%);
  margin: 0 auto;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.fts-admin-bottom-track::-webkit-scrollbar { display: none; }
.fts-admin-bottom-item {
  flex: 0 0 auto;
  min-width: 74px;
  min-height: 54px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 7px 10px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 18px;
  background: rgba(255,255,255,.055);
  color: var(--muted, rgba(255,255,255,.68));
  text-decoration: none;
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.fts-admin-bottom-icon { font-size: 1.08rem; line-height: 1; }
.fts-admin-bottom-item.active {
  color: var(--white, #fff);
  border-color: rgba(248,231,2,.38);
  background: linear-gradient(180deg, rgba(248,231,2,.16), rgba(255,255,255,.055));
  box-shadow: 0 0 0 1px rgba(248,231,2,.10), 0 0 22px rgba(248,231,2,.16);
}
.fts-admin-bottom-spacer { height: calc(84px + env(safe-area-inset-bottom)); }

@media (max-width: 560px) {
  .fts-admin-pagehead {
    width: calc(100% - 22px);
    align-items: flex-start;
    flex-direction: column;
    margin-top: 10px;
    padding: 13px;
  }
  .fts-admin-pagehead .fts-admin-actions { width: 100%; justify-content: flex-start; }
  .fts-admin-pagehead .fts-admin-actions a,
  .fts-admin-pagehead .fts-admin-actions button { flex: 1 1 auto; }
  .fts-admin-bottom-item { min-width: 70px; min-height: 52px; font-size: .56rem; }
}

@media (min-width: 900px) {
  .fts-admin-bottom-nav {
    left: 50%;
    right: auto;
    bottom: 14px;
    transform: translateX(-50%);
    width: min(780px, calc(100% - 32px));
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 28px;
    padding: 8px;
  }
  .fts-admin-bottom-spacer { height: 104px; }
}


/* V75 — documents nav : textes longs et ressources texte */
.fts-doc-open { min-width: 0; width: 100%; text-align: left; cursor: pointer; font: inherit; }
button.fts-doc-open { appearance: none; -webkit-appearance: none; }
.fts-doc-open > span:last-child { min-width: 0; overflow: hidden; }
.fts-doc-open strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; word-break: break-word; }
.fts-doc-open small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fts-doc-row--text .fts-doc-dl--text { cursor: pointer; color: var(--gold, #c9a84c); }
.fts-doc-text-view { display: grid; gap: 12px; }
.fts-doc-back { justify-self: start; border: 1px solid rgba(255,255,255,.13); background: rgba(255,255,255,.07); color: #fff; border-radius: 999px; padding: 9px 12px; font-weight: 900; }
.fts-doc-text-meta { color: rgba(255,255,255,.62); font-size: .82rem; font-weight: 800; }
.fts-doc-text-content { border: 1px solid rgba(255,255,255,.10); background: rgba(255,255,255,.055); border-radius: 18px; padding: 14px; color: rgba(255,255,255,.90); line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; max-height: min(58dvh, 520px); overflow: auto; }
@media (max-width: 560px) {
  .fts-doc-row { grid-template-columns: minmax(0, 1fr) 44px; }
  .fts-doc-open strong { font-size: .86rem; }
  .fts-doc-open small { font-size: .72rem; }
  .fts-doc-dl { min-width: 0; padding-inline: 6px; }
}

/* V76 — sécurité cache + titres longs docs */
.fts-doc-row, .fts-doc-open, .fts-doc-open span { min-width: 0; }
.fts-doc-open strong { max-width: 100%; }
@media (max-width: 560px) {
  .fts-doc-row { grid-template-columns: minmax(0, 1fr) auto; }
  .fts-doc-open strong { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
}


/* FTS repetition v103 — bouton Répéter dans Docs */
.fts-doc-actions {
  display: grid;
  grid-template-rows: 1fr;
  gap: 6px;
  min-width: 0;
}
.fts-doc-actions .fts-doc-dl {
  min-height: 38px;
  padding: 0 8px;
}
.fts-doc-row:has(.fts-doc-rehearse) .fts-doc-actions {
  grid-template-rows: repeat(2, minmax(36px, 1fr));
}
.fts-doc-rehearse {
  background: linear-gradient(135deg, rgba(248,231,2,.16), rgba(201,168,76,.12));
  border-color: rgba(248,231,2,.26);
  color: var(--white, #f5f2ee);
}
.fts-doc-rehearse:hover { border-color: rgba(248,231,2,.46); }
@media (max-width: 420px) {
  .fts-doc-row { grid-template-columns: minmax(0, 1fr) 58px; }
  .fts-doc-actions { gap: 5px; }
  .fts-doc-actions .fts-doc-dl { min-height: 36px; padding: 0 4px; }
}
