/* Back-office Assabil Academy. Direction de design : docs/design.md */

:root {
  /* Marque (site vitrine) */
  --navy: #16243d;
  --navy-deep: #0e1829;
  --navy-line: #24344f;
  --maroon: #7a1530;
  --maroon-deep: #591023;
  --gold: #b8923f;
  --gold-soft: #d8c08a;
  --ink: #2a2520;
  --white: #ffffff;

  /* Surfaces : un cadre blanc posé sur la toile, une zone de travail grise, des tuiles blanches. */
  --canvas: #e7e5df;
  --canvas-deep: #ebe9e3;
  --panel: #f3f2ee;
  --card: #ffffff;
  --card-border: #ebe8e1;
  --hairline: #efede8;
  --shadow-card: 0 1px 2px rgb(22 36 61 / 0.04);
  --radius-card: 22px;
  --radius-frame: 28px;
  --paper: #ffffff;
  --wash: #f3f2ee;
  --line: #e8e5de;
  --muted: #6e655b;
  --rail-text: #c9cfd9;
  --chart-quiet: #9aa3b2;
  --navy-soft: #dde2ea;
  --navy-soft-line: #c7cfdc;

  /* Statuts */
  --sage: #2f6b4f;
  --sage-wash: #e8f1ec;
  --gold-wash: #f6efdf;
  --gold-ink: #7a5c1c;
  --maroon-wash: #f6e9ec;

  /* Typographie */
  --font-ui: "Plus Jakarta Sans", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --font-title: var(--font-ui);

  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-base: 0.9375rem;
  --text-lg: 1.125rem;
  --text-title: 2.15rem;

  /* Treillis d'étoiles à huit branches (enluminure de mushaf), or à faible opacité. */
  --pattern-khatam: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23b8923f' stroke-opacity='.22' stroke-width='1'%3E%3Crect x='20' y='20' width='24' height='24'/%3E%3Crect x='20' y='20' width='24' height='24' transform='rotate(45 32 32)'/%3E%3Cpath d='M0 32h15M49 32h15M32 0v15M32 49v15'/%3E%3C/g%3E%3C/svg%3E");

  --pattern-khatam-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23b8923f' stroke-opacity='.07' stroke-width='1'%3E%3Crect x='20' y='20' width='24' height='24'/%3E%3Crect x='20' y='20' width='24' height='24' transform='rotate(45 32 32)'/%3E%3Cpath d='M0 32h15M49 32h15M32 0v15M32 49v15'/%3E%3C/g%3E%3C/svg%3E");

  --radius: 10px;
  --frame-gap: 14px;
  --rail-width: 252px;
  --sheet-width: 440px;
  --gutter: 2rem;
  /* Hachures des graphiques (barres, pastilles). */
  --stripes-navy: repeating-linear-gradient(135deg, #16243d 0 5px, #2b3c5e 5px 10px);
  --stripes-maroon: repeating-linear-gradient(135deg, #7a1530 0 5px, #93283f 5px 10px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  overflow-x: clip;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--text-base);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--maroon);
  text-underline-offset: 3px;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Charpente ----------
   Toute l'application tient dans un grand cadre blanc arrondi, posé sur la toile.
   Le menu est dans le cadre ; le contenu dans une zone grise où reposent les tuiles. */

body {
  background: var(--canvas);
}

.shell {
  display: grid;
  grid-template-columns: var(--rail-width) minmax(0, 1fr);
  margin: var(--frame-gap);
  min-height: calc(100vh - 2 * var(--frame-gap));
  border-radius: var(--radius-frame);
  background: var(--white);
  box-shadow: 0 1px 2px rgb(22 36 61 / 0.05), 0 24px 60px -30px rgb(22 36 61 / 0.25);
  /* clip (et non hidden) : ne casse pas le positionnement « sticky » du menu. */
  overflow: clip;
}

.workspace {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0 var(--frame-gap) var(--frame-gap) 0;
}

/* ---------- Menu ---------- */

.rail {
  background: var(--white);
  color: var(--muted);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: var(--frame-gap);
  height: calc(100vh - 2 * var(--frame-gap));
  padding: 1.25rem 1rem 1rem;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.25rem 0.5rem 1.25rem;
  color: var(--navy);
  text-decoration: none;
}

.wordmark__logo {
  flex: none;
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.wordmark__name {
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--navy);
}

.wordmark__sub {
  display: block;
  margin-top: 0.1rem;
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0;
  color: var(--muted);
}

.rail__nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.25rem 0;
}

.rail__group + .rail__group {
  margin-top: 1.1rem;
}

.rail__label {
  margin: 0 0 0.35rem;
  padding: 0 0.85rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #a19c92;
}

.rail__link {
  display: grid;
  grid-template-columns: 1.2rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.7rem;
  padding: 0.62rem 0.85rem;
  border-radius: 999px;
  color: #4f5663;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.rail__link + .rail__link {
  margin-top: 0.15rem;
}

.rail__icon {
  width: 1.2rem;
  height: 1.2rem;
}

a.rail__link:hover {
  background: var(--panel);
  color: var(--navy);
}

/* Élément actif : une pastille sombre pleine. */
.rail__link.is-active,
a.rail__link.is-active:hover {
  background: var(--navy);
  color: var(--white);
}

.rail__link.is-active .rail__icon {
  color: var(--gold-soft);
}

.rail__count {
  min-width: 1.6rem;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.rail__link.is-active .rail__count {
  background: rgb(255 255 255 / 0.14);
  color: var(--white);
}

.rail__count--alert,
.rail__link.is-active .rail__count--alert {
  background: var(--maroon);
  color: var(--white);
}

/* Raccourci en bas du menu : une tuile sombre, comme la carte promotionnelle de la référence. */
.rail__promo {
  position: relative;
  display: block;
  margin-top: 1rem;
  padding: 1.1rem 1.1rem 1.15rem;
  border-radius: 20px;
  background-color: var(--navy);
  background-image:
    radial-gradient(circle at 95% -10%, rgb(184 146 63 / 0.3), transparent 50%),
    radial-gradient(circle at -5% 115%, rgb(122 21 48 / 0.65), transparent 60%),
    var(--pattern-khatam-dark);
  color: var(--rail-text);
  text-decoration: none;
  overflow: hidden;
}

.rail__promo-title {
  display: block;
  padding-right: 2.75rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--white);
}

.rail__promo-text {
  display: block;
  margin-top: 0.35rem;
  font-size: var(--text-sm);
  line-height: 1.45;
}

.rail__promo-go {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--white);
  color: var(--navy);
}

.rail__promo-icon {
  width: 1rem;
  height: 1rem;
}

.rail__promo:hover .rail__promo-go {
  background: var(--gold-soft);
}

.avatar {
  flex: none;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--navy);
  color: var(--gold-soft);
  display: grid;
  place-items: center;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
}

.avatar--soft {
  width: 2.1rem;
  height: 2.1rem;
  background: var(--panel);
  color: var(--navy);
}

/* ---------- Barre supérieure ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0.25rem 0.85rem 0;
  font-size: var(--text-sm);
  color: var(--muted);
}

.topbar__date {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  background: var(--panel);
  color: var(--navy);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.topbar__icon {
  width: 1rem;
  height: 1rem;
  color: var(--muted);
}

.topbar__end {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.account {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}

.account__who {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.account__who strong {
  color: var(--navy);
  font-size: 0.875rem;
  font-weight: 700;
}

.account__who span,
.account__who strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account__who span {
  font-size: var(--text-xs);
  color: var(--muted);
}

.account form {
  margin: 0 0 0 0.25rem;
}

/* Boutons ronds (flèche ↗, déconnexion…). */
.round-btn {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  border: 1px solid var(--card-border);
  border-radius: 50%;
  background: var(--white);
  color: var(--navy);
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.round-btn:hover {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}

.round-btn__icon {
  width: 1rem;
  height: 1rem;
}

.round-btn--ghost {
  border-color: rgb(255 255 255 / 0.22);
  background: transparent;
  color: var(--white);
}

.round-btn--ghost:hover {
  background: var(--white);
  border-color: var(--white);
  color: var(--navy);
}

/* Boutons en pastille. */
.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 1.1rem;
  border: 1px solid var(--card-border);
  border-radius: 999px;
  background: var(--white);
  color: var(--navy);
  font-size: var(--text-sm);
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s;
}

