/* ==========================================================================
   JANGE — Composants UI partagés
   ========================================================================== */

/* ---- boutons ---- */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  font-family:'Public Sans'; font-weight:700; font-size:13.5px;
  border-radius:10px; padding:10px 16px; border:1px solid transparent; cursor:pointer;
  transition:transform .1s ease, box-shadow .15s ease, background .15s ease;
}
.btn:active{ transform:translateY(1px); }
.btn.primary{ background:var(--indigo); color:var(--on-brand); }
.btn.primary:hover{ background:var(--indigo-strong); }
.btn.ghost{ background:var(--surface); border-color:var(--border); color:var(--ink); }
.btn.ghost:hover{ background:var(--surface-2); }
.btn.subtle{ background:var(--surface-2); color:var(--ink-soft); }
.btn.danger{ background:var(--red-soft); color:var(--red); }
.btn.block{ width:100%; }
.btn.sm{ padding:7px 12px; font-size:12.5px; border-radius:8px; }
.btn:disabled{ opacity:.55; cursor:not-allowed; }

/* ---- cartes ---- */
.card{ background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-md); padding:16px; }
.card > h3, .card-title{
  font-size:12.5px; font-weight:700; text-transform:uppercase; letter-spacing:.05em;
  color:var(--ink-faint); margin-bottom:12px;
}

/* ---- carte cliquable (raccourci vers une page liée) ---- */
a.card.card-link, button.card.card-link{ display:block; text-decoration:none; color:inherit; transition:box-shadow .15s ease, transform .1s ease; }
a.card.card-link:hover, button.card.card-link:hover{ box-shadow:var(--shadow-md); transform:translateY(-1px); border-color:var(--indigo); }
button.card.card-link{ width:100%; text-align:left; cursor:pointer; font:inherit; }

/* ---- pastille cliquable ---- */
a.pill{ text-decoration:none; cursor:pointer; transition:box-shadow .15s ease; }
a.pill:hover{ box-shadow:var(--shadow-sm); }

.grid{ display:grid; gap:14px; }
.cols-4{ grid-template-columns:repeat(4,1fr); }
.cols-3{ grid-template-columns:repeat(3,1fr); }
.cols-2{ grid-template-columns:repeat(2,1fr); }
@media (max-width:980px){ .cols-4{ grid-template-columns:repeat(2,1fr); } .cols-3{ grid-template-columns:repeat(2,1fr); } }
@media (max-width:640px){ .cols-4,.cols-3,.cols-2{ grid-template-columns:1fr; } }

/* ---- stat card ---- */
.stat .label{ font-size:12px; color:var(--ink-faint); font-weight:600; }
.stat .value{ font-family:'IBM Plex Mono'; font-size:25px; font-weight:600; margin-top:6px; letter-spacing:-.01em; }
.stat .delta{ font-size:12px; margin-top:6px; display:flex; align-items:center; gap:4px; font-weight:600; }
.delta.up{ color:var(--green); } .delta.down{ color:var(--red); } .delta.flat{ color:var(--ink-faint); }

/* ---- health pills ---- */
.health{ display:flex; gap:8px; flex-wrap:wrap; }
.pill{
  display:inline-flex; align-items:center; gap:7px; padding:8px 12px; border-radius:999px;
  font-size:12.5px; font-weight:700; border:1px solid var(--border); background:var(--surface);
}
.pill .dot{ width:8px; height:8px; border-radius:50%; }
.pill .mono{ font-weight:600; opacity:.85; }
.tone-green .dot{ background:var(--green); } .tone-green{ color:var(--green); }
.tone-amber .dot{ background:var(--amber); } .tone-amber{ color:var(--amber); }
.tone-red .dot{ background:var(--red); } .tone-red{ color:var(--red); }

/* ---- listes d'actions ---- */
.actionlist{ display:flex; flex-direction:column; border-radius:10px; overflow:hidden; border:1px solid var(--border); }
.actionrow{ display:flex; align-items:center; gap:12px; padding:11px 13px; background:var(--surface); font-size:13px; }
.actionrow + .actionrow{ border-top:1px solid var(--border); }
.actionrow .ic{ width:26px; height:26px; border-radius:7px; display:flex; align-items:center; justify-content:center; flex:none; }
.ic.red{ background:var(--red-soft); color:var(--red); }
.ic.amber{ background:var(--amber-soft); color:var(--amber); }
.ic.green{ background:var(--green-soft); color:var(--green); }
.ic.indigo{ background:var(--indigo-soft); color:var(--indigo-strong); }
.actionrow .txt{ flex:1; font-weight:600; }
.actionrow .cta{ font-size:12px; font-weight:700; color:var(--indigo); white-space:nowrap; background:none; border:none; cursor:pointer; }
.actionrow .cta:hover{ text-decoration:underline; }

