/* ==========================================================================
   PAGES — styles propres à certaines pages (tableau de bord, CRM, Qualiopi…)
   ========================================================================== */

.grid-2 { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 18px; }
@media (max-width: 960px) { .grid-2 { grid-template-columns: 1fr; } }
.grid-2 .card + .card { margin-top: 0; }

.section-title { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 800; margin: 30px 0 14px; letter-spacing: -.02em; }
.section-title::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.sub-title { font-size: 12px; font-weight: 800; margin-bottom: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: .07em; }
.link-more { font-size: 12.5px; font-weight: 700; color: var(--brand-600); white-space: nowrap; }
.link-more:hover { text-decoration: none; color: var(--brand-700); }

.list-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 20px; border-bottom: 1px solid var(--border);
  color: inherit; text-decoration: none; transition: background .12s;
}
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: var(--surface-2); text-decoration: none; }
.cell-sub { font-size: 12px; color: var(--text-3); }
.cell-main { font-weight: 700; }

/* Vignette date (calendrier) */
.date-tile {
  width: 48px; flex: none; border-radius: 13px; overflow: hidden; text-align: center;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-xs);
}
.date-tile small { display: block; padding: 2px 0; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #fff; background: var(--grad-brand); }
.date-tile b { display: block; padding: 4px 0 5px; font-size: 18px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.date-tile--empty small { background: var(--surface-3); color: var(--text-3); }

.modal__icon--danger { background: var(--danger); box-shadow: 0 10px 22px -8px rgba(220, 38, 38, .6); }

/* ==========================================================================
   TABLEAU DE BORD
   ========================================================================== */
.hero {
  position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center;
  padding: 30px 32px; margin-bottom: 22px; border-radius: var(--r-xl); color: #fff;
  background:
    radial-gradient(520px 260px at 92% -20%, rgba(244, 114, 182, .45), transparent 60%),
    radial-gradient(480px 300px at 0% 120%, rgba(56, 189, 248, .40), transparent 60%),
    linear-gradient(120deg, #4338ca 0%, #6d28d9 55%, #9333ea 100%);
  box-shadow: 0 22px 44px -18px rgba(79, 70, 229, .55);
}
.hero::after { /* motif de points */
  content: ''; position: absolute; inset: 0; opacity: .18; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .9) 1px, transparent 1px); background-size: 18px 18px;
  mask-image: linear-gradient(90deg, transparent 40%, #000); -webkit-mask-image: linear-gradient(90deg, transparent 40%, #000);
}
.hero__main, .hero__stats { position: relative; z-index: 1; }
.hero__date { display: inline-block; padding: 4px 11px; border-radius: 99px; font-size: 12px; font-weight: 700; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .22); }
.hero h1 { font-size: 30px; font-weight: 800; letter-spacing: -.04em; margin: 12px 0 6px; }
.hero p { color: rgba(255, 255, 255, .82); font-size: 14.5px; max-width: 560px; }
.hero__actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 20px; }
.hero__stats { display: grid; gap: 12px; min-width: 230px; }
.hero__stat { padding: 14px 18px; border-radius: 16px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .2); backdrop-filter: blur(10px); }
.hero__stat small { display: block; font-size: 12px; color: rgba(255, 255, 255, .75); font-weight: 600; }
.hero__stat b { display: block; font-size: 26px; font-weight: 800; letter-spacing: -.03em; line-height: 1.2; }
.hero__stat b em { font-style: normal; font-size: 14px; opacity: .7; margin-left: 2px; }
.hero__stat span { font-size: 11.5px; color: rgba(255, 255, 255, .7); }
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; padding: 22px 20px; border-radius: var(--r-lg); }
  .hero h1 { font-size: 24px; }
  .hero__stats { grid-template-columns: 1fr 1fr; min-width: 0; }
  .hero__stat { padding: 11px 13px; }
  .hero__stat b { font-size: 20px; }
}
@media (max-width: 480px) { .hero__actions .btn { flex: 1 1 auto; } }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; }
.dash-grid .card + .card { margin-top: 0; }
@media (max-width: 1100px) { .dash-grid { grid-template-columns: 1fr; } }