.pill-btn:hover {
  background: var(--panel);
}

.pill-btn__icon {
  width: 1rem;
  height: 1rem;
}

.pill-btn--dark {
  border-color: var(--navy);
  background: var(--navy);
  color: var(--white);
}

.pill-btn--dark:hover {
  background: var(--navy-deep);
}

.pill-btn--accent {
  border-color: var(--maroon);
  background: var(--maroon);
  color: var(--white);
}

.pill-btn--accent:hover {
  background: var(--maroon-deep);
}

.pill-btn--small {
  padding: 0.4rem 0.85rem;
  font-size: var(--text-xs);
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 700;
  white-space: nowrap;
}

.main {
  flex: 1;
  min-width: 0;
  padding: 2rem var(--gutter) 3rem;
  border-radius: 24px;
  background: var(--panel);
}

/* ---------- En-tête de page ---------- */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.page-head h1 {
  margin: 0;
  font-family: var(--font-title);
  font-size: var(--text-title);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.15;
  color: var(--navy);
  overflow-wrap: anywhere;
}

.page-head p {
  margin: 0.35rem 0 0;
  color: var(--muted);
  max-width: 60ch;
}

.page-head__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ---------- Sections ---------- */

.grid {
  display: grid;
  gap: 2.5rem;
  align-items: start;
  margin-bottom: 2.75rem;
}

.grid--charts {
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
}

.grid--desk {
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
}

/* ---------- Mosaïque de tuiles (accueil) ---------- */

.mosaic {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1rem;
  align-items: stretch;
  max-width: 1320px;
}

.mosaic__span-3 { grid-column: span 3; }
.mosaic__span-4 { grid-column: span 4; }
.mosaic__span-5 { grid-column: span 5; }
.mosaic__span-7 { grid-column: span 7; }
.mosaic__span-12 { grid-column: span 12; }

.tile {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 1.25rem 1.4rem 1.4rem;
  border-radius: var(--radius-card);
  background: var(--card);
  box-shadow: var(--shadow-card);
}

.tile__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.tile__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
}

.tile__meta {
  margin-left: 0.35rem;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--muted);
}

/* Tuile sombre : marine, halo doré et treillis discret. */
.tile--dark {
  background-color: var(--navy);
  background-image:
    radial-gradient(circle at 95% -10%, rgb(184 146 63 / 0.28), transparent 45%),
    radial-gradient(circle at -5% 115%, rgb(122 21 48 / 0.6), transparent 55%),
    var(--pattern-khatam-dark);
  color: var(--rail-text);
}

.tile--dark .tile__title {
  color: var(--white);
}

.hero-tile__value {
  margin: 0.25rem 0 0.35rem;
  font-size: 4.5rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.05em;
  color: var(--white);
}

.hero-tile__text {
  margin: 0;
}

.hero-tile__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: auto;
  padding-top: 1.5rem;
}

.hero-tile__calm {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--gold-soft);
  font-weight: 600;
}

.hero-tile__calm-icon {
  width: 1.1rem;
  height: 1.1rem;
}

/* Pile d'initiales, comme une pile d'avatars. */
.faces {
  display: flex;
  padding-left: 0.5rem;
}

.faces__item {
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  margin-left: -0.5rem;
  border: 2px solid var(--navy);
  border-radius: 50%;
  background: #2b3c5e;
  color: var(--gold-soft);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
}

.stat-tile__figure {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.stat-tile__value {
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--navy);
}

.stat-tile__context {
  margin: 0.5rem 0 1rem;
  font-size: var(--text-sm);
  color: var(--muted);
}

/* Variation en pastille colorée. */
.trend {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.trend__icon {
  width: 0.9rem;
  height: 0.9rem;
}

.trend--good {
  background: var(--sage-wash);
  color: var(--sage);
}

.trend--bad {
  background: var(--maroon-wash);
  color: var(--maroon);
}

.trend--flat {
  background: var(--panel);
  color: var(--muted);
}

.spark {
  position: relative;
  height: 46px;
  margin-top: auto;
}

.spark svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.spark polyline {
  fill: none;
  stroke: var(--navy);
  stroke-width: 2.25;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.spark__dot {
  position: absolute;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: var(--maroon);
  box-shadow: 0 0 0 3px var(--white);
}

/* Jauge en demi-cercle, découpée en segments. */
.gauge {
  position: relative;
  width: 100%;
  max-width: 270px;
  margin: 0.25rem auto 0;
}

.gauge svg {
  display: block;
  width: 100%;
  height: auto;
}

.gauge line {
  stroke: #ebe8e1;
  stroke-width: 7;
  stroke-linecap: round;
}

.gauge line.is-on {
  stroke: var(--navy);
}

.gauge__label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  text-align: center;
  line-height: 1.2;
}

.gauge__label strong {
  display: block;
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--navy);
}

.gauge-tile__foot {
  margin: auto 0 0;
  padding-top: 1rem;
  text-align: center;
  font-size: var(--text-sm);
  color: var(--muted);
}

/* ---------- Colonnes hachurées : demandes par semaine ---------- */

.columns {
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 4px;
  height: 230px;
  padding-top: 0.5rem;
}

.columns__slot {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  outline-offset: 2px;
  border-radius: 12px;
}

.columns__plot {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
}

.columns__bar {
  width: min(36px, 78%);
  min-height: 8px;
  border-radius: 12px;
  background: var(--stripes-navy);
}

.columns__slot.is-current .columns__bar {
  background: var(--stripes-maroon);
}

.columns__slot:hover .columns__bar,
.columns__slot:focus-visible .columns__bar {
  opacity: 0.85;
}

/* Pastille de valeur flottante au-dessus de la barre. */
.columns__value {
  margin-bottom: 0.4rem;
  padding: 0.1rem 0.5rem;
  border: 1px solid var(--card-border);
  border-radius: 999px;
  background: var(--white);
  box-shadow: 0 4px 10px -6px rgb(22 36 61 / 0.4);
  color: var(--navy);
  font-size: var(--text-xs);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.columns__slot.is-current .columns__value {
  border-color: var(--maroon);
  background: var(--maroon);
  color: var(--white);
}

.columns__label {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 0.5rem;
  font-size: var(--text-xs);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Une étiquette sur deux suffit : l'infobulle donne le détail. */
.columns__slot:nth-child(odd) .columns__label {
  visibility: hidden;
}

.columns__tip {
  position: absolute;
  bottom: calc(100% - 1rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
  background: var(--navy);
  color: var(--white);
  font-size: var(--text-xs);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
}

.columns__slot:hover .columns__tip,
.columns__slot:focus-visible .columns__tip {
  opacity: 1;
}

.data-table {
  margin-top: 2.25rem;
  font-size: var(--text-sm);
}

.data-table summary {
  cursor: pointer;
  color: var(--muted);
}

.data-table table {
  margin-top: 0.75rem;
  border-collapse: collapse;
  min-width: 14rem;
}

.data-table th,
.data-table td {
  padding: 0.3rem 1rem 0.3rem 0;
  border-bottom: 1px solid var(--hairline);
  text-align: left;
}

/* ---------- Grille de pastilles : séances de la semaine ---------- */

.dotgrid {
  width: 100%;
  margin-top: auto;
  border-collapse: separate;
  border-spacing: 6px;
  table-layout: fixed;
}

.dotgrid th {
  width: 5.5rem;
  padding-right: 0.25rem;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--muted);
  text-align: left;
  white-space: nowrap;
}

.dotgrid td {
  padding: 0;
  text-align: center;
}

.dot {
  display: grid;
  place-items: center;
  width: 100%;
  max-width: 2.6rem;
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 50%;
  font-size: var(--text-xs);
  font-weight: 700;
}

.dot--0 {
  background: #efede8;
}

.dot--1 {
  background: var(--navy-soft);
  color: var(--navy);
}

.dot--2 {
  background: var(--stripes-navy);
  color: var(--white);
}

.dot--3 {
  background: var(--navy);
  color: var(--white);
}

.dot.is-today {
  box-shadow: 0 0 0 2px var(--white), 0 0 0 3.5px var(--gold-soft);
}

.dotgrid tfoot td {
  padding-top: 0.15rem;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--muted);
}

.dotgrid tfoot td.is-today {
  color: var(--maroon);
  font-weight: 800;
}

/* ---------- Barres horizontales : étudiants par cursus ---------- */

.bars {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tile .bars {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 3rem;
}

.bars__row {
  display: grid;
  grid-template-columns: minmax(0, 10rem) minmax(0, 1fr) 2.25rem;
  align-items: center;
  gap: 0.85rem;
  padding: 0.55rem 0;
  font-size: var(--text-sm);
}

.bars__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.bars__track {
  display: block;
  height: 10px;
  border-radius: 999px;
  background: var(--panel);
  overflow: hidden;
}

.bars__fill {
  display: block;
  height: 100%;
  min-width: 2px;
  border-radius: 999px;
  background: var(--navy);
}

.bars__row:first-child .bars__fill {
  background: var(--maroon);
}

.bars__value {
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--navy);
}

/* ---------- Bande d'indicateurs (espace professeur) : une rangée de tuiles ---------- */

.ledger {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.ledger__item {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 1.2rem 1.35rem 1.3rem;
  border-radius: var(--radius-card);
  background: var(--card);
  box-shadow: var(--shadow-card);
}

.ledger__label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--navy);
}

