/* LMS Universitaire — design system minimal (sans dépendance externe) */
:root {
  --bg: #f4f5fa;
  --surface: #fff;
  --text: #1e2433;
  --muted: #667085;
  --border: #e4e7ee;
  --primary: #4338ca;
  --primary-hover: #3730a3;
  --primary-soft: #eef0ff;
  --danger: #c62828;
  --danger-soft: #fdecec;
  --success: #15803d;
  --success-soft: #e8f6ee;
  --warning: #b45309;
  --warning-soft: #fdf3e1;
  --info: #1d4ed8;
  --info-soft: #e8f0fe;
  --sidebar: #161a2e;
  --sidebar-text: #aeb4cc;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  font: 15px/1.5 var(--font);
  color: var(--text);
  background: var(--bg);
}
h1,
h2,
h3 {
  line-height: 1.25;
  margin: 0;
}
h1 {
  font-size: 1.55rem;
}
h2 {
  font-size: 1.15rem;
}
h3 {
  font-size: 1rem;
}
a {
  color: var(--primary);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
p {
  margin: 0 0 .75rem;
}
.i {
  width: 1.15em;
  height: 1.15em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
  vertical-align: -.2em;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: .85rem;
}
.right {
  text-align: right;
}
.nowrap {
  white-space: nowrap;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* --- Layout --- */
.shell {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: var(--sidebar);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  padding: 1.25rem .85rem;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  padding: .25rem .6rem 1.25rem;
}
.brand:hover {
  text-decoration: none;
}
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, #6366f1, #4338ca);
  display: grid;
  place-items: center;
  color: #fff;
}
.nav {
  display: flex;
  flex-direction: column;
  gap: .2rem;
}
.nav a {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .6rem .75rem;
  border-radius: 8px;
  color: var(--sidebar-text);
  font-weight: 500;
}
.nav a:hover {
  background: rgba(255,255,255,.07);
  color: #fff;
  text-decoration: none;
}
.nav a.active {
  background: rgba(99,102,241,.22);
  color: #fff;
}
.nav-label {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 1rem .75rem .35rem;
  color: #6c7396;
}
.sidebar-foot {
  margin-top: auto;
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: .9rem;
}
.user-chip {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .35rem .5rem;
  color: #fff;
  border-radius: 8px;
}
.user-chip:hover {
  background: rgba(255,255,255,.07);
  text-decoration: none;
}
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #3b4170;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: .8rem;
  color: #fff;
  flex: none;
}
.logout {
  width: 100%;
  margin-top: .4rem;
  background: none;
  border: 0;
  color: var(--sidebar-text);
  display: flex;
  gap: .7rem;
  align-items: center;
  padding: .55rem .75rem;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
}
.logout:hover {
  background: rgba(255,255,255,.07);
  color: #fff;
}
.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.topbar {
  display: none;
  align-items: center;
  gap: .75rem;
  padding: .7rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.content {
  padding: 1.75rem 2rem 3rem;
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
}
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.4rem;
}
.page-head .sub {
  color: var(--muted);
  margin-top: .25rem;
}
.actions {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  align-items: center;
}
.breadcrumb {
  font-size: .85rem;
  color: var(--muted);
  margin-bottom: .5rem;
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
}
.breadcrumb a {
  color: var(--muted);
}
.breadcrumb a:hover {
  color: var(--primary);
}

