/* PPG Pédagogie — feuille de style */
:root {
  --green: #0f5d3a; --green-2: #1c7a4f; --green-soft: #e3efe7;
  --amber: #e9a420; --amber-soft: #fdf1d8;
  --red: #b4332b; --red-soft: #fbe4e1;
  --blue: #2a5d8f; --blue-soft: #e2ecf6;
  --ink: #1d2420; --ink-2: #4a544e; --muted: #7b847f;
  --bg: #f4f2ec; --card: #fff; --line: #e2dfd6;
  --radius: 10px; --shadow: 0 1px 2px rgba(20,30,25,.06), 0 4px 14px rgba(20,30,25,.05);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.5 var(--font); color: var(--ink); background: var(--bg); }
a { color: var(--green-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4, h5 { margin: 0 0 .5em; line-height: 1.25; }
h3 { font-size: 1.05rem; }
h4 { font-size: .95rem; margin-top: 1em; }
ul, ol { padding-left: 1.2em; margin: .3em 0 .8em; }
li { margin: .2em 0; }
code { background: #eee; padding: 0 .3em; border-radius: 4px; }
.muted { color: var(--muted); } .small { font-size: .85em; }
[hidden] { display: none !important; }

/* Layout --------------------------------------------------------------- */
.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { background: var(--green); color: #e9f2ec; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand, .auth-brand { display: flex; gap: .7em; align-items: center; padding: 1.1em 1em; }
.brand small, .auth-brand small { display: block; font-size: .75em; opacity: .75; }
.brand-mark { background: var(--amber); color: var(--green); font-weight: 800; letter-spacing: .03em; border-radius: 8px; padding: .45em .55em; font-size: .9em; }
.sidebar nav { flex: 1; padding: .3em .6em; overflow-y: auto; }
.sidebar nav a { display: flex; align-items: center; gap: .7em; color: #d6e7dc; padding: .6em .75em; border-radius: 8px; margin: 2px 0; }
.sidebar nav a svg { width: 18px; height: 18px; fill: currentColor; opacity: .85; flex: none; }
.sidebar nav a:hover { background: rgba(255,255,255,.08); text-decoration: none; }
.sidebar nav a.active { background: rgba(255,255,255,.14); color: #fff; box-shadow: inset 3px 0 0 var(--amber); }
.sidebar-foot { padding: 1em; border-top: 1px solid rgba(255,255,255,.12); font-size: .85em; }
.sidebar-foot small { display: block; opacity: .7; }
.logout { color: var(--amber); display: inline-block; margin-top: .5em; }
.main { min-width: 0; }
.topbar { display: flex; align-items: center; gap: 1em; padding: .9em 1.6em; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.topbar h1 { font-size: 1.15rem; margin: 0; flex: 1; }
.annee { font-size: .8em; color: var(--muted); }
.burger { display: none; background: none; border: 0; font-size: 1.4em; cursor: pointer; }
.content { padding: 1.4em 1.6em 3em; max-width: 1400px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2em; align-items: start; }
.grid-2.wide-left { grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2em; }
.stack { display: flex; flex-direction: column; gap: 1.2em; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2em 1.3em; box-shadow: var(--shadow); margin-bottom: 1.2em; }
.stack > .card, .grid-2 > .card, .grid-2 > .stack > .card { margin-bottom: 0; }
.card-alert { border-left: 4px solid var(--red); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8em; margin-bottom: 1em; }
.row-btns { display: flex; gap: .5em; flex-wrap: wrap; align-items: center; }
.row-btns.end { justify-content: flex-end; margin-top: 1em; } .row-btns.center { justify-content: center; }

/* Buttons & forms ------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4em; background: var(--green); color: #fff; border: 1px solid var(--green); padding: .55em 1.05em; border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none !important; }
.btn:hover { background: var(--green-2); }
.btn.ghost { background: transparent; color: var(--green); }
.btn.ghost:hover { background: var(--green-soft); }
.btn.block { width: 100%; } .btn.big { font-size: 1.15em; padding: .7em 1.6em; }
button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--green-2); cursor: pointer; }
.danger, button.link.danger { color: var(--red); }
label { display: flex; flex-direction: column; gap: .3em; font-size: .88em; font-weight: 600; color: var(--ink-2); }
label.check { flex-direction: row; align-items: center; gap: .5em; font-weight: 500; }
input, select, textarea { font: inherit; font-weight: 400; color: var(--ink); background: #fff; border: 1px solid #cfcbbf; border-radius: 7px; padding: .5em .65em; width: 100%; }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--green); }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(28,122,79,.35); border-color: var(--green-2); }
textarea { resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .8em 1em; }
.span2 { grid-column: 1 / -1; }
.seg { display: flex; gap: 1.2em; align-items: center; padding: .4em 0; }
.seg label { flex-direction: row; align-items: center; gap: .4em; font-weight: 500; }
.inline { display: inline; } .inline-label { flex-direction: row; align-items: center; gap: .5em; }
.inline-label input { width: auto; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 1em 1.1em; margin: 0 0 1em; }
legend { font-weight: 700; color: var(--green); padding: 0 .4em; }
fieldset.medical { border-color: #e8c1bc; background: #fffaf9; }
fieldset.medical legend { color: var(--red); }
.classe-picker { margin-bottom: 1.1em; max-width: 380px; }

/* Flash, badges, chips ------------------------------------------------- */
.flash { padding: .75em 1em; border-radius: 8px; margin-bottom: 1em; border: 1px solid; }
.flash-ok { background: var(--green-soft); border-color: #b9d8c4; color: #154d31; }
.flash-err { background: var(--red-soft); border-color: #eab9b3; color: #7e211b; }
.flash-warn { background: var(--amber-soft); border-color: #f0d394; color: #6d4a08; }
.badge { display: inline-block; font-size: .72em; font-weight: 700; padding: .15em .5em; border-radius: 999px; background: var(--green-soft); color: var(--green); vertical-align: middle; }
.badge.danger { background: var(--red-soft); color: var(--red); }
.chips { display: flex; gap: .4em; flex-wrap: wrap; }
.chip { font-size: .82em; padding: .3em .7em; border-radius: 999px; background: #ece9e0; color: var(--ink-2); }
.chip.g1, .g-card.g1 { background: var(--green-soft); color: var(--green); }
.chip.g2, .g-card.g2 { background: var(--blue-soft); color: var(--blue); }
.chip.g3, .g-card.g3 { background: var(--amber-soft); color: #7b5206; }
.sel-g { width: auto; padding: .25em .4em; font-size: .88em; }
.sel-g.g1 { border-color: #8cc2a2; } .sel-g.g2 { border-color: #9dbbd9; } .sel-g.g3 { border-color: #e7c27b; }
.note { font-size: .85em; background: var(--amber-soft); border-left: 3px solid var(--amber); padding: .6em .8em; border-radius: 0 6px 6px 0; margin: .8em 0 0; }
.empty { text-align: center; padding: 2em 1em; color: var(--muted); }
.empty .btn { margin-top: .5em; }
.back { font-weight: 600; }

/* Tables ---------------------------------------------------------------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: .9em; }
.table th, .table td { padding: .55em .6em; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table thead th { background: #f7f5f0; font-size: .8em; text-transform: uppercase; letter-spacing: .02em; color: var(--ink-2); white-space: nowrap; }
.table thead th small { text-transform: none; font-weight: 500; color: var(--muted); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table.compact th, .table.compact td { padding: .35em .5em; }
.table tr.low td { background: #fff7f5; }
.table tr.hl td { background: var(--amber-soft); font-weight: 700; }
.actions { white-space: nowrap; text-align: right; }
.actions > * { margin-left: .6em; display: inline; }

.eval-grid input.n { width: 4.2em; padding: .35em .4em; text-align: center; }
.eval-grid input.n.w { width: 5.4em; }
.eval-grid input.obs { min-width: 9em; padding: .35em .5em; }
.eval-grid select { width: auto; padding: .3em; }
.eval-grid td.who { white-space: nowrap; }
.eval-grid .sub { display: block; text-align: center; font-size: .72em; color: var(--muted); min-height: 1em; }
.eval-grid .pouls { white-space: nowrap; }
.eval-grid .pouls input { width: 3.6em; margin-right: 2px; }
.eval-grid input.warn { border-color: var(--red); background: var(--red-soft); }
.eval-grid tbody tr:hover td { background: #fbfaf6; }
.sx { font-size: .7em; padding: 0 .35em; border-radius: 4px; margin-left: .3em; }
.sx.G { background: var(--blue-soft); color: var(--blue); } .sx.F { background: #f6e3ef; color: #8b2f6a; }
td.out { font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; border-radius: 6px; }
td.out.good { color: var(--green); } td.out.mid { color: #8a5d05; } td.out.bad { color: var(--red); }
td.out.strong { font-size: 1.05em; }
td.out.g1 { color: var(--green); } td.out.g2 { color: var(--blue); } td.out.g3 { color: #8a5d05; }
.bareme-box summary { cursor: pointer; font-weight: 600; }
.bareme-box table { margin-top: .8em; max-width: 640px; }

/* Dashboard ------------------------------------------------------------- */
.hero { display: flex; justify-content: space-between; align-items: center; gap: 1.5em; flex-wrap: wrap; background: linear-gradient(120deg, var(--green), #13704a); color: #fff; border-radius: 14px; padding: 1.4em 1.6em; margin-bottom: 1.2em; }
.hero h2 { font-size: 1.4rem; } .hero p { margin: 0; max-width: 62ch; opacity: .92; }
.hero .btn { background: var(--amber); border-color: var(--amber); color: var(--green); }
.hero .btn.ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .9em; margin-bottom: 1.2em; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .9em 1.1em; font-size: .85em; color: var(--muted); box-shadow: var(--shadow); }
.kpi span { display: block; font-size: 1.8rem; font-weight: 700; color: var(--ink); line-height: 1.1; font-variant-numeric: tabular-nums; }
.class-row { display: flex; justify-content: space-between; gap: 1em; padding: .8em 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.class-row:last-child { border-bottom: 0; }
.class-id small { display: block; }
.class-actions { display: flex; gap: .9em; align-items: center; font-size: .9em; font-weight: 600; }
.progress { height: 6px; background: #ece9e0; border-radius: 4px; margin: .4em 0 .2em; width: 220px; max-width: 100%; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--green-2); }
.checklist { list-style: none; padding: 0; }
.checklist li { padding-left: 1.5em; position: relative; }
.checklist li::before { content: "✓"; position: absolute; left: 0; color: var(--green-2); font-weight: 700; }
.alert-list { list-style: none; padding: 0; }
.alert-list li { padding: .4em 0; border-bottom: 1px dashed var(--line); }
.dl { display: grid; grid-template-columns: auto 1fr; gap: .3em 1em; margin: 0; font-size: .9em; }
.dl dt { color: var(--muted); } .dl dd { margin: 0; }
.big { font-size: 1.3em; }

/* Résultats -------------------------------------------------------------- */
.bars { display: flex; flex-direction: column; gap: .5em; }
.bar-row { display: grid; grid-template-columns: 50px 1fr 28px; gap: .6em; align-items: center; font-size: .88em; }
.bar { background: #f0ede5; height: 16px; border-radius: 4px; overflow: hidden; }
.bar i { display: block; height: 100%; }
.bar .b0 { background: #c2463d; } .bar .b1 { background: #df8a3a; } .bar .b2 { background: #e8b94a; } .bar .b3 { background: #56a073; } .bar .b4 { background: var(--green); }
.bar-row b { text-align: right; }
.gain-list { list-style: none; padding: 0; max-height: 360px; overflow: auto; font-size: .9em; }
.gain-list li { display: flex; justify-content: space-between; padding: .3em 0; border-bottom: 1px solid var(--line); }
.up { color: var(--green); } .down { color: var(--red); }

/* Progressions -------------------------------------------------------------- */
.tabs { display: flex; gap: .3em; flex-wrap: wrap; background: #ebe8df; padding: .25em; border-radius: 9px; }
.tabs a { padding: .45em .9em; border-radius: 7px; color: var(--ink-2); font-weight: 600; font-size: .9em; }
.tabs a:hover { text-decoration: none; background: rgba(255,255,255,.5); }
.tabs a.active { background: #fff; color: var(--green); box-shadow: var(--shadow); }
.tabs.small a { font-size: .82em; }
.steps { display: grid; grid-template-columns: repeat(6, 1fr); gap: .5em; margin-bottom: 1.2em; }
.step { display: flex; gap: .55em; align-items: center; padding: .6em .7em; background: var(--card); border: 1px solid var(--line); border-radius: 9px; color: var(--ink-2); font-size: .82em; line-height: 1.25; }
.step b { flex: none; width: 1.9em; height: 1.9em; border-radius: 50%; display: grid; place-items: center; background: #ece9e0; color: var(--ink-2); }
.step:hover { text-decoration: none; border-color: var(--green-2); }
.step.done b { background: var(--green); color: #fff; }
.step.next { border-color: var(--amber); box-shadow: 0 0 0 2px var(--amber-soft); }
.step.next b { background: var(--amber); color: var(--green); }
.seance-sheet { padding: 1.6em 1.8em; }
.sheet-head { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5em; border-bottom: 2px solid var(--green); padding-bottom: 1em; margin-bottom: 1.2em; }
.sheet-head small { color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; font-size: .75em; }
.sheet-head h2 { font-size: 1.35rem; color: var(--green); margin-top: .2em; }
.objectifs { background: var(--green-soft); border-radius: 8px; padding: .7em .9em .7em 2em; margin: 0; font-size: .9em; }
.sheet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.6em; }
.seance-sheet h4 { display: flex; align-items: center; gap: .5em; color: var(--green); font-size: 1rem; }
.num-dot { width: 1.6em; height: 1.6em; border-radius: 50%; background: var(--green); color: #fff; display: inline-grid; place-items: center; font-size: .8em; }
.lbl { font-size: .75em; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; margin: .6em 0 .2em; }
.corps { margin: 1em 0; }
.partie { border-left: 3px solid var(--line); padding: .2em 0 .2em 1em; margin: .8em 0; }
.partie h5 { font-size: .95rem; margin-bottom: .3em; }
.groupes-run { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8em; margin-top: 1em; }
.g-card { border-radius: 10px; padding: .8em 1em; display: flex; flex-direction: column; gap: .15em; }
.g-card .fr { font-size: 1.1em; font-weight: 700; color: var(--ink); }
.g-card a { font-weight: 700; margin-top: .3em; color: inherit; }
ul.cols { columns: 2; }
.nb { background: var(--red-soft); color: #6f1f19; padding: .7em 1em; border-radius: 8px; font-size: .92em; }
.sheet-foot { display: flex; justify-content: space-between; gap: 1em; flex-wrap: wrap; font-size: .8em; color: var(--muted); border-top: 1px solid var(--line); padding-top: .8em; margin-top: 1em; }
.pager { display: flex; justify-content: space-between; font-weight: 600; }

/* Cahier ------------------------------------------------------------------ */
.cahier-entry { border: 1px solid var(--line); border-radius: 8px; padding: .8em 1em; margin-bottom: .8em; }
.cahier-entry header { display: flex; align-items: center; gap: .6em; flex-wrap: wrap; margin-bottom: .4em; }
.cahier-entry .actions { margin-left: auto; font-size: .85em; }
.cahier-entry .pre { font-size: .88em; color: var(--ink-2); }
.obs-note { font-size: .88em; background: #f7f5f0; padding: .5em .7em; border-radius: 6px; margin: .5em 0 0; }

/* Ressources ------------------------------------------------------------- */
.toc { display: flex; gap: .4em; flex-wrap: wrap; margin-bottom: 1.2em; }
.toc a { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: .35em .9em; font-size: .85em; font-weight: 600; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .8em; }
.tile { border: 1px solid var(--line); border-radius: 9px; padding: .8em 1em; }
.tile p { margin: .3em 0; font-size: .88em; }
.tile small { color: var(--green-2); font-weight: 700; font-size: .75em; text-transform: uppercase; }
.diagram { width: 100%; max-width: 460px; color: var(--green-2); font-family: var(--font); }
.diagram.small { max-width: 240px; }
.d-field { fill: var(--green-soft); stroke: var(--green-2); stroke-width: 1.5; }
.d-base { stroke: var(--green); stroke-width: 4; }
.d-wave circle { fill: var(--amber); }
.d-wave line { stroke: var(--green); stroke-width: 2; }
.d-rec { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 5 4; color: var(--muted); }
.d-edu { stroke: var(--amber); stroke-width: 2.5; }
.d-lbl { font-size: 11px; fill: var(--ink-2); } .d-lbl.big { font-size: 13px; font-weight: 700; fill: var(--green); }
.ateliers li small { color: var(--muted); }
.test-card { border: 1px solid var(--line); border-radius: 9px; padding: .9em 1.1em; }
.test-card h4 { margin-top: 0; }
.test-card p { font-size: .9em; margin: .4em 0; }

/* Outils --------------------------------------------------------------- */
.result { margin: 1em 0; }
.big-figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: .6em; }
.big-figs > div { background: #f7f5f0; border-radius: 9px; padding: .7em .8em; }
.big-figs b { display: block; font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.big-figs small { color: var(--muted); }
.big-figs .hl { background: var(--green); color: #fff; } .big-figs .hl small { color: #cfe6d7; }
.z-rest { background: var(--green-soft) !important; } .z-mid { background: var(--amber-soft) !important; }
.z-work { background: var(--blue-soft) !important; } .z-high { background: var(--red-soft) !important; }
.zones { display: flex; flex-wrap: wrap; gap: .3em; font-size: .75em; }
.z { padding: .25em .6em; border-radius: 999px; }
.z.rest { background: var(--green-soft); } .z.mid { background: var(--amber-soft); } .z.work { background: var(--blue-soft); } .z.high { background: var(--red-soft); }
.chrono-wrap { display: grid; grid-template-columns: minmax(260px, 1fr) 1.6fr; gap: 1.4em; }
.chrono-config { display: flex; flex-direction: column; gap: .8em; }
.phase-list { list-style: none; padding: 0; margin: 0; max-height: 260px; overflow: auto; font-size: .85em; border: 1px solid var(--line); border-radius: 8px; }
.phase-list:empty { display: none; }
.phase-list li { display: flex; justify-content: space-between; padding: .3em .7em; margin: 0; border-bottom: 1px solid var(--line); }
.phase-list li.work { border-left: 3px solid var(--green-2); } .phase-list li.rest { border-left: 3px solid var(--amber); color: var(--muted); }
.phase-list li.current { background: var(--amber-soft); font-weight: 700; }
.phase-list li.total { font-weight: 700; background: #f7f5f0; }
.chrono-face { border-radius: 16px; padding: 1.6em; text-align: center; background: #1f2a24; color: #fff; transition: background .3s; display: flex; flex-direction: column; justify-content: center; gap: .4em; }
.chrono-face[data-state=work] { background: var(--green); }
.chrono-face[data-state=rest] { background: #8a5d05; }
.chrono-face[data-state=done] { background: var(--blue); }
.chrono-face small, .chrono-face p { opacity: .8; }
.chrono-phase { font-size: 1.3rem; font-weight: 700; }
.chrono-time { font-size: clamp(3.5rem, 12vw, 7rem); font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; letter-spacing: -.02em; }
.chrono-bar { height: 8px; background: rgba(255,255,255,.2); border-radius: 4px; overflow: hidden; }
.chrono-bar i { display: block; height: 100%; width: 0; background: var(--amber); transition: width .2s linear; }
.chrono-next { min-height: 1.4em; opacity: .85; }
.chrono-face .btn { background: #fff; color: var(--green); border-color: #fff; }
.chrono-face .btn.ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }

/* Illustrations (Ressources) ---------------------------------------------- */
.figure { margin: .8em 0; }
.figure a { display: block; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: .4em; }
.figure img { display: block; width: 100%; height: auto; max-height: 520px; object-fit: contain; }
.figure figcaption { font-size: .82em; color: var(--ink-2); margin-top: .35em; text-align: center; }
.figures { align-items: start; }

/* Barèmes ------------------------------------------------------------------ */
.baremes-hero { background: linear-gradient(120deg, #123f5c, var(--green)); }
.mod-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.2em; }
.mod-card { display: flex; flex-direction: column; gap: .7em; margin: 0; border-top: 4px solid var(--green); }
.mod-card.mod-courses { border-top-color: #2a5d8f; } .mod-card.mod-concours { border-top-color: #b4642b; }
.mod-card.mod-force { border-top-color: var(--green); } .mod-card.mod-examens { border-top-color: #7a3e8f; }
.mod-card header { display: flex; gap: .8em; align-items: center; }
.mod-card h3 { margin: 0; } .mod-card p { margin: 0; font-size: .9em; }
.mod-card .row-btns { margin-top: auto; }
.mod-badge { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; flex: none; background: var(--green-soft); color: var(--green); }
.mod-badge.mod-courses { background: var(--blue-soft); color: var(--blue); }
.mod-badge.mod-concours { background: #f8e8db; color: #9a521e; }
.mod-badge.mod-examens { background: #f0e4f4; color: #6b337e; }
.mod-ico { width: 24px; height: 24px; fill: currentColor; }
.mod-stats { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .4em; font-size: .82em; color: var(--ink-2); }
.mod-stats li { background: #f4f2ec; border-radius: 999px; padding: .2em .7em; margin: 0; }
.mod-stats li.warn { background: var(--amber-soft); color: #7b5206; }
.mod-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1em; flex-wrap: wrap; margin-bottom: 1.2em; }
.mod-title { display: flex; gap: .9em; align-items: center; }
.mod-title h2 { font-size: 1.3rem; margin: .1em 0 .15em; } .mod-title p { margin: 0; font-size: .9em; }
.pills { display: flex; flex-wrap: wrap; gap: .35em; }
.pills a { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: .3em .85em; font-size: .85em; font-weight: 600; color: var(--ink-2); }
.pills a:hover { text-decoration: none; border-color: var(--green-2); }
.pills a.active { background: var(--green); border-color: var(--green); color: #fff; }
.bareme-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1em; align-items: start; }
.bareme-table { font-size: .84em; }
.bareme-table th, .bareme-table td { text-align: center; padding: .3em .35em; border: 1px solid var(--line); }
.bareme-table thead th { white-space: normal; line-height: 1.2; vertical-align: bottom; }
.bareme-table thead th small { display: block; font-weight: 500; }
.bareme-table thead th.off { opacity: .5; text-decoration: line-through; }
.bareme-table .sexe-head { font-size: .9rem; letter-spacing: .08em; }
.bareme-table.sexe-G .sexe-head { background: var(--blue-soft); color: var(--blue); }
.bareme-table.sexe-F .sexe-head { background: #f6e3ef; color: #8b2f6a; }
.bareme-table tbody th { background: #f7f5f0; font-weight: 800; width: 3em; }
.bareme-table tbody td { font-variant-numeric: tabular-nums; white-space: nowrap; }
.bareme-table tr.pivot td, .bareme-table tr.pivot th { background: #eef5f0; }
.bareme-table td.anomalie { background: var(--amber-soft) !important; box-shadow: inset 0 0 0 2px var(--amber); cursor: help; }
.bareme-table.edit input { width: 5.4em; padding: .2em .3em; text-align: center; font-size: .95em; }
.bareme-table.edit input.spec { width: 100%; margin-top: .3em; font-size: .85em; }
.bareme-table.edit input.dirty { background: #eef7f1; }
.bareme-table input.warn { border-color: var(--red); background: var(--red-soft); }
.check.tiny { font-size: .75em; justify-content: center; margin-top: .2em; color: var(--muted); }
.conv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: .4em; }
.conv-grid div { border: 1px solid var(--line); border-radius: 8px; text-align: center; padding: .3em; }
.conv-grid small { display: block; color: var(--muted); font-size: .72em; }
.conv-grid b { font-size: 1.1rem; }
.conv-edit input { width: 6em; }
.params-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1em 1.4em; }
.param { display: flex; flex-direction: column; gap: .25em; padding: .5em .6em; border-radius: 8px; }
.param.changed { background: #f3f8f4; box-shadow: inset 3px 0 0 var(--green-2); }
.param small.defaut { color: var(--green); font-weight: 600; }
.lbl { font-size: .88em; font-weight: 600; color: var(--ink-2); display: block; margin-bottom: .3em; }
.chip-check { background: #f4f2ec; border: 1px solid var(--line); border-radius: 999px; padding: .3em .75em; font-size: .85em; }
.chip-check:has(input:checked) { background: var(--green-soft); border-color: #b9d8c4; color: var(--green); }
.ok-line { color: var(--green); font-weight: 600; }
.rules-inline { margin: 0; padding-left: 1.1em; max-width: 80ch; }
.perf-grid input.n.w { width: 6.2em; }
.session-form { margin-top: .8em; }
.btn.icon { white-space: nowrap; }

/* Auth -------------------------------------------------------------------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1.5em; background: radial-gradient(circle at 20% 10%, #1c7a4f, var(--green) 60%); }
.auth-card { background: #fff; border-radius: 16px; padding: 1.8em; width: 100%; max-width: 420px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.auth-card.wide { max-width: 620px; }
.auth-card .auth-brand { padding: 0 0 1.2em; }
.auth-card .tabs { margin-bottom: 1.2em; }
.auth-card .stack { gap: .9em; }

/* Print -------------------------------------------------------------------- */
.print-only { display: none; }
@media print {
  body { background: #fff; font-size: 11pt; }
  .sidebar, .topbar, .no-print, .toolbar, .classe-picker, .toc, .btn, .row-btns, .steps, .pager { display: none !important; }
  .app { display: block; } .content { padding: 0; }
  .card { box-shadow: none; border: 0; padding: 0; }
  .grid-2, .grid-2.wide-left { display: block; }
  .print-only { display: block; }
  .bareme-pair { grid-template-columns: 1fr 1fr; }
  .bareme-table { font-size: 8pt; }
  .bareme-table td.anomalie { box-shadow: none; background: none !important; }
  .print-head { margin-bottom: 1em; font-size: 10pt; border-bottom: 2px solid #000; padding-bottom: .5em; }
  .sign { display: flex !important; justify-content: space-between; margin-top: 3em; }
  .table th, .table td { border-bottom: 1px solid #999; }
  input, select, textarea { border: 0; border-bottom: 1px dotted #888; border-radius: 0; padding: .2em 0; }
  a { color: #000; }
}

/* Responsive ------------------------------------------------------------------ */
@media (max-width: 1100px) {
  .grid-3 { grid-template-columns: 1fr; }
  .bareme-pair { grid-template-columns: 1fr; }
  .steps { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: -260px; width: 250px; z-index: 20; transition: left .2s; }
  .sidebar.open { left: 0; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  .burger { display: block; }
  .grid-2, .grid-2.wide-left, .sheet-grid, .sheet-head, .chrono-wrap { grid-template-columns: 1fr; }
  .content { padding: 1em; }
  .topbar { padding: .8em 1em; }
}
@media (max-width: 560px) {
  .form-grid { grid-template-columns: 1fr; }
  .groupes-run { grid-template-columns: 1fr; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  ul.cols { columns: 1; }
  .kpi span { font-size: 1.4rem; }
}

/* Comptes, abonnements et comptabilité (super administrateur) ------------ */
.nav-group { display: block; margin: 1em 1em .3em; font-size: .7em; text-transform: uppercase; letter-spacing: .08em; color: var(--amber); font-weight: 700; opacity: .9; }
.logout.on { text-decoration: underline; }
.flash-info { background: var(--blue-soft); border-color: #bcd0e6; color: #1f4a73; }
.lic-bandeau { display: flex; align-items: center; justify-content: space-between; gap: 1em; flex-wrap: wrap; }
.btn.small-btn { padding: .3em .8em; font-size: .85em; }
.lic { display: inline-block; font-size: .72em; font-weight: 700; padding: .18em .6em; border-radius: 999px; vertical-align: middle; white-space: nowrap; }
.lic-ok { background: var(--green-soft); color: var(--green); }
.lic-info { background: var(--blue-soft); color: var(--blue); }
.lic-warn { background: var(--amber-soft); color: #7b5206; }
.lic-danger { background: var(--red-soft); color: var(--red); }
.lic-muted { background: #ece9e0; color: var(--ink-2); }
.lic-msg { margin: .3em 0; font-weight: 600; }
.lic-jauge { height: 8px; background: #ece9e0; border-radius: 99px; overflow: hidden; margin: .6em 0 .2em; }
.lic-jauge span { display: block; height: 100%; background: linear-gradient(90deg, var(--green-2), var(--green)); border-radius: 99px; }
.kpi-warn span { color: #8a5d05; } .kpi-danger span { color: var(--red); }
.kpis.compact { grid-template-columns: repeat(4, minmax(110px, 1fr)); margin: 0; }
.kpis.compact .kpi span { font-size: 1.25rem; }
.compte-head { display: flex; justify-content: space-between; gap: 1.2em; flex-wrap: wrap; align-items: center; }
.compte-head h2 { margin: 0 0 .2em; display: flex; gap: .5em; align-items: center; flex-wrap: wrap; }
.compte-head p { margin: 0; }
.forfaits { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .6em; }
.forfait { cursor: pointer; display: block; margin: 0; }
.forfait input { position: absolute; opacity: 0; pointer-events: none; }
.forfait > span { display: flex; flex-direction: column; gap: .1em; border: 1.5px solid var(--line); border-radius: 10px; padding: .7em .8em; background: #fff; height: 100%; color: var(--ink); font-weight: 400; }
.forfait strong { font-size: .95em; } .forfait b { font-size: 1.15em; color: var(--green); }
.forfait small { color: var(--muted); font-size: .78em; }
.forfait:hover > span { border-color: var(--green-2); }
.forfait input:checked + span { border-color: var(--green); background: var(--green-soft); box-shadow: inset 0 0 0 1px var(--green); }
.forfait input:focus-visible + span { outline: 2px solid rgba(28,122,79,.45); }
.forfait.static { cursor: default; }
.radio-card { flex-direction: row; align-items: flex-start; gap: .7em; border: 1px solid var(--line); border-radius: 10px; padding: .7em .8em; cursor: pointer; font-weight: 400; }
.radio-card:has(input:checked) { border-color: var(--green); background: var(--green-soft); }
.radio-card input { margin-top: .25em; }
.radio-card > span { display: flex; flex-direction: column; gap: .2em; color: var(--ink); }
.radio-card small { color: var(--muted); }
input.mini { width: 6.5em; display: inline-block; padding: .3em .5em; }
.paiement-bloc { display: flex; flex-direction: column; gap: .8em; }
.inline-form { display: flex; flex-wrap: wrap; gap: .6em; align-items: flex-end; margin-bottom: .9em; }
.inline-form > input { flex: 1 1 140px; width: auto; }
.sub-form { margin: .2em 0 .9em; }
.sub-form summary { cursor: pointer; font-weight: 600; color: var(--green-2); margin-bottom: .6em; }
.op-annule td { color: var(--muted); text-decoration: line-through; }
.op-annule td small { text-decoration: none; display: inline-block; }
.cred-card { border-left: 4px solid var(--amber); }
.cred-card textarea { font-family: ui-monospace, Consolas, monospace; font-size: .85em; margin: .4em 0 .8em; }
.relances { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: .6em; }
.relance { display: flex; justify-content: space-between; align-items: center; gap: .8em; border: 1px solid var(--line); border-radius: 9px; padding: .6em .8em; flex-wrap: wrap; }
.comptes-table td.end-cell { justify-content: flex-end; white-space: nowrap; }
.journal { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .55em; font-size: .9em; }
.journal li { border-bottom: 1px dashed var(--line); padding-bottom: .45em; }
.filtres-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8em; align-items: end; margin-bottom: .8em; }
.filtres-grid .check { flex-direction: row; align-items: center; gap: .4em; }
.barres { display: flex; flex-direction: column; gap: .45em; }
.barre-ligne { display: grid; grid-template-columns: 6.5em 1fr 7.5em; gap: .6em; align-items: center; font-size: .88em; }
.barre { background: #f0ede5; border-radius: 5px; height: 16px; overflow: hidden; }
.barre span { display: block; height: 100%; background: var(--green-2); border-radius: 5px; min-width: 0; }
.barre-val { text-align: right; font-variant-numeric: tabular-nums; }
.paiement-infos { background: #f7f5f0; border-radius: 9px; padding: .7em .9em; margin: .9em 0; }
.paiement-infos p { margin: .2em 0; }
.card.narrow { max-width: 520px; }
.regles { padding-left: 1.1em; margin: .8em 0 0; }
.mt { margin-top: 1.2em; }
.chip-on { background: var(--green-soft); color: var(--green); }
.auth-title { font-size: 1.15rem; margin: 0 0 .8em; }
.auth-foot { margin: 1.2em 0 0; text-align: center; }
@media (max-width: 700px) {
  .kpis.compact { grid-template-columns: repeat(2, 1fr); }
  .barre-ligne { grid-template-columns: 5.5em 1fr 6.5em; }
  .comptes-table td.end-cell { white-space: normal; }
}
[hidden] { display: none !important; }

/* Mot de passe oublié --------------------------------------------------- */
.auth-oubli { margin: .9em 0 0; text-align: center; font-size: .9em; }
.auth-liens { display: flex; justify-content: space-between; align-items: center; gap: 1em; margin-top: 1em; font-size: .9em; }
.auth-liens form { margin: 0; }
.etapes { list-style: none; display: flex; gap: .4em; padding: 0; margin: 0 0 1em; counter-reset: etape; font-size: .8em; }
.etapes li { flex: 1; counter-increment: etape; padding: .45em .6em; border-radius: 8px; background: #ece9e0; color: var(--muted); margin: 0; }
.etapes li::before { content: counter(etape) ". "; font-weight: 700; }
.etapes li.actif { background: var(--green-soft); color: var(--green); font-weight: 600; }
.etapes li.fait { background: #f4f2ec; color: var(--ink-2); text-decoration: line-through; }
.code-otp { font-size: 1.6rem; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; }

/* Passerelle WhatsApp ---------------------------------------------------- */
.kpi .wa-pastille { display: inline-block; font-size: 1rem; padding: .25em .7em; border-radius: 999px; background: #ece9e0; color: var(--ink-2); }
.wa-pastille.ok { background: var(--green-soft); color: var(--green); }
.wa-pastille.warn { background: var(--amber-soft); color: #7b5206; }
.wa-pastille.danger { background: var(--red-soft); color: var(--red); }
.wa-pastille.info { background: var(--blue-soft); color: var(--blue); }
.wa-qr { text-align: center; padding: .6em; border: 1px dashed var(--line); border-radius: var(--radius); margin: .6em 0; }
.wa-qr img { width: 260px; max-width: 100%; height: auto; image-rendering: pixelated; background: #fff; padding: 8px; border-radius: 8px; }
.wa-info { background: var(--green-soft); color: var(--green); padding: .7em 1em; border-radius: 8px; margin: .6em 0; }
.wa-bloc { border: 1px solid var(--line); border-radius: var(--radius); padding: .8em 1em; display: flex; flex-direction: column; gap: .7em; }
.wa-bloc legend { font-weight: 600; font-size: .9em; padding: 0 .3em; }
.row-btns .inline-form { margin: 0; }
.btn.ghost.danger { color: var(--red); }

/* Historique des évaluations --------------------------------------------- */
.hist-filtres { display: flex; flex-direction: column; gap: .8em; }
.hist-champs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8em; align-items: end; }
.hist-raccourcis { display: flex; flex-wrap: wrap; gap: .4em; align-items: center; }
.hist-raccourcis .chip:hover { text-decoration: none; background: var(--green-soft); }
.chip.on { background: var(--green); color: #fff; }
.mod-badge-txt { display: inline-flex; align-items: center; gap: .35em; font-size: .82em; font-weight: 600; padding: .2em .65em; border-radius: 999px; background: var(--green-soft); color: var(--green); white-space: nowrap; }
.mod-badge-txt .mod-ico { width: 15px; height: 15px; fill: currentColor; }
.mod-badge-txt.mod-courses { background: var(--blue-soft); color: var(--blue); }
.mod-badge-txt.mod-concours { background: #f8e8db; color: #9a521e; }
.mod-badge-txt.mod-examens { background: #f0e4f4; color: #6b337e; }
.txt-danger { color: var(--red); }
.hist-table td { vertical-align: top; }
.hist-doc-tete h2 { margin: .4em 0 .1em; }
.hist-infos { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .6em 1.2em; margin: 1em 0 0; }
.hist-infos dt { font-size: .75em; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.hist-infos dd { margin: 0; font-weight: 600; }
.hist-pv th.center, .hist-pv td.center { text-align: center; }
.hist-pv tr.groupes th { text-align: center; background: var(--green-soft); color: var(--green); border-left: 1px solid #fff; }
.hist-pv tr.groupes th:empty { background: transparent; }
.hist-pv tr.absent td { color: var(--muted); font-style: italic; }
@media (max-width: 560px) {
  .hist-champs { grid-template-columns: 1fr 1fr; }
  .hist-champs .row-btns { grid-column: 1 / -1; }
}