.ledger__icon {
  width: 1.05rem;
  height: 1.05rem;
  color: var(--maroon);
}

.ledger__figure {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.75rem;
}

.ledger__value {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--navy);
}

.ledger__context {
  margin: 0.45rem 0 0.9rem;
  font-size: var(--text-sm);
  color: var(--muted);
  min-height: 2.6em;
}

.delta {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.delta__icon {
  width: 0.9rem;
  height: 0.9rem;
}

.delta--good {
  background: var(--sage-wash);
  color: var(--sage);
}

.delta--bad {
  background: var(--maroon-wash);
  color: var(--maroon);
}

.delta--flat {
  background: var(--panel);
  color: var(--muted);
}

/* Jauge linéaire : la piste est un ton clair de la même teinte que le remplissage. */
.meter {
  height: 10px;
  margin-top: auto;
  border-radius: 999px;
  background: var(--navy-soft);
  overflow: hidden;
}

.meter__fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--stripes-navy);
}

/* ---------- File d'attente ---------- */

.table-scroll {
  overflow-x: auto;
}

.queue {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.queue th {
  padding: 0.6rem 0.75rem 0.6rem 0;
  text-align: left;
  font-weight: 500;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.queue td {
  padding: 0.7rem 0.75rem 0.7rem 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.queue tbody tr:hover {
  background: var(--wash);
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.queue__name {
  display: block;
  font-weight: 500;
  font-size: var(--text-base);
}

.queue__sub {
  display: block;
  color: var(--muted);
}

.wait {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
  color: var(--muted);
}

.wait__icon {
  width: 0.95rem;
  height: 0.95rem;
}

.wait--late {
  color: var(--maroon);
  font-weight: 600;
}

.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
}

.section__head h2 {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--navy);
}

.section__meta {
  font-size: var(--text-sm);
  color: var(--muted);
}

/* ---------- État vide ---------- */

.empty {
  padding: 2.25rem 0;
  max-width: 46ch;
}

.empty h3 {
  margin: 0 0 0.35rem;
  font-size: var(--text-base);
  font-weight: 600;
}

.empty p {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-sm);
}

/* ---------- Planning du jour ---------- */

.agenda {
  list-style: none;
  margin: 0;
  padding: 0;
}

.agenda__slot {
  display: grid;
  grid-template-columns: 3.25rem minmax(0, 1fr) auto;
  align-items: start;
  gap: 1rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--line);
}

.agenda__time {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.3;
}

.agenda__time span {
  display: block;
  font-weight: 400;
  font-size: var(--text-xs);
  color: var(--muted);
}

.agenda__body {
  min-width: 0;
}

.agenda__title {
  display: block;
  font-weight: 500;
}

.agenda__sub {
  display: block;
  font-size: var(--text-sm);
  color: var(--muted);
}

.agenda__private {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.3rem;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--navy);
}

.agenda__note {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.3rem;
  font-size: var(--text-xs);
  color: var(--muted);
}

.agenda__note--moved {
  color: var(--maroon);
  font-weight: 500;
}

.agenda__note--moved .agenda__icon {
  color: var(--maroon);
}

.agenda__icon {
  width: 0.9rem;
  height: 0.9rem;
  color: var(--gold);
}

.agenda__slot.is-past {
  opacity: 0.6;
}

.agenda__slot.is-live .agenda__time {
  color: var(--maroon);
}

/* ---------- Statuts ---------- */

.status {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: var(--radius);
  font-size: var(--text-xs);
  font-weight: 500;
}

.status--pending {
  background: var(--gold-wash);
  color: var(--ink);
}

.status--approved {
  background: var(--sage-wash);
  color: var(--sage);
}

.status--rejected {
  background: var(--maroon-wash);
  color: var(--maroon-deep);
}

.status--live {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--maroon);
  color: var(--paper);
  white-space: nowrap;
}

.status__icon {
  width: 0.9rem;
  height: 0.9rem;
}

.status--ended {
  color: var(--muted);
  padding-right: 0;
}

/* ---------- Boutons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: inherit;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}

.btn--primary {
  background: var(--maroon);
  color: var(--paper);
}

.btn--primary:hover {
  background: var(--maroon-deep);
}

.btn--primary:active {
  transform: translateY(1px);
}

.btn--primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn--secondary {
  background: var(--paper);
  border-color: var(--line);
  color: var(--ink);
}

.btn--secondary:hover {
  background: var(--wash);
}

.btn--block {
  width: 100%;
}

/* ---------- Formulaires ---------- */

.field {
  margin-bottom: 1.1rem;
}

.field label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: var(--text-sm);
  font-weight: 500;
}

.field input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}

.field input:hover {
  border-color: var(--muted);
}

.field input:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 0;
  border-color: var(--gold);
}

.field input[aria-invalid="true"] {
  border-color: var(--maroon);
}

/* ---------- Messages ---------- */

.notice {
  margin-bottom: 1.25rem;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius);
  font-size: var(--text-sm);
}

.notice--error {
  background: var(--maroon-wash);
  color: var(--maroon-deep);
}

.notice--success {
  background: var(--sage-wash);
  color: var(--sage);
}

/* ---------- Connexion : page encadrée comme un feuillet de mushaf ---------- */

.folio {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
  background-color: var(--wash);
  background-image: var(--pattern-khatam);
}

.folio__page {
  width: 100%;
  max-width: 440px;
  background: var(--paper);
  padding: 0.5rem;
  border: 1px solid var(--gold);
}

.folio__frame {
  border: 1px solid var(--gold-soft);
  padding: 2.75rem 2.5rem 2.25rem;
}

.folio__sign {
  display: block;
  text-align: center;
  color: var(--gold);
  font-size: 2.25rem;
  line-height: 1;
}

.folio__name {
  margin: 0.75rem 0 0;
  text-align: center;
  font-family: var(--font-title);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--navy);
}

.folio__lead {
  margin: 0.35rem 0 2rem;
  text-align: center;
  color: var(--muted);
  font-size: var(--text-sm);
}

.folio__foot {
  margin: 1.5rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: var(--text-xs);
  color: var(--muted);
}

/* ---------- Mobile ---------- */