/* --- Composants --- */
.menu {
  position: relative;
  display: inline-block;
}
.menu > summary {
  list-style: none;
  cursor: pointer;
}
.menu > summary::-webkit-details-marker {
  display: none;
}
.menu > summary::after {
  content: " ▾";
  font-size: .8em;
}
.menu-list {
  position: absolute;
  right: 0;
  z-index: 20;
  min-width: 15rem;
  margin-top: .25rem;
  padding: .35rem;
  display: grid;
  gap: .1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.menu-list a {
  padding: .45rem .65rem;
  border-radius: 6px;
  color: inherit;
  white-space: nowrap;
}
.menu-list a:hover {
  background: var(--primary-soft);
  text-decoration: none;
}
.doc-search {
  position: relative;
  max-width: 560px;
  margin-bottom: 1rem;
}
.doc-search .i {
  position: absolute;
  left: .75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}
.doc-search .input {
  padding-left: 2.4rem;
}
.doc-group {
  margin: 1.5rem 0 .75rem;
  font-size: 1.1rem;
}
.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: .85rem;
}
.doc-card {
  display: grid;
  gap: .35rem;
  padding: 1rem 1.1rem;
  color: inherit;
}
.doc-card:hover {
  border-color: var(--primary);
  text-decoration: none;
  box-shadow: 0 2px 10px rgba(67, 56, 202, .12);
}
.doc-card[hidden] {
  display: none;
}
.doc-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}
.doc-nav {
  position: sticky;
  top: 1rem;
  padding: 1rem;
}
.doc-nav ul {
  list-style: none;
  margin: .35rem 0 1rem;
  padding: 0;
  display: grid;
  gap: .1rem;
}
.doc-nav a {
  display: block;
  padding: .35rem .6rem;
  border-radius: 6px;
  color: inherit;
}
.doc-nav a:hover {
  background: var(--primary-soft);
  text-decoration: none;
}
.doc-nav a.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}
.doc-article .lead {
  font-size: 1.05rem;
  margin-top: -.25rem;
}
.doc-toc {
  border-left: 3px solid var(--border);
  padding: .25rem 0 .25rem .9rem;
  margin: 1rem 0 1.5rem;
}
.doc-toc ul {
  list-style: none;
  margin: .3rem 0 0;
  padding: 0;
  display: grid;
  gap: .15rem;
}
.doc-body {
  line-height: 1.65;
}
.doc-body h2 {
  margin: 2rem 0 .6rem;
  font-size: 1.25rem;
  scroll-margin-top: 1rem;
}
.doc-body h3 {
  margin: 1.4rem 0 .4rem;
  font-size: 1.05rem;
}
.doc-body ul,
.doc-body ol {
  padding-left: 1.4rem;
}
.doc-body li {
  margin: .25rem 0;
}
.doc-body code {
  background: var(--primary-soft);
  padding: .05rem .35rem;
  border-radius: 4px;
  font-size: .92em;
}
.doc-body table {
  width: 100%;
  border-collapse: collapse;
  margin: .75rem 0;
  font-size: .95rem;
}
.doc-body th,
.doc-body td {
  text-align: left;
  padding: .5rem .65rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.doc-body th {
  color: var(--muted);
  font-weight: 600;
}
.doc-callout {
  display: grid;
  gap: .2rem;
  margin: 1rem 0;
  padding: .8rem 1rem;
  border-left: 4px solid var(--info);
  background: var(--info-soft);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.doc-callout.tip {
  border-color: var(--success);
  background: var(--success-soft);
}
.doc-callout.warn {
  border-color: var(--warning);
  background: var(--warning-soft);
}
.doc-steps {
  counter-reset: step;
  list-style: none;
  padding-left: 0 !important;
}
.doc-steps > li {
  counter-increment: step;
  position: relative;
  padding-left: 2.4rem;
  margin: .8rem 0;
}
.doc-steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: .9rem;
}
.doc-pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.5rem;
  flex-wrap: wrap;
}
@media (max-width: 900px) {
  .doc-layout {
    grid-template-columns: 1fr;
  }
  .doc-nav {
    position: static;
  }
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-body {
  padding: 1.25rem;
}
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  gap: 1rem;
  flex-wrap: wrap;
}
.grid {
  display: grid;
  gap: 1rem;
}
.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}
.grid-cards {
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
}
.two-col {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 2fr 1fr;
  align-items: start;
}
.stat {
  padding: 1.1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.stat-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 1.3rem;
  flex: none;
}
.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1;
}
.stat-label {
  color: var(--muted);
  font-size: .85rem;
  margin-top: .25rem;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .55rem .95rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.2;
}
.btn:hover {
  background: #f7f8fc;
  text-decoration: none;
}
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-hover);
}
.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
.btn-danger:hover {
  background: #a61f1f;
}
.btn-ghost {
  border-color: transparent;
  background: transparent;
}
.btn-ghost:hover {
  background: #eceef6;
}
.btn-sm {
  padding: .3rem .6rem;
  font-size: .85rem;
}
.btn-icon {
  padding: .4rem;
}
.btn.is-loading {
  opacity: .7;
  pointer-events: none;
}
.btn.is-loading::after {
  content: "";
  width: .9em;
  height: .9em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .12rem .55rem;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
  background: #eceef6;
  color: #3b4170;
  white-space: nowrap;
}
.badge-success {
  background: var(--success-soft);
  color: var(--success);
}
.badge-warning {
  background: var(--warning-soft);
  color: var(--warning);
}
.badge-danger {
  background: var(--danger-soft);
  color: var(--danger);
}
.badge-tp {
  background: var(--primary-soft);
  color: var(--primary);
}
.badge-info {
  background: var(--info-soft);
  color: var(--info);
}
.chip {
  display: inline-block;
  padding: .12rem .5rem;
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: .8rem;
  font-weight: 600;
}
.chip:hover {
  text-decoration: none;
  background: #e0e4ff;
}

