/* ETAPR — charte graphique commune (couleurs du logo « etapreslecole »)
   Chargée en dernier sur toutes les pages : elle prime sur les anciens styles.
   Marine #0B2E4F · Corail #C9452F (texte) / #F06A52 (décor) · Soleil #F8AA2C · Turquoise #23A19C */
/* Police Nunito (licence SIL OFL, fichier assets/fonts/OFL.txt), hébergée sur le serveur : aucune requête vers un tiers */
@font-face{font-family:"Nunito";src:url("fonts/nunito-latin-wght.woff2") format("woff2");font-weight:200 1000;font-style:normal;font-display:swap}
:root{
  --c-navy:#0B2E4F;
  --c-navy-2:#164A78;
  --c-navy-soft:#E8EFF6;
  --c-coral:#C9452F;          /* corail foncé : lisible sur fond blanc */
  --c-coral-deco:#F06A52;
  --c-coral-soft:#FDEDEA;
  --c-sun:#F8AA2C;
  --c-sun-soft:#FEF4E2;
  --c-teal:#23A19C;
  --c-text:#14263D;
  --c-text-2:#3E5068;         /* texte secondaire, contraste > 7:1 */
  --c-line:#CBD6E2;
  --c-bg:#F3F6F9;
  /* anciennes variables redirigées vers la charte */
  --bg:var(--c-bg);
  --text:var(--c-text);
  --muted:var(--c-text-2);
  --blue:var(--c-navy);
  --blue-2:var(--c-navy-2);
  --blue-soft:var(--c-navy-soft);
  --line:var(--c-line);
  --danger:var(--c-coral);
}

html body{
  background:var(--c-bg)!important;
  color:var(--c-text)!important;
  font-family:"Nunito","Segoe UI",Arial,Helvetica,sans-serif!important;
  font-size:15px!important;
  line-height:1.45;
}