@media (max-width: 1180px) {
  .ledger {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mosaic__span-3,
  .mosaic__span-4 {
    grid-column: span 6;
  }

  .mosaic__span-5,
  .mosaic__span-7 {
    grid-column: span 12;
  }

  .tile .bars {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 960px) {
  .grid--charts,
  .grid--desk {
    grid-template-columns: minmax(0, 1fr);
  }

  .account__who {
    display: none;
  }
}

@media (max-width: 760px) {
  :root {
    --gutter: 1rem;
    --frame-gap: 0px;
  }

  .shell {
    grid-template-columns: minmax(0, 1fr);
    border-radius: 0;
  }

  .workspace {
    padding: 0;
  }

  .main {
    border-radius: 20px 20px 0 0;
  }

  .topbar {
    padding: 0.75rem 1rem;
  }

  .rail {
    position: static;
    height: auto;
    padding: 1rem 1rem 0.5rem;
  }

  .wordmark {
    padding: 0 0 0.75rem;
  }

  .rail__nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0;
  }

  .rail__group,
  .rail__group + .rail__group {
    display: contents;
  }

  .rail__label,
  .rail__promo {
    display: none;
  }

  .rail__link {
    grid-template-columns: auto auto auto;
    gap: 0.45rem;
    padding: 0.5rem 0.8rem;
  }

  .rail__link + .rail__link {
    margin-top: 0;
  }

  .mosaic__span-3,
  .mosaic__span-4 {
    grid-column: span 12;
  }

  .ledger {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-tile__value {
    font-size: 3.5rem;
  }

  .ledger__value {
    font-size: 2rem;
  }

  .hide-sm {
    display: none;
  }

  .page-head h1 {
    font-size: 1.7rem;
  }

  .folio__frame {
    padding: 2rem 1.25rem 1.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

/* =========================================================
   Modèles de pages : liste + panneau, fiche, formulaire
   ========================================================= */

.section__link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: var(--text-sm);
  font-weight: 500;
  white-space: nowrap;
}

.section__icon {
  width: 0.95rem;
  height: 0.95rem;
}

.section__head h2 .section__meta {
  margin-left: 0.4rem;
  font-weight: 400;
}

a.queue__name {
  color: var(--ink);
  text-decoration: none;
}

a.queue__name:hover {
  color: var(--maroon);
  text-decoration: underline;
}

/* ---------- Onglets de statut ---------- */

.tabs {
  display: flex;
  gap: 1.75rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.25rem;
  overflow-x: auto;
}

.tabs__item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 0;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.tabs__item:hover {
  color: var(--ink);
}

.tabs__item.is-active {
  color: var(--navy);
  border-bottom-color: var(--maroon);
}

.tabs__count {
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

/* ---------- Barre de filtres ---------- */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.toolbar__search {
  position: relative;
  flex: 1 1 260px;
  max-width: 360px;
}

.toolbar__icon {
  position: absolute;
  left: 0.7rem;
  top: 50%;
  width: 1rem;
  height: 1rem;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.toolbar input[type="search"],
.picker__search input,
.toolbar select {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}

.toolbar input[type="search"],
.picker__search input {
  padding-left: 2.1rem;
}

.toolbar__select {
  flex: 0 1 220px;
}

.toolbar__reset {
  font-size: var(--text-sm);
}

/* ---------- Liste + panneau latéral ---------- */

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
}

/* Volet ouvert : troisième colonne de la charpente, sur toute la hauteur. */
.shell.has-sheet {
  grid-template-columns: var(--rail-width) minmax(0, 1fr) var(--sheet-width);
}

.list {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.list th {
  padding: 0.6rem 0.75rem 0.6rem 0;
  text-align: left;
  font-weight: 500;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.list td {
  padding: 0.7rem 0.75rem 0.7rem 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

/* Toute la ligne est cliquable via le lien du nom. */
.list__row {
  position: relative;
}

.list__row:hover {
  background: var(--wash);
}

.list__row.is-selected {
  background: var(--wash);
  box-shadow: inset 3px 0 0 var(--maroon);
}

.list__row td:first-child {
  padding-left: 0.75rem;
}

.list th:first-child {
  padding-left: 0.75rem;
}

.list th.num,
.queue th.num {
  text-align: right;
}

.list__link {
  display: block;
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
}

.list__link::after {
  content: "";
  position: absolute;
  inset: 0;
}

.list__link:focus-visible {
  outline: none;
}

.list__link:focus-visible::after {
  outline: 2px solid var(--gold);
  outline-offset: -2px;
}

.list__sub {
  display: block;
  color: var(--muted);
}

.pager {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-top: 1.25rem;
}

.pager__info {
  font-size: var(--text-sm);
  color: var(--muted);
}

.panel {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: var(--paper);
}

.panel__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--line);
}

.panel__nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.panel__position {
  margin-left: 0.4rem;
  font-size: var(--text-xs);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius);
  color: var(--navy);
}

.icon-btn .icon {
  width: 1.1rem;
  height: 1.1rem;
}

a.icon-btn:hover {
  background: var(--wash);
}

.icon-btn[aria-disabled="true"] {
  color: var(--line);
}















.note {
  margin: 0;
  padding: 0.75rem 1rem;
  background: var(--wash);
  border-radius: var(--radius);
  font-size: var(--text-sm);
}








.btn--danger {
  background: var(--maroon);
  color: var(--paper);
}

.btn--danger:hover {
  background: var(--maroon-deep);
}

/* ---------- Formulaires ---------- */

.form {
  max-width: 760px;
}

.form__section {
  margin: 0 0 2rem;
  padding: 0;
  border: 0;
  border-top: 2px solid var(--navy);
  min-width: 0;
}

.form__section legend {
  float: left;
  width: 100%;
  padding: 0.75rem 0;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--line);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--navy);
}

.form__section legend + * {
  clear: both;
}

.form__row {
  display: grid;
  gap: 0 1rem;
}

.form__row--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form__row--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form__actions {
  display: flex;
  gap: 0.6rem;
  padding-top: 0.5rem;
}

.field select,
.field textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}

.field textarea {
  resize: vertical;
}

.field select:focus-visible,
.field textarea:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 0;
  border-color: var(--gold);
}

.field.has-error input,
.field.has-error select,
.field.has-error textarea {
  border-color: var(--maroon);
}

.field__optional {
  font-weight: 400;
  color: var(--muted);
}

.field__help {
  margin: 0.35rem 0 0;
  font-size: var(--text-xs);
  color: var(--muted);
}

.field__error {
  margin: 0.35rem 0 0;
  font-size: var(--text-sm);
  color: var(--maroon);
}

/* Type de séance : deux options côte à côte, la sélection est cerclée. */
.choice {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.choice__option {
  position: relative;
  display: block;
  cursor: pointer;
}

.choice__option input {
  position: absolute;
  opacity: 0;
}

.choice__body {
  display: grid;
  grid-template-columns: 1.4rem minmax(0, 1fr);
  gap: 0.15rem 0.75rem;
  height: 100%;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.choice__icon {
  grid-row: span 2;
  width: 1.4rem;
  height: 1.4rem;
  color: var(--muted);
}

.choice__title {
  font-weight: 600;
}

.choice__desc {
  font-size: var(--text-sm);
  color: var(--muted);
}

.choice__option:hover .choice__body {
  background: var(--wash);
}

.choice__option input:checked + .choice__body {
  border-color: var(--navy);
  box-shadow: inset 0 0 0 1px var(--navy);
}

.choice__option input:checked + .choice__body .choice__icon {
  color: var(--gold);
}

.choice__option input:focus-visible + .choice__body {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.picker__head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: var(--text-sm);
}

.picker__label {
  font-weight: 500;
}

.picker__count {
  color: var(--muted);
}

.picker__search {
  display: block;
  max-width: none;
  margin-bottom: 0.5rem;
}

.picker__list {
  list-style: none;
  margin: 0;
  padding: 0.25rem 0;
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.picker.has-error .picker__list {
  border-color: var(--maroon);
}

.picker__item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.75rem;
  font-size: var(--text-sm);
  cursor: pointer;
}

.picker__item:hover {
  background: var(--wash);
}

.picker__item input {
  accent-color: var(--navy);
}

.picker__empty {
  margin: 0.5rem 0 0;
  font-size: var(--text-sm);
  color: var(--muted);
}

[hidden] {
  display: none !important;
}

@media (max-width: 1180px) {
  .hide-md {
    display: none;
  }

  :root {
    --sheet-width: 400px;
  }
}

/* Sur petit écran, la fiche recouvre la liste. */
@media (max-width: 960px) {
  .shell.has-sheet {
    grid-template-columns: var(--rail-width) minmax(0, 1fr);
  }

  .panel {
    position: fixed;
    inset: 0;
    z-index: 10;
    max-height: none;
    border: 0;
  }
}

@media (max-width: 760px) {
  .shell.has-sheet {
    grid-template-columns: minmax(0, 1fr);
  }

  .form__row--2,
  .form__row--3,
  .choice {
    grid-template-columns: minmax(0, 1fr);
  }

}

/* =========================================================
   Fiche en panneau latéral (option A)
   ========================================================= */

/* Les libellés courts ne passent jamais à la ligne. */
.status,
.pill,
.btn,
.tabs__item,
.wait,
.section__link,
.quick__btn,
.rail__count {
  white-space: nowrap;
}

.sheet {
  border-left: 1px solid var(--line);
  box-shadow: -12px 0 32px -16px rgb(22 36 61 / 0.18);
}

.sheet .panel__bar {
  min-height: 3.6rem;
  padding: 0.5rem 1rem;
  background: var(--navy);
  border-bottom: 0;
  color: var(--paper);
}

.sheet .icon-btn {
  color: var(--rail-text);
}

.sheet a.icon-btn:hover {
  background: var(--navy-line);
  color: var(--paper);
}

.sheet .icon-btn[aria-disabled="true"] {
  color: var(--navy-line);
}

.sheet .panel__position {
  color: var(--rail-text);
}

.sheet__form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.sheet__body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 1.5rem 1rem;
}

.sheet__head {
  display: grid;
  grid-template-columns: 3.25rem minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
  padding-bottom: 1.25rem;
}

.sheet__avatar {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--wash);
  border: 1.5px solid var(--gold);
  color: var(--navy);
  font-family: var(--font-title);
  font-size: 1.15rem;
  font-weight: 700;
}