/* --- Cartes de cours --- */
.course-card {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  padding: 1.15rem;
}
.course-card.archived {
  opacity: .8;
  background: #fafafc;
}
.course-card h3 a {
  color: var(--text);
}
.course-card h3 a:hover {
  color: var(--primary);
}
.course-meta {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
}
.course-numbers {
  display: flex;
  gap: 1.4rem;
  padding-top: .75rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
}
.course-numbers b {
  display: block;
  font-size: 1.25rem;
}
.course-supports {
  margin-top: .75rem;
  border-top: 1px solid var(--border);
  padding-top: .65rem;
}
.course-supports summary {
  cursor: pointer;
  color: var(--primary);
  font-weight: 600;
}
.course-supports .list-plain {
  margin-top: .4rem;
}
.desc {
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  min-height: 3em;
}

/* --- Tableau de bord étudiant --- */
.student-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, .38fr);
  gap: 1.25rem;
  margin-bottom: 1.25rem;
  padding: 1.5rem;
  border: 1px solid #dfe2ff;
  border-radius: 16px;
  background: radial-gradient(circle at 85% 10%, rgba(129, 140, 248, .22), transparent 36%), linear-gradient(120deg, #f4f2ff, #fff);
  box-shadow: 0 8px 24px rgba(67, 56, 202, .08);
}
.student-hero-copy {
  display: grid;
  align-content: center;
  gap: .45rem;
}
.student-hero-copy h1 {
  font-size: clamp(1.65rem, 3vw, 2.1rem);
  letter-spacing: -.02em;
}
.student-hero-copy p {
  max-width: 52ch;
  color: var(--muted);
  margin: 0 0 .4rem;
}
.eyebrow {
  display: block;
  color: var(--primary);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.student-hero-next {
  display: grid;
  align-content: center;
  gap: .2rem;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(67, 56, 202, .13);
  border-radius: 12px;
  background: rgba(255,255,255,.78);
}
.student-hero-next > strong {
  font-size: 1.05rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hero-deadline {
  margin-top: .5rem;
  color: var(--primary);
  font-weight: 700;
}
.hero-deadline.is-late {
  color: var(--danger);
}
.hero-deadline.is-clear {
  color: var(--success);
}
.student-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.stat-icon-teal {
  background: #e8f8f6;
  color: #0f766e;
}
.student-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(270px, .85fr);
  gap: 1.25rem;
  margin-bottom: 1.75rem;
  align-items: stretch;
}
.student-priority,
.student-activity {
  min-width: 0;
}
.student-priority .card-head,
.student-activity .card-head {
  align-items: flex-end;
}
.student-priority .card-head h2,
.student-activity .card-head h2 {
  margin-top: .15rem;
}
.priority-list {
  padding: 0 .9rem;
}
.priority-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: .8rem;
  min-height: 4.3rem;
  padding: .75rem .35rem;
}
.priority-item + .priority-item {
  border-top: 1px solid var(--border);
}
.priority-marker {
  width: .55rem;
  height: .55rem;
  flex: none;
  border-radius: 50%;
  background: #c7cbdc;
  box-shadow: 0 0 0 4px #f1f2f8;
}
.priority-item.is-soon .priority-marker {
  background: var(--warning);
  box-shadow: 0 0 0 4px var(--warning-soft);
}
.priority-item.is-late .priority-marker {
  background: var(--danger);
  box-shadow: 0 0 0 4px var(--danger-soft);
}
.priority-copy {
  min-width: 0;
  flex: 1;
}
.priority-copy a {
  color: var(--text);
}
.priority-copy a:hover {
  color: var(--primary);
}
.priority-due {
  flex: none;
}
.compact-empty {
  padding: 2rem 1.5rem;
}
.activity-body {
  padding: 1.1rem 1.25rem;
}
.activity-highlight {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
}
.activity-highlight strong {
  display: block;
  font-size: 1.35rem;
  line-height: 1;
}
.activity-highlight small {
  display: block;
  margin-top: .2rem;
  color: var(--muted);
}
.activity-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #fff;
}
.activity-section {
  margin-top: 1.1rem;
}
.activity-section h3 {
  margin-bottom: .35rem;
  font-size: .82rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.activity-list li {
  padding: .6rem 0;
}
.activity-list li > span {
  min-width: 0;
  display: grid;
  gap: .1rem;
}
.activity-list strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.activity-list b {
  color: var(--primary);
  white-space: nowrap;
}
.activity-list b small {
  color: var(--muted);
  font-weight: 500;
}
.activity-empty {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-top: 1.1rem;
  padding: .8rem;
  color: var(--muted);
  font-size: .9rem;
  background: #fafbfd;
  border-radius: 8px;
}
.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 .75rem;
}
.section-heading h2 {
  margin-top: .15rem;
}
.student-course-card {
  min-height: 100%;
}
.course-progress {
  display: grid;
  gap: .35rem;
  padding: .75rem 0;
  border-top: 1px solid var(--border);
}
.course-progress-head {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  font-size: .85rem;
}
.course-progress-head strong {
  color: var(--primary);
}
.course-progress-empty {
  color: var(--muted);
  font-size: .85rem;
}