/* ---- tableaux ---- */
table{ width:100%; border-collapse:collapse; font-size:13px; }
thead th{ text-align:left; font-size:11px; text-transform:uppercase; letter-spacing:.04em; color:var(--ink-faint); font-weight:700; padding:0 10px 8px; }
tbody td{ padding:10px; border-top:1px solid var(--border); }
tbody tr{ transition:background .1s; }
tbody tr:hover{ background:var(--surface-2); }
td.mono{ font-size:12.5px; }

.tag{ display:inline-flex; padding:3px 9px; border-radius:999px; font-size:11px; font-weight:700; white-space:nowrap; }
.tag.red{ background:var(--red-soft); color:var(--red); }
.tag.green{ background:var(--green-soft); color:var(--green); }
.tag.amber{ background:var(--amber-soft); color:var(--amber); }
.tag.indigo{ background:var(--indigo-soft); color:var(--indigo-strong); }
.tag.teal{ background:var(--teal-soft); color:var(--teal); }

/* ---- barres de répartition ---- */
.barrow{ display:flex; align-items:center; gap:10px; font-size:12.5px; }
.barrow .name{ width:112px; flex:none; color:var(--ink-soft); font-weight:600; }
.barrow .track{ flex:1; height:7px; border-radius:99px; background:var(--surface-2); overflow:hidden; }
.barrow .fill{ height:100%; border-radius:99px; background:var(--indigo); transition:width .6s ease; }
.barrow .pct{ width:40px; text-align:right; font-family:'IBM Plex Mono'; font-weight:600; }

/* ---- avatar ---- */
.avatar{
  width:32px; height:32px; border-radius:50%; background:var(--indigo-soft); color:var(--indigo-strong);
  display:flex; align-items:center; justify-content:center; font-family:'Manrope'; font-weight:700; font-size:12px; flex:none;
}

/* ---- barre de recherche + résultats ---- */
.search-wrap{ position:relative; }
.search{
  display:flex; align-items:center; gap:8px; border:1px solid var(--border); border-radius:10px; padding:9px 12px;
  color:var(--ink-faint); font-size:13px; min-width:260px; background:var(--surface); cursor:text;
}
.search input{ border:none; background:none; outline:none; flex:1; color:var(--ink); font-size:13px; }
.search input::placeholder{ color:var(--ink-faint); }
.search-results{
  position:absolute; top:calc(100% + 8px); left:0; right:0; background:var(--surface); border:1px solid var(--border);
  border-radius:12px; box-shadow:var(--shadow-lg); z-index:60; max-height:360px; overflow:auto; display:none;
}
.search-results.open{ display:block; }
.search-group-label{ font-size:10.5px; text-transform:uppercase; letter-spacing:.05em; color:var(--ink-faint); font-weight:700; padding:10px 14px 4px; }
.search-item{ display:flex; align-items:center; gap:10px; padding:8px 14px; font-size:13px; cursor:pointer; }
.search-item:hover{ background:var(--surface-2); }
.search-item .ic{ width:24px; height:24px; border-radius:6px; background:var(--indigo-soft); color:var(--indigo-strong); display:flex; align-items:center; justify-content:center; flex:none; }
.search-item .meta{ color:var(--ink-faint); font-size:11.5px; }
.search-empty{ padding:18px 14px; font-size:12.5px; color:var(--ink-faint); text-align:center; }

