/* =====================================================================
   ESPACES FACILITATEUR & ADMIN — système de mise en page responsive
   Échelle compacte : texte 14px · titres 20→24px · contrôles 36px (42px tactile) · cartes 14px
   Points de rupture : 1180 (compact) · 860 (tablette : menu tiroir) · 620 (mobile)
   ===================================================================== */
body.staff { background: var(--bg); font-size: 14px; -webkit-text-size-adjust: 100%; }
body.staff small { font-size: .8em; }

/* ----- Cadre : menu latéral + contenu ----- */
.main { padding: 20px 26px 48px; width: 100%; max-width: 1320px; min-width: 0; }
.scrim { display: none; }

/* ----- En-tête de page ----- */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px 14px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { font-size: clamp(19px, 2vw, 23px); color: var(--navy); letter-spacing: -.2px; }
.page-head p { margin: 3px 0 0; color: var(--mute); max-width: 70ch; font-size: 13px; }
.page-head .row { gap: 8px; }

/* ----- Cartes & grilles ----- */
.card { background: var(--card); border-radius: 14px; padding: 14px 16px; box-shadow: 0 1px 2px rgba(20, 40, 90, .05), 0 4px 14px rgba(20, 40, 90, .06); border: 1px solid #E9EEF5; min-width: 0; }
.card h3 { font-size: 14px; color: var(--navy); margin-bottom: 10px; line-height: 1.3; } .card h3 .sub { font-weight: 600; color: var(--mute); font-size: 12px; }
.grid { display: grid; gap: 12px; min-width: 0; align-items: start; } .grid > * { min-width: 0; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.kpis { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.kpi { position: relative; overflow: hidden; padding: 12px 14px; }
.kpi .v { font-size: clamp(21px, 2.2vw, 26px); font-weight: 900; color: var(--navy); line-height: 1.05; }
.kpi .l { color: var(--mute); font-weight: 700; margin-top: 4px; font-size: 12px; line-height: 1.3; }
.kpi .ico { position: absolute; right: 12px; top: 12px; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-size: 17px; opacity: 1; background: #E8EEF9; color: var(--navy); }
.kpi.blue .ico { background: #DCE8FB; color: var(--blue); } .kpi.green .ico { background: #DDF3E5; color: var(--green-d); } .kpi.red .ico { background: #FDE1E1; color: var(--red); } .kpi.orange .ico { background: #FFEBD2; color: #C96A0C; }
.kpi.red .v { color: var(--red); } .kpi.green .v { color: var(--green-d); } .kpi.blue .v { color: var(--blue); } .kpi.orange .v { color: #C96A0C; }
.muted { color: var(--mute); }

/* ----- Utilitaires ----- */
.only-sm { display: none; }

/* ----- Boutons & champs (cibles tactiles) ----- */
.btn { min-height: 34px; padding: 0 13px; border: 0; border-radius: 9px; font-weight: 700; font-size: 13px; background: #EAEFF7; color: var(--navy); display: inline-flex; align-items: center; justify-content: center; gap: 7px; text-decoration: none; white-space: nowrap; transition: background .15s, box-shadow .15s; }
.btn:hover { background: #DFE7F3; } .btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--blue); color: #fff; } .btn.primary:hover { background: #164a9c; }
.btn.green { background: var(--green); color: #fff; } .btn.green:hover { background: var(--green-d); }
.btn.danger { background: #FCE8E8; color: #B12A2A; } .btn.danger:hover { background: #F8D4D4; }
.btn.ghost { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.sm { min-height: 28px; padding: 0 10px; font-size: 12px; border-radius: 8px; gap: 6px; }
.f-input, .s-input, .s-select { min-height: 36px; padding: 0 11px; border-radius: 9px; border: 1.5px solid var(--line); background: #fff; font-size: 14px; min-width: 0; width: 100%; }
textarea.f-input { padding: 8px 11px; min-height: 64px; resize: vertical; line-height: 1.4; }
.s-input, .s-select { width: auto; }
.f-input:focus, .s-input:focus, .s-select:focus { border-color: var(--blue2); outline: none; box-shadow: 0 0 0 3px rgba(27, 127, 224, .15); }
.flabel { display: block; font-weight: 700; font-size: 12.5px; color: var(--navy); margin-bottom: 4px; }
input[type=checkbox], input[type=radio] { width: 17px; height: 17px; accent-color: var(--blue); flex: none; }
.fgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; } .fgrid .full { grid-column: 1 / -1; }

/* ----- Barres d'outils ----- */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.s-input.search { flex: 1 1 240px; max-width: 380px; }
.tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.tabs button { border: 0; background: #E6ECF6; min-height: 32px; padding: 0 14px; border-radius: 999px; font-weight: 700; font-size: 13px; color: var(--navy); display: inline-flex; align-items: center; gap: 8px; } .tabs button.on { background: var(--navy); color: #fff; }

/* ----- Tableaux (défilement interne ; fiches sur mobile) ----- */
.tbl-wrap { overflow-x: auto; border-radius: 14px; -webkit-overflow-scrolling: touch; }
.card.tbl-wrap { padding: 0; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; background: #fff; }
.tbl th { text-align: left; padding: 9px 12px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--mute); background: #F4F7FB; white-space: nowrap; }
.tbl th.sort { cursor: pointer; user-select: none; } .tbl th.sort:hover { color: var(--navy); }
.tbl td { padding: 8px 12px; border-top: 1px solid #EEF1F6; vertical-align: middle; }
.tbl tr.click { cursor: pointer; } .tbl tr.click:hover td { background: #F7F9FD; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-weight: 700; font-size: 11.5px; white-space: nowrap; background: #EEF1F6; color: var(--navy); line-height: 1.5; }
.pill.g { background: var(--green-l); color: var(--green-d); } .pill.o { background: var(--orange-l); color: #B45A0A; } .pill.r { background: #FBE5E5; color: #B12A2A; } .pill.b { background: #E3EEFD; color: var(--blue); } .pill.p { background: var(--lav); color: #5B3FD6; }
.lvl { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; font-weight: 800; color: #fff; font-size: 12px; } .lvl.r { background: var(--green); } .lvl.m { background: var(--orange); }
.st { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; } .st.green { background: #2FAE58; } .st.orange { background: var(--orange); } .st.red { background: var(--red); }
.empty { text-align: center; color: var(--mute); padding: 24px 12px; }
.avatar.s { width: 32px; height: 32px; border-width: 2px; flex: none; }

/* ----- Blocs ----- */
.alert { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 11px; font-size: 13px; background: #FFF4E5; border: 1px solid #FFD9A8; margin-bottom: 8px; cursor: pointer; }
.alert.red { background: #FDECEC; border-color: #F5B8B8; } .alert:hover { filter: brightness(.98); }
.alert .ic { font-size: 16px; flex: none; width: 20px; text-align: center; color: #C96A0C; } .alert.red .ic { color: var(--red); }
.alert b { display: block; } .alert span { color: #6b5b45; font-size: 12px; }
.chart { width: 100%; height: auto; max-height: 140px; display: block; margin-inline: auto; }
.skill { display: grid; grid-template-columns: minmax(90px, 140px) 1fr 42px; gap: 10px; align-items: center; margin: 6px 0; font-size: 13px; } .skill span:last-child { text-align: right; font-weight: 800; }
.timeline { border-left: 3px solid var(--line); margin-left: 8px; padding-left: 16px; } .timeline > div { margin-bottom: 12px; position: relative; } .timeline > div::before { content: ''; position: absolute; left: -24px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--blue2); border: 2px solid #fff; }
.grp-card { border-top: 5px solid var(--green); } .grp-card.m { border-top-color: var(--orange); }
.kid-row { display: flex; align-items: center; gap: 9px; padding: 7px 0; border-top: 1px solid #EEF1F6; } .kid-row:first-of-type { border-top: 0; }
.rules { background: #F0F6FF; border-radius: 11px; padding: 10px 14px; font-weight: 600; font-size: 13px; color: var(--navy); line-height: 1.5; }
.diff-row { display: flex; gap: 8px; align-items: center; padding: 5px 0; font-size: 13px; flex-wrap: wrap; }
.range-row { display: grid; grid-template-columns: minmax(0, 1fr) 200px 44px; gap: 12px; align-items: center; padding: 9px 0; border-top: 1px solid #EEF1F6; } .range-row:first-of-type { border-top: 0; }
.range-row small { display: block; color: var(--mute); font-size: 12px; margin: 2px 0 0; font-weight: 600; opacity: 1; }
.range-row input[type=range] { width: 100%; accent-color: var(--blue); height: 28px; }
.range-row > b:last-child { text-align: right; font-size: 15px; }

/* ----- Connexion ----- */
.login-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 20px; background: linear-gradient(135deg, #14285A, #0E5A44); }
.login-card { background: #fff; border-radius: 20px; padding: 26px; width: min(380px, 100%); box-shadow: 0 30px 80px rgba(0, 0, 0, .35); }

/* ----- Éditeur d'exercice ----- */
.ed-grid { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 20px; }
.audio-box { border: 1.5px dashed var(--line); border-radius: 12px; padding: 8px 10px; }
.choice-edit { display: grid; grid-template-columns: 22px minmax(0, 1fr) minmax(0, 1fr) 32px; gap: 6px; align-items: center; margin-bottom: 6px; }
.phone-prev { width: 210px; max-width: 100%; margin: 0 auto; background: #FFF8EC; border-radius: 30px; padding: 16px 12px; border: 8px solid #1D2A44; text-align: center; }
.phone-prev .bigtext { font-size: 44px; } .phone-prev .bigemoji { font-size: 42px; }
.phone-prev .pc { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; } .phone-prev .pc div { border-radius: 14px; min-height: 54px; display: grid; place-items: center; color: #fff; font-weight: 900; font-size: 22px; } .phone-prev .pc div.ok { outline: 3px solid var(--green); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; position: sticky; bottom: -22px; background: linear-gradient(transparent, #fff 22%); padding: 18px 0 2px; }

/* =========================== Écrans compacts =========================== */
@media (max-width: 1180px) {
  .main { padding: 18px 20px 48px; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 621px) and (max-width: 1180px) { .hide-md { display: none !important; } }
@media (max-width: 1000px) { .g3, .g-2-1 { grid-template-columns: minmax(0, 1fr); } }

/* Tablette : menu en tiroir */
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .main { padding: 14px 14px 48px; }
}

/* Mobile */
@media (max-width: 620px) {
  body.staff { font-size: 14px; }
  .main { padding: 12px 12px 44px; }
  .grid { gap: 10px; } .g2, .g4, .g3 { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpis > .card:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .kpi { padding: 11px 12px; } .kpi .ico { width: 32px; height: 32px; font-size: 15px; right: 10px; top: 10px; } .kpi .l { font-size: 11.5px; }
  .card { padding: 12px; border-radius: 12px; }
  .page-head { margin-bottom: 12px; } .page-head p { font-size: 12.5px; }
  .page-head > .row { width: 100%; } .page-head > .row > .btn { flex: 1 1 auto; }
  /* contrôles plus grands au toucher ; 16px évite le zoom automatique iOS */
  .btn { min-height: 42px; font-size: 13.5px; } .btn.sm { min-height: 38px; padding: 0 12px; font-size: 13px; }
  .f-input, .s-input, .s-select { min-height: 42px; font-size: 16px; }
  input[type=checkbox], input[type=radio] { width: 22px; height: 22px; }
  .tabs button { min-height: 38px; }
  .toolbar { gap: 8px; } .toolbar > .s-input.search { flex: 1 1 100%; max-width: none; } .toolbar > .s-select { flex: 1 1 calc(50% - 4px); }
  .tabs { flex-wrap: nowrap; overflow-x: auto; margin-inline: -14px; padding-inline: 14px; scrollbar-width: none; } .tabs button { flex: none; }
  .fgrid { grid-template-columns: minmax(0, 1fr); }
  .skill { grid-template-columns: 96px 1fr 42px; gap: 8px; font-size: 13.5px; }
  .range-row { grid-template-columns: minmax(0, 1fr) 40px; gap: 4px 10px; } .range-row > div { grid-column: 1 / -1; } .range-row input[type=range] { grid-column: 1; }
  .login-card { padding: 24px 20px; }
  .hide-sm { display: none !important; }

  /* Tableaux -> fiches compactes en grille (2 ou 3 colonnes) */
  .card.tbl-wrap { background: transparent; border: 0; box-shadow: none; overflow: visible; }
  .tbl-wrap { overflow: visible; }
  table.tbl.resp, .tbl.resp tbody { display: block; background: transparent; }
  .tbl.resp thead { display: none; }
  .tbl.resp tr { display: grid; grid-template-columns: repeat(var(--tc, 2), minmax(0, 1fr)); gap: 0 12px; background: #fff; border: 1px solid #E9EEF5; border-radius: 14px; padding: 2px 12px 6px; margin-bottom: 8px; box-shadow: 0 1px 2px rgba(20, 40, 90, .05); }
  .tbl.resp td { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 5px 0; border: 0; text-align: left; min-height: 0; min-width: 0; font-size: 13px; }
  .tbl.resp td::before { content: attr(data-l); font-size: 10.5px; font-weight: 800; color: var(--mute); text-transform: uppercase; letter-spacing: .5px; }
  .tbl.resp td.tmain, .tbl.resp td[colspan], .tbl.resp td.tact { grid-column: 1 / -1; }
  .tbl.resp td.tmain { order: -1; padding: 8px 0 7px; margin-bottom: 3px; border-bottom: 1px solid #F0F3F8; font-size: 14px; } .tbl.resp td.tmain::before { display: none; }
  .tbl.resp td[colspan] { align-items: center; text-align: center; } .tbl.resp td[colspan]::before { display: none; }
  .tbl.resp td.tact { flex-direction: row; justify-content: flex-end; flex-wrap: wrap; gap: 6px; padding-top: 8px; margin-top: 3px; border-top: 1px solid #F0F3F8; } .tbl.resp td.tact::before { display: none; }
  .tbl.resp tr.click:active { background: #F4F7FB; }
  .only-sm { display: inline; }
}
/* Fenêtres : feuille plein écran sur mobile */
@media (max-width: 760px) {
  .modal-wrap { padding: 0; place-items: end stretch; }
  .modal, .modal.wide { width: 100%; max-height: 96dvh; border-radius: 18px 18px 0 0; padding: 16px 14px calc(16px + env(safe-area-inset-bottom)); }
  .modal-actions { bottom: -16px; } .modal-actions .btn { flex: 1; }
  .ed-grid { grid-template-columns: minmax(0, 1fr); } .ed-grid > div:last-child { display: none; }
  .choice-edit { grid-template-columns: 24px minmax(0, 1fr) 40px; }
  .choice-edit > :nth-child(3) { grid-column: 2; grid-row: 2; } .choice-edit > :nth-child(4) { grid-column: 3; grid-row: 1; }
  .choice-edit > :nth-child(1) { grid-row: 1; }
  .modal .row.end { flex-wrap: wrap; }
}
@media print { .side, .mtop, .toolbar, .btn, .scrim { display: none !important; } .shell { display: block; } .main { padding: 0; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Avatars plus discrets dans l'espace équipe */
body.staff .avatar:not(.s) { width: 60px; height: 60px; border-width: 3px; }
body.staff .card h1 { font-size: 20px; }

/* ----- Interrupteur & validation du wolof ----- */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; justify-self: start; }
.switch input { opacity: 0; width: 100%; height: 100%; position: absolute; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; background: #C9D2E0; border-radius: 999px; transition: background .2s; }
.switch span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .2s; }
.switch input:checked + span { background: var(--green); } .switch input:checked + span::after { transform: translateX(20px); }
.rv { margin-bottom: 12px; } .rv-ref { background: #F6F8FC; border-radius: 10px; padding: 8px 12px; }
.bar { height: 8px; border-radius: 6px; background: var(--grey); overflow: hidden; } .bar > i { display: block; height: 100%; border-radius: 6px; background: var(--green); }
@media (max-width: 620px) { .range-row .switch { grid-column: 1; } }

/* ----- Studio d'enregistrement ----- */
.studio { max-width: 720px; margin: 0 auto; padding: 18px; }
.st-text { min-height: 84px !important; font-size: 26px; font-weight: 800; line-height: 1.3; padding: 12px 14px !important; color: var(--navy); }
.rec-btn { width: 92px; height: 92px; border-radius: 50%; border: 0; background: var(--red); color: #fff; font-size: 34px; display: grid; place-items: center; box-shadow: 0 8px 0 rgba(0, 0, 0, .15), 0 12px 24px rgba(226, 75, 75, .35); transition: transform .1s; }
.rec-btn:active { transform: translateY(4px); box-shadow: 0 3px 0 rgba(0, 0, 0, .15); } .rec-btn.on { background: #222; animation: pulse 1s infinite; }
.meter { height: 8px; border-radius: 6px; background: var(--grey); margin: 12px auto 0; max-width: 360px; overflow: hidden; } .meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #2FAE58, #FFC93C, #E24B4B); transition: width .08s; }
.dots { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; max-width: 760px; margin-inline: auto; }
.dotb { min-width: 30px; height: 28px; border-radius: 8px; border: 1.5px solid var(--line); background: #fff; font-size: 11px; font-weight: 800; color: var(--mute); padding: 0 6px; }
.dotb.ok { background: var(--green-l); border-color: #B9E3C4; color: var(--green-d); } .dotb.cur { border-color: var(--navy); background: var(--navy); color: #fff; }
@media (max-width: 620px) { .studio { padding: 14px; } .st-text { font-size: 22px; } .rec-btn { width: 84px; height: 84px; } .dotb { min-width: 34px; height: 34px; } }

/* Logo dans l'espace équipe */
.login-card .brand-full { width: min(78%, 250px); margin-bottom: 10px; }
.login-card .brand-full { width: min(60%, 190px); }

/* ----- Changement d'avatar (fiche élève) ----- */
.avatar-edit { position: relative; border: 0; background: none; padding: 0; cursor: pointer; border-radius: 50%; flex: none; }
.avatar-edit .av-badge { position: absolute; right: -2px; bottom: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; font-size: 12px; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); }
.avatar-edit:hover .av-badge { background: #164a9c; }
.ap-title { font-weight: 800; font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--mute); margin: 14px 0 8px; }
.ap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 10px; }
.ap-cell { border: 3px solid transparent; border-radius: 50%; padding: 2px; background: none; cursor: pointer; transition: transform .1s; }
.ap-cell:hover { transform: scale(1.05); } .ap-cell.on { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(27, 127, 224, .2); }
.ap-cell .avatar { width: 100%; height: auto; aspect-ratio: 1; border-width: 2px; box-shadow: 0 2px 6px rgba(0, 0, 0, .18); }
.modal .color-pick button { width: 34px; height: 34px; }
.avatar-edit .avatar { width: 84px !important; height: 84px !important; border-width: 3px; }

.dotb.df { background: #E3EEFD; border-color: #B7D3F8; color: var(--blue); }


/* =====================================================================
   MENU LATÉRAL (navigation seule, jamais de défilement) + BARRE DU HAUT (compte, état, alertes)
   Admin = bleu nuit / orange · Facilitateur = vert forêt / menthe · Studio wolof = violet / or
   Style sobre : coins peu arrondis (8 px), aucune bordure colorée sur les cartes
   ===================================================================== */
:root { --side-w: 272px; }
body.staff { --role-a: #FFB36B; --role-b: #FF8A3D; --role-on: #14285A; }
.role-fac { --role-a: #8BEBB0; --role-b: #34D17F; --role-on: #0B4634; }
.role-rev { --role-a: #FFD166; --role-b: #FFB020; --role-on: #331A86; }

.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100dvh; transition: grid-template-columns .2s ease; }
.content { min-width: 0; display: flex; flex-direction: column; min-height: 100dvh; }

/* ----- menu latéral ----- */
.side { --s1: #10306E; --s2: #14285A; --s3: #1A1F5C; --acc: var(--role-a); --acc2: var(--role-b); --on: var(--role-on);
  --nl-h: clamp(40px, calc((100dvh - 150px) / 11), 50px);          /* liens plus hauts et plus aérés ; le menu défile au besoin (barre masquée) */
  position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; padding: 18px 12px 12px; color: #fff; z-index: 30; overflow: hidden;
  background: linear-gradient(185deg, var(--s1), var(--s2) 58%, var(--s3)); }
.role-fac .side { --s1: #0F5A43; --s2: #0B4634; --s3: #0A3446; }
.role-rev .side { --s1: #4A22B0; --s2: #331A86; --s3: #221061; }

.brand-row { display: flex; align-items: center; gap: 8px; padding: 0 4px 16px; border-bottom: 1px solid rgba(255, 255, 255, .12); }
.side .brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; min-width: 0; flex: 1; }
.side .brand img.brand-mark { width: 50px; height: auto; margin: 0; flex: none; filter: drop-shadow(0 2px 5px rgba(0, 0, 0, .35)); }
.brand-txt { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.bt { font-size: 21px; font-weight: 900; letter-spacing: -.3px; line-height: 1; } .bt b { color: var(--acc); }
.space-pill { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; padding: 3px 9px; border-radius: 6px; font-size: 10.5px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: var(--acc); background: rgba(255, 255, 255, .10); white-space: nowrap; }
.collapse { flex: none; width: 32px; height: 32px; border-radius: 8px; border: 0; background: rgba(255, 255, 255, .09); color: rgba(255, 255, 255, .8); cursor: pointer; display: grid; place-items: center; font-size: 11px; }
.collapse:hover { background: rgba(255, 255, 255, .2); color: #fff; }

.nav { flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; display: flex; flex-direction: column; padding: 4px 2px 8px 0; margin-right: -4px; scrollbar-width: thin; scrollbar-color: transparent transparent; transition: scrollbar-color .2s; }
.nav:hover, .nav:focus-within { scrollbar-color: rgba(255, 255, 255, .32) transparent; }                      /* Firefox : visible seulement au survol */
.nav::-webkit-scrollbar { width: 6px; } .nav::-webkit-scrollbar-track { background: transparent; }
.nav::-webkit-scrollbar-thumb { background: transparent; border-radius: 6px; } .nav:hover::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .3); }
.grp { display: flex; align-items: center; gap: 8px; margin: calc(var(--nl-h) * .5) 10px 6px; font-size: 11px; font-weight: 800; letter-spacing: 1.4px; text-transform: uppercase; color: rgba(255, 255, 255, .5); white-space: nowrap; }
.grp::after { content: ''; flex: 1; height: 1px; background: rgba(255, 255, 255, .12); }
.nl { position: relative; display: flex; align-items: center; gap: 13px; height: var(--nl-h); padding: 0 10px 0 8px; margin: 3px 0; border-radius: 10px; color: rgba(255, 255, 255, .86); text-decoration: none; font-size: 14.5px; font-weight: 650; transition: background .15s; flex: none; }
.ni { flex: none; width: calc(var(--nl-h) - 10px); height: calc(var(--nl-h) - 10px); border-radius: 9px; display: grid; place-items: center; font-size: 15px; background: rgba(255, 255, 255, .10); color: #fff; }
.nt { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nl:hover { background: rgba(255, 255, 255, .09); color: #fff; }
.nl.on { background: rgba(255, 255, 255, .16); color: #fff; }
.nl.on::before { content: ''; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 2px 2px 0; background: var(--acc); }
.nl.on .ni { background: linear-gradient(160deg, var(--acc), var(--acc2)); color: var(--on); }
.nb { flex: none; display: flex; align-items: center; }
.nbv { min-width: 24px; height: 22px; padding: 0 7px; border-radius: 7px; display: inline-grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff; }
.nbv.red { background: #E24B4B; } .nbv.warn { background: var(--acc2); color: #241400; } .nbv.soft { background: rgba(255, 255, 255, .18); }
.nbv.dot { min-width: 9px; width: 9px; height: 9px; padding: 0; border-radius: 50%; background: var(--acc2); }

/* ----- barre du haut ----- */
.navbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 4px; height: 56px; padding: 0 20px; background: #fff; border-bottom: 1px solid #E6EBF2; }
.crumb { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; color: var(--mute); } .crumb i { font-size: 9px; opacity: .6; }
.crumb b { color: var(--navy); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nspace { flex: 1; }
.nchip { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; margin-right: 6px; border: 0; border-radius: 7px; background: #F1F4F9; color: var(--navy); font-size: 12.5px; font-weight: 700; text-decoration: none; cursor: pointer; white-space: nowrap; }
.nchip:hover { background: #E6ECF5; } .nchip > i:first-child { color: var(--blue); } .nchip b { font-weight: 900; letter-spacing: 1.2px; } .nchip .ncopy { opacity: .5; font-size: 11px; }
.role-fac .nchip b { letter-spacing: 2px; }
.nst { font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 5px; background: #E6EBF2; } .nst.ok { background: #DFF3E5; color: #167A3E; } .nst.warn { background: #FFEBCC; color: #A35A00; }
.nbtn { position: relative; width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; color: #50617F; display: grid; place-items: center; font-size: 15px; cursor: pointer; text-decoration: none; }
.nbtn:hover { background: #EEF2F8; color: var(--navy); } .nbtn.out:hover { background: #FDE8E8; color: #C0392B; }
.burger { display: none; margin-right: 4px; }
.nbadge { position: absolute; top: 2px; right: 1px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: #E24B4B; color: #fff; font-size: 10px; font-weight: 800; display: none; place-items: center; line-height: 1; } .nbadge.on { display: grid; }
.nsep { width: 1px; height: 24px; background: #E2E8F0; margin: 0 8px; }
.nuser { display: flex; align-items: center; gap: 9px; padding-right: 4px; }
.uav { flex: none; width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; font-weight: 900; font-size: 13px; color: var(--role-on); background: linear-gradient(160deg, var(--role-a), var(--role-b)); }
.ut { min-width: 0; line-height: 1.2; } .ut b { display: block; font-size: 13px; color: var(--navy); white-space: nowrap; } .ut small { display: block; font-size: 11px; color: var(--mute); margin: 0; opacity: 1; white-space: nowrap; }

/* ----- mode réduit (bureau) ----- */
@media (min-width: 861px) {
  body.side-collapsed { --side-w: 68px; }
  body.side-collapsed .side { padding-inline: 8px; }
  body.side-collapsed .brand-txt, body.side-collapsed .nt, body.side-collapsed .grp span { display: none; }
  body.side-collapsed .brand-row { flex-direction: column; gap: 8px; padding-bottom: 10px; }
  body.side-collapsed .grp { margin: calc(var(--nl-h) * .3) 10px; } body.side-collapsed .grp::after { background: rgba(255, 255, 255, .2); }
  body.side-collapsed .nl { justify-content: center; padding: 0; } body.side-collapsed .nl.on::before { left: -8px; }
  body.side-collapsed .nb { position: absolute; top: 1px; right: 4px; } body.side-collapsed .nbv { min-width: 16px; height: 16px; font-size: 9.5px; padding: 0 4px; }
}
@media (max-height: 560px) { .grp span { display: none; } .grp { margin: 4px 14px; } }

/* ----- tablette / mobile : le menu devient un tiroir ----- */
@media (max-width: 1100px) { .nchip .nct { display: none; } .ut small { display: none; } }
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: 0; width: min(290px, 86vw); z-index: 70; transform: translateX(-104%); transition: transform .25s ease; padding-top: calc(14px + env(safe-area-inset-top)); --nl-h: clamp(44px, calc((100dvh - 150px) / 11), 52px); }
  .side.open { transform: none; box-shadow: 14px 0 44px rgba(0, 0, 0, .4); }
  .collapse { display: none; }
  .scrim.on { display: block; position: fixed; inset: 0; background: rgba(10, 20, 45, .55); z-index: 60; }
  .burger { display: grid; } .navbar { padding: 0 10px; padding-top: env(safe-area-inset-top); height: calc(52px + env(safe-area-inset-top)); }
  .crumb .cs, .crumb > i { display: none; }
  .nuser .ut, .nsep { display: none; } .nuser { padding: 0 2px; }
}
@media (max-width: 520px) { .nchip { display: none; } .nbtn { width: 34px; } }
@media print { .side, .navbar, .scrim { display: none !important; } .shell { display: block; } }

/* ----- coins peu arrondis, aucune bordure colorée ----- */
.card, .tbl-wrap, .kpi, .rules, .statcard, .alert { border-radius: 8px; }
.card { border-color: #E6EBF2; }
.alert, .alert.red { border: 1px solid #E6EBF2; }
.btn { border-radius: 7px; } .btn.sm { border-radius: 6px; }
.f-input, .s-input, .s-select { border-radius: 7px; }
.pill { border-radius: 6px; } .lvl { border-radius: 6px; } .tabs button { border-radius: 8px; }
.audio-box { border-radius: 8px; } .modal { border-radius: 10px; } .login-card { border-radius: 12px; }
.grp-card { border-top: 0; }
.kid-row .st, .pill .st { flex: none; }
@media (max-width: 760px) { .modal, .modal.wide { border-radius: 12px 12px 0 0; } }

/* Bouton réduire / agrandir : pastille ronde posée sur le bord entre le menu et le contenu, en haut */
.collapse.edge { position: fixed; z-index: 45; top: 14px; left: calc(var(--side-w) - 10px); width: 28px; height: 28px; border-radius: 50%; border: 1px solid #D8E0EC; background: #fff; color: var(--navy); font-size: 12px; box-shadow: 0 3px 10px rgba(20, 40, 90, .22); display: grid; place-items: center; cursor: pointer; transition: left .2s ease, background .15s, color .15s, transform .15s; }
.collapse.edge:hover { background: var(--navy); color: #fff; transform: scale(1.1); }
@media (max-width: 860px) { .collapse.edge { display: none; } }
@media print { .collapse.edge { display: none; } }
@media (min-width: 861px) { .navbar { padding-left: 34px; } }

/* ===== Application mobile : barre d'onglets en bas (style Android / Material) ===== */
.tabbar, .side-me { display: none; }
@media (max-width: 860px) {
  .navbar .nbtn:not(#nbell), .navbar .nuser, .navbar .nsep, .burger { display: none !important; }
  .navbar { background: var(--navy); border: 0; color: #fff; }
  .navbar .crumb b { color: #fff; font-size: 17px; font-weight: 800; }
  .navbar .nbtn { color: #fff; }
  .main { padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: #fff; border-top: 1px solid #E3E8F1; box-shadow: 0 -4px 18px rgba(20, 40, 90, .1); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tab { display: flex; flex-direction: column; align-items: center; gap: 3px; border: 0; background: none; font: inherit; color: #5B6B85; text-decoration: none; padding: 2px 0; min-height: 52px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .tab .tp { position: relative; display: grid; place-items: center; width: 60px; height: 30px; border-radius: 16px; font-size: 18px; transition: background .18s, color .18s; }
  .tab .tl { font-size: 11.5px; font-weight: 700; line-height: 1; }
  .tab.on { color: var(--navy); } .tab.on .tp { background: #DCE8FB; color: var(--blue); } .tab.on .tl { font-weight: 800; }
  .tab:active .tp { background: #E8EEF9; }
  .tab .tb { display: none; position: absolute; top: -3px; right: 8px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--red); color: #fff; font-size: 10.5px; font-weight: 800; line-height: 17px; text-align: center; }
  .tab .tb.on { display: block; }
  .side-me { display: block; margin-top: auto; padding: 12px 6px 6px; border-top: 1px solid rgba(255, 255, 255, .12); }
  .sm-user { display: flex; align-items: center; gap: 10px; color: #fff; margin-bottom: 8px; } .sm-user b { display: block; font-size: 14px; } .sm-user small { color: rgba(255, 255, 255, .65); font-size: 12px; }
  .sm-btn { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: 8px; background: rgba(255, 255, 255, .08); color: #fff; font: inherit; font-size: 14px; font-weight: 700; text-decoration: none; margin-top: 6px; cursor: pointer; }
  .sm-btn.out { background: rgba(229, 62, 62, .22); }
}
@media print { .tabbar { display: none !important; } }