/* --- Page d'un cours : en-tête, onglets --- */
.course-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.course-hero-main {
  flex: 1 1 360px;
  min-width: 0;
  display: grid;
  gap: .6rem;
  align-content: start;
}
.course-hero-main .sub {
  color: var(--muted);
  margin: 0;
  display: flex;
  gap: .45rem;
  align-items: center;
  flex-wrap: wrap;
}
.course-hero-stats {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
}
.course-hero-stats .stat {
  padding: .8rem 1.1rem;
  min-width: 128px;
}
.course-hero-stats .stat-icon {
  width: 38px;
  height: 38px;
  font-size: 1.1rem;
}
.course-hero-stats .stat-value {
  font-size: 1.5rem;
}
.course-hero {
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}
.tabs {
  display: flex;
  gap: .6rem;
  margin-bottom: 1.25rem;
  overflow-x: auto;
  padding: .15rem .15rem .35rem;
}
.tab {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .6rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
}
.tab:hover {
  border-color: #b8bff0;
  text-decoration: none;
}
.tab[aria-current="page"] {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
}
.tabs-sub {
  margin-bottom: .85rem;
}
.tabs-sub .tab {
  padding: .4rem .9rem;
  font-size: .92rem;
  box-shadow: none;
}
.gb-groups {
  margin-bottom: 1rem;
}
.tab-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.tab-head p {
  margin: 0;
}
.course-desc {
  color: var(--muted);
  max-width: 70ch;
  margin: 0;
}
.course-next-deadline {
  color: var(--muted);
  margin: .15rem 0 0;
  font-size: .9rem;
}
.course-next-deadline strong {
  color: var(--text);
}
.course-filters {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  margin: 0 0 1rem;
}
.filter-search {
  position: relative;
  flex: 1 1 240px;
  max-width: 420px;
}
.filter-search .i {
  position: absolute;
  left: .75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}
