:root {
  --bg: #191919; --bg-2: #1f1f1f; --panel: #232323; --panel-2: #2a2a2a; --hover: #2f2f2f;
  --border: #303030; --border-2: #3a3a3a;
  --text: #ebebea; --text-2: #c9c9c6; --muted: #9b9a97; --faint: #6f6e69;
  --purple: #a77bf3; --purple-ink: #c9a9ff; --purple-soft: #3a2d4f; --gold: #e2b54a; --gold-soft: #3d331c;
  --green: #4dab9a; --red: #e5705d; --blue: #529cca; --orange: #ffa344; --yellow: #ffdc49;
  --bg-gray: #2f2f2f; --bg-brown: #3a2e28; --bg-orange: #44322a; --bg-yellow: #3e3624; --bg-green: #283c34;
  --bg-blue: #253645; --bg-purple: #3a2e4c; --bg-pink: #452b3b; --bg-red: #4a2c2a;
  --tc-gray: #9b9a97; --tc-brown: #ba856f; --tc-orange: #ffa344; --tc-yellow: #ffdc49; --tc-green: #4dab9a;
  --tc-blue: #529cca; --tc-purple: #a77bf3; --tc-pink: #e255a1; --tc-red: #ff7369;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.25);
  --radius: 10px; --sidebar: 248px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #ffffff; --bg-2: #fbfbfa; --panel: #ffffff; --panel-2: #f7f7f5; --hover: #efefed;
  --border: #e9e9e7; --border-2: #dcdcd9;
  --text: #37352f; --text-2: #55534e; --muted: #787774; --faint: #a5a49f;
  --purple: #7c4dd6; --purple-ink: #6436c4; --purple-soft: #f1ebfb; --gold: #b8860b; --gold-soft: #fbf3db;
  --green: #448361; --red: #d44c47; --blue: #337ea9; --orange: #d9730d; --yellow: #cb912f;
  --bg-gray: #f1f1ef; --bg-brown: #f4eeee; --bg-orange: #fbecdd; --bg-yellow: #fbf3db; --bg-green: #edf3ec;
  --bg-blue: #e7f3f8; --bg-purple: #f4f0f9; --bg-pink: #faf1f5; --bg-red: #fdebec;
  --tc-gray: #787774; --tc-brown: #9f6b53; --tc-orange: #d9730d; --tc-yellow: #cb912f; --tc-green: #448361;
  --tc-blue: #337ea9; --tc-purple: #9065b0; --tc-pink: #c14c8a; --tc-red: #d44c47;
  --shadow: 0 1px 2px rgba(15,15,15,.06), 0 8px 24px rgba(15,15,15,.08);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
.hidden { display: none !important; }

/* ---------- Boot / loading ---------- */
.boot { min-height: 100vh; display: grid; place-items: center; color: var(--muted); }
.spinner { width: 28px; height: 28px; border: 3px solid var(--border-2); border-top-color: var(--purple); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Auth ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(1200px 500px at 50% -10%, var(--purple-soft), transparent 70%), var(--bg); }
.auth-card { width: 100%; max-width: 400px; background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 32px 28px; box-shadow: var(--shadow); }
.auth-crown { font-size: 44px; line-height: 1; margin-bottom: 8px; }
.auth-card h1 { font-size: 24px; margin: 0 0 4px; letter-spacing: -.02em; }
.auth-card p.sub { margin: 0 0 22px; color: var(--muted); font-size: 14px; }
.auth-switch { margin-top: 18px; font-size: 13.5px; color: var(--muted); text-align: center; }
.auth-switch a { color: var(--purple-ink); cursor: pointer; text-decoration: none; font-weight: 500; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.input, select.input, textarea.input { width: 100%; background: var(--bg-2); border: 1px solid var(--border-2); border-radius: 8px; padding: 9px 11px; outline: none; transition: border-color .15s, box-shadow .15s; }
.input:focus { border-color: var(--purple); box-shadow: 0 0 0 3px color-mix(in srgb, var(--purple) 25%, transparent); }
textarea.input { resize: vertical; min-height: 90px; line-height: 1.5; }
textarea.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; min-height: 480px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; margin: 6px 0 12px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--purple); }
.chips-edit { display: flex; flex-wrap: wrap; gap: 6px; }
.input.calc { background: transparent; border-style: dashed; font-weight: 600; cursor: default; }
.chip-opt { border: 1px solid var(--border-2); border-radius: 999px; padding: 3px 10px; font-size: 12.5px; cursor: pointer; background: var(--bg-2); user-select: none; }
.chip-opt.on { background: var(--purple-soft); border-color: var(--purple); color: var(--purple-ink); }
.form-error { background: var(--bg-red); color: var(--tc-red); padding: 9px 12px; border-radius: 8px; font-size: 13.5px; margin-bottom: 12px; }
.form-ok { background: var(--bg-green); color: var(--tc-green); padding: 9px 12px; border-radius: 8px; font-size: 13.5px; margin-bottom: 12px; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: -6px; margin-bottom: 12px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--border-2); background: var(--panel-2); border-radius: 8px; padding: 7px 13px; cursor: pointer; font-size: 14px; font-weight: 500; text-decoration: none; white-space: nowrap; transition: background .12s, border-color .12s, opacity .12s; }
.btn:hover { background: var(--hover); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--purple); border-color: var(--purple); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #1a1405; }
.btn.danger { color: var(--tc-red); }
.btn.danger:hover { background: var(--bg-red); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--hover); }
.btn.sm { padding: 4px 9px; font-size: 13px; }
.btn.block { width: 100%; padding: 10px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Layout ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar); flex: 0 0 var(--sidebar); background: var(--bg-2); border-right: 1px solid var(--border); height: 100vh; position: sticky; top: 0; display: flex; flex-direction: column; overflow-y: auto; }
.sb-head { display: flex; align-items: center; gap: 9px; padding: 14px 14px 10px; font-weight: 600; font-size: 14.5px; }
.sb-head .crown { font-size: 20px; }
.sb-nav { padding: 4px 8px; display: flex; flex-direction: column; gap: 1px; }
.sb-link { display: flex; align-items: center; gap: 9px; padding: 6px 10px; border-radius: 6px; color: var(--text-2); text-decoration: none; font-size: 14px; cursor: pointer; }
.sb-link:hover { background: var(--hover); }
.sb-link.active { background: var(--hover); color: var(--text); font-weight: 500; }
.sb-link .ic { width: 20px; text-align: center; }
.sb-section { padding: 14px 18px 4px; font-size: 11.5px; color: var(--faint); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.sb-students { padding: 0 8px 12px; display: flex; flex-direction: column; gap: 1px; }
.sb-students .sb-link { font-size: 13.5px; padding: 4px 10px; }
.sb-search { margin: 8px 12px 4px; }
.sb-search input { width: 100%; background: var(--panel); border: 1px solid var(--border); border-radius: 7px; padding: 6px 10px; font-size: 13px; outline: none; }
.sb-foot { margin-top: auto; padding: 10px 12px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--muted); }
.main { flex: 1; min-width: 0; }
.topbar { display: none; }
.page { max-width: 1100px; margin: 0 auto; padding: 36px 48px 80px; }
.page.narrow { max-width: 860px; }

