/* Jàngal — gestion d'école — identité : bleu encre + corail, papier crème */
:root {
  --ink: #14306b; --ink2: #1f3f8f; --ink3: #2c56b8; --inkSoft: #e8eefb;
  --coral: #f4511e; --coral2: #ff7a50; --coralSoft: #fff0ea;
  --paper: #f6f4ef; --card: #ffffff; --line: #e6e2d8; --line2: #efece5;
  --text: #1b2235; --muted: #687087; --faint: #9aa1b3;
  --ok: #15803d; --okSoft: #e7f6ec; --warn: #b45309; --warnSoft: #fff4e0; --bad: #c62828; --badSoft: #fdecec;
  --r: 16px; --r2: 12px; --sh: 0 1px 2px rgba(20,48,107,.06), 0 6px 18px rgba(20,48,107,.06);
  --fT: 'Fredoka', 'Nunito Sans', system-ui, sans-serif; --fB: 'Nunito Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body { font-family: var(--fB); font-size: 15px; color: var(--text); background: var(--paper); line-height: 1.45; min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
:where(svg) { width: 20px; height: 20px; flex: none; }
a { color: var(--ink3); }
h1, h2, h3 { font-family: var(--fT); font-weight: 600; margin: 0; letter-spacing: .1px; }
h1 { font-size: 1.45rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 13px; } .tiny { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; } .b { font-weight: 800; } .nowrap { white-space: nowrap; }
.ok { color: var(--ok); } .bad { color: var(--bad); } .warn { color: var(--warn); } .coral { color: var(--coral); }
.hide { display: none !important; }

/* ===== Cadre de l'application ===== */
#app { min-height: 100vh; }
.top { position: sticky; top: 0; z-index: 30; background: var(--ink); color: #fff; padding: 10px 16px; display: flex; align-items: center; gap: 12px; box-shadow: 0 2px 10px rgba(10,25,60,.25); }
.top img { width: 36px; height: 36px; border-radius: 10px; background: #fff; object-fit: contain; }
.top .t1 { font-family: var(--fT); font-size: 1.02rem; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .t2 { font-size: 12px; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .grow { flex: 1; min-width: 0; }
.top .ib { background: rgba(255,255,255,.12); border: 0; color: #fff; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; cursor: pointer; position: relative; flex: none; }
.top .ib .dot { position: absolute; top: 6px; right: 6px; min-width: 16px; height: 16px; border-radius: 8px; background: var(--coral); font-size: 10px; font-weight: 800; display: grid; place-items: center; padding: 0 4px; }
main { padding: 16px 16px 96px; max-width: 1100px; margin: 0 auto; }
.nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: #fff; border-top: 1px solid var(--line); display: flex; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.nav a { flex: 1; text-align: center; text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 700; padding: 4px 2px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; gap: 2px; position: relative; }
.nav a svg { width: 24px; height: 24px; }
.nav a.on { color: var(--ink); }
.nav a.on::before { content: ''; position: absolute; top: -7px; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--coral); }
.nav a .dot { position: absolute; top: 0; right: calc(50% - 20px); min-width: 16px; height: 16px; border-radius: 8px; background: var(--coral); color: #fff; font-size: 10px; display: grid; place-items: center; padding: 0 4px; }
.side { display: none; }
@media (min-width: 900px) {
  .nav { display: none; }
  .side { display: flex; flex-direction: column; position: fixed; top: 60px; bottom: 0; left: 0; width: 230px; background: #fff; border-right: 1px solid var(--line); padding: 14px 10px; overflow-y: auto; gap: 2px; }
  .side a { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); padding: 10px 12px; border-radius: 12px; font-weight: 700; font-size: 14px; }
  .side a svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
  .side a:hover { background: var(--paper); }
  .side a.on { background: var(--inkSoft); color: var(--ink); } .side a.on svg { color: var(--ink); }
  .side .sep { height: 1px; background: var(--line2); margin: 8px 6px; }
  .side .dot { margin-left: auto; background: var(--coral); color: #fff; font-size: 11px; border-radius: 9px; padding: 0 6px; }
  main { margin-left: 230px; padding: 22px 26px 40px; }
  .top { padding: 10px 22px; }
}

/* ===== Éléments ===== */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); padding: 16px; }
.card + .card, .card + .sec, .sec + .card, .grid + .card, .card + .grid, .grid + .sec, .sec + .grid, .grid + .grid { margin-top: 14px; }
.sec { display: flex; align-items: center; gap: 10px; margin: 20px 0 10px; }
.sec h2 { flex: 1; }
.page-h { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.page-h h1 { flex: 1; min-width: 160px; }
.back { border: 0; background: #fff; border: 1px solid var(--line); width: 40px; height: 40px; border-radius: 12px; cursor: pointer; display: grid; place-items: center; flex: none; }
.grid { display: grid; gap: 12px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 700px) { .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .g2m { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 699px) { .g4, .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 > .stat.hero:first-child, .g3 > :last-child:nth-child(odd) { grid-column: 1 / -1; } .stat .v { font-size: 1.3rem; } }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font-weight: 800; cursor: pointer; text-decoration: none; color: var(--text); white-space: nowrap; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.p { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.c { background: var(--coral); border-color: var(--coral); color: #fff; }
.btn.g { background: #1faa59; border-color: #1faa59; color: #fff; }
.btn.d { color: var(--bad); border-color: #f2c4c4; }
.btn.s { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.w { width: 100%; }
.btn:disabled { opacity: .55; cursor: default; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 20px; padding: 7px 13px; font-weight: 700; font-size: 13px; cursor: pointer; white-space: nowrap; color: var(--text); }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.tag { display: inline-block; font-size: 11.5px; font-weight: 800; padding: 2px 8px; border-radius: 20px; background: var(--paper); color: var(--muted); white-space: nowrap; }
.tag.ok { background: var(--okSoft); color: var(--ok); } .tag.bad { background: var(--badSoft); color: var(--bad); } .tag.warn { background: var(--warnSoft); color: var(--warn); } .tag.ink { background: var(--inkSoft); color: var(--ink); } .tag.coral { background: var(--coralSoft); color: var(--coral); }
.tabs { display: flex; gap: 4px; background: #ebe7de; padding: 4px; border-radius: 14px; margin-bottom: 14px; overflow-x: auto; }
.tabs button { flex: 1; border: 0; background: transparent; padding: 9px 10px; border-radius: 11px; font-weight: 800; font-size: 13.5px; cursor: pointer; color: var(--muted); white-space: nowrap; }
.tabs button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.empty svg { width: 42px; height: 42px; color: var(--faint); display: block; margin: 0 auto 8px; }

/* Listes */
.list { background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--sh); }
.li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line2); cursor: pointer; text-decoration: none; color: inherit; }
.li:first-child { border-top: 0; }
.li:hover { background: #fbfaf7; }
.li .grow { flex: 1; min-width: 0; }
.li .t { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .s { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .r { text-align: right; flex: none; }
.av { width: 42px; height: 42px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 800; font-size: 14px; color: #fff; background: var(--ink2); object-fit: cover; }
.av.fem { background: #c2185b; } .av.lg { width: 76px; height: 76px; font-size: 24px; }

/* Statistiques */
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px; box-shadow: var(--sh); position: relative; overflow: hidden; }
.stat .k { font-size: 12.5px; color: var(--muted); font-weight: 700; }
.stat .v { font-family: var(--fT); font-size: 1.55rem; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .x { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.stat.hero { background: linear-gradient(135deg, var(--ink) 0%, var(--ink2) 70%, #2a4fa6 100%); color: #fff; border: 0; }
.stat.hero .k, .stat.hero .x { color: rgba(255,255,255,.75); }
.stat.hero::after { content: ''; position: absolute; right: -30px; top: -30px; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, rgba(255,122,80,.55), transparent 70%); }
.stat.alert { border-color: #f6c9b8; background: linear-gradient(180deg, #fff 0%, var(--coralSoft) 100%); }
.ring { --p: 50; width: 84px; height: 84px; border-radius: 50%; background: conic-gradient(var(--c, var(--ok)) calc(var(--p) * 1%), #ece8df 0); display: grid; place-items: center; flex: none; }
.ring::before { content: attr(data-l); width: 64px; height: 64px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-family: var(--fT); font-weight: 600; font-size: 1.1rem; }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 140px; padding-top: 10px; }
.bars .bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; min-width: 0; }
.bars .bar i { display: block; width: 100%; max-width: 46px; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, var(--ink3), var(--ink)); min-height: 3px; }
.bars .bar.cur i { background: linear-gradient(180deg, var(--coral2), var(--coral)); }
.bars .bar span { font-size: 11px; color: var(--muted); font-weight: 700; }
.bars .bar b { font-size: 10.5px; color: var(--text); white-space: nowrap; }
.prog { height: 8px; background: #ece8df; border-radius: 6px; overflow: hidden; }
.prog i { display: block; height: 100%; background: var(--ok); border-radius: 6px; }
.todo { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line2); cursor: pointer; }
.todo:first-of-type { border-top: 0; }
.todo .ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--coralSoft); color: var(--coral); }
.todo .ic svg { width: 20px; height: 20px; }
.todo .ic.ink { background: var(--inkSoft); color: var(--ink); } .todo .ic.ok { background: var(--okSoft); color: var(--ok); }

/* Formulaires */
.f { display: block; margin-bottom: 12px; }
.f > span { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 5px; }
.in, select.in, textarea.in { width: 100%; min-height: 46px; border: 1px solid #d9d4c8; background: #fff; border-radius: 12px; padding: 0 12px; font-size: 16px; outline: none; }
textarea.in { padding: 10px 12px; min-height: 90px; resize: vertical; }
.in:focus { border-color: var(--ink3); box-shadow: 0 0 0 3px rgba(44,86,184,.15); }
.row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
input[type=date].in, input[type=time].in { min-width: 0; max-width: 100%; padding: 0 8px; }
.check { display: flex; align-items: center; gap: 10px; padding: 10px 0; cursor: pointer; font-weight: 700; }
.check input { width: 22px; height: 22px; accent-color: var(--ink); flex: none; }
.search { position: relative; }
.search svg { position: absolute; left: 12px; top: 13px; width: 20px; height: 20px; color: var(--faint); }
.search .in { padding-left: 40px; }
fieldset.box { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px 4px; margin: 0 0 14px; background: #fff; }
fieldset.box legend { font-family: var(--fT); font-weight: 600; padding: 0 6px; color: var(--ink); }

/* Tableaux */
.tbl-w { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 800; padding: 10px 12px; background: #faf8f4; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px 12px; border-top: 1px solid var(--line2); }
.tbl tr:first-child td { border-top: 0; }
.tbl .r, .tbl th.r { text-align: right; white-space: nowrap; }
.tbl tfoot td { font-weight: 800; background: #faf8f4; border-top: 1px solid var(--line); }

/* Fenêtres */
.sheet-bg { position: fixed; inset: 0; background: rgba(15,22,40,.45); z-index: 60; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.sheet { background: var(--paper); width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; border-radius: 22px 22px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); animation: up .2s ease-out; }
.sheet .sh-h { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.sheet .sh-h h2 { flex: 1; }
.sheet .x { border: 0; background: #fff; width: 38px; height: 38px; border-radius: 50%; cursor: pointer; font-size: 20px; border: 1px solid var(--line); }
@media (min-width: 700px) { .sheet-bg { align-items: center; } .sheet { border-radius: 22px; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: var(--text); color: #fff; padding: 12px 18px; border-radius: 14px; z-index: 80; font-weight: 700; box-shadow: 0 8px 24px rgba(0,0,0,.25); max-width: calc(100% - 32px); animation: up .2s; }
.toast.bad { background: var(--bad); }
.loading { display: grid; place-items: center; padding: 50px; color: var(--muted); }
.spin { width: 32px; height: 32px; border: 3px solid var(--line); border-top-color: var(--ink); border-radius: 50%; animation: sp .8s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }

/* Connexion */
.login { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; background:
  radial-gradient(circle at 85% 10%, rgba(255,122,80,.35), transparent 40%), radial-gradient(circle at 10% 90%, rgba(44,86,184,.5), transparent 45%), var(--ink); }
.login .box { width: 100%; max-width: 420px; background: #fff; border-radius: 24px; padding: 24px 20px; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.login .brand { text-align: center; margin-bottom: 16px; }
.login .brand img { width: 84px; height: 84px; border-radius: 22px; }
.login .brand h1 { margin-top: 8px; color: var(--ink); }
.login .who { display: grid; grid-template-columns: 1fr; gap: 8px; max-height: 260px; overflow-y: auto; margin-bottom: 12px; }
.login .who button { text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 11px 14px; font-weight: 800; cursor: pointer; display: flex; align-items: center; gap: 10px; }
.login .who button.on { border-color: var(--ink); background: var(--inkSoft); }
.pin { display: flex; gap: 10px; justify-content: center; margin: 10px 0 14px; }
.pin i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--ink); }
.pin i.f { background: var(--ink); }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pad button { min-height: 54px; border: 1px solid var(--line); background: #faf8f4; border-radius: 14px; font-size: 22px; font-weight: 700; cursor: pointer; font-family: var(--fT); }
.pad button:active { background: var(--inkSoft); }
.login .foot { color: rgba(255,255,255,.7); margin-top: 16px; font-size: 13px; text-align: center; }

/* Appel */
.appel { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.appel button { border: 2px solid #cfe9d7; background: var(--okSoft); border-radius: 14px; padding: 10px; text-align: left; cursor: pointer; display: flex; gap: 8px; align-items: center; min-height: 58px; }
.appel button .n { font-weight: 800; font-size: 13.5px; line-height: 1.15; }
.appel button .e { font-size: 11.5px; font-weight: 800; color: var(--ok); }
.appel button.absent { border-color: #f1b5b5; background: var(--badSoft); } .appel button.absent .e { color: var(--bad); }
.appel button.retard { border-color: #f5d39c; background: var(--warnSoft); } .appel button.retard .e { color: var(--warn); }
.appel .av { width: 34px; height: 34px; font-size: 12px; }

/* Saisie des notes */
.notes-g .li { cursor: default; }
.notes-g .in { width: 86px; min-height: 42px; text-align: center; font-weight: 800; padding: 0 6px; }
.notes-g .abs { display: flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: var(--muted); }

/* Emploi du temps */
.edt { display: grid; grid-template-columns: repeat(6, minmax(130px, 1fr)); gap: 8px; overflow-x: auto; }
.edt .day h3 { font-size: 14px; text-align: center; padding: 8px; background: var(--ink); color: #fff; border-radius: 10px; margin-bottom: 6px; }
.edt .slot { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--ink3); border-radius: 10px; padding: 8px; margin-bottom: 6px; font-size: 13px; cursor: pointer; }
.edt .slot.ar { border-left-color: #0f9d58; }
.edt .slot .h { font-weight: 800; font-size: 12px; color: var(--muted); }
.edt .slot .m { font-weight: 800; }
@media (max-width: 699px) { .edt { grid-template-columns: 1fr; } .edt .day.empty { display: none; } }

/* Messages */
.msg { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.msg + .msg { margin-top: 10px; }
.msg .h { display: flex; gap: 8px; align-items: center; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; flex-wrap: wrap; }
.msg .h b { color: var(--text); }
.msg.in { border-left: 4px solid var(--coral); }
.msg.new { background: var(--coralSoft); }
.msg p { margin: 4px 0 0; white-space: pre-wrap; }

/* Fiche élève */
.hero-el { display: flex; gap: 14px; align-items: center; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; }
.kv dt { color: var(--muted); font-weight: 700; } .kv dd { margin: 0; font-weight: 700; }
.dus .li { cursor: default; }
.pick { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; margin-bottom: 6px; cursor: pointer; }
.pick input { width: 20px; height: 20px; accent-color: var(--ink); }
.pick .grow { flex: 1; }
.pick.paid { opacity: .5; }
.hizb { display: flex; gap: 3px; flex-wrap: wrap; }
.hizb i { width: 14px; height: 14px; border-radius: 4px; background: #e2ddd2; }
.hizb i.on { background: #0f9d58; }

/* Impression (reçus, bulletins, cartes) */
#print { display: none; }
@media print {
  @page { size: A4; margin: 10mm; }
  body { background: #fff; }
  #app, .sheet-bg, .toast { display: none !important; }
  #print { display: block; }
  .pg { page-break-after: always; break-after: page; }
  .pg:last-child { page-break-after: auto; break-after: auto; }
}
.doc { font-family: var(--fB); color: #111; font-size: 12.5px; }
.doc .dh { display: flex; align-items: center; gap: 12px; border-bottom: 2px solid var(--ink); padding-bottom: 8px; margin-bottom: 10px; }
.doc .dh img { width: 62px; height: 62px; object-fit: contain; }
.doc .dh .n { font-family: var(--fT); font-size: 18px; color: var(--ink); font-weight: 600; }
.doc .rs { text-align: center; font-size: 11px; line-height: 1.3; }
.doc table { width: 100%; border-collapse: collapse; }
.doc th, .doc td { border: 1px solid #999; padding: 4px 6px; }
.doc th { background: #eef2fb; font-size: 11px; }
.doc .r { text-align: right; } .doc .c { text-align: center; }
.doc .ttl { text-align: center; font-family: var(--fT); font-size: 17px; font-weight: 600; margin: 8px 0; color: var(--ink); text-transform: uppercase; letter-spacing: .5px; }
.doc .sig { display: flex; justify-content: space-between; margin-top: 18px; }
.doc .sig div { width: 45%; text-align: center; min-height: 60px; }
.recu { max-width: 148mm; margin: 0 auto; border: 1px dashed #aaa; padding: 10mm; }
.recu .big { font-family: var(--fT); font-size: 22px; font-weight: 600; text-align: center; border: 2px solid var(--ink); border-radius: 10px; padding: 6px; margin: 10px 0; color: var(--ink); }
.cards-p { display: grid; grid-template-columns: repeat(2, 85.6mm); gap: 6mm; justify-content: center; }
.idc { width: 85.6mm; height: 54mm; border-radius: 4mm; overflow: hidden; position: relative; background: #fff; border: 1px solid #ccc; display: flex; flex-direction: column; break-inside: avoid; }
.idc .ih { background: linear-gradient(135deg, var(--ink), var(--ink2)); color: #fff; padding: 2mm 3mm; display: flex; gap: 2mm; align-items: center; }
.idc .ih img { width: 8mm; height: 8mm; background: #fff; border-radius: 2mm; }
.idc .ih b { font-family: var(--fT); font-size: 10pt; font-weight: 600; line-height: 1.05; }
.idc .ih span { font-size: 6.5pt; opacity: .8; }
.idc .ib { display: flex; gap: 3mm; padding: 2.5mm 3mm; flex: 1; align-items: center; }
.idc .ph { width: 20mm; height: 25mm; border-radius: 2mm; background: #e8eefb; display: grid; place-items: center; font-weight: 800; color: var(--ink); font-size: 14pt; object-fit: cover; flex: none; }
.idc .inf { flex: 1; font-size: 7.5pt; line-height: 1.35; min-width: 0; }
.idc .inf .nm { font-size: 10pt; font-weight: 800; line-height: 1.1; margin-bottom: 1mm; }
.idc .qr { width: 21mm; height: 21mm; flex: none; }
.idc .qr img, .idc .qr canvas { width: 21mm !important; height: 21mm !important; }
.idc .if { background: var(--coral); height: 2.2mm; }
.bul { font-size: 11.5px; }
.bul th, .bul td { padding: 3px 5px; }
.bul .grp td { background: #f4f1ea; font-weight: 800; font-size: 11px; }

/* ================================================================
   DESIGN V2 — profondeur, mouvements doux, finitions
   ================================================================ */
@property --p { syntax: '<number>'; inherits: false; initial-value: 0; }
body { background:
  radial-gradient(circle at 1px 1px, rgba(20,48,107,.06) 1px, transparent 0) 0 0 / 22px 22px,
  linear-gradient(180deg, #f8f6f1 0%, var(--paper) 100%); background-attachment: fixed; }
::selection { background: rgba(244,81,30,.2); }

/* En-tête : dégradé + liseré corail */
.top { background: linear-gradient(100deg, #10275a 0%, var(--ink) 45%, #1d3c86 100%); box-shadow: 0 4px 18px rgba(10,25,60,.28); }
.top::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--coral2) 30%, var(--coral) 70%, transparent); opacity: .85; }
.top img { transition: transform .4s cubic-bezier(.3,1.6,.5,1); box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.top img:hover { transform: rotate(-8deg) scale(1.08); }
.top .ib { transition: background .2s, transform .15s; }
.top .ib:hover { background: rgba(255,255,255,.22); }
.top .ib:active { transform: scale(.92); }

/* Barre latérale */
@media (min-width: 900px) {
  .side { background: rgba(255,255,255,.86); backdrop-filter: blur(10px); }
  .side a { position: relative; transition: background .2s, color .2s, padding-left .2s; }
  .side a:hover { padding-left: 16px; }
  .side a.on { background: linear-gradient(90deg, var(--inkSoft), rgba(232,238,251,.3)); }
  .side a.on::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--coral); animation: barIn .3s ease-out; }
  .side .dot { animation: pulse 2s infinite; }
}
@keyframes barIn { from { transform: scaleY(0); } }

/* Barre du bas (téléphone) */
.nav { background: rgba(255,255,255,.94); backdrop-filter: blur(12px); box-shadow: 0 -4px 20px rgba(20,48,107,.07); }
.nav a { transition: color .2s; }
.nav a svg { transition: transform .25s cubic-bezier(.3,1.6,.5,1); }
.nav a.on svg { transform: translateY(-2px) scale(1.12); }
.nav a.on::before { animation: navIn .3s ease-out; left: 32%; right: 32%; height: 3px; }
.nav a:active svg { transform: scale(.88); }
.nav a .dot { animation: pulse 2s infinite; }
@keyframes navIn { from { transform: scaleX(0); } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(244,81,30,.5); } 50% { box-shadow: 0 0 0 5px rgba(244,81,30,0); } }

/* Entrée des écrans : les blocs montent l'un après l'autre */
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes riseS { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
main.enter > * { animation: rise .42s cubic-bezier(.2,.8,.2,1) both; }
main.enter > *:nth-child(2) { animation-delay: .05s; } main.enter > *:nth-child(3) { animation-delay: .1s; }
main.enter > *:nth-child(4) { animation-delay: .15s; } main.enter > *:nth-child(5) { animation-delay: .2s; }
main.enter > *:nth-child(6) { animation-delay: .25s; } main.enter > *:nth-child(n+7) { animation-delay: .3s; }
main.enter .grid > * { animation: rise .45s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--k, 0) * 60ms + .08s); }
main.enter .list > .li, main.enter .appel > button, main.enter .msg, main.enter .edt .slot { animation: riseS .35s ease-out both; animation-delay: calc(var(--i, 0) * 22ms + .12s); }

main.enter .list.noanim > .li { animation: none; }
/* Cartes et statistiques : relief au survol */
.card, .stat, .list { transition: box-shadow .25s, transform .25s, border-color .25s; }
.stat[data-go]:hover, .card[data-go]:hover, .stat[data-a]:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(20,48,107,.06), 0 14px 30px rgba(20,48,107,.12); }
.stat::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--ink3); opacity: 0; transition: opacity .25s; }
.stat[data-go]:hover::before { opacity: 1; }
.stat .v { letter-spacing: -.3px; }
.stat.hero { box-shadow: 0 10px 28px rgba(20,48,107,.35); }
.stat.hero::before { content: ''; position: absolute; inset: 0; width: auto; opacity: 1; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.16) 50%, transparent 70%); background-size: 250% 100%; animation: sheen 4.5s ease-in-out infinite; }
@keyframes sheen { 0% { background-position: 130% 0; } 55%, 100% { background-position: -130% 0; } }
.stat.alert { box-shadow: 0 6px 22px rgba(244,81,30,.14); }
.stat.alert .v { animation: none; }

/* Anneau, barres et jauges qui se remplissent */
.ring { animation: ringFill 1.3s cubic-bezier(.2,.8,.2,1) both; animation-delay: .25s; }
@keyframes ringFill { from { --p: 0; } }
.ring::before { box-shadow: inset 0 2px 6px rgba(0,0,0,.06); }
.bars .bar i { transform-origin: bottom; animation: growY .9s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i, 0) * 70ms + .2s); }
.bars .bar b { animation: riseS .4s ease-out both; animation-delay: calc(var(--i, 0) * 70ms + .6s); }
@keyframes growY { from { transform: scaleY(0); } }
.prog i { transform-origin: left; animation: growX 1.1s cubic-bezier(.2,.8,.2,1) both; animation-delay: .3s; background: linear-gradient(90deg, #16a34a, #22c55e); }
@keyframes growX { from { transform: scaleX(0); } }
.hizb i.on { animation: pop .3s ease-out both; animation-delay: calc(var(--i, 0) * 25ms); }

/* Boutons : appui et lumière */
.btn { transition: transform .12s, box-shadow .2s, background .2s, filter .2s; position: relative; overflow: hidden; }
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: scale(.96); }
.btn.p { background: linear-gradient(135deg, var(--ink2), var(--ink)); box-shadow: 0 4px 14px rgba(20,48,107,.28); }
.btn.c { background: linear-gradient(135deg, var(--coral2), var(--coral)); box-shadow: 0 4px 14px rgba(244,81,30,.3); }
.btn.g { background: linear-gradient(135deg, #25c26a, #1a9d52); box-shadow: 0 4px 12px rgba(31,170,89,.28); }
.btn.p:hover, .btn.c:hover, .btn.g:hover { box-shadow: 0 8px 22px rgba(20,48,107,.3); }
.btn .rip { position: absolute; border-radius: 50%; background: rgba(255,255,255,.45); transform: scale(0); animation: ripple .55s ease-out forwards; pointer-events: none; }
@keyframes ripple { to { transform: scale(2.6); opacity: 0; } }
.chip { transition: background .2s, color .2s, border-color .2s, transform .12s; }
.chip:active { transform: scale(.95); }
.chip.on { box-shadow: 0 3px 10px rgba(20,48,107,.25); }
.tabs button { transition: background .25s, color .25s, box-shadow .25s; }
.tabs button.on { animation: tabIn .25s ease-out; }
@keyframes tabIn { from { transform: scale(.94); } }

/* Listes */
.li { transition: background .15s, padding-left .2s; }
.li:hover { padding-left: 18px; }
.li .av { transition: transform .3s cubic-bezier(.3,1.6,.5,1); }
.li:hover .av { transform: scale(1.08); }
.av { background: linear-gradient(135deg, var(--ink3), var(--ink)); box-shadow: 0 2px 6px rgba(20,48,107,.2); }
.av.fem { background: linear-gradient(135deg, #e0457b, #b0175a); }
.tag { transition: transform .2s; }

/* Chargement : silhouettes qui scintillent au lieu de la roue */
.skel { display: grid; gap: 12px; }
.skel i { display: block; height: 18px; border-radius: 10px; background: linear-gradient(90deg, #ebe7de 0%, #f6f3ec 40%, #ebe7de 80%); background-size: 300% 100%; animation: shimmer 1.2s linear infinite; }
.skel i.h { height: 34px; width: 45%; }
.skel i.b { height: 92px; border-radius: 16px; }
.skel .r { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -50% 0; } }

/* Bandeau d'accueil du tableau de bord */
.welcome { position: relative; overflow: hidden; border-radius: 22px; padding: 20px 20px 18px; color: #fff; margin-bottom: 14px;
  background: radial-gradient(circle at 88% 20%, rgba(255,122,80,.55), transparent 38%), radial-gradient(circle at 10% 120%, rgba(60,110,220,.6), transparent 45%), linear-gradient(120deg, #10275a, var(--ink) 50%, #24479a); box-shadow: 0 14px 34px rgba(20,48,107,.3); }
.welcome h1 { font-size: 1.6rem; }
.welcome .sub { opacity: .8; font-size: 13.5px; margin-top: 2px; }
.welcome .btns { margin-top: 14px; position: relative; z-index: 1; }
.welcome .btn:not(.c) { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.25); color: #fff; backdrop-filter: blur(4px); }
.welcome .deco { position: absolute; right: -6px; top: -6px; width: 150px; height: 150px; opacity: .95; pointer-events: none; }
.welcome .deco .sun { transform-origin: 75px 62px; animation: spin 26s linear infinite; }
.welcome .deco .book { animation: float 4s ease-in-out infinite; }
.welcome h1, .welcome .sub { padding-right: 120px; position: relative; z-index: 1; }
@media (max-width: 900px) { .welcome .deco { width: 104px; height: 104px; right: -12px; top: -8px; opacity: .5; } .welcome h1, .welcome .sub { padding-right: 60px; } .welcome h1 { font-size: 1.35rem; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

/* Connexion : formes qui flottent, entrée de la carte, code qui vibre */
.login { position: relative; overflow: hidden; }
.login::before, .login::after { content: ''; position: absolute; border-radius: 50%; filter: blur(8px); pointer-events: none; }
.login::before { width: 340px; height: 340px; background: radial-gradient(circle, rgba(255,122,80,.45), transparent 65%); top: -90px; right: -80px; animation: drift 12s ease-in-out infinite; }
.login::after { width: 420px; height: 420px; background: radial-gradient(circle, rgba(70,120,230,.5), transparent 65%); bottom: -140px; left: -120px; animation: drift 15s ease-in-out infinite reverse; }
@keyframes drift { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(30px, 25px); } }
.login .box { position: relative; z-index: 1; animation: boxIn .55s cubic-bezier(.2,.9,.3,1.2) both; }
.login .box.noin { animation: none; }
@keyframes boxIn { from { opacity: 0; transform: translateY(24px) scale(.96); } }
.login .brand img { animation: float 4.5s ease-in-out infinite; box-shadow: 0 10px 24px rgba(20,48,107,.3); }
.login .who button { transition: border-color .2s, background .2s, transform .12s; }
.login .who button:active { transform: scale(.98); }
.login .who button.on { box-shadow: 0 0 0 3px rgba(44,86,184,.15); }
.pin i { transition: background .15s, transform .15s; }
.pin i.new { animation: pop .25s cubic-bezier(.3,1.8,.5,1); }
.pin.shake { animation: shake .45s; }
.pin.shake i { border-color: var(--bad); }
@keyframes pop { 0% { transform: scale(.4); } 70% { transform: scale(1.25); } 100% { transform: scale(1); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-9px); } 40%, 80% { transform: translateX(9px); } }
.pad button { transition: background .15s, transform .1s, box-shadow .15s; }
.pad button:active { transform: scale(.93); background: var(--inkSoft); box-shadow: inset 0 2px 6px rgba(20,48,107,.12); }
.login .foot { position: relative; z-index: 1; }

/* Appel : petit rebond à chaque toucher */
.appel button { transition: background .2s, border-color .2s, transform .12s; }
.appel button:active { transform: scale(.96); }
.appel button.tap { animation: pop .3s ease-out; }

/* Fenêtres et messages */
.sheet { box-shadow: 0 -10px 40px rgba(10,20,50,.25); }
.sheet-bg { backdrop-filter: blur(3px); }
.toast { display: flex; align-items: center; gap: 8px; animation: toastIn .35s cubic-bezier(.2,.9,.3,1.3); }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 20px) scale(.9); } to { opacity: 1; transform: translate(-50%, 0); } }
.todo { transition: background .15s, padding-left .2s; border-radius: 10px; }
.todo:hover { background: #faf8f3; padding-left: 6px; }
.todo .ic { transition: transform .3s cubic-bezier(.3,1.6,.5,1); }
.todo:hover .ic { transform: rotate(-8deg) scale(1.08); }
.edt .slot { transition: transform .15s, box-shadow .2s; }
.edt .slot:hover { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(20,48,107,.1); }
.page-h h1 { position: relative; }
.sec h2::after { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--coral); margin-left: 8px; vertical-align: middle; }

/* Respect des réglages « réduire les animations » */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}
@media print { main.enter > * { animation: none !important; } }