.filter-search .input {
  padding-left: 2.3rem;
}
.course-filters .select {
  width: auto;
  min-width: 150px;
}
.warning-text {
  color: var(--warning);
}
.assignment-deadline {
  margin: -.3rem 0 0;
}
.supports-layout {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(280px, .8fr) minmax(0, 1.4fr);
  align-items: start;
}
.support-list {
  display: grid;
}
.support-row {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.support-row:last-child {
  border-bottom: 0;
}
.support-icon {
  width: 38px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
}
.support-main {
  min-width: 0;
  flex: 1;
}
.support-main h3 {
  margin-bottom: .15rem;
}
.support-main h3 a {
  color: var(--text);
}
.support-row .actions {
  margin-left: auto;
}
.menu-list .menu-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  width: 100%;
  padding: .45rem .65rem;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.menu-list .menu-item:hover,
.menu-list .menu-item:focus-visible {
  background: var(--primary-soft);
}
@media (min-width: 961px) {
  .crumb-compact {
    display: none;
  }
}
.rate {
  display: flex;
  align-items: center;
  gap: .65rem;
}
.rate .bar {
  flex: none;
  width: 90px;
}

/* --- Tableaux --- */
.table-wrap {
  overflow-x: auto;
}
table.table {
  width: 100%;
  border-collapse: collapse;
}
.table th {
  text-align: left;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  padding: .7rem 1rem;
  border-bottom: 1px solid var(--border);
  background: #fafbfd;
  white-space: nowrap;
}
.table td {
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tr:last-child td {
  border-bottom: 0;
}
.table tbody tr:hover {
  background: #fafbff;
}
.table th a {
  color: inherit;
}
.table th a:hover {
  color: var(--primary);
  text-decoration: none;
}

/* --- Carnet de notes : synthèse et pondérations --- */
.gradebook-summary {
  display: grid;
  grid-template-columns: minmax(190px, 1.2fr) repeat(3, minmax(160px, 1fr));
  gap: .85rem;
  margin-bottom: 1rem;
}
.gradebook-summary-card {
  min-width: 0;
  padding: 1rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.gradebook-summary-card-final {
  color: #fff;
  background: linear-gradient(135deg, #4338ca, #6366f1);
  border-color: transparent;
}
.gradebook-summary-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}
.gradebook-summary-label {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.gradebook-summary-card-final .gradebook-summary-label,
.gradebook-summary-card-final .gradebook-summary-note {
  color: rgba(255,255,255,.78);
}
.gradebook-summary-value {
  margin-top: .55rem;
  font-size: 1.8rem;
  font-weight: 750;
  line-height: 1;
}
.gradebook-summary-value span {
  margin-left: .2rem;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 600;
}
.gradebook-summary-card-final .gradebook-summary-value span {
  color: rgba(255,255,255,.78);
}
.gradebook-summary-note {
  margin-top: .45rem;
  color: var(--muted);
  font-size: .78rem;
}
.gradebook-settings-body {
  display: grid;
  gap: 1.25rem;
  padding: 1.25rem;
}
.gradebook-settings-section + .gradebook-settings-section {
  padding-top: 1.15rem;
  border-top: 1px solid var(--border);
}
.gradebook-settings-title {
  margin-bottom: .8rem;
}
.gradebook-settings-title h3 {
  margin: 0;
  font-size: 1rem;
}
.gradebook-settings-title p {
  margin: .2rem 0 0;
}
.gradebook-category-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .8rem;
}
.gradebook-work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: .75rem;
}
.gradebook-weight-field {
  display: grid;
  gap: .3rem;
  padding: .75rem;
  background: #fafbff;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.gradebook-weight-field label {
  display: block;
  min-height: 1.25rem;
  color: var(--text);
  font-size: .86rem;
  font-weight: 650;
}
.gradebook-work-field label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gradebook-settings-footer {
  display: flex;
  justify-content: flex-end;
  padding: .85rem 1.25rem;
  border-top: 1px solid var(--border);
  background: #fafbff;
  border-radius: 0 0 var(--radius) var(--radius);
}
.gradebook-weight-preview {
  margin-top: 1rem;
  padding: .85rem 1rem;
  background: #f7f8ff;
  border: 1px solid #dfe3ff;
  border-radius: 10px;
}
.gradebook-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .65rem;
  font-size: .86rem;
}
.gradebook-preview-head span {
  color: var(--muted);
  font-size: .78rem;
}
.gradebook-preview-bars {
  display: grid;
  gap: .45rem;
}
.gradebook-preview-row {
  display: grid;
  grid-template-columns: 82px 1fr 52px;
  align-items: center;
  gap: .55rem;
  font-size: .8rem;
}
.gradebook-preview-row .bar {
  min-width: 0;
  height: 7px;
}
.gradebook-preview-result {
  margin: .7rem 0 0;
}
.gradebook-publishing-body,
.gradebook-import-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .65rem;
}
.gradebook-publishing-body form {
  margin: 0;
}
.gradebook-export-form {
  display: flex;
  flex-direction: column;
  gap: .65rem;
  width: 100%;
}
.gradebook-export-groups {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem 1.1rem;
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.gradebook-export-groups legend {
  padding: 0;
  margin-bottom: .35rem;
  color: var(--muted);
}
.gradebook-export-group {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}
.gradebook-export-all {
  font-weight: 600;
}
.gradebook-export-form .error {
  margin: 0;
  color: var(--danger);
}
.gradebook-export-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
}
.gradebook-publishing-body .btn[disabled] {
  opacity: .5;
  cursor: not-allowed;
}
.gradebook-import-form {
  padding: 1rem 1.25rem 1.25rem;
}
.gradebook-file {
  display: grid;
  gap: .35rem;
  flex: 1 1 280px;
  color: var(--muted);
  font-size: .85rem;
  font-weight: 600;
}
.student-progress-card {
  margin-bottom: 1.25rem;
}
.student-progress-card > .card-head > strong {
  color: var(--primary);
  font-size: 1.35rem;
}
.progress-bar {
  height: 10px;
  min-width: 0;
}
.student-progress-stats {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem 1.25rem;
  margin-top: .8rem;
  color: var(--muted);
  font-size: .84rem;
}
.student-progress-stats strong {
  color: var(--text);
}
.gradebook-table-card .table-wrap {
  max-height: 70vh;
}
.gradebook thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}
.gradebook thead th:first-child,
.gradebook thead th:nth-child(2) {
  z-index: 3;
}
.gradebook tbody td:first-child,
.gradebook tbody td:nth-child(2) {
  background: var(--surface);
}
.gradebook tbody tr:hover td:first-child,
.gradebook tbody tr:hover td:nth-child(2) {
  background: #fafbff;
}
.gradebook tfoot th {
  position: sticky;
  bottom: 0;
  z-index: 2;
  background: #fafbfd;
}
.gradebook-stats tfoot th,
.gradebook-stats tfoot td {
  position: static;
  background: #fafbfd;
}
.bar {
  height: 8px;
  background: #eceef6;
  border-radius: 999px;
  overflow: hidden;
  min-width: 90px;
}
.bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #4338ca);
  border-radius: 999px;
}

