:root {
  --bg: #f2f5f3; --card: #fff; --ink: #11231c; --muted: #5b6e66; --line: #dce5e0; --soft: #eaf3ee;
  --pri: #0b6b4f; --pri-d: #0b3d2e; --pri-l: #e2f1ea; --acc: #f2c200; --red: #c62828; --red-l: #fdecea;
  --ok: #188a4a; --warn: #b26a00; --warn-l: #fff4e0; --r: 14px; --sh: 0 1px 2px rgba(16,35,28,.06), 0 4px 16px rgba(16,35,28,.06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", Arial, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 var(--font); -webkit-text-size-adjust: 100%; }
a { color: var(--pri); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
.muted { color: var(--muted); } .small { font-size: 13px; } .b { font-weight: 700; } .right { text-align: right; } .center { text-align: center; }
.hide { display: none !important; }
.splash { height: 100vh; display: grid; place-items: center; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--line); border-top-color: var(--pri); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Connexion ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 20% 10%, #12704f 0, #0b3d2e 45%, #07261d 100%); }
.login-card { width: 100%; max-width: 400px; background: var(--card); border-radius: 20px; padding: 28px 24px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.login-card .brand { display: flex; gap: 12px; align-items: center; margin-bottom: 22px; }
.login-card .brand img { width: 52px; height: 52px; object-fit: contain; }
.login-card h1 { font-size: 20px; }
.flag { height: 5px; border-radius: 3px; background: linear-gradient(90deg, #0b7a53 33%, #c8102e 33% 66%, #f2c200 66%); margin: 18px 0 0; }

/* ---------- Structure ---------- */
.shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 252px; background: var(--pri-d); color: #e5f2ec; display: flex; flex-direction: column; z-index: 30; transform: translateX(-100%); transition: transform .22s ease; }
.sidebar.open { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.35); }
.sb-head { padding: 18px 16px 14px; display: flex; gap: 10px; align-items: center; border-bottom: 1px solid rgba(255,255,255,.08); }
.sb-head img { width: 38px; height: 38px; object-fit: contain; background: #fff; border-radius: 10px; padding: 3px; }
.sb-head b { font-size: 13.5px; line-height: 1.25; display: block; }
.sb-head small { opacity: .7; font-size: 12px; }
.sb-nav { padding: 10px 8px; overflow-y: auto; flex: 1; }
.sb-nav a { display: flex; gap: 12px; align-items: center; padding: 11px 12px; color: #d3e8de; text-decoration: none; border-radius: 10px; margin-bottom: 2px; font-weight: 500; }
.sb-nav a:hover { background: rgba(255,255,255,.06); }
.sb-nav a.active { background: rgba(242,194,0,.16); color: #fff; box-shadow: inset 3px 0 0 var(--acc); }
.sb-nav .ico { width: 22px; text-align: center; font-size: 17px; }
.sb-nav .sec { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; opacity: .5; padding: 14px 12px 6px; }
.sb-foot { padding: 12px 16px calc(12px + var(--safe-b)); border-top: 1px solid rgba(255,255,255,.08); font-size: 13px; }
.sb-foot button { background: none; border: 0; color: #f6d55c; cursor: pointer; padding: 0; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: rgba(242,245,243,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); min-height: 58px; }
.topbar h1 { font-size: 17px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .back, .topbar .menu { border: 0; background: var(--card); width: 40px; height: 40px; border-radius: 12px; box-shadow: var(--sh); cursor: pointer; font-size: 18px; flex: none; }
.netdot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); flex: none; }
.netdot.off { background: var(--red); }
main.view { padding: 16px 14px calc(92px + var(--safe-b)); max-width: 1180px; margin: 0 auto; }
.bottomnav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 25; display: flex; background: var(--card); border-top: 1px solid var(--line); padding-bottom: var(--safe-b); }
.bottomnav a, .bottomnav button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 9px; font-size: 11.5px; color: var(--muted); text-decoration: none; border: 0; background: none; cursor: pointer; }
.bottomnav .ico { font-size: 20px; line-height: 1.1; }
.bottomnav .active { color: var(--pri); font-weight: 700; }
@media (min-width: 960px) {
  .sidebar { transform: none; } .sidebar.open { box-shadow: none; }
  .shell { padding-left: 252px; } .topbar .menu, .bottomnav { display: none; }
  main.view { padding: 22px 28px 40px; }
}

/* ---------- Composants ---------- */
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--sh); padding: 16px; margin-bottom: 14px; }
.card > h2 { font-size: 16px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.card-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.card-h h2 { font-size: 16px; flex: 1; }
.grid { display: grid; gap: 12px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.kpi { background: var(--card); border-radius: var(--r); box-shadow: var(--sh); padding: 14px 16px; }
.kpi span { color: var(--muted); font-size: 13px; }
.kpi strong { display: block; font-size: 26px; color: var(--pri-d); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 0 16px; border-radius: 11px; border: 1px solid var(--line); background: var(--card); cursor: pointer; font-weight: 600; text-decoration: none; color: var(--ink); white-space: nowrap; transition: transform .05s, background .15s; }
.btn:active { transform: scale(.98); }
.btn-p { background: var(--pri); border-color: var(--pri); color: #fff; }
.btn-p:hover { background: #0a5d45; }
.btn-a { background: var(--acc); border-color: var(--acc); color: #10231c; }
.btn-d { color: var(--red); border-color: #f2c4c0; }
.btn-g { background: transparent; border-color: transparent; }
.btn-sm { min-height: 34px; padding: 0 11px; font-size: 13.5px; border-radius: 9px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field label { font-size: 13px; font-weight: 600; color: var(--muted); }
.input, select.input, textarea.input { width: 100%; min-height: 44px; padding: 9px 12px; border: 1.5px solid var(--line); border-radius: 11px; background: var(--card); outline: none; }
textarea.input { min-height: 120px; resize: vertical; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
.input:focus { border-color: var(--pri); box-shadow: 0 0 0 3px var(--pri-l); }
.input-sm { min-height: 36px; padding: 5px 8px; border-radius: 9px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; background: var(--soft); color: var(--pri-d); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.chip.warn { background: var(--warn-l); color: var(--warn); } .chip.red { background: var(--red-l); color: var(--red); } .chip.ok { background: #e3f5ea; color: var(--ok); }
.chip.gray { background: #eef0ef; color: var(--muted); }
.progress { height: 8px; background: #e6ece9; border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--pri), #2fa77a); border-radius: 99px; }
.progress.done > i { background: var(--ok); }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin: 0 -2px 14px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a, .tabs button { flex: none; padding: 9px 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-weight: 600; font-size: 14px; cursor: pointer; }
.tabs .active { background: var(--pri-d); color: #fff; border-color: var(--pri-d); }
.tabs .locked { color: var(--muted); }
.seg { display: inline-flex; background: #e7eeea; border-radius: 11px; padding: 3px; }
.seg button { border: 0; background: none; padding: 7px 12px; border-radius: 9px; cursor: pointer; font-weight: 600; font-size: 13.5px; color: var(--muted); }
.seg .on { background: var(--card); color: var(--ink); box-shadow: var(--sh); }
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -16px; padding: 0 16px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; padding: 8px 8px; border-bottom: 2px solid var(--line); white-space: nowrap; background: var(--card); position: sticky; top: 0; }
.tbl td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:hover td { background: #fafcfb; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty .big { font-size: 40px; }
.banner { padding: 12px 14px; border-radius: 12px; margin-bottom: 14px; display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.banner.warn { background: var(--warn-l); color: #6b4300; } .banner.info { background: var(--pri-l); color: var(--pri-d); } .banner.red { background: var(--red-l); color: #7a1714; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.avatar { width: 40px; height: 40px; border-radius: 12px; background: var(--pri-l); color: var(--pri-d); display: grid; place-items: center; font-weight: 800; flex: none; }
.grow { flex: 1; min-width: 0; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Cartes « mes classes » ---------- */
.assign { display: block; text-decoration: none; color: inherit; background: var(--card); border-radius: var(--r); box-shadow: var(--sh); padding: 16px; border: 2px solid transparent; transition: border-color .15s, transform .1s; }
.assign:hover { border-color: var(--pri-l); }
.assign:active { transform: scale(.99); }
.assign .t { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.assign h3 { font-size: 17px; }
.seqdots { display: flex; gap: 5px; margin-top: 10px; }
.seqdots span { flex: 1; text-align: center; font-size: 11.5px; font-weight: 700; padding: 5px 0; border-radius: 7px; background: #eef1ef; color: var(--muted); }
.seqdots span.full { background: #dff3e7; color: var(--ok); } .seqdots span.part { background: var(--warn-l); color: var(--warn); } .seqdots span.open { outline: 2px solid var(--acc); outline-offset: -2px; }

/* ---------- Saisie des notes ---------- */
.ge-head { position: sticky; top: 58px; z-index: 10; background: var(--bg); padding: 8px 0 10px; margin: -8px 0 6px; }
.ge-stats { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.ge-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ge-tools .input { flex: 1; min-width: 150px; }
.save-st { font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.save-st.saving { color: var(--warn); } .save-st.saved { color: var(--ok); } .save-st.offline { color: var(--red); }
.ge-list { background: var(--card); border-radius: var(--r); box-shadow: var(--sh); overflow: hidden; }
.ge-row { display: grid; grid-template-columns: 34px 1fr 92px 54px; align-items: center; gap: 8px; padding: 7px 12px; border-bottom: 1px solid var(--line); }
.ge-row:last-child { border-bottom: 0; }
.ge-row.focus { background: #f5fbf8; }
.ge-row .idx { color: var(--muted); font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; }
.ge-row .nm { min-width: 0; }
.ge-row .nm b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14.5px; }
.ge-row .nm small { color: var(--muted); font-size: 12px; }
.note-in { width: 100%; height: 44px; border: 1.5px solid var(--line); border-radius: 10px; text-align: center; font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; outline: none; background: var(--card); }
.note-in:focus { border-color: var(--pri); box-shadow: 0 0 0 3px var(--pri-l); }
.note-in.low { color: var(--red); } .note-in.err { border-color: var(--red); background: var(--red-l); } .note-in.saved { border-color: #a9dcbd; }
.note-in:disabled { background: #f3f5f4; color: var(--muted); }
.abs-btn { height: 44px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--card); font-size: 12px; font-weight: 800; color: var(--muted); cursor: pointer; }
.abs-btn.on { background: var(--red); border-color: var(--red); color: #fff; }
.fiche { background: var(--card); border-radius: 20px; box-shadow: var(--sh); padding: 22px 18px; text-align: center; max-width: 520px; margin: 0 auto; }
.fiche .who { font-size: 21px; font-weight: 800; margin: 6px 0 2px; }
.fiche .note-in { height: 84px; font-size: 44px; max-width: 220px; margin: 18px auto 10px; display: block; border-radius: 16px; }
.fiche .nav { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 14px; }
.fiche .nav .btn { min-height: 52px; }
.fiche .pos { color: var(--muted); font-weight: 600; }

/* ---------- Discipline / conseil ---------- */
.mini-in { width: 64px; min-height: 36px; text-align: center; border: 1.5px solid var(--line); border-radius: 8px; padding: 4px; }
.mini-in:focus { border-color: var(--pri); outline: none; }
.chk { width: 22px; height: 22px; accent-color: var(--pri); }
.rank { font-weight: 800; color: var(--pri-d); }
.moy-low { color: var(--red); font-weight: 700; } .moy-ok { color: var(--ok); font-weight: 700; }

/* ---------- Fenêtre modale ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(8,24,18,.5); z-index: 50; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.modal { background: var(--card); width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; border-radius: 20px 20px 0 0; padding: 20px 18px calc(18px + var(--safe-b)); animation: up .2s ease; }
.modal h2 { font-size: 18px; margin-bottom: 14px; }
.modal .foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; position: sticky; bottom: -18px; background: var(--card); padding: 10px 0 0; }
@media (min-width: 640px) { .modal-bg { align-items: center; } .modal { border-radius: 20px; } }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
#toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(80px + var(--safe-b)); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: 92vw; }
.toast { background: var(--pri-d); color: #fff; padding: 11px 16px; border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.2); font-weight: 600; font-size: 14px; animation: up .2s; }
.toast.err { background: var(--red); }
@media (min-width: 960px) { #toasts { bottom: 24px; } }
.pw { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 22px; font-weight: 800; letter-spacing: .06em; background: var(--soft); padding: 12px; border-radius: 12px; text-align: center; user-select: all; }
.scale-row { display: grid; grid-template-columns: 70px 1fr 1fr 60px 36px; gap: 6px; margin-bottom: 6px; }
.logo-prev { width: 72px; height: 72px; object-fit: contain; border: 1px dashed var(--line); border-radius: 12px; background: #fff; }
@media (max-width: 640px) { .ge-stats .chip { font-size: 11.5px; padding: 2px 8px; } .ge-head .tabs { margin-bottom: 8px; } .ge-head .tabs a { padding: 7px 12px; font-size: 13px; } }

@media print {
  .sidebar, .topbar, .bottomnav, #toasts, .btns, .tabs button:not(.active), .ge-tools { display: none !important; }
  .shell { padding-left: 0 !important; } main.view { padding: 0 !important; max-width: none; }
  .card, .kpi { box-shadow: none; border: 1px solid #ccd; break-inside: avoid; }
  body { background: #fff; }
}

/* ===== Composants ajoutés : profils, recherche, emplois du temps, photos, portail ===== */
.check { display: flex; align-items: center; gap: 10px; padding: 6px 0; cursor: pointer; }
.barrow { display: grid; grid-template-columns: 92px 1fr 52px; gap: 8px; align-items: center; margin: 5px 0; }
.modal.wide { max-width: 900px; }
.langsw button { padding: 6px 10px; font-size: 12.5px; }
.topbar .langsw { flex: none; }
.themebtn { flex: none; padding: 6px 8px; line-height: 0; display: inline-flex; align-items: center; justify-content: center; }
.gsearch { position: relative; flex: 0 1 320px; }
.gsr { position: absolute; top: 44px; left: 0; right: 0; background: var(--card); border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.18); max-height: 60vh; overflow: auto; z-index: 40; }
.gsr a { display: flex; gap: 10px; align-items: center; padding: 9px 12px; color: inherit; text-decoration: none; border-bottom: 1px solid var(--line); }
.gsr a.sel, .gsr a:hover { background: var(--pri-l); }
.gsr small { display: block; color: var(--muted); }
.gsbtn { display: none; }
@media (max-width: 700px) { .gsearch { display: none; } .gsearch.open { display: block; position: absolute; left: 8px; right: 8px; top: 62px; } .gsbtn { display: inline-block; } }
.ph-av { border-radius: 10px; object-fit: cover; background: var(--soft); flex: none; }
.ph-big { width: 132px; height: 176px; border-radius: 16px; object-fit: cover; background: var(--soft); display: grid; place-items: center; font-size: 42px; color: var(--muted); border: 2px dashed var(--line); cursor: pointer; }
.ph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.ph-card { background: var(--card); border-radius: 14px; box-shadow: var(--sh); padding: 8px; text-align: center; font-size: 12.5px; cursor: pointer; border: 2px solid transparent; }
.ph-card img, .ph-card .ph-empty { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 10px; background: var(--soft); display: grid; place-items: center; font-size: 32px; color: var(--muted); }
.ph-card.ok { border-color: #a9dcbd; } .ph-card.miss { border-color: #f2c4c0; }
.qr { display: block; }
.tt { width: 100%; border-collapse: separate; border-spacing: 4px; table-layout: fixed; min-width: 640px; }
.tt th { font-size: 12px; color: var(--muted); font-weight: 700; padding: 4px; }
.tt td { background: var(--card); border-radius: 10px; height: 54px; padding: 5px 6px; font-size: 12.5px; vertical-align: top; box-shadow: inset 0 0 0 1px var(--line); cursor: default; }
.tt td.edit { cursor: pointer; } .tt td.edit:hover { box-shadow: inset 0 0 0 2px var(--pri); }
.tt td.pause { background: repeating-linear-gradient(45deg, #f4f6f5, #f4f6f5 6px, #eceff0 6px, #eceff0 12px); height: 18px; box-shadow: none; text-align: center; color: var(--muted); font-size: 11px; }
.tt td.full { background: var(--pri-l); box-shadow: none; }
.tt td.busy { background: #fbeceb; }
.tt td b { display: block; font-size: 12.5px; }
.tt td small { color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt td small.tt-grp { color: var(--accent, #0b7a5a); font-weight: 600; }
.tt .hcol { width: 74px; text-align: right; font-size: 11.5px; color: var(--muted); background: none; box-shadow: none; }
.statgrid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.pill-nav { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.child-card { display: block; text-decoration: none; color: inherit; transition: transform .12s, box-shadow .12s; } .child-card:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(16,35,28,.12); }
.big-num { font-size: 34px; font-weight: 800; color: var(--pri-d); line-height: 1; }
.notice { border-left: 4px solid var(--acc); }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; border-radius: 99px; background: var(--red); color: #fff; font-size: 11.5px; font-weight: 800; padding: 0 6px; margin-left: auto; }
.sb-nav a .badge { margin-left: auto; }
.timeline { border-left: 2px solid var(--line); margin-left: 6px; padding-left: 14px; }
.timeline > div { position: relative; padding: 6px 0; }
.timeline > div::before { content: ''; position: absolute; left: -20px; top: 12px; width: 10px; height: 10px; border-radius: 50%; background: var(--pri); }
.step-ok { color: var(--ok); } .step-wait { color: var(--warn); }
.drop { border: 2px dashed var(--line); border-radius: 16px; padding: 22px; text-align: center; color: var(--muted); }
.drop.over { border-color: var(--pri); background: var(--pri-l); }
.sig-prev { max-height: 70px; max-width: 220px; background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 50% / 12px 12px; border-radius: 8px; padding: 4px; }

/* ---------- Import : zone de dépôt ---------- */
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px 14px; border: 2px dashed #b7cfc3; border-radius: var(--r); background: var(--soft); cursor: pointer; text-align: center; margin-bottom: 12px; transition: background .15s, border-color .15s; }
.dropzone .big { font-size: 34px; } .dropzone.over { background: var(--pri-l); border-color: var(--pri); } .dropzone.on { border-style: solid; border-color: var(--pri); background: var(--card); }

/* ---------- Paramètres : cachet, signature, barre d'enregistrement ---------- */
.stampbox { display: flex; gap: 12px; align-items: flex-start; }
.stamp-prev { flex: none; width: 112px; height: 112px; border-radius: 12px; border: 1px solid var(--line); display: grid; place-items: center; text-align: center; padding: 6px;
  background: repeating-conic-gradient(#f1f4f2 0 25%, #fff 0 50%) 0 0 / 16px 16px; }
.stamp-prev img { background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 50% / 10px 10px; max-width: 100%; max-height: 100%; object-fit: contain; }
.savebar { position: sticky; bottom: calc(70px + var(--safe-b)); z-index: 5; margin-bottom: 14px; }
.savebar .btn { width: 100%; min-height: 50px; box-shadow: 0 6px 20px rgba(11,107,79,.35); }
@media (min-width: 960px) { .savebar { bottom: 12px; } }

/* ---------- Portail parents / élèves ---------- */
.phwrap { display: flex; flex-direction: column; align-items: center; }
.ptabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.ptabs button { flex: none; padding: 7px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); font-weight: 600; font-size: 13.5px; cursor: pointer; }
.ptabs .active { background: var(--pri); color: #fff; border-color: var(--pri); }
.subj { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.subj:last-child { border-bottom: 0; }
.choice-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.choice { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); cursor: pointer; transition: border-color .12s, background .12s; }
.choice span { font-size: 22px; } .choice small { color: var(--muted); font-size: 12.5px; } .choice:hover, .choice:focus-visible { border-color: var(--pri); background: var(--pri-l); }
.edt-grid td, .edt-grid th { min-width: 96px; vertical-align: top; } .edt-grid .today { background: #f4fbf7; } .edt-grid tr.pause td { background: var(--soft); padding: 3px 8px; }
.cls-card { display: block; text-decoration: none; color: inherit; } .cls-card:hover { box-shadow: 0 8px 24px rgba(16,35,28,.12); }
.kpi strong span { font-size: inherit; color: inherit; } .kpi strong .moy-low { color: var(--red); } .kpi strong .moy-ok { color: var(--ok); }

/* ---------- File d'envoi WhatsApp ---------- */
.sendq { display: grid; gap: 10px; }
.sq-card { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: #f6faf8; }
.sq-card pre { white-space: pre-wrap; font: 14px/1.45 var(--font); margin: 8px 0 0; max-height: 34vh; overflow: auto; }
.choice.on { border-color: var(--pri); background: var(--pri-l); }
.modal.wide { max-width: 720px; }
.choice.plan .price { font-size: 20px; color: var(--pri-d); margin: 2px 0; }
.choice.op { flex: 1; align-items: center; min-height: 48px; justify-content: center; }

/* ---------- Onglets : tout est visible ----------
   Ordinateur : les onglets passent à la ligne. Téléphone : une ligne qui défile au doigt, avec un indicateur « › ». */
@media (min-width: 700px) {
  .tabs, .ptabs { flex-wrap: wrap; overflow: visible; }
}
@media (max-width: 699px) {
  .tabs, .ptabs { scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
  .tabs > *, .ptabs > * { scroll-snap-align: start; }
  .tabwrap { position: relative; }
  .tabwrap.more::after { content: '›'; position: absolute; right: 0; top: 0; bottom: 18px; width: 42px; display: flex; align-items: center; justify-content: flex-end; padding-right: 4px;
    font-size: 26px; font-weight: 700; color: var(--pri-d); background: linear-gradient(90deg, rgba(242,245,243,0), var(--bg) 70%); pointer-events: none; }
  .tabwrap.less::before { content: '‹'; position: absolute; left: 0; top: 0; bottom: 18px; width: 34px; z-index: 1; display: flex; align-items: center; padding-left: 2px;
    font-size: 26px; font-weight: 700; color: var(--pri-d); background: linear-gradient(270deg, rgba(242,245,243,0), var(--bg) 70%); pointer-events: none; }
}
/* Saisie à plusieurs évaluations */
.ge-multi .note-in.sm { width: 74px; height: 40px; font-size: 17px; padding: 4px; text-align: center; }
.ge-multi td, .ge-multi th { vertical-align: middle; }
.ge-multi tr.hide { display: none; }
.scale-row.ev-row { grid-template-columns: 2fr 2fr 80px auto; }
/* Appel en classe */
.roll { display: grid; gap: 6px; margin-bottom: 12px; }
.roll-it { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 8px 10px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); cursor: pointer; min-height: 56px; }
.roll-it.abs { border-color: var(--red); background: var(--red-l); } .roll-it.late { border-color: var(--warn); background: var(--warn-l); }
.appel-banner { text-decoration: none; color: inherit; }
/* Saisie à plusieurs évaluations sur téléphone : une carte par élève (nom, puis les évaluations côte à côte, puis la note de séquence) */
@media (max-width: 699px) {
  .ge-multi thead { display: none; }
  .ge-multi, .ge-multi tbody { display: block; }
  .ge-multi tr { display: grid; grid-template-columns: repeat(var(--n, 2), 1fr) 70px; gap: 6px 8px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
  .ge-multi tr.hide { display: none; }
  .ge-multi td { border: 0; padding: 0; }
  .ge-multi td.idx { display: none; }
  .ge-multi td.nm { grid-column: 1 / -1; font-size: 15px; }
  .ge-multi td[data-l]::before { content: attr(data-l); display: block; font-size: 11px; color: var(--muted); margin-bottom: 3px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ge-multi td[data-res] { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; font-size: 18px; }
  .ge-multi .note-in.sm { width: 100%; height: 46px; font-size: 19px; }
}

/* Emploi du temps général : lignes = jours × créneaux, colonnes = classes (ou enseignants) */
.tg-wrap { overflow: auto; max-height: 72vh; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.tg { border-collapse: separate; border-spacing: 0; font-size: 11.5px; min-width: 100%; }
.tg th, .tg td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 3px 4px; text-align: center; vertical-align: middle; }
.tg thead th { position: sticky; top: 0; z-index: 3; background: var(--soft, #eef4f1); font-size: 11.5px; min-width: 78px; white-space: nowrap; }
.tg thead th small { color: var(--muted); font-weight: 400; }
.tg .tg-day { position: sticky; left: 0; z-index: 2; width: 26px; min-width: 26px; background: #f4f6f5; font-weight: 700; padding: 0; }
.tg thead .tg-day, .tg thead .tg-h { z-index: 4; }
.tg .tg-day span { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; font-size: 12px; }
.tg .tg-h { position: sticky; left: 26px; z-index: 2; width: 46px; min-width: 46px; background: #fafbfa; color: var(--muted); font-size: 10.5px; line-height: 1.2; }
.tg td { height: 40px; min-width: 78px; max-width: 110px; line-height: 1.2; }
.tg td b { display: block; font-size: 11.5px; }
.tg td small { display: block; color: var(--muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg td.full { background: var(--pri-l); }
.tg td.edit { cursor: pointer; } .tg td.edit:hover { box-shadow: inset 0 0 0 2px var(--pri); }
.tg td.hl { background: #ffe9a8; box-shadow: inset 0 0 0 2px #e0a800; }
.tg td.dim { opacity: .38; }
.tg td.cf { box-shadow: inset 0 0 0 2px #c0392b; background: #fbeceb; }
.tg td.drag { opacity: .4; } .tg td.over { box-shadow: inset 0 0 0 2px var(--pri); background: var(--card); }
.tg tr.tg-first > * { border-top: 2px solid #9aa5a0; }
.tg tr.tg-pause td { height: 10px; padding: 0; font-size: 9px; color: var(--muted); background: repeating-linear-gradient(45deg, #f4f6f5, #f4f6f5 6px, #eceff0 6px, #eceff0 12px); }
@media (max-width: 640px) {
  .tg-tools { flex: 1 1 100%; } .tg-tools .input { max-width: none !important; flex: 1 1 100%; } .tg-tools .seg { flex: 1 1 100%; } .tg-tools .seg button { flex: 1; }
  .tg td { min-width: 70px; } .tg thead th { min-width: 70px; }
}
/* Horaires : créneaux par jour */
.tt td.off { background: transparent; box-shadow: inset 0 0 0 1px var(--line); background-image: repeating-linear-gradient(45deg, transparent 0 6px, rgba(0,0,0,.035) 6px 12px); }
.slot-row { display: grid; grid-template-columns: 96px 96px auto 1fr 36px; gap: 6px; align-items: center; margin-bottom: 6px; }
.slot-row.is-pause { background: #f6f7f6; border-radius: 8px; padding: 2px 4px; }
.dchips { display: inline-flex; flex-wrap: wrap; gap: 3px; }
.dchip { position: relative; cursor: pointer; }
.dchip input { position: absolute; opacity: 0; pointer-events: none; }
.dchip span { display: inline-block; min-width: 34px; text-align: center; padding: 3px 5px; border-radius: 6px; font-size: 11.5px; border: 1px solid var(--line); color: var(--muted); background: var(--card); }
.dchip input:checked + span { background: var(--pri); border-color: var(--pri); color: #fff; font-weight: 600; }
.dchip input:focus-visible + span { outline: 2px solid var(--pri); outline-offset: 1px; }
.gen { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; margin-top: 6px; }
.gen label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.gen .grow { flex: 1 1 160px; }
@media (max-width: 640px) { .slot-row { grid-template-columns: 1fr 1fr 36px; } .slot-row .check { grid-column: 1 / 3; } .slot-row .dchips { grid-column: 1 / -1; } }
@media (max-width: 640px) { .slot-row [data-rm] { grid-column: 3; grid-row: 1; } }
/* Classes du programme national */
.cat-g { margin: 6px 0 14px; } .cat-g h3 { font-size: 14px; margin: 10px 0 6px; color: var(--pri); }
.cat-row { display: grid; grid-template-columns: minmax(170px, 1fr) 70px 2fr; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.cat-row.done { opacity: .6; } .cat-row details summary { cursor: pointer; } .cat-row details div { margin-top: 4px; line-height: 1.5; }
@media (max-width: 640px) { .cat-row { grid-template-columns: 1fr 70px; } .cat-row details { grid-column: 1 / -1; } }
/* Suivi des demandes */
.rq-steps { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.rq-step { position: relative; font-size: 11.5px; padding: 3px 10px 3px 18px; border-radius: 6px; background: #f1f3f2; color: var(--muted); }
.rq-step::before { content: ''; position: absolute; left: 7px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: #c3cbc7; }
.rq-step.ok { background: #e6f3ed; color: #0b5a40; } .rq-step.ok::before { background: #0b6b4f; }
.rq-step.ko { background: #fbeceb; color: #9c2b22; } .rq-step.ko::before { background: #c0392b; }
.rq-step small { display: block; font-size: 10.5px; opacity: .85; }
.sb-nav .ico, .bottomnav .ico { display: inline-flex; align-items: center; justify-content: center; }
.sb-nav .ico svg { opacity: .9; } .bottomnav .ico svg { width: 20px; height: 20px; }

/* Marque de l'application (Lipem) */
.sb-brand { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 13px; font-weight: 700; letter-spacing: .3px; color: #e7eef8; }
.sb-brand img { width: 28px; height: 28px; border-radius: 7px; }
.sb-brand small { display: block; font-weight: 500; font-size: 11px; color: #9fc3b3; letter-spacing: .2px; }
.sb-grp summary { display: flex; gap: 12px; align-items: center; padding: 11px 12px; color: #d3e8de; border-radius: 10px; cursor: pointer; font-weight: 500; list-style: none; }
.sb-grp summary::-webkit-details-marker { display: none; }
.sb-grp summary::after { content: ""; margin-left: auto; width: 7px; height: 7px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform .15s; }
.sb-grp[open] summary::after { transform: rotate(-135deg); }
.sb-grp summary:hover { background: rgba(255,255,255,.06); }
.sb-grp summary .n { font-size: 11px; background: rgba(255,255,255,.12); border-radius: 9px; padding: 1px 7px; }
.sb-grp a { padding-left: 26px; font-size: 14px; }
.login-logo { display: block; width: 210px; max-width: 70%; margin: 0 auto 14px; }
.login-card .powered { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 14px; font-size: 12px; color: var(--muted, #5b6e66); }
.login-card .powered img { width: 26px; height: 26px; border-radius: 6px; }

/* Page d'accueil publique (vitrine) à côté du formulaire de connexion */
.login.with-vitrine { grid-template-columns: minmax(0, 560px) 400px; gap: 28px; align-content: center; justify-content: center; }
.vitrine { color: #fff; }
.vitrine .v-logo { width: 240px; max-width: 70%; background: #fff; border-radius: 16px; padding: 10px 14px; display: block; margin-bottom: 16px; }
.vitrine h2 { font-size: 24px; line-height: 1.25; margin: 0 0 8px; }
.vitrine p { opacity: .85; line-height: 1.55; margin: 0 0 14px; }
.v-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.v-k { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14); border-radius: 12px; padding: 10px 12px; }
.v-k b { display: block; font-size: 22px; } .v-k span { font-size: 12px; opacity: .8; }
.vitrine .btn:not(.btn-p) { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.25); }
@media (max-width: 1000px) { .login.with-vitrine { grid-template-columns: minmax(0, 420px); } .login.with-vitrine .login-card { order: -1; } .v-stats { grid-template-columns: repeat(2, 1fr); } .vitrine { padding: 6px 4px 24px; } }
@media (min-width: 1001px) { .login.with-vitrine .login-card .login-logo { display: none; } }
@media (max-width: 1000px) { .vitrine .v-logo { display: none; } }

/* ---------- Listes déroulantes avec recherche ---------- */
.cb-wrap { position: relative; display: block; }
.cb-wrap.sm, td .cb-wrap { display: inline-block; min-width: 150px; }
.cb-wrap > select { width: 100%; }
.cb-btn { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; background: transparent; }
.cb-pop { position: fixed; z-index: 1000; background: var(--card, #fff); border: 1px solid var(--line, #ddd); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.18); display: flex; flex-direction: column; overflow: hidden; }
.cb-pop .cb-q { margin: 8px; width: calc(100% - 16px); }
.cb-l { overflow-y: auto; padding: 0 4px 6px; }
.cb-o { padding: 7px 10px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.cb-o:hover, .cb-o.act { background: var(--soft, #eef5f0); }
.cb-o.on { font-weight: 700; color: var(--pri-d, #1f5e3b); }
.cb-o.dis { opacity: .45; cursor: default; }
.cb-g { padding: 6px 10px 2px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted, #777); }
.cb-vide { padding: 10px; color: var(--muted, #777); font-size: 13px; }

/* ---------- Pages longues : haut, milieu, bas ---------- */
.pg-nav { position: fixed; right: 14px; bottom: 18px; z-index: 900; display: flex; flex-direction: column; gap: 6px; opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .2s, transform .2s; }
.pg-nav.on { opacity: 1; pointer-events: auto; transform: none; }
.pg-nav button { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line, #ddd); background: var(--card, #fff); color: var(--pri-d, #1f5e3b); font-size: 19px; line-height: 1; cursor: pointer; box-shadow: 0 3px 10px rgba(0,0,0,.15); }
.pg-nav button:hover { background: var(--soft, #eef5f0); }

/* ---------- Tableaux et listes longs : affichage par paquets ---------- */
.lp-cache { display: none !important; }
.lp-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; padding: 10px 0 4px; }
@media print { .pg-nav, .lp-bar, .cb-btn { display: none !important; } .lp-cache { display: table-row !important; } }

/* Pastille de nouveauté (annonces, demandes) */
.nb-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: auto; border-radius: 9px; background: var(--red, #c62828); color: #fff; font-size: 11px; font-weight: 700; line-height: 1; }
a .nb-badge { margin-left: 6px; }
.sb-nav a { position: relative; }
.sb-ver { opacity: .85; }
.sb-aide { margin-top: 8px; width: 100%; background: transparent; border: 1px solid rgba(255,255,255,.25); color: #e7eef8; border-radius: 8px; padding: 6px 8px; font: inherit; font-size: 12.5px; cursor: pointer; }
.sb-aide:hover { background: rgba(255,255,255,.08); }
.sig-mini { display: inline-block; max-height: 34px; max-width: 110px; vertical-align: middle; margin-left: 6px; background: #fff; border-radius: 4px; }
.list-item.ct-visa { background: var(--accent-soft, #eef3fb); border-left: 3px solid var(--accent, #1b3a6b); }
#mb, #more { position: relative; }
.nb-badge.nb-dot { position: absolute; top: 2px; right: 2px; margin: 0; min-width: 16px; height: 16px; font-size: 10px; padding: 0 4px; }
.sb-aide .nb-badge { margin-left: 6px; }
/* Téléphone : une ligne de liste avec des boutons (Cours, Modifier, Mot de passe...) garde toute la largeur pour le nom
   et passe les boutons à la ligne, au lieu d'écraser le nom sur deux lettres */
@media (max-width: 640px) {
  .list-item:has(> .btn), .list-item:has(> .btns), .list-item:has(> button:not(.sig-mini)) { flex-wrap: wrap; row-gap: 8px; }
  .list-item:has(> .btn) > .grow, .list-item:has(> .btns) > .grow, .list-item:has(> button) > .grow { flex: 1 1 calc(100% - 72px); min-width: 0; }
  /* barres de filtres : chaque champ prend une largeur lisible, deux par ligne au plus */
  .card-h > .grow:has(> .input, > select, > .cb-wrap) { flex: 1 1 100%; min-width: 0; }
  .card-h .grow > .input, .card-h .grow > select, .card-h .grow > .cb-wrap { flex: 1 1 150px; max-width: none !important; min-width: 0; }
  .card-h .grow > .cb-wrap > select { max-width: none !important; }
}
@media (max-width: 640px) {
  .card-h > .grow { flex: 1 1 200px; min-width: 0; }
  .btns .btn { white-space: normal; text-align: center; max-width: 100%; line-height: 1.25; padding-top: 6px; padding-bottom: 6px; }
  /* barèmes (appréciations) : seuil, libellé, cote et suppression sur la 1re ligne ; libellé anglais dessous */
  .scale-row:not(.ev-row):not([style]) { grid-template-columns: 64px 1fr 56px 36px; }
  .scale-row:not(.ev-row):not([style]) > :nth-child(3) { grid-column: 2; grid-row: 2; }
  /* évaluations : nom sur toute la ligne, puis nom anglais, poids, suppression */
  .scale-row.ev-row { grid-template-columns: 1fr 64px 36px; }
  .scale-row.ev-row > :nth-child(1) { grid-column: 1 / -1; }
  /* vacances (emploi du temps) : deux dates, puis le libellé */
  .scale-row[style] { grid-template-columns: 1fr 1fr 36px !important; }
  .scale-row[style] > :nth-child(3) { grid-column: 1 / 3; grid-row: 2; }
}
/* pastille de la barre du bas : sur l'icône, sans pousser le libellé */
.bottomnav a { position: relative; }
.bottomnav a .nb-badge { position: absolute; top: 3px; left: calc(50% + 5px); margin: 0; min-width: 16px; height: 16px; font-size: 10px; padding: 0 4px; }
/* une étiquette longue (titre de leçon, matière) passe à la ligne au lieu d'élargir la page */
.chip { max-width: 100%; }
@media (max-width: 640px) { .chip { white-space: normal; overflow-wrap: anywhere; } .list-item > .grow { min-width: 0; overflow-wrap: anywhere; } }
/* tableaux avec des champs à remplir (catalogue des matières...) : les noms restent lisibles, le tableau défile de côté */
@media (max-width: 640px) {
  .tbl td > input.input[name="nom"], .tbl td > input.input[name="nom_en"], .tbl td > input.input[name="label"] { min-width: 140px; }
  .tbl td > input.input[name="code"] { min-width: 64px; }
}
.cb-pop.cb-tel { box-shadow: 0 0 0 100vmax rgba(0,0,0,.28), 0 10px 30px rgba(0,0,0,.25); }
/* Présence de la direction sur téléphone : les cinq choix passent sous le nom, sur toute la largeur */
@media (max-width: 640px) { .pd-seg { flex: 1 1 100%; display: flex; flex-wrap: wrap; } .pd-seg button { flex: 1 1 auto; padding-left: 6px; padding-right: 6px; } }

/* Menu rangé par thèmes (chef) */
.sb-sec { margin: 4px 0 6px; border-radius: 12px; }
.sb-sec[open] { background: rgba(255,255,255,.035); padding-bottom: 4px; }
.sb-sec > summary { display: flex; gap: 12px; align-items: center; padding: 10px 12px; color: #fff; border-radius: 10px; cursor: pointer; font-weight: 700; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; list-style: none; }
.sb-sec > summary::-webkit-details-marker { display: none; }
.sb-sec > summary .t { flex: 1; }
.sb-sec > summary::after { content: ""; width: 7px; height: 7px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform .15s; opacity: .7; margin-left: 4px; }
.sb-sec[open] > summary::after { transform: rotate(-135deg); }
.sb-sec > summary:hover { background: rgba(255,255,255,.06); }
.sb-sec > summary .ico { color: var(--acc); }
.sb-sec[open] > summary .sec-n { display: none; }
.sb-sec > summary .sec-n { position: static; margin: 0; }
.sb-sec a { padding: 9px 12px 9px 20px; font-size: 14px; }
.sb-sec a .ico { width: 18px; }

/* Tableau de bord (direction) */
.dtiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 14px; }
.dtile { position: relative; display: grid; grid-template-columns: 44px 1fr; grid-template-rows: auto auto auto; column-gap: 12px; align-items: center; padding: 14px 16px; border-radius: var(--r); text-decoration: none; color: var(--ink); background: var(--card); box-shadow: var(--sh); border-left: 5px solid var(--line); transition: transform .12s, box-shadow .12s; }
.dtile:hover { transform: translateY(-1px); box-shadow: 0 2px 4px rgba(16,35,28,.08), 0 8px 22px rgba(16,35,28,.09); }
.dtile .dt-ic { grid-row: 1 / 4; width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--soft); color: var(--pri); }
.dtile .dt-n { font-size: 28px; font-weight: 800; line-height: 1.05; color: var(--pri-d); }
.dtile .dt-l { font-weight: 600; font-size: 14px; line-height: 1.25; }
.dtile .dt-s { font-size: 12px; color: var(--muted); margin-top: 2px; }
.dtile.todo { border-left-color: var(--red); }
.dtile.todo .dt-ic { background: var(--red-l); color: var(--red); }
.dtile.todo .dt-n { color: var(--red); }
.dtile.todo .dt-s { color: var(--red); font-weight: 600; }
.dtile.calm { border-left-color: #b9dcc9; }
.dtile.calm .dt-n { color: #9bb3a8; }
.dkpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: 14px; }
.dkpi { display: flex; gap: 12px; align-items: flex-start; background: linear-gradient(135deg, var(--pri-d), var(--pri)); color: #fff; border-radius: var(--r); padding: 14px 16px; box-shadow: var(--sh); }
.dkpi .dk-ic { width: 40px; height: 40px; flex: none; border-radius: 11px; background: rgba(255,255,255,.14); display: flex; align-items: center; justify-content: center; color: var(--acc); }
.dkpi .dk-l { display: block; font-size: 13px; opacity: .85; }
.dkpi strong { display: block; font-size: 28px; line-height: 1.1; }
.dkpi .dk-s { display: block; font-size: 12px; opacity: .8; margin-top: 2px; }
.dkpi.warn { background: linear-gradient(135deg, #7a3e00, var(--warn)); }
.dk-bar { display: block; height: 5px; border-radius: 9px; background: rgba(120,190,255,.55); margin-top: 6px; overflow: hidden; }
.dk-bar > i { display: block; height: 100%; background: #ff9fc4; }
.dmain { display: grid; gap: 0 14px; }
@media (min-width: 1100px) { .dmain { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; } }
.dalert { display: flex; gap: 10px; align-items: flex-start; text-decoration: none; }
.dalert > span:first-child { flex: none; margin-top: 1px; }
.dsaisie .ds-head { display: flex; gap: 16px; align-items: center; margin-bottom: 6px; }
.ds-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ring .rg-bg { fill: none; stroke: #e6ece9; stroke-width: 9; }
.ring .rg-v { fill: none; stroke-width: 9; stroke-linecap: round; stroke: var(--pri); transition: stroke-dashoffset .6s; }
.ring text { font-size: 17px; font-weight: 800; fill: var(--ink); }
.ring.ok .rg-v { stroke: var(--ok); } .ring.mid .rg-v { stroke: #e0a100; } .ring.low .rg-v { stroke: var(--red); }
.dclass { display: grid; grid-template-columns: minmax(80px, 130px) 1fr 46px auto; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.dclass:last-child { border-bottom: 0; }
.dclass .dc-n { font-weight: 700; color: inherit; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dclass .dc-p { text-align: right; }
.dclass.low .dc-p { color: var(--red); } .dclass.mid .dc-p { color: var(--warn); } .dclass.ok .dc-p { color: var(--ok); }
.dclass .dc-m { grid-column: 1 / -1; }
.progress.low > i { background: linear-gradient(90deg, #d84339, #ef7d55); }
.progress.mid > i { background: linear-gradient(90deg, #e0a100, #f2c200); }
.dseqs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.dseq { display: flex; flex-direction: column; align-items: flex-start; min-width: 92px; padding: 8px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); cursor: pointer; }
.dseq span { font-size: 12px; color: var(--muted); }
.dseq.on { border-color: var(--ok); background: #e3f5ea; }
.dseq.on span { color: var(--ok); font-weight: 700; }
.dmini { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dmini > div { background: var(--soft); border-radius: 12px; padding: 10px 12px; }
.dmini strong { display: block; font-size: 22px; color: var(--pri-d); }
.dmini span { font-size: 12px; color: var(--muted); line-height: 1.3; display: block; }
.dmini > .warn { background: var(--warn-l); } .dmini > .warn strong { color: var(--warn); }
.dshorts { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.dshort { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--soft); color: var(--pri-d); text-decoration: none; font-weight: 600; font-size: 13.5px; line-height: 1.25; }
.dshort:hover { background: var(--pri-l); }
.dshort > span { color: var(--pri); flex: none; display: flex; }
@media (max-width: 640px) {
  .dtiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  .dtile { grid-template-columns: 1fr; padding: 12px; border-left-width: 4px; }
  .dtile .dt-ic { grid-row: auto; width: 36px; height: 36px; margin-bottom: 6px; }
  .dtile .dt-n { font-size: 24px; }
  .dtile .dt-l { font-size: 13px; }
  .dkpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .dkpi { flex-direction: column; gap: 6px; padding: 12px; } .dkpi .grow { align-self: stretch; }
  .dkpi .dk-ic { width: 32px; height: 32px; }
  .dkpi strong { font-size: 24px; }
  .dsaisie .ds-head { gap: 12px; }
  .dsaisie .ring { width: 74px; height: 74px; }
  .dclass { grid-template-columns: 1fr auto auto; grid-template-areas: "n p b" "g g g" "m m m"; row-gap: 6px; }
  .dclass .dc-n { grid-area: n; } .dclass .dc-p { grid-area: p; } .dclass > .btn, .dclass > .chip { grid-area: b; } .dclass > .progress { grid-area: g; } .dclass .dc-m { grid-area: m; }
  .dshorts { grid-template-columns: 1fr 1fr; }
}

/* Enseignant : accueil, appel, saisie, cahier (pensés d'abord pour le téléphone) */
.t-hello { margin: 0 0 12px; } .t-hello h2 { font-size: 20px; } .t-hello .small::first-letter { text-transform: uppercase; }
.t-quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.t-quick a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 14px 8px; min-height: 84px; border-radius: var(--r); background: linear-gradient(135deg, var(--pri-d), var(--pri)); color: #fff; text-decoration: none; font-weight: 600; font-size: 13.5px; text-align: center; line-height: 1.2; box-shadow: var(--sh); }
.t-quick a span { width: 38px; height: 38px; border-radius: 11px; background: rgba(255,255,255,.14); display: flex; align-items: center; justify-content: center; color: var(--acc); }
.t-quick a svg { width: 22px; height: 22px; }
.t-sec { margin: 18px 0 10px; font-size: 16px; }
.tcours { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.tcours:last-child { border-bottom: 0; }
.tcours .tc-h { width: 54px; flex: none; text-align: center; border-radius: 10px; background: var(--soft); padding: 6px 0; align-self: flex-start; }
.tcours .tc-h b { display: block; font-size: 15px; } .tcours .tc-h small { color: var(--muted); font-size: 12px; }
.tcours .tc-b { flex: 1; min-width: 0; }
.tcours .tc-a { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tcours .tc-a .btn { min-height: 36px; }
.tcours.encours .tc-h { background: var(--pri); color: #fff; } .tcours.encours .tc-h small { color: #d3e8de; }
.tcours.fini { opacity: .72; }
.assign-go { margin-top: 10px; font-weight: 700; color: var(--pri); font-size: 14px; text-align: right; }
.ge-outils { margin-bottom: 8px; }
.ge-outils > summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); font-size: 13.5px; font-weight: 600; color: var(--pri-d); margin-bottom: 8px; }
.ge-outils > summary::-webkit-details-marker { display: none; }
.ge-outils > summary::after { content: ""; width: 6px; height: 6px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); margin-left: 4px; }
.ge-outils[open] > summary::after { transform: rotate(-135deg); }
@media (min-width: 700px) { .ge-outils > summary { display: none; } }
.g-mob { display: none; }
.roll-sum { position: sticky; top: 58px; z-index: 9; display: grid; grid-template-columns: repeat(3, 1fr) auto; gap: 8px; align-items: stretch; background: var(--bg); padding: 6px 0 10px; }
.roll-sum .rs { border-radius: 12px; padding: 6px 10px; text-align: center; background: var(--card); box-shadow: var(--sh); }
.roll-sum .rs strong { display: block; font-size: 22px; line-height: 1.1; }
.roll-sum .rs span { font-size: 12px; color: var(--muted); }
.roll-sum .rs.ok strong { color: var(--ok); } .roll-sum .rs.red strong { color: var(--red); } .roll-sum .rs.warn strong { color: var(--warn); }
.roll-sum .btn { align-self: center; }
.roll-i { width: 22px; text-align: right; color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; flex: none; }
.cstats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.cstats > div { background: var(--card); border-radius: 12px; box-shadow: var(--sh); padding: 10px 12px; }
.cstats strong { display: block; font-size: 22px; color: var(--pri-d); line-height: 1.15; }
.cstats strong small { font-size: 12px; color: var(--muted); font-weight: 600; }
.cstats span { font-size: 12px; color: var(--muted); }
.lec-row.on { background: var(--pri-l); border-radius: 8px; }
@media (max-width: 640px) {
  .g-desk { display: none; } .g-mob { display: inline; }
  .t-quick a { min-height: 76px; font-size: 12.5px; padding: 10px 4px; }
  .ge-row { grid-template-columns: 26px 1fr 84px 50px; padding: 8px 10px; }
  .ge-row .nm b { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 14px; line-height: 1.25; }
  .ge-row .nm small { font-size: 11px; }
  .roll-sum { top: 56px; gap: 6px; }
  .roll-sum .rs { padding: 5px 4px; } .roll-sum .rs strong { font-size: 19px; }
  .roll-sum .btn { padding: 6px 8px; font-size: 12px; white-space: normal; line-height: 1.15; max-width: 84px; }
  .cstats { gap: 6px; } .cstats > div { padding: 8px 6px; text-align: center; } .cstats strong { font-size: 18px; } .cstats span { font-size: 11px; line-height: 1.2; display: block; }
  .roll-card p { font-size: 12.5px; }
  #fs .btns .btn { flex: 1 1 100%; justify-content: center; min-height: 46px; }
  .lec-row { flex-wrap: wrap; } .lec-row select { margin-left: 30px; }
}
@media (max-width: 640px) { .cmp-line .small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; } .cmp-line.full .small { display: block; } }
@media (min-width: 700px) { .t-quick a { flex-direction: row; min-height: 0; padding: 10px 14px; justify-content: flex-start; font-size: 14.5px; gap: 12px; } }
.note-chip { flex: none; min-width: 58px; text-align: center; font-weight: 800; font-size: 17px; color: var(--ok); background: #e3f5ea; border-radius: 10px; padding: 4px 8px; }
.note-chip small { font-size: 11px; font-weight: 600; color: var(--muted); } .note-chip.low { color: var(--red); background: var(--red-l); }
/* Listes dont chaque ligne est un lien (économat, recherche d'élève) : pas de soulignement */
a.list-item { color: inherit; text-decoration: none; }
a.list-item:hover { background: #fafcfb; }
/* Invitation aux notifications */
.push-inv { position: fixed; left: 50%; transform: translateX(-50%); bottom: 76px; z-index: 60; width: min(560px, calc(100% - 24px)); background: var(--card, #fff); border: 1px solid var(--line, #dfe7e3); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: 10px 12px; display: flex; gap: 8px; align-items: center; }
@media (min-width: 900px) { .push-inv { bottom: 20px; } }

/* ---------- Thème sombre (Mon compte → Apparence : clair, sombre ou comme l'appareil) ---------- */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1613; --card: #16211c; --ink: #e2ebe6; --muted: #9db0a7; --line: #2b3a33; --soft: #1c2a24;
  --pri: #1f9a70; --pri-d: #a9dcc6; --pri-l: #173a2e; --fond-fort: #0a2e23; --acc: #f2c200; --red: #ef6b5f; --red-l: #3b1f1c;
  --ok: #4cc485; --warn: #f0a640; --warn-l: #3a2c14; --sh: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.35);
}
html[data-theme="dark"] .input, html[data-theme="dark"] select.input, html[data-theme="dark"] textarea.input, html[data-theme="dark"] .note-in { color: var(--ink); background: #111a16; }
html[data-theme="dark"] .note-in:disabled { background: #1a2420; }
html[data-theme="dark"] .chip.gray, html[data-theme="dark"] .seqdots span, html[data-theme="dark"] .rq-step, html[data-theme="dark"] .seg { background: #22302a; }
html[data-theme="dark"] .chip.ok, html[data-theme="dark"] .dseq.on, html[data-theme="dark"] .rq-step.ok { background: #173a2a; color: var(--ok); }
html[data-theme="dark"] .rq-step.ko, html[data-theme="dark"] .tt td.busy, html[data-theme="dark"] .tg td.cf { background: #3b1f1c; color: #f2b8b1; }
html[data-theme="dark"] .progress, html[data-theme="dark"] .ring .rg-bg { background: #22302a; stroke: #22302a; }
html[data-theme="dark"] .tbl tr:hover td, html[data-theme="dark"] .ge-row.focus, html[data-theme="dark"] .edt-grid .today { background: #1b2822; }
html[data-theme="dark"] .tt td.pause, html[data-theme="dark"] .tg tr.tg-pause td { background: repeating-linear-gradient(45deg, #1a2520, #1a2520 6px, #202d27 6px, #202d27 12px); }
html[data-theme="dark"] .tg .tg-day, html[data-theme="dark"] .tg .tg-h, html[data-theme="dark"] .slot-row.is-pause, html[data-theme="dark"] .sq-card { background: #1a2520; }
html[data-theme="dark"] .tg td.hl { background: #4a3d10; box-shadow: inset 0 0 0 2px #e0a800; }
html[data-theme="dark"] .list-item.ct-visa { background: #18233a; }
html[data-theme="dark"] .login-card { background: var(--card); }
html[data-theme="dark"] .btn-d { border-color: #6a2e29; }
html[data-theme="dark"] .modal-bg { background: rgba(0,0,0,.6); }
html[data-theme="dark"] .btn, html[data-theme="dark"] .tabs a, html[data-theme="dark"] .tabs button, html[data-theme="dark"] .ptabs button { color: var(--ink); }
html[data-theme="dark"] .btn-p, html[data-theme="dark"] .tabs .active, html[data-theme="dark"] .ptabs .active { color: #fff; }
html[data-theme="dark"] .banner.info { background: #16303a; color: #cfe6ef; }
html[data-theme="dark"] .banner.warn { background: #3a2c14; color: #f4d9a8; }
html[data-theme="dark"] .push-inv { background: var(--card); }
.theme-seg { display: inline-flex; gap: 6px; flex-wrap: wrap; }
html[data-theme="dark"] .banner.red { background: #3b1f1c; color: #f2b8b1; }

/* En sombre, --pri-d est une couleur de texte claire : les fonds qui l'utilisaient prennent la couleur foncée */
html[data-theme="dark"] .sidebar { background: var(--fond-fort); }
html[data-theme="dark"] .tabs .active { background: var(--pri); border-color: var(--pri); }
html[data-theme="dark"] .toast { background: #22302a; }
html[data-theme="dark"] .dkpi { background: linear-gradient(135deg, var(--fond-fort), var(--pri)); }
html[data-theme="dark"] .topbar { background: rgba(14,22,19,.92); }
html[data-theme="dark"] .t-quick a { background: linear-gradient(135deg, var(--fond-fort), var(--pri)); }
html[data-theme="dark"] .tabwrap.more::after, html[data-theme="dark"] .tabwrap.less::before { background: linear-gradient(90deg, rgba(14,22,19,0), var(--bg) 70%); }
.vh-bulk { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-top: 6px; }
.vh-bulk label { display: inline-flex; align-items: center; gap: 6px; }

/* Paie : retenues propres à l'établissement (une ligne par retenue) */
.rg-row { display: grid; grid-template-columns: minmax(160px, 2fr) 80px 1fr 1.3fr 1.6fr auto; gap: 6px; align-items: center; margin-bottom: 6px; }
.rg-row .input { width: 100%; min-width: 0; padding-top: 6px; padding-bottom: 6px; font-size: 13.5px; }
@media (max-width: 700px) { .rg-row { grid-template-columns: 1fr 1fr; } .rg-row [data-v=libelle] { grid-column: 1 / -1; } }