/* Anneau (donut) */
.donut { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; justify-content: center; }
.donut__chart { position: relative; width: 150px; height: 150px; flex: none; }
.donut__chart svg { width: 100%; height: 100%; }
.donut__center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.donut__center b { font-size: 26px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.donut__center small { font-size: 11.5px; color: var(--text-3); }
.donut__legend { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 170px; display: grid; gap: 9px; }
.donut__legend li { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.donut__legend i { width: 10px; height: 10px; border-radius: 4px; flex: none; }
.donut__legend b { font-variant-numeric: tabular-nums; }
.donut__legend em { font-style: normal; color: var(--text-3); font-size: 12px; width: 40px; text-align: right; }

/* Barres */
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 16px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 4px; margin-right: 6px; vertical-align: -1px; }
.dot--success { background: #10b981; } .dot--info { background: #6366f1; } .dot--warning { background: #f59e0b; }
.bar { margin-bottom: 15px; }
.bar__head { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.bar__track { display: flex; height: 12px; background: var(--surface-2); border-radius: 99px; overflow: hidden; gap: 2px; }
.bar__seg { display: block; height: 100%; border-radius: 99px; transition: width .6s var(--ease); }
.bar__seg--success { background: linear-gradient(90deg, #059669, #34d399); }
.bar__seg--info { background: linear-gradient(90deg, #4f46e5, #818cf8); }
.bar__seg--warning { background: linear-gradient(90deg, #d97706, #fbbf24); }
.bars-total { display: flex; justify-content: space-between; border-top: 1px dashed var(--border-2); padding-top: 14px; margin-top: 6px; font-weight: 800; }
.bars-total b { color: var(--brand-600); font-size: 16px; }

/* Frise des sessions */
.timeline__item { display: flex; gap: 14px; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--border); color: inherit; text-decoration: none; transition: background .12s; }
.timeline__item:last-child { border-bottom: 0; }
.timeline__item:hover { background: var(--surface-2); text-decoration: none; }
.timeline__fill { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.timeline__fill .progress { flex: 1; }
.timeline__fill span { font-size: 12px; font-weight: 700; color: var(--text-2); font-variant-numeric: tabular-nums; }

/* À faire */
.todo-list { padding: 8px; }
.todo { --tone: var(--warning); --tone-bg: var(--warning-bg); display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: var(--r-md); color: inherit; text-decoration: none; transition: background .15s; }
.todo:hover { background: var(--surface-2); text-decoration: none; }
.todo b { display: block; font-size: 13.5px; }
.todo small { display: block; font-size: 12px; color: var(--text-3); }
.todo__icon { width: 38px; height: 38px; border-radius: 12px; flex: none; display: grid; place-items: center; background: var(--tone-bg); color: var(--tone); }
.todo > .i { color: var(--text-3); width: 16px; height: 16px; transition: transform .15s; }
.todo:hover > .i { transform: translateX(3px); color: var(--brand-600); }
.todo--info { --tone: var(--info); --tone-bg: var(--info-bg); }
.todo--danger { --tone: var(--danger); --tone-bg: var(--danger-bg); }
.todo--violet { --tone: var(--violet); --tone-bg: var(--violet-bg); }
.todo--sky { --tone: var(--sky); --tone-bg: var(--sky-bg); }

/* Pipeline */
.pipeline { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 720px) { .pipeline { grid-template-columns: 1fr; } }
.pipeline__col { --tone: var(--warning); background: var(--surface-2); border-radius: var(--r-md); padding: 12px; border-top: 3px solid var(--tone); }
.pipeline__col--info { --tone: var(--brand-500); }
.pipeline__col--success { --tone: var(--success); }
.pipeline__head { display: flex; align-items: center; justify-content: space-between; margin: 2px 4px 12px; font-size: 12px; color: var(--text-2); }
.pipeline__name { font-size: 13px; font-weight: 800; color: var(--text); }
.pipeline__name em { font-style: normal; margin-left: 4px; padding: 1px 7px; border-radius: 99px; background: var(--surface); font-size: 11px; color: var(--text-2); }
.pipeline__item { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 9px 10px; margin-bottom: 7px; color: inherit; text-decoration: none; transition: box-shadow .15s, transform .15s; }
.pipeline__item:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); text-decoration: none; }
.pipeline__more, .pipeline__empty { display: block; text-align: center; color: var(--text-3); font-size: 12px; padding: 8px; font-weight: 600; }`n.kcol .pipeline__empty { padding: 22px 8px; border: 1.5px dashed var(--border-2); border-radius: var(--r-md); }

/* ==========================================================================
   CRM : kanban
   ========================================================================== */
.kanban { display: grid; grid-template-columns: repeat(5, minmax(190px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 10px; scroll-snap-type: x proximity; }
.kcol { background: var(--surface-2); border-radius: var(--r-lg); padding: 12px; min-height: 140px; scroll-snap-align: start; border: 1px solid var(--border); }
.kcol__head { display: flex; justify-content: space-between; align-items: center; margin: 0 2px 12px; }
.kcol__head .muted { font-weight: 800; font-size: 12px; padding: 1px 8px; border-radius: 99px; background: var(--surface); color: var(--text-2); }
.kcard {
  display: flex; flex-direction: column; gap: 6px; width: 100%; text-align: left; position: relative;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 11px 12px; margin-bottom: 9px;
  font-size: 12.5px; box-shadow: var(--shadow-xs); transition: box-shadow .15s, transform .15s, border-color .15s; color: var(--text);
}
.kcard:hover { transform: translateY(-2px); border-color: var(--border-2); }
.kcard__top { display: flex; align-items: center; gap: 9px; min-width: 0; }
.kcard__top b { font-size: 13px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.kcard__warn { font-style: normal; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: var(--warning); color: #fff; font-size: 11px; font-weight: 800; flex: none; }
.kcard > span:not(.kcard__top):not(.kcard__foot) { font-size: 12px; color: var(--text-3); }
.kcard__foot { display: flex; justify-content: space-between; align-items: center; font-size: 11.5px; color: var(--text-3); }
.kcard__foot em { font-style: normal; }
.kcard__foot strong { padding: 1px 8px; border-radius: 99px; font-size: 11px; background: var(--surface-2); }
.kcard--success { box-shadow: inset 3px 0 0 var(--success), var(--shadow-xs); }
.kcard--warning { box-shadow: inset 3px 0 0 var(--warning), var(--shadow-xs); }
.kcard--danger  { box-shadow: inset 3px 0 0 var(--danger), var(--shadow-xs); }
.text-success { color: var(--success); } .text-warning { color: var(--warning); } .text-danger { color: var(--danger); }
@media (max-width: 720px) { .kanban { grid-template-columns: repeat(5, 80vw); margin: 0 -14px; padding: 0 14px 10px; } }

.history { margin-top: 22px; border-top: 1px solid var(--border); padding-top: 16px; }
.history__head { margin-bottom: 10px; font-size: 13px; }
#crm-history { max-height: 190px; overflow-y: auto; margin-bottom: 12px; padding-left: 14px; border-left: 2px solid var(--border); }
.history__item { position: relative; background: var(--surface-2); border-radius: var(--r-sm); padding: 9px 12px; margin-bottom: 8px; font-size: 13px; }
.history__item::before { content: ''; position: absolute; left: -21px; top: 13px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand-500); box-shadow: 0 0 0 3px var(--surface); }
.history__add { display: grid; grid-template-columns: 140px 1fr auto; gap: 8px; }
@media (max-width: 720px) { .history__add { grid-template-columns: 1fr; } }

/* ==========================================================================
   QUALIOPI
   ========================================================================== */
.crit { --tone: var(--brand-600); --tone-bg: var(--brand-50); overflow: hidden; }
.crit .card__head { background: linear-gradient(90deg, var(--tone-bg), transparent 70%); }
.crit--success { --tone: var(--success); --tone-bg: var(--success-bg); }
.crit--warning { --tone: var(--warning); --tone-bg: var(--warning-bg); }
.crit--violet  { --tone: var(--violet);  --tone-bg: var(--violet-bg); }
.crit--danger  { --tone: var(--danger);  --tone-bg: var(--danger-bg); }
.crit__num { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; font-weight: 800; font-size: 15px; background: var(--tone); color: #fff; }
.crit__intro { font-size: 13px; color: var(--text-2); line-height: 1.75; margin-bottom: 16px; padding: 10px 14px; border-radius: var(--r-sm); background: var(--surface-2); }
.crit .ok { color: var(--success); } .crit .todo { color: var(--warning); display: inline; padding: 0; }

/* ==========================================================================
   AMÉLIORATION, E-LEARNING, MAILS
   ========================================================================== */
.idea { position: relative; overflow: hidden; }
.idea::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--warning); }
.idea--danger::before { background: var(--danger); } .idea--success::before { background: var(--success); }
.idea__title { font-size: 15px; }
.note-box { margin-top: 12px; padding: 10px 13px; background: var(--surface-2); border-radius: var(--r-sm); font-size: 13px; color: var(--text-2); }

.creds { display: grid; gap: 10px; }
.creds > div { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; background: var(--grad-soft); border: 1px solid var(--border); border-radius: var(--r-md); }
.creds span { color: var(--text-2); font-size: 12.5px; font-weight: 600; }
.creds b { font-size: 17px; letter-spacing: .05em; }

.mail-preview {
  white-space: pre-wrap; font-family: var(--font); font-size: 13.5px; line-height: 1.7;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); padding: 18px; max-height: 360px; overflow: auto; margin: 0;
}

/* Bandeaux */
.global-alert { margin: 16px 28px 0; }
@media (max-width: 960px) { .global-alert { margin: 12px 14px 0; } }

.demo-banner { position: fixed; z-index: 200; left: 50%; bottom: 12px; transform: translateX(-50%); background: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning); border-radius: 99px; padding: 5px 14px; font-size: 12px; font-weight: 700; pointer-events: none; white-space: nowrap; }
@media (max-width: 960px) { .demo-banner { bottom: auto; top: calc(62px + var(--safe-top)); font-size: 10.5px; padding: 2px 10px; opacity: .9; } }

/* ==========================================================================
   MISSIONS DU JOUR
   ========================================================================== */
.day-nav { display: flex; align-items: center; gap: 4px; padding: 3px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
.day-nav__date { width: auto; min-height: 34px; padding: 5px 9px; border: 0; background: transparent; font-weight: 700; }
.day-nav__date:focus { box-shadow: none; }

.ring { position: relative; flex: none; display: grid; place-items: center; }
.ring svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ring circle { transition: stroke-dasharray .6s var(--ease); }
.ring b { position: relative; font-size: 13px; font-weight: 800; letter-spacing: -.02em; }

.mission-card { overflow: hidden; }
.mission-card__head { display: flex; align-items: center; gap: 16px; padding: 20px 22px; background: var(--grad-soft); border-bottom: 1px solid var(--border); }
.mission-card__head h2 { font-size: 19px; font-weight: 800; letter-spacing: -.02em; }
.mission-card__head p { color: var(--text-2); font-size: 13px; }
.mission-list { padding: 10px; display: grid; gap: 6px; }
.mission-card__foot { padding: 14px 22px 20px; display: flex; justify-content: flex-end; }
.mission-card__foot .alert { flex: 1; }

.mission {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; text-align: left;
  border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); color: var(--text);
  transition: border-color .15s, background .15s, transform .1s, box-shadow .15s;
}
.mission:not(:disabled):hover { border-color: var(--brand-500); box-shadow: var(--shadow-sm); }
.mission:not(:disabled):active { transform: scale(.995); }
.mission b { display: block; font-size: 14.5px; }
.mission small { display: block; font-size: 12.5px; color: var(--text-3); margin-top: 1px; }
.mission__box {
  width: 26px; height: 26px; flex: none; border-radius: 8px; border: 2px solid var(--border-2);
  display: grid; place-items: center; color: #fff; transition: all .2s var(--ease);
}
.mission__box .i { width: 16px; height: 16px; stroke-width: 3; }
.mission__ico { width: 36px; height: 36px; flex: none; border-radius: 11px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-600); }
.mission__ico .i { width: 18px; height: 18px; }
.mission__tag { display: inline-block !important; margin-top: 5px !important; padding: 1px 8px; border-radius: 99px; background: var(--violet-bg); color: var(--violet) !important; font-weight: 700; font-size: 11px !important; }
.mission__done { display: inline-flex; align-items: center; gap: 6px; flex: none; font-size: 12px; font-weight: 700; color: var(--success); }
.mission__done .i { width: 14px; height: 14px; }
.mission__confirm { flex: none; font-size: 12px; font-weight: 800; color: var(--brand-600); animation: pulse 1s infinite; }
.mission.is-done { background: var(--success-bg); border-color: color-mix(in srgb, var(--success) 30%, transparent); cursor: default; }
.mission.is-done b { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--success) 60%, transparent); color: var(--text-2); }
.mission.is-done .mission__box { background: var(--success); border-color: var(--success); }
.mission.is-done .mission__ico { background: color-mix(in srgb, var(--success) 15%, transparent); color: var(--success); }
.mission.is-armed { border-color: var(--brand-500); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-500) 18%, transparent); }
.mission.is-armed .mission__box { border-color: var(--brand-500); background: var(--brand-50); }
.mission:disabled:not(.is-done) { opacity: .6; }
@media (max-width: 720px) {
  .mission { padding: 12px; gap: 10px; flex-wrap: wrap; }
  .mission__ico { display: none; }
  .mission__done, .mission__confirm { width: 100%; padding-left: 36px; }
  .mission-card__foot .btn { width: 100%; }
}

.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.team-grid .card + .card { margin-top: 0; }
.team-card { padding: 18px; }
.team-card__head { display: flex; align-items: center; gap: 12px; }
.team-card__head b { display: block; font-size: 15px; }
.team-card__head small { display: block; font-size: 12px; color: var(--text-3); }
.team-card__status { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 14px 0 10px; font-size: 12px; }
.team-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.team-list li { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: var(--r-sm); font-size: 13px; }
.team-list li:hover { background: var(--surface-2); }
.team-list__dot { width: 18px; height: 18px; flex: none; border-radius: 6px; border: 2px solid var(--border-2); display: grid; place-items: center; color: #fff; }
.team-list__dot .i { width: 12px; height: 12px; stroke-width: 3; }
.team-list li.is-done .team-list__dot { background: var(--success); border-color: var(--success); }
.team-list li.is-done .grow { color: var(--text-2); }
.team-list__time { font-size: 11.5px; font-weight: 700; color: var(--success); }
.team-list .icon-btn { width: 26px; height: 26px; opacity: .5; }
.team-list .icon-btn:hover { opacity: 1; }

.hist-table td, .hist-table th { padding: 10px 12px; }
.hist { display: inline-block; min-width: 54px; padding: 3px 8px; border-radius: 99px; font-size: 12px; font-weight: 800; }
.hist--success { background: var(--success-bg); color: var(--success); }
.hist--info { background: var(--info-bg); color: var(--info); }
.hist--warning { background: var(--warning-bg); color: var(--warning); }
.hist--danger { background: var(--danger-bg); color: var(--danger); }

.mg-membre { margin-bottom: 20px; }
.mg-membre__head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.file-row.is-off { opacity: .5; }
.file-row__type .i { width: 18px; height: 18px; }

/* Widget « missions » du tableau de bord */
.dash-missions { margin-bottom: 22px; }
.dash-missions__row { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border); color: inherit; text-decoration: none; }
.dash-missions__row:last-child { border-bottom: 0; }
.dash-missions__row:hover { background: var(--surface-2); text-decoration: none; }
.dash-missions__row .progress { width: 120px; flex: none; }
@media (max-width: 720px) { .dash-missions__row .progress { width: 70px; } }
/* ==========================================================================
   MESSAGERIE & PRÉSENCE
   ========================================================================== */
.chat-btn { position: relative; }
.chat-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; display: inline-grid; place-items: center; font-size: 11px; font-weight: 800; color: #fff; background: #ef4444; flex: none; }
.chat-badge--top { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; font-size: 10px; box-shadow: 0 0 0 2px var(--bg); }

.presence-dot { position: absolute; right: -2px; bottom: -2px; width: 12px; height: 12px; border-radius: 50%; background: var(--border-2); box-shadow: 0 0 0 2.5px var(--surface); }
.presence-dot.is-on { background: #10b981; }
.chat-av, .chat-online__p { position: relative; display: inline-flex; flex: none; }

.chat-panel {
  position: fixed; z-index: 65; top: 0; right: 0; bottom: 0; width: min(410px, 100vw);
  display: flex; flex-direction: column; background: var(--surface); border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg); animation: chat-in .28s var(--ease);
  padding-top: var(--safe-top); padding-bottom: var(--safe-bottom);
}
@keyframes chat-in { from { transform: translateX(40px); opacity: 0; } }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 14px 18px; border-bottom: 1px solid var(--border); }
.chat-head b { display: block; font-size: 16px; letter-spacing: -.01em; }
.chat-head small { display: block; font-size: 12px; color: var(--text-3); }
.chat-body { flex: 1; overflow-y: auto; padding: 8px 0 16px; }
.chat-section { padding: 14px 18px 6px; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.chat-team { background: var(--grad-brand) !important; color: #fff !important; }
.chat-team .i { width: 18px; height: 18px; }

.chat-online { display: flex; gap: 12px; padding: 12px 18px 4px; overflow-x: auto; }
.chat-online__p { flex-direction: column; align-items: center; gap: 4px; border: 0; background: none; padding: 0; width: 52px; color: var(--text-2); }
.chat-online__p .avatar { width: 46px; height: 46px; border-radius: 16px; font-size: 14px; }
.chat-online__p .presence-dot { top: 34px; right: 2px; bottom: auto; }
.chat-online__p small { font-size: 11px; font-weight: 600; max-width: 52px; }

.chat-conv { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 18px; border: 0; background: none; text-align: left; color: var(--text); transition: background .12s; }
.chat-conv:hover { background: var(--surface-2); }
.chat-conv__top { display: flex; justify-content: space-between; gap: 8px; }
.chat-conv__top small { font-size: 11px; color: var(--text-3); flex: none; }
.chat-conv__sub { display: block; font-size: 12.5px; color: var(--text-3); }
.chat-conv.has-unread b, .chat-conv.has-unread .chat-conv__sub { color: var(--text); font-weight: 700; }
.chat-notif { display: flex; align-items: center; gap: 8px; margin: 8px 14px 0; padding: 9px 12px; width: calc(100% - 28px); border: 1px dashed var(--border-2); border-radius: var(--r-sm); background: var(--surface-2); color: var(--text-2); font-size: 12.5px; font-weight: 600; }
.chat-notif .i { width: 16px; height: 16px; color: var(--warning); }

.chat-thread { padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; background: var(--bg); }
.chat-day { align-self: center; margin: 12px 0 6px; padding: 3px 10px; border-radius: 99px; font-size: 11px; font-weight: 700; color: var(--text-3); background: var(--surface); border: 1px solid var(--border); }
.chat-msg { display: flex; flex-direction: column; align-items: flex-start; max-width: 82%; margin-top: 8px; }
.chat-msg.is-cont { margin-top: 2px; }
.chat-msg.is-mine { align-self: flex-end; align-items: flex-end; }
.chat-msg__from { font-size: 11.5px; font-weight: 700; color: var(--brand-600); margin: 0 0 2px 10px; }
.chat-msg__bubble { padding: 9px 13px; border-radius: 16px 16px 16px 5px; background: var(--surface); border: 1px solid var(--border); font-size: 14px; line-height: 1.45; word-wrap: break-word; overflow-wrap: anywhere; }
.chat-msg.is-mine .chat-msg__bubble { background: var(--grad-brand); color: #fff; border-color: transparent; border-radius: 16px 16px 5px 16px; }
.chat-msg__time { font-size: 10.5px; color: var(--text-3); margin: 2px 6px 0; }
.chat-input { display: flex; gap: 8px; align-items: flex-end; padding: 12px 14px; border-top: 1px solid var(--border); background: var(--surface); }
.chat-input .input { resize: none; min-height: 44px; max-height: 140px; border-radius: 14px; padding: 11px 14px; line-height: 1.4; }
.chat-send { width: 44px; height: 44px; min-height: 44px; padding: 0; border-radius: 14px; flex: none; }

.chat-toast { width: 100%; text-align: left; border: 1px solid var(--border); cursor: pointer; }
.chat-toast b { display: block; font-size: 13px; }
.chat-toast small { display: block; font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.chat-toast .avatar { width: 36px; height: 36px; padding: 0; }

/* Bandeau « En ligne » du menu latéral */
.online-strip { position: relative; margin: 6px 0 10px; padding: 10px 12px; border-radius: var(--r-md); background: rgba(255, 255, 255, .04); border: 1px solid var(--side-border); }
.online-strip__label { display: flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 700; color: var(--side-text); }
.online-strip__label .presence-dot { position: static; box-shadow: 0 0 0 3px rgba(16, 185, 129, .25); width: 8px; height: 8px; }
.online-strip__list { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.online-strip__list button { border: 0; background: none; padding: 0; border-radius: 9px; transition: transform .15s; }
.online-strip__list button:hover { transform: translateY(-2px); }

@media (max-width: 720px) {
  .chat-panel { width: 100vw; border-left: 0; }
  .chat-input .input { font-size: 16px; }
}
/* ==========================================================================
   RH & RAPPELS
   ========================================================================== */
.rh-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 4px; }
.rh-stats > div { padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2); }
.rh-stats small { display: block; font-size: 11px; color: var(--text-3); font-weight: 600; }
.rh-stats b { font-size: 17px; letter-spacing: -.02em; }
.rh-rules { margin-top: 18px; background: var(--grad-soft); }
.rh-rules b .i { width: 16px; height: 16px; vertical-align: -3px; color: var(--brand-600); }
.rh-rules ul { margin: 10px 0 0 18px; padding: 0; display: grid; gap: 6px; font-size: 13px; color: var(--text-2); }
.note-box .i { width: 15px; height: 15px; vertical-align: -3px; }

.global-reminders { margin: 16px 28px 0; display: grid; gap: 10px; }
@media (max-width: 960px) { .global-reminders { margin: 12px 14px 0; } }
.reminder {
  display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: var(--r-lg); color: #fff;
  background: linear-gradient(120deg, #b45309 0%, #dc2626 100%); box-shadow: 0 16px 34px -14px rgba(220, 38, 38, .6);
  animation: pop .3s var(--ease);
}
.reminder__icon { width: 50px; height: 50px; flex: none; border-radius: 15px; display: grid; place-items: center; background: rgba(255, 255, 255, .18); animation: pulse 1.6s infinite; }
.reminder__icon .i { width: 26px; height: 26px; }
.reminder b { display: block; font-size: 18px; font-weight: 800; letter-spacing: -.02em; text-transform: uppercase; }
.reminder p { font-size: 14.5px; color: rgba(255, 255, 255, .92); margin-top: 2px; }
@media (max-width: 720px) { .reminder { flex-wrap: wrap; } .reminder .btn { width: 100%; } }

.reminder-popup { text-align: center; padding: 18px 6px 6px; }
.reminder-popup__icon { width: 84px; height: 84px; margin: 0 auto 16px; border-radius: 26px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #f59e0b, #dc2626); box-shadow: 0 18px 36px -12px rgba(220, 38, 38, .6); animation: pop .4s var(--ease); }
.reminder-popup__icon .i { width: 42px; height: 42px; }
.reminder-popup small { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--danger); }
.reminder-popup h2 { font-size: 26px; font-weight: 800; letter-spacing: -.03em; margin: 6px 0 8px; }
.reminder-popup p { font-size: 16px; color: var(--text-2); }
/* ---------- Espace formateur ---------- */
body.mode-formateur #btn-search, body.mode-formateur #btn-aide, body.mode-formateur #btn-create, body.mode-formateur #fab, body.mode-formateur #btn-install, body.mode-formateur #online-strip { display: none !important; }
.login__modes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px; background: var(--surface-2, var(--surface-3)); border-radius: 12px; margin-bottom: 4px; }
.login__mode { border: 0; background: transparent; padding: 9px 10px; border-radius: 9px; font: inherit; font-weight: 700; color: var(--text-2); cursor: pointer; }
.login__mode[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.esp-grille { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 860px) { .esp-grille { grid-template-columns: 1fr; } }
.esp-session h2 { margin: 8px 0 2px; font-size: 22px; }
.esp-pastille { display: inline-block; font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 99px; background: var(--surface-3); color: var(--text-2); }
.esp-pastille.is-on { background: var(--success-bg); color: var(--success); }
.esp-photo-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; margin-top: 16px; padding: 22px 16px; border: 0; border-radius: 18px; background: var(--grad-brand); color: #fff; cursor: pointer; font: inherit; box-shadow: 0 8px 22px rgba(0,0,0,.14); transition: transform .15s; }
.esp-photo-btn:hover { transform: translateY(-2px); }
.esp-photo-btn:disabled { opacity: .7; cursor: wait; transform: none; }
.esp-photo-btn span { font-size: 40px; line-height: 1; }
.esp-photo-btn b { font-size: 19px; }
.esp-photo-btn small { opacity: .9; text-align: center; }
.esp-docs { display: grid; gap: 8px; }
.esp-doc { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 12px; }
.esp-doc img { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; display: block; }
.esp-doc__ico { width: 48px; text-align: center; font-size: 26px; }
.esp-doc .grow { min-width: 0; display: flex; flex-direction: column; }
.esp-doc small { color: var(--text-3); }
.esp-eleves { margin: 0; padding-left: 22px; line-height: 1.9; }
.esp-raccourcis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 16px 0; }
.esp-rac { display: flex; flex-direction: column; gap: 2px; padding: 16px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); color: var(--text); text-decoration: none; text-align: left; font: inherit; cursor: pointer; }
.esp-rac:hover { border-color: var(--border-2); transform: translateY(-1px); }
.esp-rac span { font-size: 28px; }
.esp-rac small { color: var(--text-3); }
.esp-liste { display: grid; gap: 6px; }
.esp-ligne { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: transparent; color: var(--text); font: inherit; cursor: pointer; text-align: left; }
.esp-ligne.is-on { border-color: var(--text); }
.esp-ligne small { color: var(--text-3); }

/* ---------- Base de cours ---------- */
.bib-filtres { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 10px; }
.bib-q { flex: 1; min-width: 220px; }
.bib-types { margin-bottom: 14px; }
.bib-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.bib-carte { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.bib-carte__tete { display: flex; gap: 10px; align-items: flex-start; }
.bib-carte__tete .grow { min-width: 0; display: flex; flex-direction: column; }
.bib-carte__tete b { overflow-wrap: anywhere; }
.bib-carte__tete small { color: var(--text-3); }
.bib-emoji { font-size: 28px; line-height: 1; }
.bib-desc { margin: 0; color: var(--text-2); font-size: 13px; }
.bib-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: auto; }

/* ---------- Chat : pièces jointes ---------- */
.chat-joindre { flex: none; font-size: 18px; }
.chat-envoi { padding: 6px 14px; font-size: 12.5px; color: var(--text-2); background: var(--surface-3); }
.chat-pieces { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.chat-msg__bubble > .chat-pieces:first-child { margin-top: 0; }
.chat-pj { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 10px; background: rgba(127,127,127,.14); color: inherit; text-decoration: none; max-width: 240px; }
.chat-pj small { opacity: .75; flex: none; }
.chat-pj--img { padding: 0; background: none; }
.chat-pj--img img { display: block; max-width: 220px; max-height: 220px; border-radius: 10px; object-fit: cover; }

/* ---------- Mails types (lien CPF, pièces CMA) ---------- */
/* « mtm- » et pas « mt- » : .mt-grille est déjà pris par la Médiathèque (apple.css) */
.mtm-grille { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(0, 1.3fr); gap: 18px; }
@media (max-width: 860px) { .mtm-grille { grid-template-columns: 1fr; } }
.mt-form { display: flex; flex-direction: column; gap: 12px; }
.mt-form .field-row { display: flex; gap: 10px; flex-wrap: wrap; }
.mt-liens { display: grid; gap: 6px; }
.mt-lien { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.mt-lien span { flex: 1; font-weight: 600; }
.mt-lien small { color: var(--text-3); white-space: nowrap; }
.mt-lien:has(input:checked) { border-color: var(--text); background: var(--surface-3); }
.mt-lien.is-off { opacity: .55; cursor: not-allowed; }
.mt-urgent { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--danger-bg, #fef2f2); color: var(--danger, #b91c1c); cursor: pointer; }
.mt-apercu { display: flex; flex-direction: column; gap: 6px; }
.mt-apercu iframe { width: 100%; min-height: 520px; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.mt-gl { display: grid; grid-template-columns: 1.2fr 1fr 2fr auto; gap: 6px; margin-bottom: 6px; align-items: center; }
@media (max-width: 760px) { .mt-gl { grid-template-columns: 1fr; padding-bottom: 10px; border-bottom: 1px solid var(--border); } }

/* ---------- Finances claires (cartes cliquables) ---------- */
.stats--4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.fin-stat--clic { text-align: left; font: inherit; color: inherit; cursor: pointer; display: flex; flex-direction: column; align-items: flex-start; transition: transform .15s, box-shadow .15s; }
.fin-stat--clic:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.08); }
.fin-stat__expl { font-size: 12px; color: var(--text-3); margin-top: 6px; line-height: 1.35; }
.fin-stat__voir { font-size: 12px; font-weight: 700; color: var(--brand, #7c5cff); margin-top: auto; padding-top: 8px; }
.fin-stat--ko { border-color: color-mix(in srgb, var(--danger, #ef4444) 40%, transparent); }
.fin-sous-titre { margin: 16px 0 8px; font-size: 14px; }
.fin-ok { padding: 10px 14px; border-radius: 12px; background: var(--success-bg); color: var(--success); font-weight: 600; font-size: 13.5px; }
.fin-regle { margin-top: 12px; border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; background: var(--surface); }
.fin-regle summary { cursor: pointer; font-weight: 700; }
.fin-regle ol { margin: 10px 0 0; padding-left: 22px; line-height: 1.8; }
.fin-liste__expl { margin: 0 0 6px; color: var(--text-2); }
.fin-liste__total { margin: 0 0 12px; }
.fin-liste { display: grid; gap: 8px; }
.fin-liste__ligne { display: flex; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; }
.fin-liste__ligne .grow { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.fin-liste__ligne small { color: var(--text-3); }
.fin-liste__etat .badge { white-space: normal; text-align: left; }
.fin-liste__droite { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.fin-liste__actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 640px) { .fin-liste__ligne { flex-direction: column; } .fin-liste__droite { align-items: flex-start; } }

.fin-btn-recu { white-space: nowrap; margin-top: 4px; }
.btn--success { background: var(--success, #16a34a); border-color: var(--success, #16a34a); color: #fff; }
.fin-recu { font-size: 12.5px; color: var(--success); font-weight: 600; margin-top: 4px; }
.fin-recu .link-more { font-size: 12px; margin-left: 4px; color: var(--text-3); }

/* ---------- Planning (calendrier de l'équipe) ---------- */
.pl-barre { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-bottom: 12px; }
.pl-barre--filtres { margin-top: -4px; }
.pl-titre { font-size: 16px; min-width: 190px; text-align: center; }
.pl-grille { display: grid; gap: 6px; }
.pl-grille--semaine { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.pl-grille--mois { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.pl-entete { text-align: center; font-size: 12px; font-weight: 700; color: var(--text-3); text-transform: uppercase; }
.pl-jour { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 6px; min-height: 150px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pl-grille--mois .pl-jour { min-height: 108px; }
.pl-jour.is-auj { border-color: var(--brand, #7c5cff); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand, #7c5cff) 25%, transparent); }
.pl-jour.is-hors { opacity: .45; }
.pl-jour.is-we { background: var(--surface-2, var(--surface)); }
.pl-jour__tete { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; color: var(--text-2); }
.pl-jour.is-auj .pl-jour__tete b { background: var(--brand, #7c5cff); color: #fff; border-radius: 99px; padding: 0 7px; }
.pl-plus { border: 0; background: transparent; color: var(--text-3); font-size: 18px; line-height: 1; cursor: pointer; border-radius: 6px; width: 24px; height: 24px; }
.pl-plus:hover { background: var(--surface-3); color: var(--text); }
.pl-jour__corps { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pl-ev { display: flex; flex-direction: column; text-align: left; font: inherit; font-size: 12px; line-height: 1.3; padding: 4px 6px; border-radius: 7px; border: 0; cursor: pointer; color: var(--text); min-width: 0; overflow: hidden; }
.pl-ev b, .pl-ev small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-ev small { color: var(--text-3); font-size: 11px; }
.pl-ev--session { background: color-mix(in srgb, var(--c) 18%, transparent); border-left: 3px solid var(--c); font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.pl-ev--creneau { background: color-mix(in srgb, var(--c) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); }
.pl-ev--creneau.is-moi { box-shadow: inset 3px 0 0 var(--c); }
.pl-ev--creneau.is-fait { opacity: .5; text-decoration: line-through; }
.pl-ev--examen { background: color-mix(in srgb, #ff4b4b 14%, transparent); color: var(--text); font-weight: 600; cursor: default; white-space: nowrap; text-overflow: ellipsis; display: block; }
.pl-plus-de { border: 0; background: none; color: var(--brand, #7c5cff); font-size: 12px; font-weight: 700; cursor: pointer; text-align: left; padding: 2px 4px; }
.pl-legende { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 0 0; font-size: 12px; color: var(--text-3); }
.pl-legende i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.pl-ligne { display: flex; gap: 12px; align-items: center; width: 100%; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--border); background: none; font: inherit; color: var(--text); text-align: left; cursor: pointer; }
.pl-ligne:last-child { border-bottom: 0; }
.pl-ligne:hover { background: var(--surface-3); }
.pl-ligne .grow { display: flex; flex-direction: column; min-width: 0; }
.pl-ligne small { color: var(--text-3); }
.pl-ligne__date { display: flex; flex-direction: column; align-items: center; min-width: 44px; font-size: 11px; text-transform: uppercase; color: var(--text-3); }
.pl-ligne__date b { font-size: 20px; color: var(--text); }
.pl-heures > div { display: flex; gap: 8px; align-items: center; }
.pl-fiche p { margin: 0 0 8px; }
.pl-notes { background: var(--surface-3); padding: 8px 10px; border-radius: 8px; }
.pl-detail .pl-jour { min-height: 0; border: 0; padding: 0; }
.pl-detail .pl-ev b, .pl-detail .pl-ev small { white-space: normal; }
@media (max-width: 900px) {
  .pl-grille--semaine { grid-template-columns: 1fr; }
  .pl-grille--semaine .pl-jour { min-height: 0; }
  .pl-grille--mois { gap: 3px; }
  .pl-grille--mois .pl-jour { min-height: 64px; padding: 3px; }
  .pl-grille--mois .pl-ev small { display: none; }
  .pl-grille--mois .pl-ev { font-size: 10.5px; padding: 2px 4px; }
}
.pl-jour__date { border: 0; background: none; font: inherit; color: inherit; cursor: pointer; padding: 0; text-align: left; }
.pl-jour__date:hover { color: var(--text); text-decoration: underline; }
.pl-detail .pl-jour__date { pointer-events: none; }

.sess-fo { margin-top: 12px; }
.sess-fo .chip small { font-weight: 500; }