/* --- Formulaires --- */
.form {
  display: grid;
  gap: 1.1rem;
  max-width: 640px;
}
.field label {
  display: block;
  font-weight: 600;
  margin-bottom: .3rem;
}
.input,
.select,
.textarea,
.file {
  width: 100%;
  padding: .6rem .75rem;
  border: 1px solid #cdd2e0;
  border-radius: 8px;
  font: inherit;
  background: #fff;
  color: var(--text);
}
.input:focus,
.select:focus,
.textarea:focus,
.btn:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(99,102,241,.35);
  outline-offset: 1px;
  border-color: var(--primary);
}
.field.has-error .input,
.field.has-error .select,
.field.has-error .textarea {
  border-color: var(--danger);
}
.help {
  color: var(--muted);
  font-size: .85rem;
  margin-top: .25rem;
}
.errorlist {
  list-style: none;
  margin: .3rem 0 0;
  padding: 0;
  color: var(--danger);
  font-size: .88rem;
}
.form-actions {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
  margin-top: .5rem;
}
.toolbar {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
  align-items: center;
  padding: .9rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.toolbar .input,
.toolbar .select {
  width: auto;
  min-width: 160px;
}
.toolbar .search {
  flex: 1 1 240px;
  position: relative;
}
.toolbar .search .input {
  width: 100%;
  padding-left: 2.2rem;
}
.toolbar .search .i {
  position: absolute;
  left: .7rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}
.checkbox {
  width: 1.05rem;
  height: 1.05rem;
}

/* --- Alertes, toasts, vide, pagination --- */
.alert {
  display: flex;
  gap: .7rem;
  padding: .85rem 1rem;
  border-radius: 8px;
  border: 1px solid;
  margin-bottom: 1rem;
}
.alert-danger {
  background: var(--danger-soft);
  border-color: #f4b4b4;
  color: #7f1d1d;
}
.alert-warning {
  background: var(--warning-soft);
  border-color: #f0d29b;
  color: #7a3a07;
}
.alert-info {
  background: var(--info-soft);
  border-color: #b9cdf7;
  color: #173a8c;
}
.alert-success {
  background: var(--success-soft);
  border-color: #a8dcbc;
  color: #0f5a2c;
}
.toasts {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  width: min(380px, calc(100vw - 2rem));
}
.toast {
  display: flex;
  gap: .7rem;
  align-items: flex-start;
  padding: .8rem 1rem;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--info);
  box-shadow: 0 8px 24px rgba(16,24,40,.16);
  animation: slide .25s ease-out;
}
.toast.success {
  border-left-color: var(--success);
}
.toast.error {
  border-left-color: var(--danger);
}
.toast.warning {
  border-left-color: var(--warning);
}
.toast .close {
  margin-left: auto;
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--muted);
  padding: 0;
}
@keyframes slide {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.empty {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--muted);
}
.empty .empty-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 1rem;
  border-radius: 16px;
  background: var(--primary-soft);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-size: 1.7rem;
}
.empty h3 {
  color: var(--text);
  margin-bottom: .35rem;
}
.pagination {
  display: flex;
  gap: .35rem;
  justify-content: center;
  padding: 1rem;
  flex-wrap: wrap;
}
.pagination a,
.pagination span {
  padding: .35rem .7rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: #fff;
}
.pagination .current {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.pagination a:hover {
  background: #f0f2fa;
  text-decoration: none;
}
.skeleton {
  background: linear-gradient(90deg, #eceef6 25%, #f6f7fb 37%, #eceef6 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease infinite;
  border-radius: 6px;
  height: 1em;
}
@keyframes shimmer {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}
.upload-zone {
  border: 2px dashed #c4c9dc;
  border-radius: var(--radius);
  padding: 1.5rem;
  background: #fafbff;
}
.stack > * + * {
  margin-top: 1.25rem;
}
.list-plain {
  list-style: none;
  margin: 0;
  padding: 0;
}
.list-plain li {
  padding: .65rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  align-items: center;
}
.list-plain li:last-child {
  border-bottom: 0;
}
.row-error {
  background: #fff7f7;
}
.row-skipped {
  background: #fffbf1;
}

/* --- Dialogues --- */
dialog {
  border: 0;
  border-radius: 14px;
  padding: 0;
  width: min(460px, calc(100vw - 2rem));
  box-shadow: 0 24px 60px rgba(16,24,40,.3);
  color: var(--text);
}
dialog::backdrop {
  background: rgba(22,26,46,.55);
}
.dialog-body {
  padding: 1.4rem;
}
.dialog-body h3 {
  margin-bottom: .5rem;
}
.dialog-foot {
  display: flex;
  justify-content: flex-end;
  gap: .6rem;
  padding: 0 1.4rem 1.4rem;
}

/* --- Connexion --- */
.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: radial-gradient(circle at 20% 10%, #e3e6ff, transparent 40%), var(--bg);
}
.auth-card {
  width: min(420px, 100%);
  padding: 2rem;
}
.auth-card .brand {
  color: var(--text);
  padding-left: 0;
}

/* --- Responsive --- */
@media (max-width: 960px) {
  .shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 270px;
    transform: translateX(-100%);
    transition: transform .2s;
    z-index: 50;
  }
  body.nav-open .sidebar {
    transform: none;
  }
  body.nav-open::after {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 40;
  }
  .topbar {
    display: flex;
  }
  .content {
    padding: 1.25rem 1rem 2.5rem;
  }
  .grid-3 {
    grid-template-columns: 1fr;
  }
  .two-col {
    grid-template-columns: 1fr;
  }
  .supports-layout {
    grid-template-columns: 1fr;
  }
  .student-hero {
    grid-template-columns: 1fr;
  }
  .student-dashboard-grid {
    grid-template-columns: 1fr;
  }
  .gradebook-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .gradebook-summary-card-final {
    grid-column: 1 / -1;
  }
}
@media (max-width: 760px) {
  .student-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .hide-sm {
    display: none;
  }
  .table th,
  .table td {
    padding: .65rem .6rem;
  }
  .page-head .actions .btn {
    flex: 1 1 auto;
  }
  .support-row {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .support-row .actions {
    width: 100%;
    margin-left: 0;
  }
  .student-hero {
    padding: 1.15rem;
  }
  .student-hero .actions {
    display: grid;
    grid-template-columns: 1fr;
  }
  .student-hero .actions .btn {
    width: 100%;
  }
  .student-stats {
    gap: .65rem;
  }
  .student-stats .stat {
    padding: .85rem .75rem;
    gap: .65rem;
  }
  .student-stats .stat-icon {
    width: 38px;
    height: 38px;
    font-size: 1rem;
  }
  .student-stats .stat-value {
    font-size: 1.45rem;
  }
  .gradebook-summary {
    grid-template-columns: 1fr;
  }
  .gradebook-summary-card-final {
    grid-column: auto;
  }
  .gradebook-category-grid {
    grid-template-columns: 1fr;
  }
  .gradebook-settings-footer .btn {
    width: 100%;
  }
  .priority-item {
    align-items: flex-start;
  }
  .priority-due {
    margin-left: auto;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* Épreuve : le sujet reste flouté tant que la page n'est pas en plein écran (voir tp.js). */
.tp-gated {
  filter: blur(12px);
  user-select: none;
  pointer-events: none;
}
.tp-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, .6);
}
.tp-gate[hidden] {
  display: none;
}
.tp-gate-card {
  background: var(--surface);
  color: var(--text);
  border-radius: 12px;
  padding: 24px;
  max-width: 420px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .25);
}
.tp-gate-card h2 {
  margin: 0 0 8px;
}
.tp-gate-card p {
  margin: 0 0 16px;
  color: var(--muted);
}
.backup-output { margin: .5rem 0 0; padding: .75rem; max-height: 18rem; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; font-size: .85rem; }