/* ---- centre de notifications ---- */
.bell-btn{ position:relative; width:34px; height:34px; border-radius:9px; display:flex; align-items:center; justify-content:center; background:var(--surface); border:1px solid var(--border); }
.bell-btn:hover{ background:var(--surface-2); }
.bell-dot{ position:absolute; top:6px; right:7px; width:7px; height:7px; border-radius:50%; background:var(--red); border:1.5px solid var(--surface); }
.notif-panel{
  position:absolute; top:calc(100% + 8px); right:0; width:340px; background:var(--surface); border:1px solid var(--border);
  border-radius:12px; box-shadow:var(--shadow-lg); z-index:60; display:none; overflow:hidden;
}
.notif-panel.open{ display:block; }
.notif-head{ display:flex; align-items:center; justify-content:space-between; padding:12px 14px; border-bottom:1px solid var(--border); font-weight:700; font-size:13px; }
.notif-list{ max-height:360px; overflow:auto; }
.notif-item{ display:flex; gap:10px; padding:11px 14px; border-bottom:1px solid var(--border); font-size:12.5px; }
.notif-item:last-child{ border-bottom:none; }
.notif-item .ic{ width:26px; height:26px; border-radius:7px; display:flex; align-items:center; justify-content:center; flex:none; }
.notif-item .txt b{ font-weight:700; }
.notif-item .time{ font-size:11px; color:var(--ink-faint); margin-top:2px; }