.sheet__identity {
  min-width: 0;
}

.sheet__name {
  margin: 0;
  font-family: var(--font-title);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--navy);
  text-wrap: balance;
}

.sheet__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.6rem;
  margin-top: 0.45rem;
}

.sheet__since {
  font-size: var(--text-sm);
  color: var(--muted);
  white-space: nowrap;
}

/* Statut : pastille + libellé court. */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.6rem 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 600;
}

.pill::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: currentColor;
}

.pill--pending {
  background: var(--gold-wash);
  color: var(--gold-ink);
}

.pill--approved {
  background: var(--sage-wash);
  color: var(--sage);
}

.pill--rejected {
  background: var(--maroon-wash);
  color: var(--maroon);
}

/* Actions rapides de contact. */
.quick {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 0.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}

.quick__btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.7rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--navy);
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
}

.quick__btn:hover {
  background: var(--wash);
  border-color: var(--gold-soft);
}

.quick__icon {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--gold);
}

.sheet__section {
  padding-top: 1.35rem;
}

.sheet__title {
  margin: 0 0 0.6rem;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--navy);
}

.sheet__lead {
  margin: -0.2rem 0 1rem;
  font-size: var(--text-sm);
  color: var(--muted);
}

/* Lignes libellé / valeur : la valeur ne se coupe jamais au milieu. */
.rows {
  margin: 0;
}

.rows__item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
  font-size: var(--text-sm);
}

.rows__item:last-child {
  border-bottom: 0;
}

.rows__item dt {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  white-space: nowrap;
}

.rows__item dd {
  margin: 0;
  min-width: 0;
  font-weight: 500;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rows__icon {
  flex: none;
  width: 1rem;
  height: 1rem;
  color: var(--muted);
}

.contact {
  list-style: none;
  margin: 0;
  padding: 0;
}

.contact__item {
  display: grid;
  grid-template-columns: 1rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0;
  font-size: var(--text-sm);
}

.contact__value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact__copy {
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: none;
  color: var(--muted);
  cursor: pointer;
}

.contact__copy .icon {
  width: 1rem;
  height: 1rem;
}

.contact__copy:hover {
  background: var(--wash);
  color: var(--navy);
}

.contact__copy.is-done {
  color: var(--sage);
}

/* Historique. */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.timeline__item {
  position: relative;
  display: grid;
  grid-template-columns: 0.75rem minmax(0, 1fr);
  gap: 0.85rem;
  padding-bottom: 1rem;
  font-size: var(--text-sm);
}

.timeline__item:not(:last-child)::after {
  content: "";
  position: absolute;
  left: calc(0.375rem - 0.5px);
  top: 1.05rem;
  bottom: 0;
  width: 1px;
  background: var(--line);
}

.timeline__dot {
  width: 0.75rem;
  height: 0.75rem;
  margin-top: 0.3rem;
  border-radius: 50%;
  background: var(--navy);
}

.timeline__item.is-waiting .timeline__dot {
  background: var(--paper);
  border: 2px solid var(--gold);
}

.timeline__item.is-approved .timeline__dot {
  background: var(--sage);
}

.timeline__item.is-rejected .timeline__dot {
  background: var(--maroon);
}

.timeline__what {
  display: block;
  font-weight: 500;
}

.timeline__when {
  display: block;
  color: var(--muted);
}

.timeline__note {
  margin-top: 0.5rem;
}

/* Étapes numérotées de la confirmation (une vraie séquence). */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
}

.steps__item {
  display: grid;
  grid-template-columns: 1.6rem minmax(0, 1fr);
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
  font-size: var(--text-sm);
}

.steps__item:last-child {
  border-bottom: 0;
}

.steps__num {
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--navy);
  color: var(--paper);
  font-size: var(--text-xs);
  font-weight: 600;
}

.steps__value {
  display: block;
  margin-top: 0.15rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sheet__actions {
  display: flex;
  gap: 0.6rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--line);
  background: var(--wash);
}

.sheet__primary {
  flex: 1;
}

.btn__icon {
  width: 1.1rem;
  height: 1.1rem;
}

/* Planning du jour : une info par ligne, tronquée plutôt que coupée. */
.agenda__sub {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 960px) {
  .sheet {
    border-radius: 0;
    box-shadow: none;
  }
}

/* =========================================================
   Agenda des séances
   ========================================================= */

.nowrap {
  white-space: nowrap;
}

.agenda-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.agenda-bar__nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.agenda-bar__nav .btn.is-current {
  color: var(--muted);
}

.agenda-bar__range {
  margin: 0 0 0 0.5rem;
  font-family: var(--font-title);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--navy);
  white-space: nowrap;
}

.agenda-bar__range::first-letter {
  text-transform: uppercase;
}

.icon-btn--bordered {
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid var(--line);
  background: var(--paper);
}

/* Sélecteur Jour / Semaine / Liste. */
.segmented {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 3px);
  background: var(--wash);
}

.segmented__item {
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.segmented__item:hover {
  color: var(--ink);
}

.segmented__item.is-active {
  background: var(--paper);
  color: var(--navy);
  box-shadow: 0 1px 2px rgb(22 36 61 / 0.12);
}

/* --- Grille --------------------------------------------------------------- */

.cal-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.cal {
  --hour: 64px;
  --time-col: 3.75rem;
  min-width: 760px;
}

.cal--jour {
  min-width: 0;
}

.cal__head,
.cal__body {
  display: grid;
  grid-template-columns: var(--time-col) repeat(var(--days), minmax(0, 1fr));
}

.cal__head {
  position: sticky;
  top: 0;
  z-index: 3;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.cal__day {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 0.25rem;
  border-left: 1px solid var(--line);
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}

.cal__day:hover {
  background: var(--wash);
}

.cal__dow {
  font-size: var(--text-sm);
}

.cal__num {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--navy);
}

.cal__day.is-today .cal__num {
  display: inline-grid;
  place-items: center;
  min-width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  background: var(--maroon);
  color: var(--paper);
}

.cal__day.is-today .cal__dow {
  color: var(--maroon);
  font-weight: 600;
}

.cal__body {
  position: relative;
  height: calc(var(--hours) * var(--hour));
}

.cal__times {
  position: relative;
}

.cal__hour {
  position: absolute;
  top: calc(var(--row) * var(--hour));
  right: 0.6rem;
  transform: translateY(-50%);
  font-size: var(--text-xs);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.cal__hour:first-child {
  transform: none;
  top: 0.2rem;
}

.cal__col {
  position: relative;
  display: grid;
  grid-template-rows: repeat(var(--hours), var(--hour));
  border-left: 1px solid var(--line);
}

.cal__col.is-today {
  background: rgb(122 21 48 / 0.025);
}

/* Créneau vide : cliquer pour programmer une séance. */
.cal__slot {
  border-bottom: 1px solid var(--line);
}

.cal__slot:hover {
  background: var(--wash);
}

.cal__slot:hover::after {
  content: "+";
  display: block;
  padding: 0.15rem 0.4rem;
  color: var(--muted);
  font-size: var(--text-sm);
}

/* Trait « maintenant ». */
.cal__now {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--start) * var(--hour) / 60);
  z-index: 2;
  height: 2px;
  background: var(--maroon);
  pointer-events: none;
}