.stu-top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.stu-top-in { max-width: 1100px; margin: 0 auto; padding: 10px 48px; display: flex; align-items: center; gap: 12px; }
.stu-top .brand { display: flex; align-items: center; gap: 8px; font-weight: 600; text-decoration: none; }
.stu-top .grow { flex: 1; }
.stu-top .who { color: var(--muted); font-size: 13.5px; }

/* ---------- Headers ---------- */
.cover { height: 170px; border-radius: 0 0 14px 14px; margin: -36px -48px 0; background:
  radial-gradient(600px 220px at 15% 120%, rgba(226,181,74,.35), transparent 70%),
  radial-gradient(700px 260px at 85% -20%, rgba(167,123,243,.55), transparent 70%),
  linear-gradient(135deg, #1b1230, #2b1a4a 45%, #120c1f); position: relative; overflow: hidden; }
.cover::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(115deg, transparent 0 22px, rgba(255,255,255,.025) 22px 23px); }
.cover.inset { margin: 4px 0 0; border-radius: 14px; height: 150px; }
.page-icon { font-size: 64px; line-height: 1; margin-top: -36px; position: relative; z-index: 2; }
.page-icon.noc { margin-top: 0; }
.page-title { font-size: 38px; font-weight: 700; letter-spacing: -.025em; line-height: 1.15; margin: 10px 0 6px; }
.page-sub { color: var(--muted); margin: 0 0 18px; }
.crumbs { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 13.5px; margin-bottom: 18px; flex-wrap: wrap; }
.crumbs a { text-decoration: none; color: var(--muted); }
.crumbs a:hover { color: var(--text); }
.section-title { font-size: 22px; font-weight: 650; letter-spacing: -.015em; margin: 34px 0 12px; display: flex; align-items: center; gap: 10px; }
.section-title .grow { flex: 1; }
h2.tagline { font-size: 22px; font-weight: 650; margin: 8px 0 14px; letter-spacing: -.01em; }

/* ---------- Cards / tiles ---------- */
.callout-lg { display: flex; gap: 12px; padding: 16px 18px; border-radius: var(--radius); background: var(--bg-purple); margin: 14px 0; }
.callout-lg.gray { background: var(--bg-gray); }
.callout-lg .ic { font-size: 20px; line-height: 1.4; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin: 18px 0 6px; }
.kpi { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.kpi .lbl { font-size: 12.5px; color: var(--muted); }
.kpi .val { font-size: 24px; font-weight: 700; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .val.gold { color: var(--gold); }
.kpi .val.purple { color: var(--purple-ink); }
.kpi .note { font-size: 12px; color: var(--faint); }
.links-list { display: flex; flex-direction: column; gap: 2px; }
.link-row { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 7px; text-decoration: none; cursor: pointer; }
.link-row:hover { background: var(--hover); }
.link-row .ic { width: 22px; text-align: center; }
.link-row .t { text-decoration: underline; text-decoration-color: var(--border-2); text-underline-offset: 3px; font-weight: 500; }
.link-row .meta { margin-left: auto; color: var(--faint); font-size: 12.5px; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; text-decoration: none; display: flex; flex-direction: column; transition: transform .12s, border-color .12s, background .12s; cursor: pointer; }
.card:hover { border-color: var(--border-2); background: var(--panel-2); transform: translateY(-1px); }
.card-cover { height: 92px; position: relative; background: linear-gradient(135deg, #2b1a4a, #4a2f7a 60%, #6b4a1f); display: grid; place-items: center; }
.card-cover.novid { background: linear-gradient(135deg, var(--panel-2), var(--bg-gray)); }
.card-cover .play { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.92); color: #2b1a4a; display: grid; place-items: center; font-size: 15px; box-shadow: 0 4px 14px rgba(0,0,0,.35); }
.card-cover .date-chip { position: absolute; left: 10px; top: 10px; background: rgba(0,0,0,.45); color: #fff; font-size: 11.5px; padding: 2px 8px; border-radius: 999px; backdrop-filter: blur(4px); }
.card-body { padding: 11px 13px 13px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-title { font-weight: 600; font-size: 14px; line-height: 1.35; }
.card-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: auto; font-size: 12px; color: var(--muted); }

.stu-card { padding: 14px; gap: 8px; }
.stu-card .top { display: flex; align-items: center; gap: 10px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13.5px; color: #fff; flex: 0 0 36px; }
.stu-card .nm { font-weight: 600; line-height: 1.25; }
.stu-card .sub { font-size: 12px; color: var(--muted); }
.progress { height: 5px; background: var(--bg-gray); border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--purple), var(--gold)); border-radius: 99px; }

.pill { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 5px; font-size: 12px; font-weight: 500; white-space: nowrap; line-height: 1.6; }
.pill.gray { background: var(--bg-gray); color: var(--text-2); }
.pill.blue { background: var(--bg-blue); color: var(--tc-blue); }
.pill.purple { background: var(--bg-purple); color: var(--tc-purple); }
.pill.orange { background: var(--bg-orange); color: var(--tc-orange); }
.pill.green { background: var(--bg-green); color: var(--tc-green); }
.pill.red { background: var(--bg-red); color: var(--tc-red); }
.pill.yellow { background: var(--bg-yellow); color: var(--tc-yellow); }
.pill.brown { background: var(--bg-brown); color: var(--tc-brown); }
.pill.pink { background: var(--bg-pink); color: var(--tc-pink); }

/* ---------- Espace élève ---------- */
.space-grid { display: grid; grid-template-columns: 290px 1fr; gap: 22px; align-items: start; margin-top: 16px; }
.side-cards { display: flex; flex-direction: column; gap: 10px; position: sticky; top: 72px; }
.side-card { display: flex; gap: 11px; align-items: flex-start; padding: 13px 14px; background: var(--bg-gray); border-radius: var(--radius); text-decoration: none; transition: background .12s, transform .12s; }
a.side-card:hover { background: var(--hover); transform: translateY(-1px); }
.side-card .ic { font-size: 19px; line-height: 1.3; }
.side-card .t { font-weight: 600; font-size: 14px; }
.side-card .d { font-size: 12.5px; color: var(--muted); word-break: break-word; }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; margin-bottom: 16px; }
.panel h3 { margin: 0 0 10px; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.panel h3 .grow { flex: 1; }
.todo-list { display: flex; flex-direction: column; gap: 2px; }
.todo-row { display: flex; gap: 10px; align-items: flex-start; padding: 6px 6px; border-radius: 6px; }
.todo-row:hover { background: var(--hover); }
.todo-row input { margin-top: 4px; width: 16px; height: 16px; accent-color: var(--purple); flex: 0 0 auto; cursor: pointer; }
.todo-row .src { font-size: 11.5px; color: var(--faint); display: block; }
.todo-row.done .tx { text-decoration: line-through; color: var(--faint); }
.empty { color: var(--muted); font-size: 14px; padding: 14px 4px; }
.latest-video .n-video { margin: 0 0 8px; }

/* ---------- Session page ---------- */
.session-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.session-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--border); }
.session-nav a { max-width: 48%; text-decoration: none; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 13.5px; }
.session-nav a:hover { background: var(--hover); }
.session-nav small { display: block; color: var(--muted); font-size: 11.5px; }

/* ---------- Notion content ---------- */
.notion { font-size: 15.5px; line-height: 1.68; color: var(--text); word-wrap: break-word; }
.notion > :first-child { margin-top: 0; }
.notion h1 { font-size: 28px; line-height: 1.25; margin: 26px 0 8px; letter-spacing: -.02em; }
.notion h2 { font-size: 22px; line-height: 1.3; margin: 26px 0 8px; letter-spacing: -.01em; }
.notion h3 { font-size: 18px; line-height: 1.35; margin: 20px 0 6px; }
.notion p { margin: 6px 0; }
.notion hr { border: none; border-top: 1px solid var(--border-2); margin: 18px 0; }
.notion ul, .notion ol { margin: 4px 0; padding-left: 26px; }
.notion li { margin: 3px 0; }
.notion li > p { margin: 0; }
.notion a { color: var(--text); text-decoration: underline; text-decoration-color: var(--faint); text-underline-offset: 3px; }
.notion a:hover { text-decoration-color: var(--text); }
.notion code { background: var(--bg-gray); color: var(--tc-red); padding: 1px 5px; border-radius: 4px; font-size: .88em; }
.notion pre.n-code { background: var(--bg-2); border: 1px solid var(--border); padding: 12px 14px; border-radius: 8px; overflow-x: auto; }
.notion pre.n-code code { background: none; color: var(--text); padding: 0; }
.notion blockquote { border-left: 3px solid var(--text); margin: 10px 0; padding: 2px 14px; }
.notion blockquote[class*="bg-"] { border-left-color: transparent; border-radius: 6px; padding: 8px 14px; }
.n-callout { display: flex; gap: 10px; padding: 14px 16px; border-radius: 8px; margin: 10px 0; }
.n-callout-icon { font-size: 18px; line-height: 1.5; flex: 0 0 auto; }
.n-callout-body { flex: 1; min-width: 0; }
.n-callout-body > :first-child { margin-top: 0; }
.n-callout-body > :last-child { margin-bottom: 0; }
.n-callout-body h2, .n-callout-body h1 { margin-top: 4px; }
.n-columns { display: flex; gap: 18px; margin: 10px 0; }
.n-column { min-width: 0; }
.n-table-wrap { overflow-x: auto; margin: 12px 0; }
.n-table { border-collapse: collapse; width: 100%; font-size: 14px; }
.n-table td, .n-table th { border: 1px solid var(--border-2); padding: 7px 10px; vertical-align: top; text-align: left; }
.n-table td p { margin: 0; }
.n-table.hdr-row tr:first-child td, .n-table th { background: var(--bg-gray); font-weight: 600; }
.n-table.hdr-col td:first-child { background: var(--bg-gray); font-weight: 600; }
.n-todo { list-style: none; margin-left: -24px; }
.n-todo label { display: flex; gap: 9px; align-items: flex-start; cursor: pointer; }
.n-todo input[type=checkbox] { margin-top: 5px; width: 16px; height: 16px; accent-color: var(--purple); flex: 0 0 auto; cursor: pointer; }
.n-todo input[type=checkbox]:disabled { cursor: default; }
.n-todo.done > label > span { text-decoration: line-through; color: var(--faint); }
.n-todo-block { display: flex; gap: 9px; margin: 4px 0; }
.n-todo-block.done span { text-decoration: line-through; color: var(--faint); }
.n-toggle { margin: 6px 0; }
.n-toggle summary { cursor: pointer; font-weight: 500; }
.n-spacer { height: 6px; }
.n-video { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 10px; overflow: hidden; margin: 8px 0 4px; box-shadow: var(--shadow); }
.n-video iframe, .n-video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.n-video-link { display: inline-block; font-size: 12.5px; color: var(--muted) !important; margin-bottom: 12px; text-decoration: none !important; }
.n-video-missing { padding: 14px 16px; border-radius: 10px; background: var(--bg-gray); color: var(--text-2); font-size: 14px; margin: 8px 0 14px; }
.n-bookmark { display: flex; flex-direction: column; border: 1px solid var(--border-2); border-radius: 8px; padding: 10px 14px; margin: 8px 0; text-decoration: none !important; }
.n-bookmark:hover { background: var(--hover); }
.n-bookmark-title { font-weight: 500; }
.n-bookmark-url { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.n-mention, .n-page-link { color: var(--text-2); }
.n-page-link { margin: 4px 0; }
.n-image-missing { padding: 12px; border: 1px dashed var(--border-2); border-radius: 8px; color: var(--muted); font-size: 13.5px; margin: 8px 0; }
.n-image { border-radius: 8px; margin: 8px 0; }
.bg-gray { background: var(--bg-gray); } .bg-brown { background: var(--bg-brown); } .bg-orange { background: var(--bg-orange); }
.bg-yellow { background: var(--bg-yellow); } .bg-green { background: var(--bg-green); } .bg-blue { background: var(--bg-blue); }
.bg-purple { background: var(--bg-purple); } .bg-pink { background: var(--bg-pink); } .bg-red { background: var(--bg-red); }
.tc-gray { color: var(--tc-gray); } .tc-brown { color: var(--tc-brown); } .tc-orange { color: var(--tc-orange); } .tc-yellow { color: var(--tc-yellow); }
.tc-green { color: var(--tc-green); } .tc-blue { color: var(--tc-blue); } .tc-purple { color: var(--tc-purple); } .tc-pink { color: var(--tc-pink); } .tc-red { color: var(--tc-red); }

/* ---------- Tables (CRM) ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin: 8px 0 14px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: 8px 12px; font-size: 14px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; text-decoration: none; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--text); font-weight: 500; }
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar .grow { flex: 1; }
.toolbar input.input { max-width: 260px; padding: 6px 10px; }
.dtable-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; }
.dtable { border-collapse: collapse; width: 100%; font-size: 13.5px; }
.dtable th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12.5px; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--bg-2); position: sticky; top: 0; }
.dtable td { padding: 7px 10px; border-bottom: 1px solid var(--border); vertical-align: top; max-width: 340px; }
.dtable tr.row { cursor: pointer; }
.dtable tr.row:hover td { background: var(--hover); }
.dtable tr.group td { background: var(--bg-2); font-weight: 600; font-size: 13px; padding: 9px 10px; }
.dtable td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dtable td.nm { font-weight: 600; white-space: nowrap; }
.dtable td .clip { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dtable tfoot td { font-weight: 600; background: var(--bg-2); }
.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.kcol { flex: 0 0 270px; background: var(--bg-2); border-radius: 10px; padding: 10px; min-height: 120px; }
.kcol.over { outline: 2px dashed var(--purple); }
.kcol h4 { margin: 2px 4px 10px; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.kcol h4 .n { color: var(--faint); font-weight: 400; }
.kcard { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 10px 11px; margin-bottom: 8px; cursor: grab; font-size: 13px; }
.kcard:active { cursor: grabbing; }
.kcard .nm { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.kcard .ln { color: var(--muted); font-size: 12.5px; }

/* ---------- Drawer / modal ---------- */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 60; display: flex; justify-content: flex-end; animation: fade .15s; }
.overlay.center { justify-content: center; align-items: center; padding: 16px; }
@keyframes fade { from { opacity: 0; } }
.drawer { width: min(640px, 100%); height: 100%; background: var(--panel); border-left: 1px solid var(--border); overflow-y: auto; padding: 22px 24px 40px; animation: slide .18s ease-out; }
@keyframes slide { from { transform: translateX(30px); opacity: .6; } }
.modal { width: min(560px, 100%); max-height: 90vh; overflow-y: auto; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 22px 24px; box-shadow: var(--shadow); }
.drawer h2, .modal h2 { margin: 0 0 14px; font-size: 20px; display: flex; align-items: center; gap: 8px; }
.drawer h2 .grow, .modal h2 .grow { flex: 1; }
.fs { border: 1px solid var(--border); border-radius: 10px; padding: 14px 14px 4px; margin: 0 0 14px; }
.fs legend { font-size: 12.5px; color: var(--muted); padding: 0 6px; font-weight: 600; }
.copybox { background: var(--bg-2); border: 1px solid var(--border-2); border-radius: 8px; padding: 12px; font-size: 13.5px; white-space: pre-wrap; margin: 10px 0; max-height: 50vh; overflow-y: auto; }
.code-big { font-family: ui-monospace, Menlo, monospace; font-size: 22px; letter-spacing: .12em; font-weight: 700; color: var(--gold); }

.toast-wrap { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--text); color: var(--bg); padding: 9px 16px; border-radius: 9px; font-size: 14px; box-shadow: var(--shadow); animation: fade .2s; }
.toast.err { background: var(--red); color: #fff; }

.editor-split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.editor-split .preview { border: 1px solid var(--border); border-radius: 8px; padding: 16px; max-height: 640px; overflow-y: auto; }
.tree { display: flex; flex-direction: column; gap: 1px; }
.tree .child { margin-left: 22px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.right { margin-left: auto; }
.mt0 { margin-top: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .space-grid { grid-template-columns: 1fr; }
  .side-cards { position: static; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
  .editor-split { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .shell { display: block; }
  .sidebar { position: fixed; z-index: 70; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .sidebar.open { transform: none; }
  .topbar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--bg); z-index: 30; font-weight: 600; }
  .page { padding: 20px 16px 60px; }
  .cover { margin: -20px -16px 0; height: 120px; border-radius: 0; }
  .page-title { font-size: 28px; }
  .page-icon { font-size: 50px; margin-top: -28px; }
  .stu-top-in { padding: 10px 16px; }
  .stu-top .who { display: none; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .n-columns { flex-direction: column; gap: 4px; }
  .drawer { padding: 18px 16px 40px; }
  .section-title { font-size: 19px; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Accountability : deadlines ---------- */
.due-chip { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 500; padding: 0 7px; border-radius: 5px; background: var(--bg-blue); color: var(--tc-blue); margin-left: 6px; white-space: nowrap; line-height: 1.7; vertical-align: 1px; }
.due-chip.today { background: var(--bg-yellow); color: var(--tc-yellow); }
.due-chip.late { background: var(--bg-red); color: var(--tc-red); }
.due-chip.ok, .done .due-chip, .todo-row.done .due-chip { background: var(--bg-gray); color: var(--faint); }
.due-input { margin-left: 8px; background: var(--bg-2); border: 1px solid var(--border-2); border-radius: 6px; padding: 1px 6px; font-size: 12.5px; color: var(--text-2); }
li.n-todo:has(> .due-input) { display: flex; align-items: flex-start; gap: 8px; }
li.n-todo > label { flex: 1; min-width: 0; }
.n-todo > .due-input { flex: 0 0 auto; margin: 1px 0 0; }
.alert-late { display: flex; gap: 8px; align-items: center; background: var(--bg-red); color: var(--tc-red); border-radius: 8px; padding: 8px 12px; font-size: 13.5px; font-weight: 500; margin: 4px 0 8px; }
.acc-table td.act { min-width: 260px; max-width: 520px; }
.acc-table td.act .sess { display: block; font-size: 12px; color: var(--faint); margin-top: 2px; text-decoration: none; }
.acc-table td.act .sess:hover { color: var(--text); }
.acc-table tr.row { cursor: default; }
.acc-table tr.done td.act > span:first-child { text-decoration: line-through; color: var(--faint); }
.acc-table input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--purple); cursor: pointer; }
.acc-table input[type=date] { background: var(--bg-2); border: 1px solid var(--border-2); border-radius: 6px; padding: 3px 6px; font-size: 13px; }
.seg { display: inline-flex; background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; padding: 2px; gap: 2px; flex-wrap: wrap; }
.seg button { border: none; background: transparent; padding: 4px 10px; border-radius: 6px; font-size: 13px; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--panel-2); color: var(--text); font-weight: 500; box-shadow: 0 0 0 1px var(--border-2); }
.kpi.click { cursor: pointer; }
.kpi.click:hover { border-color: var(--border-2); }
.kpi .val.red { color: var(--tc-red); }

/* ---------- Courbe de croissance ---------- */
.g-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.g-big { font-size: 30px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.growth { position: relative; }
.growth svg { display: block; width: 100%; height: auto; overflow: visible; touch-action: pan-y; }
.g-grid { stroke: var(--border); stroke-width: 1; }
.g-grid.base { stroke: var(--border-2); }
.g-axis { fill: var(--faint); font-size: 11px; font-family: inherit; }
.g-line { fill: none; stroke: var(--purple); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.g-dot { fill: var(--purple); stroke: var(--panel); stroke-width: 2; }
.g-val { fill: var(--text); font-size: 12px; font-weight: 600; font-family: inherit; }
.g-cross { stroke: var(--faint); stroke-width: 1; stroke-dasharray: 3 3; }
.g-hit { cursor: crosshair; }
.g-tip { position: absolute; transform: translate(-50%, -100%); background: var(--panel-2); border: 1px solid var(--border-2); border-radius: 8px; padding: 6px 10px; font-size: 12.5px; line-height: 1.45; pointer-events: none; box-shadow: var(--shadow); white-space: nowrap; z-index: 2; }
.g-table summary { cursor: pointer; margin-top: 6px; }

/* ---------- Classement accountability ---------- */
.rank-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.rank-col { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; border-top: 3px solid var(--border-2); min-width: 0; }
.rank-col.r-yellow { border-top-color: var(--gold); }
.rank-col.r-purple { border-top-color: var(--purple); }
.rank-col.r-pink { border-top-color: var(--tc-pink); }
.rank-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rank-title { font-weight: 650; font-size: 15px; }
.rank-n { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rank-item { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 7px; text-decoration: none; }
.rank-item:hover { background: var(--hover); }
.rank-item .avatar { width: 24px; height: 24px; flex-basis: 24px; font-size: 10px; }
.rank-item .nm { flex: 1; min-width: 0; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-item .sc { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 820px) { .rank-grid { grid-template-columns: 1fr; } }

/* ---------- Accountability Partner ---------- */
.pill.pink { background: var(--bg-pink); color: var(--tc-pink); }
.ap-hero { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 16px 0 6px; }
.ap-rank-big { font-size: 40px; line-height: 1; }
.ap-miss { margin: 4px 0 0 18px; padding: 0; }
.ap-miss li { margin: 2px 0; }
.ap-live { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin: 6px 0 14px; }
.ap-live .kpi { padding: 10px 12px; }
.ap-table td.num { font-weight: 500; }
.ap-table td.ap-big { background: var(--bg-yellow); color: var(--tc-yellow); }
.ap-table td.ap-hos { background: var(--bg-purple); color: var(--tc-purple); }
.ap-table td.ap-low { color: var(--tc-red); }
.ap-table td.ap-none { color: var(--faint); }
.ap-table tr.me td { box-shadow: inset 0 0 0 9999px rgba(167, 123, 243, .08); }
.ap-key { display: inline-block; padding: 0 6px; border-radius: 4px; font-weight: 500; }
.ap-key.ap-big { background: var(--bg-yellow); color: var(--tc-yellow); }
.ap-key.ap-hos { background: var(--bg-purple); color: var(--tc-purple); }
.ap-key.ap-low { background: var(--bg-red); color: var(--tc-red); }
.evo { font-weight: 700; font-size: 13px; }
.evo.up { color: var(--tc-green); } .evo.down { color: var(--tc-red); } .evo.eq { color: var(--faint); }
.ap-remind { text-decoration: none; margin: 0 0 14px; padding: 12px 14px; }
.att-in { width: 64px; text-align: right; background: var(--bg-2); border: 1px solid var(--border); border-radius: 6px; padding: 4px 6px; color: var(--text); font: inherit; }
.att-in:focus { outline: 2px solid var(--purple); outline-offset: -1px; }
.fn-row { display: grid; grid-template-columns: 150px 1fr 70px; gap: 10px; align-items: center; margin: 6px 0; font-size: 13.5px; }
.fn-bar { height: 14px; background: var(--bg-gray); border-radius: 4px; overflow: hidden; }
.fn-bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--purple), var(--gold)); border-radius: 4px; }
.fn-v { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
#apf .input[type=number] { font-size: 16px; }
@media (max-width: 820px) { .ap-hero { grid-template-columns: 1fr; } .fn-row { grid-template-columns: 100px 1fr 56px; } }

/* ---------- Lien vers l'Exodus App ---------- */
.sb-link.sb-app { margin-top: 6px; border: 1px solid var(--border); color: var(--purple-ink); font-weight: 500; }
.sb-link.sb-app:hover { background: var(--purple-soft); }
@media (max-width: 640px) { .stu-top-in { flex-wrap: wrap; row-gap: 6px; } .stu-top-in .who { display: none; } }

/* ---------- Minimaliste (v11) ---------- */
.sidebar .grow { flex: 1; }
.subnav { display: flex; gap: 18px; border-bottom: 1px solid var(--border); margin: 10px 0 18px; overflow-x: auto; scrollbar-width: none; }
.subnav a { padding: 8px 0; color: var(--muted); text-decoration: none; font-size: 14px; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subnav a:hover { color: var(--text); }
.subnav a.on { color: var(--text); border-bottom-color: var(--purple); font-weight: 500; }
.topnav { display: flex; gap: 4px; margin-left: 18px; }
.topnav a { padding: 6px 10px; border-radius: 7px; color: var(--muted); text-decoration: none; font-size: 14px; white-space: nowrap; }
.topnav a:hover { background: var(--hover); color: var(--text); }
.topnav a.on { color: var(--text); background: var(--hover); font-weight: 500; }
a.kpi { text-decoration: none; color: inherit; display: block; }
.kpi.click { cursor: pointer; }
.kpi.click:hover { border-color: var(--border-2); }
.kpi.sel { border-color: var(--purple); box-shadow: 0 0 0 1px var(--purple) inset; }
details.more { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 10px; }
details.more > summary { cursor: pointer; color: var(--muted); font-size: 14px; font-weight: 500; list-style: none; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: '▸ '; }
details.more[open] > summary::before { content: '▾ '; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 4px 10px; border: 1px solid var(--border); border-radius: 99px; font-size: 13px; text-decoration: none; color: var(--text-2); }
.chip:hover { background: var(--hover); }
.att-list { max-height: 280px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.att-item { margin: 4px 0; }
@media (max-width: 640px) { .topnav { margin-left: 4px; } .topnav a { padding: 6px 7px; font-size: 13px; } .brand-t { display: none; } .att-list { grid-template-columns: 1fr; } }