/* ---------- En-tête ---------- */
body .topbar{background:#fff!important}
body .topbar:after{background:linear-gradient(90deg,var(--c-navy) 0 55%,var(--c-coral-deco) 55% 80%,var(--c-sun) 80%)!important;height:3px!important;opacity:1!important}
body .brand-logo{height:46px;width:auto;display:block}
body .brand strong{color:var(--c-navy)!important;font-size:18px!important}
body .brand span{color:var(--c-text-2)!important;font-size:13px!important}
body .user-badge{background:var(--c-navy)!important;border-color:var(--c-navy)!important;color:#fff!important;font-size:13px!important}
body .status-pill,body .info-pill{font-size:12.5px!important;color:var(--c-text-2)!important}

/* ---------- Onglets Intervenants / Élèves ---------- */
body .tabs .tab{font-size:16px!important;font-weight:700!important;color:var(--c-navy)!important;background:#fff!important;border-color:var(--c-line)!important}
body .tabs .tab::after,body .tabs .tab::before{display:none!important}
body .tabs .tab.active{background:var(--c-navy)!important;color:#fff!important;border-color:var(--c-navy)!important;box-shadow:inset 0 -4px 0 var(--c-sun)!important}

/* ---------- Compteurs ---------- */
body .stats > *{border-color:var(--c-line)!important}
body .stats > * > *:first-child{font-size:13px!important;font-weight:700!important;color:var(--c-text-2)!important;letter-spacing:.3px}
body .stats > * strong,body .stats > * > *:last-child{font-size:24px!important;color:var(--c-navy)!important;font-weight:800!important}

/* ---------- Étiquettes, champs, listes ---------- */
body .toolbar label,body .search-wrap label,body .advanced-filters label,body .card label,body .wrap label{font-size:13px!important;font-weight:700!important;color:var(--c-text-2)!important;letter-spacing:.2px}
body input:not([type=checkbox]):not([type=radio]):not([type=file]),body select,body textarea,
body .toolbar input,body .toolbar select,body .search-wrap input,body .page-size{
  font-size:15px!important;color:var(--c-text)!important;background:#fff!important;
  border:1px solid #AFC0D2!important;border-radius:10px!important;min-height:42px}
body input::placeholder,body textarea::placeholder{color:#5F7085!important;opacity:1}
body input:focus,body select:focus,body textarea:focus{outline:none!important;border-color:var(--c-navy-2)!important;box-shadow:0 0 0 3px rgba(22,74,120,.18)!important}
body input[type=checkbox]{width:18px;height:18px;accent-color:var(--c-navy)}

/* ---------- Boutons ---------- */
body .btn,body button.btn,body a.btn{font-size:14px!important;font-weight:700!important;border-radius:10px!important;min-height:40px;line-height:1.2;white-space:nowrap}
body .btn-light{background:#fff!important;color:var(--c-navy)!important;border:1px solid #AFC0D2!important}
body .btn-light:hover{background:var(--c-navy-soft)!important}
body .btn-primary,body .main-action-btn{background:var(--c-navy)!important;color:#fff!important;border:1px solid var(--c-navy)!important}
body .btn-primary:hover,body .main-action-btn:hover{background:var(--c-navy-2)!important}
body .btn.primary{background:var(--c-navy)!important;color:#fff!important;border:1px solid var(--c-navy)!important}
body .btn.danger{background:var(--c-coral)!important;color:#fff!important;border:1px solid var(--c-coral)!important}
body .btn-danger{background:#fff!important;color:var(--c-coral)!important;border:1px solid #E7A598!important}
body .btn-danger:not(.is-disabled):hover{background:var(--c-coral-soft)!important}
body .btn-danger.is-disabled,body .btn:disabled{opacity:.55!important}
body .btn-logout{color:var(--c-coral)!important}
body .open-btn{font-size:13.5px!important;font-weight:700!important;color:var(--c-navy)!important;background:var(--c-navy-soft)!important;border:1px solid #B9CCE0!important;border-radius:8px!important;white-space:nowrap}
body .page-size{font-size:14px!important}

/* ---------- Titres de bloc ---------- */
body .panel h2,body .panel-head h2,body .panel-head h1,body #sectionTitle{font-size:24px!important;color:var(--c-navy)!important;font-weight:800!important}
body .panel-head p,body .panel-head-main p,body .panel-head #sectionSub{font-size:14px!important;color:var(--c-text-2)!important}
body .pager,body .pager span,body .page-info{font-size:14px!important;color:var(--c-text)!important}

/* En-tête de liste : le texte d'intro ne doit plus être écrasé par les boutons */
body .panel-head-main{flex-wrap:wrap!important;gap:12px 16px!important;align-items:flex-end!important}
body .panel-head-main > div:first-child{flex:1 1 auto!important;min-width:min(240px,100%)!important}
body .main-actions-bar{max-width:100%}
body .main-actions-bar{flex-wrap:wrap!important;gap:8px!important}

/* ---------- Tableaux ---------- */
/* Colonne Actions toujours visible, même quand le tableau défile */
body .table-wrap th.actions-head,body .table-wrap td.actions-cell{position:sticky!important;right:0;z-index:1;background:#fff!important;box-shadow:-6px 0 8px -6px rgba(11,46,79,.25)}
body .table-wrap th.actions-head{background:#EEF3F8!important;z-index:2}
body table tbody tr:nth-child(even) td.actions-cell{background:#F8FAFC!important}
body table tbody tr:hover td.actions-cell{background:var(--c-sun-soft)!important}
body table thead th,body .table-wrap th{font-size:12.5px!important;font-weight:800!important;color:var(--c-navy)!important;letter-spacing:.4px;background:#EEF3F8!important;border-bottom:2px solid var(--c-navy)!important}
body table tbody td{font-size:14.5px!important;line-height:1.35}
body .table-wrap td{font-size:14.5px!important;color:var(--c-text)!important;line-height:1.35}
body table tbody tr:nth-child(even) td{background:#F8FAFC}
body table tbody tr:hover td{background:var(--c-sun-soft)!important}
body .table-wrap td[class*=tel]{white-space:nowrap!important}
body .muted{color:var(--c-text-2)!important}

/* ---------- Fiche (fenêtre détail / modification) ---------- */
body .detail-modal-head h2,body .detail-modal-head strong{color:var(--c-navy)!important}
#detailPanel #detailGrid label,body .detail-grid .detail-item label{font-size:12.5px!important;font-weight:800!important;color:var(--c-text-2)!important;letter-spacing:.4px}
body .detail-grid .detail-item > div{font-size:15.5px!important;font-weight:600!important;color:var(--c-text)!important;margin-top:3px}
body .detail-grid .detail-section-title{font-size:14px!important;color:var(--c-navy)!important;border-left-color:var(--c-sun)!important}
body .attachments h3{font-size:16px!important;color:var(--c-navy)!important}

/* ---------- Pages simples : administration, mot de passe, connexion ---------- */
body .card,body .box,body section.panel{border-color:var(--c-line)!important}
body h1{color:var(--c-navy)!important}
body .error{color:#8E2A1B!important;background:var(--c-coral-soft)!important;border-color:#E7A598!important}
body .success,body .ok{color:#1D5E3B!important}

body form button[type=submit]:not(.btn){background:var(--c-navy)!important;color:#fff!important;font-size:16px!important;font-weight:700!important;border-radius:11px!important}
body form button[type=submit]:not(.btn):hover{background:var(--c-navy-2)!important}
body .card .tabs a{color:var(--c-text-2)!important;font-size:15px!important}
body .card .tabs a.active{color:var(--c-navy)!important;border-bottom:3px solid var(--c-sun)!important}
body .intro,body .note{color:var(--c-text-2)!important;font-size:14.5px!important}
body .err{color:#8E2A1B!important;background:var(--c-coral-soft)!important;border-color:#E7A598!important}
body .msg{color:#1D5E3B!important}
body .brand{border-bottom-color:var(--c-sun)}

/* ---------- Petits écrans ---------- */
@media (max-width:760px){
  html body{font-size:15px!important}
  body .brand-logo{height:36px}
  body table tbody td,body .table-wrap td{font-size:14px!important}
}

/* ---------- Colonne Actions de la liste ---------- */
body .table-wrap td{vertical-align:middle!important}
body .table-wrap th.actions-head{text-align:left!important;width:160px;min-width:160px}
body .table-wrap td.actions-cell{width:160px;min-width:160px}
body .row-actions{display:flex!important;flex-wrap:nowrap!important;align-items:center!important;gap:6px!important;margin:0!important}
body .row-actions .open-btn{height:34px!important;min-height:34px!important;padding:0 14px!important;display:inline-flex!important;align-items:center!important;margin:0!important}
body .row-actions .files-row-btn{height:34px!important;min-width:48px;padding:0 9px!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:4px;margin:0!important;
  font-size:13.5px!important;font-weight:800!important;color:var(--c-navy)!important;background:var(--c-sun-soft)!important;border:1px solid #F1CF92!important;border-radius:8px!important}

/* ---------- Fiche en lecture : vue unique, sans défilement ---------- */
#detailOverlay #detailPanel.fiche-lecture{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(300px,380px)!important;grid-template-rows:auto minmax(0,1fr)!important;
  width:min(1240px,calc(100vw - 24px))!important;max-width:min(1240px,calc(100vw - 24px))!important;height:auto!important;max-height:calc(100dvh - 24px)!important;border-radius:16px!important;overflow:hidden!important}
#detailOverlay:has(#detailPanel.fiche-lecture){justify-content:center!important;align-items:center!important;padding:12px!important}
#detailOverlay #detailPanel.fiche-lecture .detail-modal-head{grid-column:1 / -1!important;padding:12px 20px!important;border-bottom:3px solid var(--c-sun)!important}
#detailOverlay #detailPanel.fiche-lecture #detailGrid:not(.hidden){display:block!important;grid-column:1!important;height:auto!important;max-height:none!important;overflow:auto!important;padding:14px 20px!important;margin:0!important}
#detailOverlay #detailPanel.fiche-lecture #attachments{grid-column:2!important;grid-row:2!important;max-height:none!important;height:auto!important;overflow:auto!important;margin:0!important;
  padding:14px 16px!important;border-top:0!important;border-left:1px solid var(--c-line)!important;background:#F7F9FC!important}

#detailPanel .fc-blocs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 22px}
#detailPanel .fc-bloc{min-width:0}
#detailPanel .fc-bloc.fc-large{grid-column:1 / -1}
#detailPanel #detailGrid .fc-bloc h3{background:none!important;border-left:0!important;margin:0 0 6px!important;padding:0 0 4px!important;font-size:13px!important;font-weight:800!important;letter-spacing:.6px;text-transform:uppercase;color:var(--c-navy)!important;border-bottom:2px solid var(--c-sun)!important}
#detailPanel .fc-ligne{display:grid;grid-template-columns:118px minmax(0,1fr);gap:8px;padding:4px 0;border-bottom:1px dashed #E1E8F0;align-items:baseline}
#detailPanel .fc-ligne.fc-long{grid-template-columns:1fr}
#detailPanel .fc-ligne.fc-long .fc-cle{display:none}
#detailPanel .fc-cle{font-size:13px;font-weight:700;color:var(--c-text-2)}
#detailPanel .fc-val{font-size:15px;font-weight:600;color:var(--c-text);overflow-wrap:break-word;word-break:normal;hyphens:manual}
#detailPanel .fc-val a{color:var(--c-navy-2);text-decoration:none;border-bottom:1px solid #B9CCE0}
#detailPanel .fc-vides{margin:6px 0 0!important;font-size:12.5px!important;color:#5F7085!important;line-height:1.4!important;font-weight:400!important}
#detailPanel .fc-vides span{font-weight:700!important;font-size:12.5px!important}
#detailPanel .fc-suivi{margin:12px 0 0!important;font-size:12.5px!important;color:#5F7085!important}

/* ---------- Pièces jointes ---------- */
#detailPanel #attachments .attachments-head h3{display:flex;align-items:center;gap:8px;margin:0 0 10px!important;font-size:13px!important;font-weight:800;letter-spacing:.6px;text-transform:uppercase;color:var(--c-navy)!important}
#detailPanel #attachments .attachment-count{background:var(--c-navy)!important;color:#fff!important;border-radius:999px!important;padding:1px 9px!important;font-size:12.5px!important}
#detailPanel #attachments .attachment-list{display:flex!important;flex-direction:column!important;gap:8px!important}
#detailPanel #attachments .attachment:not(.queued-attachment){display:grid!important;grid-template-columns:40px minmax(0,1fr)!important;grid-template-areas:"ico nom" "act act"!important;gap:6px 10px!important;align-items:center!important;
  padding:9px 10px!important;margin:0!important;background:#fff!important;border:1px solid var(--c-line)!important;border-radius:10px!important}
#detailPanel #attachments .attachment-type{grid-area:ico;width:40px;height:40px;border-radius:8px;display:grid;place-items:center;font-size:11px;font-weight:800;letter-spacing:.3px;color:#fff;background:var(--c-navy-2)}
#detailPanel #attachments .attachment-type.type-pdf{background:var(--c-coral)}
#detailPanel #attachments .attachment-type.type-img{background:var(--c-teal)}
#detailPanel #attachments .attachment-type.type-xls{background:#2E7D4F}
#detailPanel #attachments .attachment-name-wrap{grid-area:nom;min-width:0}
#detailPanel #attachments .attachment-name{display:block;font-size:14px!important;font-weight:700!important;color:var(--c-text)!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#detailPanel #attachments .attachment-meta{display:block;font-size:12.5px!important;color:#5F7085!important}
#detailPanel #attachments .attachment-actions{grid-area:act;display:block!important;margin:0!important}
#detailPanel #attachments .attachment-action-buttons{display:flex!important;flex-wrap:wrap!important;gap:6px!important;justify-content:flex-start!important}
#detailPanel #attachments .attachment-action-btn{height:32px!important;min-width:32px!important;width:auto!important;padding:0 10px!important;font-size:13px!important;font-weight:700!important;color:var(--c-navy)!important;
  background:var(--c-navy-soft)!important;border:1px solid #B9CCE0!important;border-radius:8px!important;display:inline-flex!important;align-items:center!important;gap:4px}
#detailPanel #attachments .attachment-action-btn:hover{background:#D7E3EF!important}
#detailPanel #attachments .attachment-action-btn.danger{color:var(--c-coral)!important;background:var(--c-coral-soft)!important;border-color:#E7A598!important}
#detailPanel #attachments > p.muted{font-size:14px!important}

/* Fiche : écran moyen (tablette, petit portable) — infos sur 2 colonnes, pièces jointes dessous */
@media (max-width:1180px){
  #detailOverlay #detailPanel.fiche-lecture{display:block!important;overflow-y:auto!important}
  #detailOverlay #detailPanel.fiche-lecture #detailGrid:not(.hidden),#detailOverlay #detailPanel.fiche-lecture #attachments{min-height:0;flex:none!important}
  #detailOverlay #detailPanel.fiche-lecture #detailGrid:not(.hidden){overflow:visible!important;max-height:none!important;height:auto!important}
  #detailOverlay #detailPanel.fiche-lecture #attachments{max-height:none!important;grid-column:1!important;grid-row:3!important;border-left:0!important;border-top:1px solid var(--c-line)!important;overflow:visible!important}
  #detailPanel.fiche-lecture #attachments .attachment-list{display:grid!important;grid-template-columns:repeat(auto-fill,minmax(260px,1fr))!important}
}
/* Fiche : smartphone — plein écran, une colonne, cibles tactiles confortables */
@media (max-width:640px){
  #detailOverlay:has(#detailPanel.fiche-lecture){padding:0!important}
  #detailOverlay #detailPanel.fiche-lecture{width:100vw!important;max-width:100vw!important;height:100dvh!important;max-height:100dvh!important;border-radius:0!important}
  #detailOverlay #detailPanel.fiche-lecture .detail-modal-head{position:sticky;top:0;z-index:3;background:#fff!important;display:flex!important;flex-wrap:wrap!important;gap:8px!important;padding:10px 14px!important}
  #detailOverlay #detailPanel.fiche-lecture .detail-modal-head > div:first-child{flex:1 1 100%}
  #detailOverlay #detailPanel.fiche-lecture #detailTitle{font-size:20px!important}
  #detailOverlay #detailPanel.fiche-lecture .detail-head-actions{display:flex!important;gap:8px!important;width:100%}
  #detailOverlay #detailPanel.fiche-lecture .detail-head-actions .btn{flex:1 1 0;min-height:44px!important}
  #detailOverlay #detailPanel.fiche-lecture #detailGrid{padding:12px 14px!important}
  #detailOverlay #detailPanel.fiche-lecture #attachments{padding:12px 14px 20px!important}
  #detailPanel .fc-blocs{grid-template-columns:1fr;gap:14px}
  #detailPanel .fc-ligne{grid-template-columns:104px minmax(0,1fr);padding:6px 0}
  #detailPanel .fc-val{font-size:15.5px}
  #detailPanel.fiche-lecture #attachments .attachment-list{grid-template-columns:1fr!important}
  #detailPanel #attachments .attachment-action-btn{height:40px!important;flex:1 1 0;justify-content:center}
}

/* ================= Uniformisation (audit du 05/11/2026) ================= */
/* Icônes dessinées (remplacent les emojis) */
.ico{width:1.1em;height:1.1em;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;vertical-align:-.18em;flex:none;display:inline-block}
body .btn .ico,body .open-btn .ico{margin-right:2px}
body .pill-icon .ico{width:14px;height:14px}
body .delete-dialog-icon .ico{width:28px;height:28px;color:var(--c-coral)}
body .row-actions .files-row-btn .ico{width:15px;height:15px}

/* Surfaces du navigateur aux couleurs de la charte */
::selection{background:#FBD99B;color:var(--c-navy)}
html{scrollbar-color:#AFC0D2 transparent}
body :focus-visible{outline:3px solid var(--c-sun)!important;outline-offset:2px!important;border-radius:6px}
body table td,body .stats strong,body .page-info,body .attachment-meta,body .fc-val{font-variant-numeric:tabular-nums}
body a{text-underline-offset:3px}

/* Titres de rubrique : même style partout (formulaire, pièces jointes, fiche) — sans barre latérale épaisse */
#detailPanel .detail-section-title,#detailPanel #editForm .form-section > h3,#detailPanel .etapr-upload-section h3,#detailPanel .etapr-existing-section h3,
#detailPanel .etapr-upload-section > :first-child,#detailPanel .etapr-existing-section > :first-child{
  background:none!important;border-left:0!important;border-radius:0!important;padding:0 0 4px!important;margin:4px 0 8px!important;
  border-bottom:2px solid var(--c-sun)!important;font-size:13px!important;font-weight:800!important;letter-spacing:.6px;text-transform:uppercase;color:var(--c-navy)!important;box-shadow:none!important}

/* Pages simples : logo en tête, badge de rôle discret */
body .page-logo{display:block;height:52px;width:auto;margin:0 0 14px}
body .card .badge{display:inline-block;background:var(--c-navy-soft)!important;color:var(--c-navy)!important;font-size:12px!important;font-weight:800;letter-spacing:.3px;border-radius:999px;padding:3px 10px;margin:0 0 8px}

/* ---------- En-tête et liste sur smartphone ---------- */
@media (max-width:760px){
  body .topbar{grid-template-columns:auto 1fr!important;gap:10px!important}
  body .brand > div{display:none!important}
  body .session{justify-content:flex-end;flex-wrap:wrap}
  body .session .btn .btn-label{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
  body .session .btn{min-width:42px;padding:0 10px!important;justify-content:center}
  body .user-badge{display:none!important}
}
@media (max-width:640px){
  /* La liste devient des cartes : nom en premier, infos ensuite, action à droite */
  body .table-wrap{overflow:visible!important;border:0!important;background:none!important}
  body .table-wrap table,body .table-wrap tbody{display:block!important;width:100%!important;min-width:0!important}
  body .table-wrap thead{display:none!important}
  body .table-wrap tbody tr{display:flex!important;flex-wrap:wrap;align-items:center;gap:2px 8px;padding:12px!important;margin:0 0 10px;background:#fff!important;border:1px solid var(--c-line);border-radius:12px;box-shadow:0 2px 6px rgba(11,46,79,.06)}
  body .table-wrap tbody tr td{display:block!important;border:0!important;padding:0!important;background:none!important;width:auto!important;min-width:0!important;box-shadow:none!important;position:static!important}
  body .table-wrap tbody tr:hover td{background:none!important}
  body .table-wrap td.check-cell{order:0}
  body .table-wrap td.col-civilite{display:none!important}
  body .table-wrap td.col-nom{order:1;font-weight:800!important;font-size:16px!important;color:var(--c-navy)!important}
  body .table-wrap td.col-prenom{order:2;font-weight:700!important;font-size:16px!important}
  body .table-wrap td.actions-cell{order:3;margin-left:auto}
  body .table-wrap tbody tr td:not(.check-cell):not(.col-civilite):not(.col-nom):not(.col-prenom):not(.actions-cell){order:4;font-size:13.5px!important;color:var(--c-text-2)!important}
  body .table-wrap td.col-reference,body .table-wrap td.col-ville{flex-basis:100%;padding-left:28px!important}
  body .table-wrap td.col-email,body .table-wrap td.col-telephone_1,body .table-wrap td.col-classe,body .table-wrap td.col-ima,body .table-wrap td.created-cell{padding-left:28px!important}
  body .table-wrap td.created-cell{flex-basis:100%;font-size:12.5px!important}
  body .table-wrap td .muted{display:none}
  body .table-wrap td.empty-state{flex-basis:100%;text-align:center}
}

/* Toute l'interface dans la police de la charte (les champs et boutons n'héritent pas par défaut) */
body input,body select,body textarea,body button,body .btn,body table{font-family:inherit!important}

/* Smartphone : compteurs sur une ligne, filtres plus compacts, barre d'actions lisible */
@media (max-width:640px){
  body .stats,body .compact-stats{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:6px!important}
  body .stats > *{padding:8px 10px!important;min-height:0!important;display:flex!important;flex-direction:column!important;align-items:flex-start!important;gap:2px!important;grid-column:auto!important}
  body .stats > * > *:first-child{font-size:11px!important;letter-spacing:.2px}
  body .stats > * strong,body .stats > * > *:last-child{font-size:20px!important}
  body .toolbar{gap:8px!important}
  body .main-actions-bar .btn,body .main-actions-bar .page-size{min-height:40px!important}
  body .main-actions-bar .page-size{flex:1 1 100%}
  body .pager,body .main-pager{width:100%;justify-content:space-between!important;border-left:0!important;padding-left:0!important;margin-left:0!important}
  body #sectionSub{display:none}
}

/* Fiche : le titre « Pièces jointes » ne reste plus collé en haut (il recouvrait les boutons sur smartphone) */
#detailOverlay #detailPanel.fiche-lecture #attachments .attachments-head{position:static!important;top:auto!important;z-index:auto!important;background:none!important;box-shadow:none!important}
@media (max-width:640px){
  #detailPanel.fiche-lecture #attachments .attachment-action-btn{height:38px!important}
  #detailPanel.fiche-lecture #attachments .attachment-type{width:34px;height:34px;font-size:10px}
  #detailPanel.fiche-lecture #attachments .attachment:not(.queued-attachment){grid-template-columns:34px minmax(0,1fr)!important;padding:8px!important}
}

/* Cartes smartphone v2 : grille fixe — la case, le nom (prénom dessous), le bouton toujours en haut à droite */
@media (max-width:640px){
  body .table-wrap tbody tr{display:grid!important;grid-template-columns:28px minmax(0,1fr) auto!important;column-gap:10px!important;row-gap:3px!important;align-items:start!important}
  body .table-wrap tbody tr td{grid-column:2!important;padding-left:0!important;flex-basis:auto!important;order:0!important}
  body .table-wrap td.check-cell{grid-column:1!important;grid-row:1 / span 2!important;padding-top:3px!important}
  body .table-wrap td.col-nom{grid-row:1!important;line-height:1.25!important;overflow-wrap:anywhere}
  body .table-wrap td.col-prenom{grid-row:2!important;font-size:15px!important;line-height:1.25!important}
  body .table-wrap td.actions-cell{grid-column:3!important;grid-row:1 / span 2!important;margin:0!important;align-self:start}
  body .table-wrap td.actions-cell .row-actions{flex-direction:column!important;align-items:stretch!important;gap:6px!important}
  body .table-wrap td.created-cell{font-size:12.5px!important;margin-top:2px}
  body .table-wrap tbody tr td:not(.check-cell):not(.col-nom):not(.col-prenom):not(.actions-cell){grid-column:2 / -1!important;overflow-wrap:anywhere}
  body .table-wrap td.col-ville{margin-top:4px}
}
@media (max-width:640px){
  body .table-wrap tbody tr td:not(.etapr-x){padding-left:0!important}
  body .panel-head-main,body .panel-head-main > div:first-child,body #sectionTitle{text-align:left!important;align-items:flex-start!important;justify-content:flex-start!important}
}

/* N° de sécurité sociale masqué */
#detailPanel .fc-secret{display:inline-flex;align-items:center;gap:8px;flex-wrap:wrap}
#detailPanel .fc-secret-val{letter-spacing:.5px}
#detailPanel .fc-reveal{display:inline-flex;align-items:center;gap:4px;height:28px;padding:0 9px;border-radius:7px;border:1px solid #B9CCE0;background:var(--c-navy-soft);color:var(--c-navy);font:inherit;font-size:13px;font-weight:700;cursor:pointer}
#detailPanel .fc-reveal:hover{background:#D7E3EF}

/* Fiche plus lisible sur grand écran (retour du propriétaire : « beaucoup trop petit ») */
@media (min-width:1181px){
  #detailOverlay #detailPanel.fiche-lecture{width:min(1400px,calc(100vw - 48px))!important;max-width:min(1400px,calc(100vw - 48px))!important;grid-template-columns:minmax(0,1fr) minmax(340px,420px)!important}
  #detailOverlay #detailPanel.fiche-lecture #detailTitle{font-size:28px!important}
  #detailOverlay #detailPanel.fiche-lecture #detailSub{font-size:15px!important}
  #detailOverlay #detailPanel.fiche-lecture .detail-modal-head .btn{min-height:44px!important;font-size:15px!important;padding:0 18px!important}
  #detailOverlay #detailPanel.fiche-lecture #detailGrid{padding:20px 28px!important}
  #detailPanel .fc-blocs{gap:22px 36px}
  #detailPanel #detailGrid .fc-bloc h3{font-size:15px!important;margin-bottom:10px!important}
  #detailPanel .fc-ligne{grid-template-columns:170px minmax(0,1fr);padding:8px 0}
  #detailPanel .fc-cle{font-size:15px}
  #detailPanel .fc-val{font-size:18px}
  #detailPanel .fc-vides,#detailPanel .fc-vides span{font-size:14.5px!important}
  #detailPanel .fc-suivi{font-size:14.5px!important;margin-top:18px!important}
  #detailPanel .fc-reveal{height:32px;font-size:14px}
  #detailOverlay #detailPanel.fiche-lecture #attachments{padding:20px 22px!important}
  #detailPanel #attachments .attachments-head h3{font-size:15px!important}
  #detailPanel #attachments .attachment-name{font-size:15.5px!important}
  #detailPanel #attachments .attachment-meta{font-size:13.5px!important}
  #detailPanel #attachments .attachment-action-btn{height:36px!important;font-size:14px!important}
  #detailPanel #attachments > p.muted{font-size:16px!important}
}

/* Grand écran : pièces jointes sous les informations, en grille sur toute la largeur (plus de zone vide) */
@media (min-width:1181px){
  #detailOverlay #detailPanel.fiche-lecture{display:flex!important;flex-direction:column!important;width:min(1320px,calc(100vw - 48px))!important;max-width:min(1320px,calc(100vw - 48px))!important}
  #detailOverlay #detailPanel.fiche-lecture #detailGrid:not(.hidden){flex:0 1 auto!important;overflow:auto!important;min-height:0}
  #detailOverlay #detailPanel.fiche-lecture #attachments{flex:0 0 auto!important;border-left:0!important;border-top:1px solid var(--c-line)!important;padding:16px 28px 22px!important;max-height:42vh!important;overflow:auto!important}
  #detailPanel.fiche-lecture #attachments .attachment-list{display:grid!important;grid-template-columns:repeat(auto-fill,minmax(380px,1fr))!important;gap:10px!important}
  #detailPanel.fiche-lecture #attachments .attachment:not(.queued-attachment){grid-template-columns:40px minmax(0,1fr) auto!important;grid-template-areas:"ico nom act"!important}
  #detailPanel.fiche-lecture #attachments .attachment-action-buttons{flex-wrap:nowrap!important}
}
@media (min-width:1181px){
  #detailPanel.fiche-lecture .fc-blocs{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  #detailPanel.fiche-lecture .fc-bloc.fc-large{grid-column:auto!important}
  #detailPanel.fiche-lecture .fc-ligne{grid-template-columns:150px minmax(0,1fr)}
  /* Sans pièce jointe : une seule ligne discrète */
  #detailPanel.fiche-lecture #attachments:has(> p.muted){display:flex!important;align-items:center;gap:16px;padding:12px 28px!important}
  #detailPanel.fiche-lecture #attachments:has(> p.muted) .attachments-head h3{margin:0!important}
  #detailPanel.fiche-lecture #attachments > p.muted{margin:0!important}
}

/* Fiche v3 : tailles fluides (s'adaptent à la largeur de l'écran), observations pleine largeur de colonne */
#detailPanel .fc-ligne.fc-long,#detailPanel.fiche-lecture .fc-ligne.fc-long{grid-template-columns:1fr!important}
#detailPanel .fc-secret{flex-wrap:nowrap!important;white-space:nowrap}
#detailPanel.fiche-lecture #attachments .attachments-head,#detailPanel.fiche-lecture #attachments .attachments-head h3{text-align:left!important;justify-content:flex-start!important}
#detailPanel.fiche-lecture #attachments > p.muted{text-align:left!important}
@media (min-width:1181px){
  #detailOverlay #detailPanel.fiche-lecture{width:min(1560px,calc(100vw - 32px))!important;max-width:min(1560px,calc(100vw - 32px))!important;max-height:calc(100dvh - 24px)!important}
  #detailOverlay #detailPanel.fiche-lecture #detailTitle{font-size:clamp(26px,1.2vw + 12px,34px)!important}
  #detailOverlay #detailPanel.fiche-lecture #detailSub{font-size:clamp(14px,.4vw + 9px,17px)!important}
  #detailOverlay #detailPanel.fiche-lecture #detailGrid{padding:clamp(16px,1.4vw,28px) clamp(20px,2vw,36px)!important}
  #detailPanel.fiche-lecture .fc-blocs{grid-template-columns:1.05fr 1.1fr .85fr!important;gap:20px clamp(24px,2.4vw,48px)!important}
  #detailPanel.fiche-lecture #detailGrid .fc-bloc h3{font-size:clamp(14px,.35vw + 10px,17px)!important}
  #detailPanel.fiche-lecture .fc-ligne{grid-template-columns:clamp(140px,10vw,190px) minmax(0,1fr)!important;padding:clamp(6px,.5vw,10px) 0!important}
  #detailPanel.fiche-lecture .fc-cle{font-size:clamp(14px,.35vw + 10px,17px)!important}
  #detailPanel.fiche-lecture .fc-val{font-size:clamp(16.5px,.55vw + 10px,21px)!important}
  #detailPanel.fiche-lecture .fc-vides,#detailPanel.fiche-lecture .fc-vides span,#detailPanel.fiche-lecture .fc-suivi{font-size:clamp(14px,.3vw + 10px,16px)!important}
  #detailPanel.fiche-lecture .fc-reveal{height:clamp(30px,2vw,36px);font-size:clamp(13px,.3vw + 9px,15px)}
  #detailOverlay #detailPanel.fiche-lecture #attachments{padding:16px clamp(20px,2vw,36px) 22px!important}
  #detailPanel.fiche-lecture #attachments .attachments-head h3{font-size:clamp(14px,.35vw + 10px,17px)!important}
  #detailPanel.fiche-lecture #attachments .attachment-list{grid-template-columns:repeat(auto-fill,minmax(clamp(400px,30vw,520px),1fr))!important}
  #detailPanel.fiche-lecture #attachments .attachment:not(.queued-attachment){grid-template-columns:44px minmax(0,1fr) auto!important;padding:12px 14px!important}
  #detailPanel.fiche-lecture #attachments .attachment-type{width:44px;height:44px;font-size:12px}
  #detailPanel.fiche-lecture #attachments .attachment-name{font-size:clamp(15px,.35vw + 11px,18px)!important}
  #detailPanel.fiche-lecture #attachments .attachment-meta{font-size:clamp(13px,.25vw + 10px,15px)!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  #detailPanel.fiche-lecture #attachments .attachment-action-btn{height:clamp(36px,2.4vw,42px)!important;font-size:clamp(14px,.3vw + 10px,16px)!important;padding:0 12px!important}
  #detailPanel.fiche-lecture #attachments > p.muted{font-size:16px!important}
}
/* Téléphone : texte plus grand aussi */
@media (max-width:640px){
  #detailPanel .fc-cle{font-size:14px}
  #detailPanel .fc-val{font-size:17px!important}
  #detailPanel .fc-ligne{grid-template-columns:112px minmax(0,1fr)}
  #detailOverlay #detailPanel.fiche-lecture #detailTitle{font-size:22px!important}
  #detailPanel #attachments .attachment-name{font-size:15.5px!important}
}
@media (min-width:1181px){
  #detailOverlay:has(#detailPanel.fiche-lecture){padding:12px!important}
  #detailOverlay #detailPanel.fiche-lecture{width:min(1880px,calc(100vw - 24px))!important;max-width:min(1880px,calc(100vw - 24px))!important}
  /* Pièces jointes : le nom prend la place, les boutons restent compacts */
  #detailPanel.fiche-lecture #attachments .attachment-action-btn{padding:0 10px!important}
}
@media (min-width:1181px){
  #detailPanel.fiche-lecture #attachments .attachment-list{grid-template-columns:repeat(auto-fill,minmax(clamp(480px,36vw,640px),1fr))!important}
}
/* Sans pièce jointe : une ligne alignée à gauche, quelle que soit la taille d'écran */
#detailPanel.fiche-lecture #attachments:has(> p.muted){display:flex!important;flex-direction:row!important;flex-wrap:wrap!important;justify-content:flex-start!important;align-items:center!important;gap:6px 16px!important;min-height:0!important;padding-top:12px!important;padding-bottom:12px!important}
#detailPanel.fiche-lecture #attachments:has(> p.muted) .attachments-head{margin:0!important;background:none!important;padding:0!important}
#detailPanel.fiche-lecture #attachments:has(> p.muted) .attachments-head h3{margin:0!important}

/* N° de sécurité sociale : le bouton ne déborde plus (il passe sous le numéro si la place manque) */
#detailPanel .fc-secret{flex-wrap:wrap!important;white-space:normal!important;max-width:100%}
#detailPanel .fc-secret-val{white-space:nowrap}
/* E-mail sur une seule ligne si possible */
#detailPanel .fc-val a[href^="mailto:"]{white-space:nowrap;overflow-wrap:normal;word-break:normal}
#detailPanel .fc-ligne:has(a[href^="mailto:"]) .fc-val{overflow-wrap:normal;min-width:0}
@media (max-width:640px){
  #detailPanel .fc-ligne:has(a[href^="mailto:"]){grid-template-columns:1fr!important;row-gap:2px}
  #detailPanel .fc-val a[href^="mailto:"]{font-size:clamp(13px,4.3vw,17px);display:inline-block;max-width:100%;overflow:hidden;text-overflow:ellipsis;vertical-align:bottom}
  /* Liste en cartes : e-mail sur une ligne, réduit si besoin */
  body .table-wrap td.col-email{white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;overflow-wrap:normal!important;font-size:clamp(12px,3.6vw,13.5px)!important}
}
@media (min-width:641px){
  #detailPanel .fc-val a[href^="mailto:"]{display:inline-block;max-width:100%;overflow:hidden;text-overflow:ellipsis;vertical-align:bottom}
}
/* Colonne Actions (ordinateur) : titre et boutons centrés */
@media (min-width:641px){
  body .table-wrap th.actions-head{text-align:center!important}
  body .table-wrap td.actions-cell{text-align:center!important;vertical-align:middle!important}
  body .table-wrap td.actions-cell .row-actions{justify-content:center!important;align-items:center!important}
}

/* Listes, filtres et en-tête : mêmes tailles fluides que la fiche (une seule échelle typographique) */
@media (min-width:641px){
  body .table-wrap td,body table tbody td{font-size:clamp(14.5px,.3vw + 10.5px,17px)!important}
  body .table-wrap th,body table thead th{font-size:clamp(12.5px,.2vw + 9.5px,14.5px)!important}
  body .stats > * > *:first-child{font-size:clamp(13px,.2vw + 10px,15px)!important}
  body .stats > * strong,body .stats > * > *:last-child{font-size:clamp(24px,.6vw + 16px,30px)!important}
  body .toolbar label,body .search-wrap label{font-size:clamp(13px,.2vw + 10px,15px)!important}
  body .toolbar input,body .toolbar select,body .search-wrap input{font-size:clamp(15px,.25vw + 11px,17px)!important}
  body .btn,body button.btn,body a.btn,body .open-btn,body .page-size{font-size:clamp(14px,.2vw + 11px,16px)!important}
  body .panel-head h1,body #sectionTitle{font-size:clamp(24px,.8vw + 14px,32px)!important}
  body .panel-head #sectionSub,body .panel-head-main p{font-size:clamp(14px,.2vw + 11px,16px)!important}
  body .tabs .tab{font-size:clamp(16px,.25vw + 12px,18px)!important}
  body .brand strong{font-size:clamp(18px,.3vw + 14px,21px)!important}
  body .brand span{font-size:clamp(13px,.15vw + 11px,15px)!important}
  body .row-actions .files-row-btn{font-size:clamp(13.5px,.2vw + 10.5px,15px)!important}
}
/* Fiche : même format pour intervenants et élèves, avec de vraies marges (le 100vw incluait la barre de défilement) */
@media (min-width:1181px){
  #detailOverlay:has(#detailPanel.fiche-lecture){padding:24px 32px!important;justify-content:center!important;align-items:center!important;box-sizing:border-box}
  #detailOverlay #detailPanel.fiche-lecture{width:min(1560px,100%)!important;max-width:min(1560px,100%)!important;margin:0 auto!important;box-sizing:border-box!important}
}