.cal__now::before {
  content: "";
  position: absolute;
  left: -5px;
  top: -4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--maroon);
}

/* --- Séances -------------------------------------------------------------- */

.event {
  position: absolute;
  z-index: 1;
  top: calc(var(--start) * var(--hour) / 60 + 1px);
  height: calc(var(--dur) * var(--hour) / 60 - 3px);
  left: calc(var(--lane) * (100% - 6px) / var(--lanes) + 3px);
  width: calc((100% - 6px) / var(--lanes) - 2px);
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow: hidden;
  padding: 0.3rem 0.45rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: var(--text-xs);
  line-height: 1.3;
  text-decoration: none;
}

.event:hover,
.event.is-selected {
  z-index: 2;
  box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--gold);
}

.event__time {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.event__icon {
  flex: none;
  width: 0.85rem;
  height: 0.85rem;
}

.event__title {
  font-weight: 600;
  font-size: var(--text-sm);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event__meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0.8;
}

/* Chaque ligne fait exactement 16 px : on n'affiche que les lignes qui tiennent. */
.event__time,
.event__title,
.event__meta {
  flex: none;
  height: 16px;
  line-height: 16px;
}

.event--sm .event__meta,
.event--md .event__meta--teacher,
.event--xs .event__meta {
  display: none;
}

.event--xs {
  flex-direction: row;
  align-items: center;
  gap: 0.35rem;
  padding-top: 0;
  padding-bottom: 0;
}

.event--xs .event__title {
  min-width: 0;
}

.event--scheduled {
  background: var(--navy-soft);
  border-color: var(--navy-soft-line);
  color: var(--navy);
}

.event--live {
  background: var(--maroon);
  color: var(--paper);
}

.event--ended {
  background: var(--wash);
  border-color: var(--line);
  color: var(--muted);
}

.event--cancelled {
  background: repeating-linear-gradient(
    135deg,
    var(--paper) 0 6px,
    var(--wash) 6px 12px
  );
  border-color: var(--line);
  color: var(--muted);
}

.event--cancelled .event__title {
  text-decoration: line-through;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  list-style: none;
  margin: 0.9rem 0 0;
  padding: 0;
  font-size: var(--text-xs);
  color: var(--muted);
}

.legend li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.legend__swatch {
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 3px;
  border: 1px solid var(--line);
}

.legend__icon {
  width: 0.9rem;
  height: 0.9rem;
}

/* --- Fiche de séance ------------------------------------------------------ */

.pill--scheduled {
  background: var(--navy-soft);
  color: var(--navy);
}

.pill--live {
  background: var(--maroon);
  color: var(--paper);
}

.pill--ended {
  background: var(--wash);
  color: var(--muted);
}

.pill--cancelled {
  background: var(--maroon-wash);
  color: var(--maroon);
}

.pill--kind {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}

.pill--kind::before {
  display: none;
}

.sheet__avatar--icon .icon {
  width: 1.4rem;
  height: 1.4rem;
  color: var(--navy);
}

.sheet__section--first {
  padding-top: 0.25rem;
}

.sheet__or {
  margin: 1.25rem 0 0.75rem;
  font-size: var(--text-sm);
  color: var(--muted);
}

.rows__hint {
  margin-left: 0.35rem;
  color: var(--maroon);
  font-weight: 600;
}

.people {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
}

.people__item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0;
  font-size: var(--text-sm);
  font-weight: 500;
}

.people__avatar {
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  background: var(--wash);
  border: 1px solid var(--gold-soft);
  color: var(--navy);
  font-size: var(--text-xs);
  font-weight: 600;
}

.timeline__item.is-moved .timeline__dot {
  background: var(--paper);
  border: 2px solid var(--maroon);
}

.timeline__item.is-live .timeline__dot {
  background: var(--maroon);
}

.timeline__item.is-ended .timeline__dot {
  background: var(--muted);
}

.btn--quiet-danger {
  color: var(--maroon);
}

.quick button.quick__btn {
  background: var(--paper);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
}

/* --- Accueil ---------------------------------------------------------------- */

a.agenda__title {
  color: var(--ink);
  text-decoration: none;
}

a.agenda__title:hover {
  color: var(--maroon);
  text-decoration: underline;
}

.more-link {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: var(--text-sm);
  font-weight: 500;
}

@media (max-width: 760px) {
  .agenda-bar__range {
    flex-basis: 100%;
    margin: 0.25rem 0 0;
    font-size: 1.15rem;
  }

  .agenda-bar__nav {
    flex-wrap: wrap;
  }
}

/* =========================================================
   Formulaire de séance : étapes + récapitulatif en direct
   ========================================================= */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
  color: var(--muted);
  font-size: var(--text-sm);
  text-decoration: none;
}

.back-link:hover {
  color: var(--maroon);
}

.back-link__icon {
  width: 0.95rem;
  height: 0.95rem;
}

.composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 340px);
  gap: 2.5rem;
  align-items: start;
  max-width: 1120px;
}

.composer__main {
  min-width: 0;
}

/* Étapes numérotées : c'est un vrai parcours, dans cet ordre. */
.step {
  margin: 0 0 1.25rem;
  padding: 1.25rem 1.5rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  min-width: 0;
}

.step__head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  float: left;
  width: 100%;
  margin-bottom: 1.1rem;
  padding: 0;
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--navy);
}

.step__head + * {
  clear: both;
}

.step__num {
  flex: none;
  display: grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  background: var(--navy);
  color: var(--paper);
  font-size: var(--text-sm);
  font-weight: 600;
}

.step__hint {
  margin: -0.5rem 0 1rem;
}

.field__label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: var(--text-sm);
  font-weight: 500;
}