/* ---- modales ---- */
.modal-backdrop{
  position:fixed; inset:0; background:rgba(10,12,23,.45); z-index:130; display:none;
  align-items:center; justify-content:center; padding:20px;
}
.modal-backdrop.open{ display:flex; }
.modal{ background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg); box-shadow:var(--shadow-lg); width:100%; max-width:400px; padding:22px; }
.modal h3{ font-size:16px; margin-bottom:4px; }
.modal .sub{ font-size:12.5px; color:var(--ink-faint); margin-bottom:18px; }
.pay-channels{ display:flex; flex-direction:column; gap:8px; margin-bottom:16px; }
.pay-channel{
  display:flex; align-items:center; gap:12px; padding:12px; border:1.5px solid var(--border); border-radius:10px; cursor:pointer; transition:.12s;
}
.pay-channel:hover{ border-color:var(--indigo); }
.pay-channel.selected{ border-color:var(--indigo); background:var(--indigo-soft); }
.pay-channel .sw{ width:34px; height:34px; border-radius:9px; display:flex; align-items:center; justify-content:center; font-family:'Manrope'; font-weight:800; font-size:11px; color:#fff; flex:none; }
.pay-channel .name{ font-weight:700; font-size:13.5px; }
.pay-channel .desc{ font-size:11.5px; color:var(--ink-faint); }
.pay-status{ display:flex; flex-direction:column; align-items:center; text-align:center; gap:10px; padding:12px 0 4px; }
.pay-status .spin{ width:38px; height:38px; border-radius:50%; border:3px solid var(--indigo-soft); border-top-color:var(--indigo); animation:spin .8s linear infinite; }
@keyframes spin{ to{ transform:rotate(360deg); } }
.pay-status .check{ width:44px; height:44px; border-radius:50%; background:var(--green-soft); color:var(--green); display:flex; align-items:center; justify-content:center; }
.receipt{ border:1px dashed var(--border); border-radius:10px; padding:14px; margin-top:6px; font-size:12px; }
.receipt-row{ display:flex; justify-content:space-between; padding:4px 0; }
.receipt-row .k{ color:var(--ink-faint); }

/* ---- notifications (d132b) : cartes empilées en haut à droite, façon Linear / Vercel / Stripe.
   Icône colorée par type, titre + message, action facultative (« Annuler »), fermeture, barre de
   temps qui se met en pause au survol. Remplace l'ancienne bande noire en bas de page. ---- */
.jx-toasts{
  position:fixed; top:16px; right:16px; z-index:300; display:flex; flex-direction:column; gap:10px;
  width:min(392px, calc(100vw - 24px)); pointer-events:none;
}
.jx-toast{
  --tc:var(--indigo); --tc-soft:var(--indigo-soft);
  position:relative; overflow:hidden; pointer-events:auto; display:flex; gap:12px; align-items:flex-start;
  background:var(--surface); color:var(--ink); border:1px solid var(--border); border-radius:14px;
  padding:13px 14px 15px 13px; box-shadow:var(--shadow-lg);
  opacity:0; transform:translateX(18px) scale(.98); transition:opacity .22s ease, transform .22s cubic-bezier(.2,.8,.2,1);
}
.jx-toast.in{ opacity:1; transform:none; }
.jx-toast.out{ opacity:0; transform:translateX(18px) scale(.98); }
.jx-toast.success{ --tc:var(--green); --tc-soft:var(--green-soft); }
.jx-toast.error{ --tc:var(--red); --tc-soft:var(--red-soft); }
.jx-toast.warn{ --tc:var(--amber); --tc-soft:var(--amber-soft); }
.jx-toast-ico{ flex:none; width:30px; height:30px; border-radius:50%; background:var(--tc-soft); color:var(--tc); display:flex; align-items:center; justify-content:center; }
.jx-toast-ico .icon{ width:16px; height:16px; }
.jx-toast-body{ flex:1; min-width:0; padding-top:1px; }
.jx-toast-title{ font-size:13.5px; font-weight:700; line-height:1.3; }
.jx-toast-msg{ font-size:12.5px; color:var(--ink-soft); line-height:1.45; margin-top:2px; overflow-wrap:anywhere; }
.jx-toast-title + .jx-toast-msg{ margin-top:3px; }
.jx-toast-actions{ display:flex; gap:6px; flex-wrap:wrap; margin-top:9px; }
.jx-toast-actions a, .jx-toast-actions button{
  font:inherit; font-size:12.5px; font-weight:700; color:var(--tc); background:var(--tc-soft); border:0; border-radius:8px;
  padding:5px 11px; cursor:pointer; text-decoration:none; transition:filter .12s;
}
.jx-toast-actions a:hover, .jx-toast-actions button:hover{ filter:brightness(.94); }
.jx-toast-x{ flex:none; width:24px; height:24px; margin:-2px -4px 0 0; border:0; background:transparent; color:var(--ink-faint); border-radius:7px; cursor:pointer; display:flex; align-items:center; justify-content:center; }
.jx-toast-x:hover{ background:var(--surface-2); color:var(--ink); }
.jx-toast-x .icon{ width:13px; height:13px; }
.jx-toast-bar{ position:absolute; left:0; bottom:0; height:3px; width:100%; background:var(--tc); opacity:.55; transform-origin:left; animation:jxbar linear forwards; }
.jx-toast:hover .jx-toast-bar{ animation-play-state:paused; }
@keyframes jxbar{ from{ transform:scaleX(1); } to{ transform:scaleX(0); } }
@media (max-width:640px){ .jx-toasts{ top:auto; bottom:12px; right:12px; left:12px; width:auto; flex-direction:column-reverse; } }
@media (prefers-reduced-motion:reduce){ .jx-toast{ transition:opacity .01s; transform:none; } .jx-toast-bar{ animation:none; display:none; } }

/* ---- boîtes de dialogue (d132b) : confirmation, choix à trois voies ---- */
.jx-dlg-backdrop{
  position:fixed; inset:0; z-index:310; background:rgba(10,12,23,.5); display:flex; align-items:center; justify-content:center; padding:20px;
  opacity:0; transition:opacity .16s ease; backdrop-filter:blur(2px);
}
.jx-dlg-backdrop.in{ opacity:1; }
.jx-dlg{
  --tc:var(--indigo); --tc-soft:var(--indigo-soft);
  width:100%; max-width:420px; background:var(--surface); color:var(--ink); border:1px solid var(--border); border-radius:18px;
  box-shadow:var(--shadow-lg); padding:22px 22px 18px; transform:translateY(10px) scale(.97); transition:transform .2s cubic-bezier(.2,.8,.2,1);
}
.jx-dlg-backdrop.in .jx-dlg{ transform:none; }
.jx-dlg.danger{ --tc:var(--red); --tc-soft:var(--red-soft); }
.jx-dlg.warn{ --tc:var(--amber); --tc-soft:var(--amber-soft); }
.jx-dlg-ico{ width:42px; height:42px; border-radius:50%; background:var(--tc-soft); color:var(--tc); display:flex; align-items:center; justify-content:center; margin-bottom:12px; }
.jx-dlg-ico .icon{ width:20px; height:20px; }
.jx-dlg h3{ font-size:16.5px; font-weight:800; line-height:1.3; margin:0 0 6px; }
.jx-dlg p{ font-size:13.5px; color:var(--ink-soft); line-height:1.55; margin:0; }
.jx-dlg-actions{ display:flex; gap:8px; justify-content:flex-end; flex-wrap:wrap; margin-top:20px; }
.jx-dlg-actions .btn.danger-solid{ background:var(--red); color:#fff; }
.jx-dlg-actions .btn.danger-solid:hover{ filter:brightness(.92); }
@media (max-width:520px){
  .jx-dlg-backdrop{ align-items:flex-end; padding:0; }
  .jx-dlg{ max-width:none; border-radius:18px 18px 0 0; padding-bottom:22px; }
  .jx-dlg-actions{ flex-direction:column-reverse; }
  .jx-dlg-actions .btn{ width:100%; justify-content:center; padding:11px 14px; }
}

.jx-dlg-label{ display:block; font-size:12px; font-weight:700; color:var(--ink-soft); margin:14px 0 5px; }
.jx-dlg-text{ width:100%; box-sizing:border-box; font:inherit; font-size:13.5px; line-height:1.5; color:var(--ink); background:var(--surface); border:1px solid var(--border); border-radius:10px; padding:10px 12px; resize:vertical; min-height:96px; }
.jx-dlg-text:focus{ outline:2px solid var(--indigo); outline-offset:1px; border-color:transparent; }
.jx-dlg-err{ font-size:12px; font-weight:700; color:var(--red); margin-top:6px; }
.jx-dlg-err[hidden]{ display:none; }

/* ---- barre d'état d'une page de rédaction (d132b) ---- */
.jx-state{ display:inline-flex; align-items:center; gap:6px; font-size:12px; font-weight:600; color:var(--ink-faint); white-space:nowrap; }
.jx-state::before{ content:''; width:8px; height:8px; border-radius:50%; background:var(--green); }
.jx-state.dirty{ color:var(--amber); }
.jx-state.dirty::before{ background:var(--amber); }
.jx-state.busy::before{ background:var(--indigo); animation:jxpulse 1s ease-in-out infinite; }
@keyframes jxpulse{ 50%{ opacity:.25; } }
.jx-banner{
  display:flex; gap:10px; align-items:flex-start; border:1px solid var(--tc, var(--border)); background:var(--tc-soft, var(--surface-2));
  border-radius:12px; padding:11px 13px; margin-bottom:12px; font-size:13px; line-height:1.5;
}
.jx-banner.error{ --tc:var(--red); --tc-soft:var(--red-soft); }
.jx-banner.success{ --tc:var(--green); --tc-soft:var(--green-soft); }
.jx-banner.info{ --tc:var(--indigo); --tc-soft:var(--indigo-soft); }
.jx-banner.warn{ --tc:var(--amber); --tc-soft:var(--amber-soft); }
.jx-banner .icon{ flex:none; width:18px; height:18px; color:var(--tc); margin-top:1px; }
.jx-banner .grow{ flex:1; min-width:0; }
.jx-banner b{ font-weight:800; }
.jx-banner .jx-banner-act{ display:flex; gap:8px; flex-wrap:wrap; margin-top:8px; }

/* ---- timeline ---- */
.timeline{ display:flex; flex-direction:column; }
.tl-row{ display:flex; gap:10px; padding:9px 0; }
.tl-row + .tl-row{ border-top:1px solid var(--border); }
.tl-dot{ width:26px; height:26px; border-radius:7px; display:flex; align-items:center; justify-content:center; flex:none; }
.tl-txt{ font-size:12.5px; font-weight:600; }
.tl-date{ font-size:10.5px; color:var(--ink-faint); margin-top:1px; }

/* ---- listes compactes ---- */
.list-row{ display:flex; align-items:center; gap:10px; padding:9px 0; font-size:12.5px; }
.list-row + .list-row{ border-top:1px solid var(--border); }
.list-row .t{ font-weight:700; width:52px; flex:none; color:var(--ink-soft); font-family:'IBM Plex Mono'; font-size:11.5px; }
.list-row .n{ flex:1; font-weight:600; }
.list-row .m{ font-size:11px; color:var(--ink-faint); }

/* ---- kpi mini (mobile) ---- */
.m-grid3{ display:grid; grid-template-columns:repeat(3,1fr); gap:9px; }
.m-mini{ background:var(--surface); border:1px solid var(--border); border-radius:12px; padding:10px; text-align:center; }
.m-mini .v{ font-family:'IBM Plex Mono'; font-weight:600; font-size:16px; }
.m-mini .l{ font-size:10.5px; color:var(--ink-faint); font-weight:600; margin-top:2px; }
button.m-mini{ width:100%; cursor:pointer; transition:box-shadow .15s ease, transform .1s ease; }
button.m-mini:hover{ box-shadow:var(--shadow-sm); border-color:var(--indigo); transform:translateY(-1px); }
a.m-mini{ display:block; text-decoration:none; color:inherit; cursor:pointer; transition:box-shadow .15s ease, transform .1s ease; }
a.m-mini:hover{ box-shadow:var(--shadow-sm); border-color:var(--indigo); transform:translateY(-1px); }

/* ---- ligne de cours cliquable (Family Hub) ---- */
.m-course{ cursor:pointer; transition:background .1s ease; border-radius:8px; }
.m-course:hover{ background:var(--surface-2); }

/* ---- avatar rond générique (initiales) ---- */
.av{ width:38px; height:38px; border-radius:50%; background:var(--surface-2); display:flex; align-items:center; justify-content:center; font-family:'Manrope'; font-weight:800; font-size:13px; color:var(--ink-soft); flex:none; }

/* ---- sélecteur d'enfant (Family Hub) ---- */
.kids{ display:flex; gap:10px; overflow-x:auto; }
.kid{
  display:flex; flex-direction:column; align-items:center; gap:5px; padding:8px 12px; border-radius:12px; font-size:11px;
  font-weight:700; color:var(--ink-faint); border:1.5px solid transparent; cursor:pointer; flex:none; background:none;
}
.kid.active{ color:var(--indigo-strong); }
.kid.active .av{ background:var(--indigo-soft); color:var(--indigo-strong); border:1.5px solid var(--indigo); }

/* ---- fratrie répartie sur plusieurs établissements (Family Hub) ---- */
.schools-strip{ display:flex; gap:8px; overflow-x:auto; }
.school-chip{ display:flex; align-items:center; gap:6px; font-size:11.5px; font-weight:600; border:1px solid var(--border); border-radius:999px; padding:6px 12px; background:var(--surface); cursor:pointer; color:var(--ink-soft); flex:none; white-space:nowrap; }
.school-chip:hover{ border-color:var(--indigo); color:var(--indigo-strong); }
.school-chip .dot{ width:7px; height:7px; border-radius:50%; flex:none; }

/* ---- appel de paiement rapide ---- */
.pay-cta{ display:flex; align-items:center; justify-content:space-between; background:var(--indigo); color:var(--on-brand); border-radius:14px; padding:14px 16px; }
.pay-cta .amt{ font-family:'IBM Plex Mono'; font-weight:600; font-size:19px; }
.pay-cta .l{ font-size:11px; opacity:.8; font-weight:600; }
.pay-cta .pay-btn{ background:#fff; color:var(--indigo-strong); font-weight:800; font-size:12.5px; padding:9px 14px; border-radius:9px; border:none; cursor:pointer; }

/* ---- flux / étapes ---- */
.flow{ display:flex; align-items:stretch; border:1px solid var(--border); border-radius:14px; overflow:hidden; background:var(--surface); }
.flow-step{ flex:1; padding:16px 18px; display:flex; flex-direction:column; gap:6px; }
.flow-step + .flow-step{ border-left:1px dashed var(--border); }
.flow-step .n{ font-family:'IBM Plex Mono'; font-size:11px; color:var(--indigo); font-weight:600; }
.flow-step b{ font-size:13.5px; }
.flow-step span{ font-size:11.5px; color:var(--ink-faint); }
@media (max-width:900px){ .flow{ flex-direction:column; } .flow-step + .flow-step{ border-left:none; border-top:1px dashed var(--border); } }

/* ---- badges de statut appel ---- */
.att-state{ display:inline-flex; align-items:center; gap:6px; padding:6px 10px; border-radius:8px; font-size:12px; font-weight:700; border:1.5px solid var(--border); cursor:pointer; }
.att-state[data-state="present"]{ background:var(--green-soft); color:var(--green); border-color:transparent; }
.att-state[data-state="absent"]{ background:var(--red-soft); color:var(--red); border-color:transparent; }
.att-state[data-state="retard"]{ background:var(--amber-soft); color:var(--amber); border-color:transparent; }


/* §61 — badge « environnement de démonstration » (voir J.showEnvironmentBadge) */
.env-badge{
  position:fixed; left:50%; bottom:10px; transform:translateX(-50%);
  z-index:60; padding:5px 14px; border-radius:999px;
  background:var(--amber-soft); color:var(--amber);
  border:1px solid var(--amber);
  font-size:12px; font-weight:600; letter-spacing:.01em;
  box-shadow:0 2px 8px rgba(0,0,0,.12); pointer-events:none; white-space:nowrap;
}
@media (max-width:560px){ .env-badge{ font-size:11px; padding:4px 10px; white-space:normal; text-align:center; width:max-content; max-width:92vw; } }
@media print{ .env-badge{ display:none; } }

/* §74 — Pagination intelligente (J.pager) */
.pager{ display:flex; align-items:center; justify-content:space-between; gap:10px 16px; flex-wrap:wrap; padding:12px 2px 2px; margin-top:6px; border-top:1px solid var(--border); font-size:12.5px; color:var(--ink-soft); }
.pager .pg-info strong{ color:var(--ink); font-weight:700; }
.pager .pg-ctrl{ display:flex; align-items:center; gap:4px; }
.pager .pg-nums{ display:flex; align-items:center; gap:3px; }
.pager .pg-num, .pager .pg-nav{ min-width:32px; height:32px; padding:0 8px; border:1px solid transparent; border-radius:9px; background:transparent; color:var(--ink-soft); font:inherit; font-weight:600; cursor:pointer; display:inline-flex; align-items:center; justify-content:center; transition:background .12s, color .12s, border-color .12s; }
.pager .pg-num:hover, .pager .pg-nav:hover:not(:disabled){ background:var(--surface-2); color:var(--ink); }
.pager .pg-num.on{ background:var(--indigo); color:var(--on-brand); border-color:var(--indigo); cursor:default; }
.pager .pg-nav{ border-color:var(--border); font-size:16px; line-height:1; }
.pager .pg-nav:disabled{ opacity:.4; cursor:not-allowed; }
.pager .pg-gap{ min-width:20px; text-align:center; color:var(--ink-faint); }
.pager .pg-mobile{ display:none; padding:0 6px; font-weight:600; color:var(--ink); white-space:nowrap; }
.pager .pg-size{ display:inline-flex; align-items:center; gap:6px; color:var(--ink-faint); }
.pager .pg-size select{ border:1px solid var(--border); border-radius:8px; background:var(--surface); color:var(--ink); padding:5px 8px; font:inherit; }
.pager button:focus-visible, .pager select:focus-visible{ outline:2px solid var(--indigo); outline-offset:2px; }
@media (max-width:640px){
  .pager{ justify-content:center; text-align:center; }
  .pager .pg-info{ width:100%; }
  .pager .pg-nums{ display:none; }
  .pager .pg-mobile{ display:inline; }
  .pager .pg-nav{ min-width:44px; height:40px; }
  .pager .pg-size{ width:100%; justify-content:center; }
}

/* §81 : sur mobile les lignes de liste passent à la ligne au lieu de déborder (ex. liste des cours enseignant). */
@media (max-width:640px){
  .list-row{ flex-wrap:wrap; row-gap:6px; }
  .list-row .n{ min-width:0; overflow-wrap:anywhere; }
}

/* §81 : une colonne de grille ne doit jamais dépasser l'écran à cause d'un tableau large (il défile dans son bloc). */
.grid > *{ min-width:0; }
@media (max-width:640px){ .cols-4,.cols-3,.cols-2{ grid-template-columns:minmax(0,1fr); } }


/* §90 — Actualisation douce (assets/js/refresh.js) */
.refresh-btn{ display:none; }
html.has-refresh .refresh-btn{ display:inline-flex; }
html.has-refresh{ overscroll-behavior-y:contain; }   /* le « tirer pour actualiser » du navigateur rechargerait toute la page */
.refresh-btn.spin svg{ animation:jspin .8s linear infinite; }
@keyframes jspin{ to{ transform:rotate(360deg); } }
html.is-refreshing .content{ transition:opacity .15s; }
.ptr{ position:fixed; top:0; left:50%; z-index:60; width:38px; height:38px; margin-top:8px; border-radius:50%; background:var(--surface); border:1px solid var(--border); box-shadow:var(--shadow-md); display:flex; align-items:center; justify-content:center; color:var(--ink-faint); transform:translate(-50%,-60px); pointer-events:none; }
.ptr svg{ width:20px; height:20px; stroke:currentColor; fill:none; stroke-width:2.2; stroke-linecap:round; stroke-linejoin:round; }
.ptr.ready{ color:var(--indigo); border-color:var(--indigo); }
@media (prefers-reduced-motion:reduce){ .refresh-btn.spin svg{ animation:none; opacity:.5; } }


/* §122 (d135) — notes et statistiques de la bibliothèque (assets/js/library-stats.js) */
.ls-kpis{ display:grid; grid-template-columns:repeat(auto-fit,minmax(130px,1fr)); gap:10px; margin-bottom:14px; }
.ls-kpi{ border:1px solid var(--border); border-radius:12px; padding:12px 14px; background:var(--surface); }
.ls-kpi-v{ font-size:26px; font-weight:800; line-height:1.1; color:var(--ink); }
.ls-kpi-l{ font-size:12px; color:var(--ink-soft); margin-top:3px; font-weight:600; }
.ls-kpi-h{ font-size:11px; color:var(--ink-faint); margin-top:2px; }
.ls-sec{ margin-top:18px; }
.ls-sec h4{ margin:0 0 8px; font-size:13px; }
.ls-two{ display:grid; grid-template-columns:1fr 1fr; gap:10px; }
@media (max-width:640px){ .ls-two{ grid-template-columns:1fr; } }
.ls-box{ border:1px solid var(--border); border-radius:10px; padding:10px 12px; font-size:12.5px; color:var(--ink-soft); }
.ls-box-t{ font-weight:700; color:var(--ink); margin-bottom:3px; }
.ls-muted{ color:var(--ink-faint); }
.ls-star{ color:var(--border); font-size:15px; letter-spacing:1px; }
.ls-star.on{ color:#e9a100; }
.ls-stars{ white-space:nowrap; }
.ls-bars{ display:flex; align-items:flex-end; gap:8px; height:120px; }
.ls-bar{ flex:1; min-width:0; display:flex; flex-direction:column; align-items:center; height:100%; }
.ls-bar-n{ font-size:11px; font-weight:700; height:16px; color:var(--ink-soft); }
.ls-bar-col{ flex:1; width:100%; max-width:46px; display:flex; align-items:flex-end; border-bottom:1px solid var(--border); }
.ls-bar-col span{ display:block; width:100%; background:var(--indigo); border-radius:6px 6px 0 0; min-height:2px; opacity:.85; }
.ls-bar-l{ font-size:11px; color:var(--ink-faint); margin-top:4px; }
.ls-rating-top{ display:flex; align-items:center; gap:14px; margin-bottom:10px; }
.ls-big{ font-size:38px; font-weight:800; line-height:1; }
.ls-dist{ display:grid; gap:5px; max-width:360px; }
.ls-dist-row{ display:flex; align-items:center; gap:8px; font-size:12px; }
.ls-dist-s{ width:30px; color:var(--ink-soft); }
.ls-dist-bar{ flex:1; height:8px; border-radius:6px; background:var(--surface-2, #eef0f4); overflow:hidden; }
.ls-dist-bar span{ display:block; height:100%; background:#e9a100; border-radius:6px; }
.ls-dist-n{ width:22px; text-align:right; color:var(--ink-faint); }
.ls-comments{ display:grid; gap:8px; }
.ls-comment{ border:1px solid var(--border); border-radius:10px; padding:10px 12px; }
.ls-comment-h{ display:flex; gap:8px; align-items:center; flex-wrap:wrap; font-size:12px; }
.ls-comment-t{ margin-top:6px; font-size:13px; line-height:1.5; }
/* Notation côté enseignant */
.ls-pick{ display:flex; gap:4px; }
.ls-pick button{ border:0; background:none; font-size:30px; line-height:1; color:var(--border); cursor:pointer; padding:2px; }
.ls-pick button.on{ color:#e9a100; }
.ls-pick button:focus-visible{ outline:2px solid var(--indigo); border-radius:6px; }
.ls-table{ width:100%; border-collapse:collapse; font-size:12.5px; }
.ls-table th{ text-align:left; font-size:11px; color:var(--ink-faint); font-weight:600; padding:6px 8px; border-bottom:1px solid var(--border); }
.ls-table td{ padding:9px 8px; border-bottom:1px solid var(--border); vertical-align:middle; }
.ls-table tr[data-open]{ cursor:pointer; }
.ls-table tr[data-open]:hover td{ background:var(--surface-2, #f5f6f9); }
.ls-scroll{ overflow-x:auto; }
.ls-statuses{ display:flex; gap:8px; flex-wrap:wrap; }
