/* =========================================================
   Espace de gestion — Centre de Formation et Certification
   Palette « malachite & laiton »
   ========================================================= */
:root {
  --malachite-900: #072B23;
  --malachite-800: #0B3D32;
  --malachite-700: #0F5244;
  --malachite-600: #146B58;
  --malachite-100: #DCEEE8;
  --malachite-50:  #EEF6F3;
  --brass: #B8902A;
  --brass-soft: #F3E9CC;
  --ink: #17201D;
  --ink-2: #47544F;
  --ink-3: #75827D;
  --line: #DCE3E0;
  --line-2: #EAF0ED;
  --bg: #F2F5F4;
  --white: #FFFFFF;
  --ok: #157A4C;    --ok-bg: #E2F4EA;
  --info: #1F5FA8;  --info-bg: #E3EDF9;
  --warn: #9A6300;  --warn-bg: #FCF0D6;
  --danger: #B3261E; --danger-bg: #FBE4E2;
  --display: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --r-sm: 6px; --r-md: 10px; --r-lg: 16px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--body); font-size: 15px; line-height: 1.5; color: var(--ink); background: var(--bg); }
a { color: var(--malachite-600); }
img { max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.right { text-align: right; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.ico { flex: none; }

/* ---------- Structure ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 256px; flex: none; background: var(--malachite-800); color: #CFE3DC;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 20px 18px 18px; color: #fff; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand img { width: 40px; height: 40px; object-fit: contain; background: #fff; border-radius: 50%; padding: 3px; }
.brand strong { display: block; font-family: var(--display); font-stretch: 115%; font-size: 18px; letter-spacing: .02em; }
.brand small { display: block; font-size: 12px; color: #9DBDB2; line-height: 1.3; max-width: 170px; }
.seal-mini { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--brass); color: var(--malachite-900); font-family: var(--display); font-weight: 800; font-size: 14px; box-shadow: 0 0 0 3px var(--malachite-800), 0 0 0 4px var(--brass); }
.nav { padding: 10px 10px 20px; flex: 1; }
.nav-group { margin-top: 14px; }
.nav-title { margin: 0 10px 4px; font-size: 12px; color: #7FA699; font-weight: 600; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: var(--r-sm); color: #CFE3DC; text-decoration: none; font-weight: 500; position: relative; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active { background: var(--malachite-700); color: #fff; }
.nav a.active::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brass); }
.nav .count { margin-left: auto; font-style: normal; font-size: 12px; font-weight: 700; background: var(--brass); color: var(--malachite-900); border-radius: 20px; padding: 0 7px; }
.sidebar-foot { padding: 12px 10px 18px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-foot a { display: flex; gap: 10px; align-items: center; color: #9DBDB2; text-decoration: none; padding: 8px 10px; font-size: 14px; }
.sidebar-foot a:hover { color: #fff; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 64px; display: flex; align-items: center; gap: 16px; padding: 0 28px; background: var(--white); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.global-search { flex: 1; max-width: 460px; display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 40px; padding: 0 14px; color: var(--ink-3); }
.global-search input { border: 0; background: transparent; padding: 9px 0; flex: 1; font: inherit; outline: none; }
.topbar-user { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.user-chip { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); padding: 4px 10px 4px 4px; border-radius: 40px; }
.user-chip:hover { background: var(--bg); }
.user-chip strong { display: block; font-size: 14px; line-height: 1.2; }
.user-chip small { display: block; font-size: 12px; color: var(--ink-3); }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--malachite-100); color: var(--malachite-700); font-weight: 700; font-family: var(--display); flex: none; }
.avatar.lg { width: 64px; height: 64px; font-size: 22px; }
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; color: var(--ink-2); background: none; border: 0; cursor: pointer; }
.icon-btn:hover { background: var(--bg); color: var(--ink); }
.menu-btn { display: none; }
.content { padding: 28px; flex: 1; width: 100%; max-width: 1400px; }
.app-foot { padding: 16px 28px; font-size: 13px; color: var(--ink-3); }
.scrim { display: none; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 30px; font-weight: 750; font-stretch: 112%; margin: 0; }
.page-head .sub { margin: 4px 0 0; color: var(--ink-3); }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Boutons & formulaires ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 600 14px/1 var(--body); padding: 11px 16px; border-radius: var(--r-sm); border: 1px solid var(--malachite-700); background: var(--malachite-700); color: #fff; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--malachite-800); }
.btn-ghost { background: var(--white); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg); }
.btn-brass { background: var(--brass); border-color: var(--brass); color: var(--malachite-900); }
.btn-brass:hover { background: #A47F22; }
.btn-danger { background: var(--white); color: var(--danger); border-color: #EBC3BF; }
.btn-danger:hover { background: var(--danger-bg); }
.btn-sm { padding: 7px 10px; font-size: 13px; }
.btn-block { width: 100%; }
.link-btn { background: none; border: 0; padding: 0; color: var(--malachite-600); font: inherit; cursor: pointer; text-decoration: underline; }

label { display: block; font-weight: 600; font-size: 14px; color: var(--ink-2); }
input, select, textarea {
  display: block; width: 100%; margin-top: 6px; font: 15px/1.4 var(--body); color: var(--ink);
  padding: 10px 12px; border: 1px solid #CCD6D2; border-radius: var(--r-sm); background: var(--white);
}
input[type=checkbox], input[type=radio] { width: auto; display: inline-block; margin: 0 6px 0 0; accent-color: var(--malachite-600); }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--malachite-600); outline: 3px solid var(--malachite-100); outline-offset: 0; }
.check { display: flex; align-items: center; font-weight: 500; color: var(--ink); }
.hint { font-weight: 400; font-size: 13px; color: var(--ink-3); margin-top: 4px; display: block; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
.span3 { grid-column: span 3; }
.span-all { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; padding-top: 8px; }
fieldset { border: 0; padding: 0; margin: 0 0 6px; }
.form-section { border-top: 1px solid var(--line-2); padding-top: 18px; margin-top: 18px; }
.form-section:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.form-section > h3 { font-size: 16px; margin-bottom: 14px; color: var(--malachite-700); }

/* ---------- Panneaux ---------- */
.panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md); padding: 20px; margin-bottom: 20px; }
.panel-head { flex-wrap: wrap; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.panel-head h2 { font-size: 17px; margin: 0; font-weight: 700; }
.panel-head a { font-size: 14px; }
.panel.flush { padding: 0; overflow: hidden; }
.panel.flush .panel-head { padding: 18px 20px 0; }
.cols { display: grid; gap: 20px; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
.cols-even { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Indicateurs */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; position: relative; text-decoration: none; color: inherit; }
.kpi:hover { border-color: #BFD0CA; }
.kpi .k-label { font-size: 14px; color: var(--ink-2); font-weight: 600; display: flex; align-items: center; gap: 8px; }
.kpi .k-label .ico { color: var(--malachite-600); }
.kpi .k-value { font-family: var(--display); font-size: 30px; font-weight: 750; font-stretch: 105%; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi .k-note { font-size: 13px; color: var(--ink-3); }
.kpi.alert .k-value { color: var(--danger); }
.kpi.lead { background: var(--malachite-800); border-color: var(--malachite-800); color: #fff; }
.kpi.lead .k-label, .kpi.lead .k-note { color: #A9CBBF; }
.kpi.lead .k-label .ico { color: var(--brass); }

/* Tableaux */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 600; color: var(--ink-3); font-size: 13px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #F8FAF9; white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #FAFCFB; }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions a, .table .actions button { color: var(--ink-3); display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 6px; background: none; border: 0; cursor: pointer; vertical-align: middle; }
.table .actions a:hover, .table .actions button:hover { background: var(--bg); color: var(--malachite-700); }
.table tfoot td { font-weight: 700; border-top: 2px solid var(--line); background: #F8FAF9; }
.who { display: flex; align-items: center; gap: 10px; }
.who .avatar { width: 32px; height: 32px; font-size: 13px; }
.who strong { display: block; font-weight: 600; }
.who small { display: block; color: var(--ink-3); font-size: 12px; }
.who a { color: inherit; text-decoration: none; }
.who a:hover strong { color: var(--malachite-600); }

.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 20px; white-space: nowrap; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-muted { background: #EDF0EF; color: var(--ink-3); }

/* Filtres */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 16px; }
.filters label { font-size: 13px; }
.filters input, .filters select { margin-top: 4px; padding: 8px 10px; font-size: 14px; min-width: 160px; }
.filters .grow { flex: 1; min-width: 220px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--ink-2); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.active { color: var(--malachite-700); border-color: var(--brass); }
.tabs a .count { font-size: 12px; background: var(--bg); padding: 1px 7px; border-radius: 10px; margin-left: 4px; }

.pager { display: flex; gap: 4px; justify-content: center; padding: 14px; }
.pager a, .pager span { min-width: 34px; height: 34px; display: grid; place-items: center; border-radius: 6px; text-decoration: none; color: var(--ink-2); font-weight: 600; }
.pager a:hover { background: var(--bg); }
.pager span { background: var(--malachite-700); color: #fff; }

.flash { padding: 12px 44px 12px 16px; border-radius: var(--r-sm); margin-bottom: 16px; position: relative; border: 1px solid; font-weight: 500; }
.flash-success { background: var(--ok-bg); color: var(--ok); border-color: #BFE3CF; }
.flash-error { background: var(--danger-bg); color: var(--danger); border-color: #F0C4C0; }
.flash-warning { background: var(--warn-bg); color: var(--warn); border-color: #EDD8A6; }
.flash-x { position: absolute; right: 8px; top: 6px; background: none; border: 0; font-size: 22px; line-height: 1; cursor: pointer; color: inherit; opacity: .6; }

.empty { text-align: center; padding: 48px 20px; color: var(--ink-2); }
.empty h2 { font-size: 20px; }
.empty p { max-width: 460px; margin: 0 auto 18px; color: var(--ink-3); }

/* Fiches */
.profile-head { display: flex; gap: 18px; align-items: center; }
.profile-head h2 { font-size: 24px; margin: 0; font-stretch: 108%; }
.dl { display: grid; grid-template-columns: 170px 1fr; gap: 8px 16px; margin: 0; font-size: 14px; }
.dl dt { color: var(--ink-3); }
.dl dd { margin: 0; font-weight: 500; white-space: pre-line; }
.stat-row { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 16px; }
.stat-row div strong { display: block; font-family: var(--display); font-size: 22px; font-variant-numeric: tabular-nums; }
.stat-row div span { font-size: 13px; color: var(--ink-3); }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line-2); }
.list li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .grow strong { display: block; font-weight: 600; }
.list .grow small { color: var(--ink-3); }
.date-tile { width: 46px; text-align: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; flex: none; }
.date-tile b { display: block; font-family: var(--display); font-size: 18px; line-height: 1.5; }
.date-tile i { display: block; font-style: normal; font-size: 11px; background: var(--malachite-50); color: var(--malachite-700); font-weight: 700; }

.progress { height: 8px; background: var(--line-2); border-radius: 8px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--malachite-600); border-radius: 8px; }

/* Graphiques */
.bars { display: flex; align-items: flex-end; gap: 14px; height: 200px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar-pair { display: flex; gap: 4px; align-items: flex-end; height: 100%; width: 100%; justify-content: center; }
.bar { width: 40%; max-width: 26px; border-radius: 4px 4px 0 0; background: var(--malachite-600); min-height: 2px; position: relative; }
.bar.out { background: var(--brass); }
.bar-col small { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.hbar { display: grid; grid-template-columns: 160px 1fr 40px; gap: 10px; align-items: center; font-size: 14px; margin-bottom: 10px; }
.hbar .progress { height: 10px; }
.hbar span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Planning hebdomadaire */
.week { display: grid; grid-template-columns: repeat(7, minmax(130px, 1fr)); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--white); }
.week-day { border-right: 1px solid var(--line-2); min-height: 260px; }
.week-day:last-child { border-right: 0; }
.week-day header { padding: 10px 12px; border-bottom: 1px solid var(--line); background: #F8FAF9; }
.week-day header b { display: block; font-family: var(--display); font-size: 20px; }
.week-day header span { font-size: 13px; color: var(--ink-3); text-transform: capitalize; }
.week-day.today header { background: var(--malachite-800); color: #fff; }
.week-day.today header span { color: #A9CBBF; }
.week-day .slots { padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.slot { display: block; text-decoration: none; color: var(--ink); background: var(--malachite-50); border-left: 3px solid var(--malachite-600); border-radius: 6px; padding: 8px 9px; font-size: 13px; }
.slot:hover { background: var(--malachite-100); }
.slot b { display: block; font-variant-numeric: tabular-nums; color: var(--malachite-700); font-size: 12px; }
.slot strong { display: block; font-weight: 600; line-height: 1.3; }
.slot small { color: var(--ink-3); display: block; }
.slot.annulee { background: #F3F3F3; border-color: #BBB; text-decoration: line-through; }
.slot.realisee { border-color: var(--brass); }
.week-nav { display: flex; align-items: center; gap: 8px; }
.week-nav strong { font-family: var(--display); min-width: 220px; text-align: center; }

/* Présences : boutons radio en segments */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg label { margin: 0; font-weight: 600; font-size: 13px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 6px 11px; cursor: pointer; color: var(--ink-2); border-right: 1px solid var(--line); }
.seg label:last-child span { border-right: 0; }
.seg input:checked + span.s-present { background: var(--ok-bg); color: var(--ok); }
.seg input:checked + span.s-retard { background: var(--warn-bg); color: var(--warn); }
.seg input:checked + span.s-absent { background: var(--danger-bg); color: var(--danger); }
.seg input:checked + span.s-excuse { background: #EDF0EF; color: var(--ink); }
.seg input:focus-visible + span { outline: 2px solid var(--brass); outline-offset: -2px; }
input.note-input { width: 90px; margin: 0; padding: 7px 9px; text-align: right; }

/* ---------- Connexion ---------- */
.login-page { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; background: var(--white); }
.login-art { background: var(--malachite-800); color: #fff; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 40px; gap: 32px; position: relative; overflow: hidden; }
.login-art::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(135deg, rgba(255,255,255,.025) 0 14px, transparent 14px 28px); pointer-events: none; }
.login-seal { width: min(340px, 70%); }
.login-quote { font-family: var(--display); font-stretch: 110%; font-size: 22px; line-height: 1.35; text-align: center; color: #DCEEE8; max-width: 440px; margin: 0; }
.login-panel { display: grid; place-items: center; padding: 40px 24px; }
.login-form { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 16px; }
.login-form h1 { font-size: 26px; font-stretch: 110%; margin: 0; }
.login-form p { margin: 0 0 6px; }

/* Sceau */
.seal { width: 100%; height: auto; display: block; }
.seal-edge { fill: var(--brass); }
.seal-face { fill: var(--malachite-700); }
.seal-line { fill: none; stroke: var(--brass); stroke-width: 1.4; }
.seal-ring { fill: var(--brass-soft); font: 700 10.5px var(--display); letter-spacing: 1.6px; }
.seal-sigle { fill: #fff; font: 800 30px var(--display); font-stretch: 120%; letter-spacing: 1px; }
.seal-sub { fill: var(--brass); font: 700 9px var(--display); letter-spacing: 3px; }

/* ---------- Impression (factures, reçus, états) ---------- */
.print-body { background: #E9EDEB; padding: 24px; }
.print-bar { max-width: 820px; margin: 0 auto 14px; display: flex; justify-content: flex-end; gap: 8px; }
.sheet { max-width: 820px; margin: 0 auto; background: #fff; padding: 48px 52px; border-radius: 4px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.sheet-head { display: flex; justify-content: space-between; gap: 24px; padding-bottom: 22px; border-bottom: 3px solid var(--malachite-700); margin-bottom: 26px; }
.sheet-head .org { display: flex; gap: 14px; align-items: center; }
.sheet-head .org img, .sheet-head .org .seal-mini { width: 58px; height: 58px; }
.sheet-head .org strong { font-family: var(--display); font-size: 19px; display: block; }
.sheet-head .org small { color: var(--ink-3); display: block; font-size: 13px; }
.sheet-head .doc { text-align: right; }
.sheet-head .doc h1 { font-size: 26px; font-stretch: 115%; color: var(--malachite-700); margin: 0; }
.sheet-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; font-size: 14px; }
.sheet-meta h3 { font-size: 13px; color: var(--ink-3); font-family: var(--body); font-weight: 600; margin-bottom: 4px; }
.sheet .total-box { margin-left: auto; width: 300px; margin-top: 18px; font-size: 15px; }
.sheet .total-box div { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--line-2); }
.sheet .total-box .grand { font-weight: 800; font-size: 18px; border-bottom: 0; color: var(--malachite-700); }
.sheet-foot { margin-top: 40px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-3); text-align: center; }
.stamp { display: inline-block; border: 3px solid currentColor; padding: 6px 14px; font-family: var(--display); font-weight: 800; font-size: 20px; transform: rotate(-8deg); border-radius: 6px; letter-spacing: 2px; }
.stamp.ok { color: var(--ok); } .stamp.danger { color: var(--danger); }
.fin-table td.lvl1 { font-weight: 700; background: #F8FAF9; }
.fin-table td.ind { padding-left: 32px; }

@media print {
  body, .print-body { background: #fff; padding: 0; }
  .no-print, .sidebar, .topbar, .page-actions, .filters, .app-foot, .tabs { display: none !important; }
  .sheet { box-shadow: none; padding: 0; max-width: none; }
  .content { padding: 0; }
  .panel { border: 0; padding: 0; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols, .cols-even { grid-template-columns: 1fr; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 50; transform: translateX(-100%); transition: transform .2s ease; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(7,43,35,.45); z-index: 40; }
  .menu-btn { display: grid; }
  .topbar { padding: 0 14px; }
  .user-chip span:not(.avatar) { display: none; }
  .content { padding: 18px 14px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .span2, .span3 { grid-column: auto; }
  .login-page { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .dl { grid-template-columns: 1fr; gap: 2px; }
  .dl dd { margin-bottom: 8px; }
  .sheet { padding: 24px; }
  .sheet-head, .sheet-meta { grid-template-columns: 1fr; flex-direction: column; }
  .page-head h1 { font-size: 24px; }
  .hbar { grid-template-columns: 110px 1fr 36px; }
}
@media (max-width: 520px) { .kpis { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- Espace étudiant ---------- */
.topbar-centre { margin: 0; font-family: var(--display); font-weight: 600; color: var(--ink-2); }
.student .sidebar { background: var(--malachite-900); }
.formation-card { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--white); padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.formation-card h3 { font-size: 19px; margin: 0; }
.formation-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-bottom: 20px; }
.modules-list { margin: 0; padding-left: 22px; }
.modules-list li { padding: 5px 0; }
.modules-list li::marker { color: var(--brass); font-weight: 700; }
.agenda-day { padding: 12px 0; border-bottom: 1px solid var(--line-2); display: grid; grid-template-columns: 120px 1fr; gap: 14px; }
.agenda-day:last-child { border-bottom: 0; }
.agenda-day .d { font-family: var(--display); font-weight: 700; }
.agenda-day .d small { display: block; font-family: var(--body); font-weight: 400; color: var(--ink-3); text-transform: capitalize; }
.agenda-day .slot { margin-bottom: 6px; }
@media (max-width: 860px) { .week-panel { display: none; } .topbar-centre { display: none; } .agenda-day { grid-template-columns: 1fr; } }