/* Durées rapides. */
.durations {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.durations__btn {
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}

.durations__btn:hover {
  border-color: var(--navy);
}

.durations__btn.is-active {
  border-color: var(--navy);
  background: var(--navy);
  color: var(--paper);
}

.durations__or {
  margin-left: 0.25rem;
  font-size: var(--text-sm);
  color: var(--muted);
  white-space: nowrap;
}

.durations__end input {
  width: 8.5rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}

/* Récapitulatif collant. */
.recap {
  position: sticky;
  top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.recap__card {
  padding: 1.35rem 1.4rem 1.1rem;
  border-radius: var(--radius);
  background: var(--navy);
  color: var(--rail-text);
  background-image: var(--pattern-khatam-dark);
}

.recap__eyebrow {
  margin: 0 0 0.35rem;
  font-size: var(--text-sm);
  color: var(--gold-soft);
}

.recap__title {
  margin: 0 0 0.6rem;
  font-family: var(--font-title);
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--paper);
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.recap__card .pill--kind {
  border-color: rgb(216 192 138 / 0.45);
  color: var(--gold-soft);
}

.recap__rows {
  margin: 1.1rem 0 0;
}

.recap__row {
  display: grid;
  grid-template-columns: 1.1rem minmax(0, 1fr);
  gap: 0.75rem;
  align-items: start;
  padding: 0.55rem 0;
  border-top: 1px solid var(--navy-line);
  font-size: var(--text-sm);
}

.recap__row dt {
  padding-top: 0.1rem;
}

.recap__row dd {
  margin: 0;
  color: var(--paper);
}

.recap__row dd::first-letter {
  text-transform: uppercase;
}

.recap__row dd.is-empty {
  color: var(--rail-text);
  opacity: 0.6;
}

.recap__icon {
  flex: none;
  width: 1.1rem;
  height: 1.1rem;
  color: var(--gold);
}

.recap__day {
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.recap__subtitle {
  margin: 0 0 0.6rem;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--navy);
}

.dayplan {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dayplan__item {
  display: grid;
  grid-template-columns: 6.25rem minmax(0, 1fr);
  gap: 0.5rem;
  padding: 0.4rem 0.55rem;
  margin-bottom: 0.25rem;
  border-radius: var(--radius);
  background: var(--wash);
  font-size: var(--text-sm);
}

.dayplan__item.is-mine {
  background: var(--navy-soft);
  color: var(--navy);
  font-weight: 600;
}

.dayplan__item.is-clash {
  background: var(--maroon-wash);
  color: var(--maroon-deep);
  font-weight: 600;
}

.dayplan__time {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.dayplan__title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recap__conflict,
.recap__free {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.6rem 0 0;
  font-size: var(--text-sm);
  font-weight: 500;
}

.recap__conflict {
  color: var(--maroon);
}

.recap__conflict .recap__icon {
  color: var(--maroon);
}

.recap__free {
  color: var(--sage);
}

.recap__free .recap__icon {
  color: var(--sage);
}

/* La légende de l'agenda est désormais au-dessus de la grille. */
.legend {
  margin: 0 0 0.9rem;
}

@media (max-width: 1100px) {
  .composer {
    grid-template-columns: minmax(0, 1fr);
  }

  .recap {
    position: static;
  }
}

@media (max-width: 760px) {
  .step {
    padding: 1rem 1rem 0.25rem;
  }
}

/* =========================================================
   Étudiants, professeurs, cursus
   ========================================================= */

.list__ellipsis {
  max-width: 22rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Étiquettes de cursus : une étiquette ne se coupe jamais, la ligne passe à la suivante. */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.chip {
  display: inline-block;
  padding: 0.12rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--navy);
  white-space: nowrap;
}

.sheet__muted {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--muted);
}

/* Prochaines séances dans une fiche. */
.minilist {
  list-style: none;
  margin: 0;
  padding: 0;
}

.minilist__item {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.55rem 0.6rem;
  margin: 0 -0.6rem;
  border-radius: var(--radius);
  color: var(--ink);
  text-decoration: none;
  font-size: var(--text-sm);
}

.minilist__item:hover {
  background: var(--wash);
}

.minilist__when {
  font-weight: 600;
  color: var(--navy);
  white-space: nowrap;
}

.minilist__when span {
  display: block;
  font-weight: 400;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.minilist__what {
  min-width: 0;
}

.minilist__title,
.minilist__sub {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.minilist__title {
  font-weight: 500;
}

.minilist__sub {
  color: var(--muted);
}

/* Cases à cocher en pastilles (cursus d'une personne). */
.toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.toggles__item {
  position: relative;
  cursor: pointer;
}

.toggles__item input {
  position: absolute;
  opacity: 0;
}

.toggles__item span {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  font-size: var(--text-sm);
  white-space: nowrap;
}

.toggles__item:hover span {
  border-color: var(--navy);
}

.toggles__item input:checked + span {
  border-color: var(--navy);
  background: var(--navy);
  color: var(--paper);
}

.toggles__item input:focus-visible + span {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

a.chip--link {
  text-decoration: none;
}

a.chip--link:hover {
  border-color: var(--navy);
}

.sheet__text {
  margin: 0 0 0.5rem;
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--ink);
  max-width: 60ch;
}

/* Interrupteur oui / non. */
.switch {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0.25rem 0 1.25rem;
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
}

.switch input {
  position: absolute;
  opacity: 0;
}

.switch__track {
  position: relative;
  flex: none;
  width: 2.4rem;
  height: 1.35rem;
  border-radius: 999px;
  background: var(--line);
}

.switch__track::after {
  content: "";
  position: absolute;
  top: 0.175rem;
  left: 0.175rem;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 1px 2px rgb(22 36 61 / 0.25);
}

.switch input:checked + .switch__track {
  background: var(--sage);
}

.switch input:checked + .switch__track::after {
  left: auto;
  right: 0.175rem;
}

.switch input:focus-visible + .switch__track {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* =========================================================
   Salle de cours (professeurs et élèves)
   ========================================================= */

.salle {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* En salle, la page tient exactement dans l'écran (pas de défilement autour de la visio). */
.salle:has(.salle-main--room) {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.salle-bar {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.7rem 1.5rem;
  background: var(--navy);
  color: var(--rail-text);
}

.salle-bar__brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--paper);
  text-decoration: none;
  white-space: nowrap;
}

.salle-bar__session {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex: 1;
  min-width: 0;
}

.salle-bar__back {
  margin: 0;
  color: var(--rail-text);
  white-space: nowrap;
}

.salle-bar__back:hover {
  color: var(--paper);
}

.salle-bar__title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--paper);
  font-weight: 500;
}

.salle-bar__user {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-left: auto;
  font-size: var(--text-sm);
}

.salle-bar__name {
  color: var(--paper);
  white-space: nowrap;
}

.btn--small {
  padding: 0.35rem 0.75rem;
  font-size: var(--text-sm);
}

.salle-main {
  flex: 1;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

/* En cours : la visio prend toute la place sous la barre. */
.salle-main--room {
  max-width: none;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.salle-video {
  position: relative;
  flex: 1;
  min-height: 0;
  background: var(--navy-deep);
}

/* Le cadre Jitsi occupe exactement la zone, quelle que soit la hauteur de la barre. */
.salle-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.salle-day {
  margin-bottom: 2rem;
}

.salle-item .btn {
  pointer-events: none;
}

.salle-card {
  max-width: 520px;
  margin: 3rem auto;
  padding: 2.5rem 2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  text-align: center;
}

.salle-card__sign {
  display: block;
  color: var(--gold);
  font-size: 2.25rem;
  line-height: 1;
  margin-bottom: 1rem;
}

.salle-card__title {
  margin: 0 0 0.6rem;
  font-family: var(--font-title);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--navy);
  text-wrap: balance;
}

.salle-card__text {
  margin: 0 0 0.75rem;
  color: var(--ink);
}

.salle-card__hint {
  margin: 0 0 1.5rem;
  font-size: var(--text-sm);
  color: var(--muted);
}

.salle-card__cta {
  padding: 0.8rem 1.6rem;
  font-size: 1rem;
}

/* Écran d'attente : le ۞ respire doucement. */
.salle-card__pulse {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 4.5rem;
  height: 4.5rem;
  margin-bottom: 1.25rem;
  border-radius: 50%;
  background: var(--wash);
  color: var(--gold);
  font-size: 2rem;
}

.salle-card__pulse::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--gold-soft);
  animation: salle-pulse 2.4s ease-out infinite;
}

@keyframes salle-pulse {
  from {
    transform: scale(1);
    opacity: 0.9;
  }

  to {
    transform: scale(1.6);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .salle-card__pulse::after {
    animation: none;
  }
}

@media (max-width: 760px) {
  .salle-bar {
    flex-wrap: wrap;
    gap: 0.6rem 1rem;
    padding: 0.6rem 1rem;
  }

  .salle-bar__name {
    display: none;
  }

  .salle-bar__session {
    order: 3;
    flex-basis: 100%;
  }

  .salle-main {
    padding: 1.25rem 1rem 2rem;
  }

  .salle-card {
    margin: 1.5rem auto;
    padding: 2rem 1.25rem;
  }
}

/* =========================================================
   Surfaces : tuiles blanches très arrondies sur la zone grise, sans bordure.
   ========================================================= */

.card {
  background: var(--card);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.grid {
  gap: 1rem;
  margin-bottom: 1rem;
}

/* Sections (fiches, espace professeur…) : même tuile que l'accueil. */
.section {
  padding: 0 1.4rem 1.3rem;
  border-radius: var(--radius-card);
  background: var(--card);
  box-shadow: var(--shadow-card);
}

.section__head {
  padding: 1.15rem 0 0.9rem;
  margin-bottom: 0.25rem;
  border-bottom-color: var(--hairline);
}

.section__head h2 {
  font-size: 1rem;
  font-weight: 700;
}

.section .empty,
.tile .empty {
  padding: 1.25rem 0 0.25rem;
}

/* Tableaux de liste posés sur une tuile. */
.main > .table-scroll,
.split__list > .table-scroll {
  padding: 0.35rem 1rem 0.5rem;
  border-radius: var(--radius-card);
  background: var(--card);
  box-shadow: var(--shadow-card);
}

.main > .table-scroll .list tr:last-child td,
.split__list > .table-scroll .list tr:last-child td {
  border-bottom: 0;
}

/* État vide en pleine page. */
.main > .empty,
.split__list > .empty {
  max-width: none;
  padding: 2rem 1.5rem;
  border: 1.5px dashed #dcd8ce;
  border-radius: var(--radius-card);
  background: var(--card);
}

.main > .empty p,
.split__list > .empty p {
  max-width: 52ch;
}

/* Champs de filtre en pastille. */
.toolbar input[type="search"],
.toolbar select {
  border-color: var(--card-border);
  border-radius: 999px;
  background: var(--card);
}

/* Onglets de statut en pastilles. */
.tabs {
  gap: 0.4rem;
  border-bottom: 0;
}

.tabs__item {
  padding: 0.5rem 1rem;
  margin-bottom: 0;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: var(--text-sm);
  font-weight: 600;
}

.tabs__item:hover {
  background: var(--card);
}

.tabs__item.is-active {
  border-color: var(--navy);
  background: var(--navy);
  color: var(--white);
}

.tabs__item.is-active .tabs__count {
  color: rgb(255 255 255 / 0.7);
}

.cal-scroll {
  border-color: transparent;
  border-radius: var(--radius-card);
  background: var(--card);
  box-shadow: var(--shadow-card);
}

.step {
  padding-bottom: 0.75rem;
  border-color: transparent;
  border-radius: var(--radius-card);
  background: var(--card);
  box-shadow: var(--shadow-card);
}

.recap__card,
.recap__day {
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.recap__day {
  border-color: transparent;
  background: var(--card);
}

.salle-card {
  border-color: transparent;
  border-radius: var(--radius-card);
  background: var(--card);
  box-shadow: var(--shadow-card);
}

/* Sélecteur segmenté en pastilles. */
.segmented {
  padding: 4px;
  border: 0;
  border-radius: 999px;
  background: var(--card);
  box-shadow: var(--shadow-card);
}

.segmented__item {
  padding: 0.4rem 1rem;
  border-radius: 999px;
  font-weight: 600;
}

.segmented__item.is-active {
  background: var(--navy);
  color: var(--white);
  box-shadow: none;
}

/* Boutons : pastilles. */
.btn {
  padding: 0.62rem 1.2rem;
  border-radius: 999px;
  font-size: var(--text-sm);
  font-weight: 700;
}

.btn--secondary {
  background: var(--card);
  border-color: var(--card-border);
  color: var(--navy);
}

.btn--secondary:hover {
  background: var(--panel);
}

.data-table summary {
  padding-top: 0.25rem;
}

.queue__who {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.queue__who > span:last-child {
  min-width: 0;
}

.queue td {
  white-space: nowrap;
}

/* Volet latéral (fiche) : une tuile flottante dans le cadre, sur ordinateur. */
@media (min-width: 961px) {
  .shell.has-sheet .workspace {
    padding-right: 0;
  }

  .sheet {
    top: var(--frame-gap);
    height: calc(100vh - 2 * var(--frame-gap));
    margin: var(--frame-gap) var(--frame-gap) var(--frame-gap) var(--frame-gap);
    border: 0;
    border-radius: var(--radius-card);
    box-shadow: 0 1px 2px rgb(22 36 61 / 0.06), 0 18px 40px -20px rgb(22 36 61 / 0.35);
    overflow: hidden;
  }
}

.queue td:first-child {
  white-space: normal;
}

/* =========================================================
   Espace professeur
   ========================================================= */

/* Prochaine séance : la carte qui ouvre l'accueil. */
.spotlight {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem 2.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  padding: 1.5rem 1.75rem;
  border-radius: var(--radius-card);
  background-color: var(--navy);
  background-image:
    radial-gradient(circle at 95% -10%, rgb(184 146 63 / 0.28), transparent 45%),
    radial-gradient(circle at -5% 115%, rgb(122 21 48 / 0.6), transparent 55%),
    var(--pattern-khatam-dark);
  color: var(--rail-text);
  box-shadow: var(--shadow-card);
}

.spotlight.is-live {
  background-color: var(--maroon-deep);
}

.spotlight__main {
  min-width: 0;
  flex: 1 1 22rem;
}

.spotlight__label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.35rem;
  font-size: var(--text-sm);
  color: var(--gold-soft);
}

.spotlight__title {
  margin: 0 0 0.85rem;
  font-family: var(--font-title);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--paper);
  text-wrap: balance;
}

.spotlight__text {
  margin: 0;
  max-width: 52ch;
}

.spotlight__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--text-sm);
  color: var(--paper);
}

.spotlight__facts li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.spotlight__icon {
  flex: none;
  width: 1rem;
  height: 1rem;
  color: var(--gold);
}

.spotlight__actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  min-width: 15rem;
}

.spotlight__cta {
  width: 100%;
  padding: 0.8rem 1.4rem;
  font-size: 1rem;
}

.spotlight .btn--primary {
  background: var(--gold);
  color: var(--navy-deep);
}

.spotlight .btn--primary:hover {
  background: var(--gold-soft);
}

.spotlight.is-live .btn--primary {
  background: var(--paper);
  color: var(--maroon-deep);
}

.spotlight .btn--secondary {
  background: transparent;
  border-color: rgb(216 192 138 / 0.5);
  color: var(--paper);
}

.spotlight__later {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: var(--text-sm);
}

.chip-btn {
  padding: 0.3rem 0.7rem;
  border: 1px solid rgb(216 192 138 / 0.45);
  border-radius: 999px;
  background: transparent;
  color: var(--paper);
  font: inherit;
  font-size: var(--text-sm);
  white-space: nowrap;
  cursor: pointer;
}

.chip-btn:hover {
  border-color: var(--gold);
  background: rgb(184 146 63 / 0.18);
}

.spotlight--empty .spotlight__title {
  margin-bottom: 0.4rem;
}

/* Colonnes de cartes empilées. */
.stack {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-width: 0;
}

.section__note {
  display: block;
  padding: 0.75rem 0 0.25rem;
}

.section__form {
  padding-top: 0.75rem;
}

.grid--profile {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.profile-id {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-top: 0.75rem;
}

.profile-id__name {
  margin: 0;
  font-family: var(--font-title);
  font-size: 1.3rem;
  color: var(--navy);
}

.profile-id .sheet__muted {
  margin: 0.15rem 0 0;
}

.sheet__start {
  padding: 0.85rem 1.5rem 0;
  border-top: 1px solid var(--line);
  background: var(--wash);
}

.sheet__foot {
  margin-top: 0.75rem;
}

a.status--live {
  text-decoration: none;
}

@media (max-width: 960px) {
  .grid--profile {
    grid-template-columns: minmax(0, 1fr);
  }

  .spotlight__actions {
    min-width: 0;
    flex: 1 1 100%;
  }
}

/* Aides de formulaire en liste (consignes de mot de passe…). */
.field__help ul {
  margin: 0;
  padding-left: 1.1rem;
}

.field__help li + li {
  margin-top: 0.15rem;
}

/* Logo complet sur les pages de connexion. */
.folio__logo {
  display: block;
  /* Le fond blanc du logo se fond dans le papier crème. */
  mix-blend-mode: multiply;
  width: 168px;
  height: auto;
  margin: 0 auto 0.5rem;
}

.folio__name {
  margin-top: 0.25rem;
  font-size: 1.35rem;
}

/* Salle de cours : le logo dans une pastille blanche, à gauche de la barre marine. */
.salle-bar__brand {
  padding: 0.3rem 1rem 0.3rem 0.45rem;
  border-radius: 999px;
  background: var(--white);
}

.salle-bar__brand .wordmark__logo {
  width: 36px;
  height: 36px;
}

.salle-bar__brand .wordmark__name {
  font-size: 1rem;
  color: var(--navy);
}

.folio__forgot {
  margin: 0.9rem 0 0;
  text-align: center;
  font-size: var(--text-sm);
}

.folio .field input[readonly] {
  background: var(--wash);
  color: var(--muted);
}

.sheet__hint {
  margin: 0 0 0.6rem;
}
