body {
  background: var(--paper, #f7f6f2);
}

#app {
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

.dash-topbar {
  display: flex;
  align-items: center;
  gap: 22px;
  margin: 0 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(26, 35, 48, 0.12);
}

.dash-brand {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  line-height: 1.15;
  flex: 0 0 auto;
}
.dash-brand-t { font: 600 20px 'Source Serif 4', Georgia, serif; color: var(--ink, #1a2330); }
.dash-brand-s { font: 700 10.5px 'Source Sans 3', system-ui, sans-serif; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3, #6a7688); margin-top: 2px; }

.dash-nav {
  display: flex;
  gap: 4px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.dash-nav::-webkit-scrollbar { display: none; }

.dash-nav a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  padding: 7px 12px;
  border-radius: 999px;
  font: 600 13px 'Source Sans 3', system-ui, sans-serif;
  color: var(--ink-2, #3d4a5c);
  text-decoration: none;
}
.dash-nav a .nav-ico { width: 15px; height: 15px; flex: 0 0 auto; opacity: 0.8; }
.dash-nav a:hover { background: rgba(26, 35, 48, 0.06); color: var(--ink, #1a2330); }
.dash-nav a.is-active { background: var(--ink, #1a2330); color: #fff; }
.dash-nav a.is-active .nav-ico { opacity: 1; }

.dash-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin: 0 0 6px;
}
.dash-toolbar-l { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.dash-refresh {
  background: var(--accent, #2d6a4f);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  font: 600 13px 'Source Sans 3', system-ui, sans-serif;
  cursor: pointer;
  white-space: nowrap;
}

.dash-refresh:hover {
  background: var(--accent-2, #40916c);
}

@media (max-width: 720px) {
  .dash-topbar { flex-direction: column; align-items: flex-start; gap: 10px; }
}

h1 {
  font-family: 'Source Serif 4', serif;
  font-size: 28px;
  margin: 0 0 8px;
}

.dash-lead {
  color: var(--ink-2, #3d4a5c);
  max-width: 720px;
  line-height: 1.6;
  margin-bottom: 24px;
}

.dash-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}

.dash-card {
  background: #fff;
  border: 1px solid var(--paper-3, #e3e0d8);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dash-card-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--accent, #2d6a4f);
}

.dash-card-label {
  font-size: 12px;
  color: var(--ink-3, #6a7688);
}

.dash-table-wrap {
  overflow-x: auto;
  background: #fff;
  border: 1px solid var(--paper-3, #e3e0d8);
  border-radius: 10px;
}

.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.dash-table th,
.dash-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--paper-3, #e3e0d8);
  text-align: left;
  vertical-align: middle;
}

.dash-table th {
  background: var(--paper-2, #eeecea);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-3, #6a7688);
}

.dash-name {
  font-weight: 600;
  white-space: nowrap;
}

.dash-alert {
  display: inline-block;
  margin-left: 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  background: #fdecd2;
  color: #a5650f;
  border-radius: 999px;
  padding: 2px 8px;
}

.dash-bar {
  position: relative;
  width: 100px;
  height: 16px;
  background: var(--paper-2, #eeecea);
  border-radius: 999px;
  overflow: hidden;
}

.dash-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--accent-3, #52b788);
  border-radius: 999px;
}

.dash-bar-label {
  position: relative;
  z-index: 1;
  font-size: 10px;
  font-weight: 700;
  color: var(--ink, #1a2330);
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.dash-sub {
  display: block;
  font-size: 11px;
  color: var(--ink-3, #6a7688);
  margin-top: 4px;
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-score {
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.dash-score.ok {
  background: var(--accent-soft, #d8f3dc);
  color: var(--accent, #2d6a4f);
}

.dash-score.warn {
  background: #fdecd2;
  color: #a5650f;
}

.dash-score.empty {
  background: var(--paper-2, #eeecea);
  color: var(--ink-3, #6a7688);
}

.dash-empty {
  text-align: center;
  color: var(--ink-3, #6a7688);
  padding: 24px !important;
}

.dash-denied {
  text-align: center;
  padding: 60px 20px;
}

.dash-denied a {
  color: var(--accent, #2d6a4f);
}

.dash-link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent, #2d6a4f);
  font-size: 11px;
  text-decoration: underline;
  cursor: pointer;
}

.dash-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 26, 20, 0.45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  z-index: 50;
  overflow-y: auto;
}

.dash-modal-backdrop[hidden] {
  display: none;
}

.dash-modal {
  background: #fff;
  border-radius: 12px;
  max-width: 640px;
  width: 100%;
  padding: 20px 22px 26px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  max-height: min(92vh, 900px);
  overflow: auto;
}

.dash-modal.dash-modal-wide {
  max-width: 820px;
}

.expl-work {
  margin: 8px 0 12px;
  padding: 10px 12px;
  background: var(--paper-1, #f7f5f1);
  border-radius: 8px;
  border: 1px solid var(--paper-3, #e3e0d8);
}

.expl-work-block {
  margin-bottom: 12px;
}

.expl-work-block:last-child {
  margin-bottom: 0;
}

.expl-work-block h4 {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink-2, #5c574e);
}

.expl-work-list {
  margin: 0;
  padding-left: 1.2em;
}

.expl-work-list li {
  margin-bottom: 8px;
}

.expl-work-list p {
  margin: 2px 0 0;
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.45;
}

.expl-work-piece {
  margin-bottom: 10px;
}

.expl-work-piece strong {
  display: block;
  font-size: 12px;
  margin-bottom: 2px;
}

.expl-work-piece p {
  margin: 0;
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.45;
}

.expl-work-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent, #2d6a4f);
  margin-right: 6px;
}

.expl-work-empty {
  margin: 6px 0 10px;
  font-size: 13px;
  color: var(--ink-2, #5c574e);
}

.expl-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.expl-panel-head h2 {
  font-family: 'Source Serif 4', serif;
  font-size: 18px;
  margin: 0;
}

.dash-modal-close {
  background: var(--paper-2, #eeecea);
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
}

.expl-panel-row {
  border: 1px solid var(--paper-3, #e3e0d8);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
}

.expl-panel-row-head {
  margin-bottom: 8px;
}

.expl-panel-row-head .dash-sub {
  max-width: none;
  white-space: normal;
}

.expl-panel-comment {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--paper-3, #e3e0d8);
  border-radius: 8px;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 13px;
  resize: vertical;
}

.expl-panel-row-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.expl-panel-row-actions button {
  background: var(--accent, #2d6a4f);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.expl-panel-row-actions button:disabled {
  opacity: 0.6;
  cursor: default;
}

.expl-save-status {
  font-size: 11px;
  color: var(--ink-3, #6a7688);
}

/* ── Sélecteur de classe (vue serveur) ─────────────────────────── */
.dash-classe {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 700 11px 'Source Sans 3', system-ui, sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3, #6a7688);
  margin: 0;
}

.dash-classe select {
  border: 1px solid rgba(26, 35, 48, 0.16);
  border-radius: 999px;
  padding: 7px 12px;
  font: 600 13px 'Source Sans 3', system-ui, sans-serif;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink, #1a2330);
  background: #fff;
}

.dash-classe-info {
  font: 400 12.5px 'Source Sans 3', system-ui, sans-serif;
  color: var(--ink-3, #6a7688);
  margin: 0;
}
.dash-org-manage { border: 1px solid rgba(26,35,48,.16); border-radius: 999px; padding: 7px 11px; background: #fff; color: #334155; font: 600 12px 'Source Sans 3', sans-serif; cursor: pointer; }
.dash-org-manage:hover { border-color: #2d6a4f; color: #205c3b; }
.dash-org-create { display: flex; gap: 8px; align-items: end; margin: 0 0 18px; }
.dash-org-create label { flex: 1; display: grid; gap: 4px; color: #526071; font: 600 11px 'Source Sans 3', sans-serif; text-transform: uppercase; letter-spacing: .05em; }
.dash-org-create input, .dash-org-class select { min-height: 34px; box-sizing: border-box; border: 1px solid rgba(26,35,48,.16); border-radius: 7px; padding: 6px 8px; background: #fff; color: #273648; font: 400 13px 'Source Sans 3', sans-serif; }
.dash-org-create button { min-height: 34px; border: 0; border-radius: 7px; padding: 6px 11px; background: #205c3b; color: #fff; font: 600 12px 'Source Sans 3', sans-serif; cursor: pointer; }
.dash-org-classes { display: grid; gap: 7px; }
.dash-org-classes h3 { margin: 0 0 2px; font: 600 16px 'Source Serif 4', Georgia, serif; }
.dash-org-class { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px; border: 1px solid rgba(26,35,48,.1); border-radius: 8px; font: 600 13px 'Source Sans 3', sans-serif; color: #273648; }
.dash-org-class small { color: #6a7688; font-weight: 400; }
.dash-org-note { margin: 14px 0 0; padding: 9px 11px; border-radius: 8px; background: #eef7f0; color: #31553d; font-size: 12px; }

/* ── Le serveur n'a rien donné : on le dit clairement ──────────── */
.dash-serveur-ko {
  margin: 16px 0 20px;
  padding: 16px 20px;
  border-radius: 12px;
  background: #fff8e6;
  border: 1px solid #f0d999;
  color: #7a5713;
}
.dash-serveur-ko h3 { margin: 0 0 6px; font: 600 15px system-ui, sans-serif; }
.dash-serveur-ko p { margin: 0 0 10px; font: 400 13.5px/1.6 system-ui, sans-serif; }
.dash-serveur-ko .btn { display: inline-block; }

.dash-parcours { color: inherit; text-decoration: none; border-bottom: 1px dashed rgba(28,27,46,.35); }
.dash-parcours:hover { color: #b5182b; border-bottom-color: #b5182b; }

/* ── Pilotage : bandeau « Cette semaine », écart, point faible, remédiation ── */
.dash-semaine { margin: 14px 0 16px; padding: 16px 20px; border-radius: 14px; background: #fffdf9; border: 1px solid rgba(26,35,48,.12); border-left: 4px solid #b5182b; }
.dash-semaine h2 { margin: 0 0 6px; font: 600 20px 'Source Serif 4', Georgia, serif; }
.dash-ou { margin: 0 0 10px; font-size: 13.5px; color: #3d4a5c; }
.dash-ok { margin: 0; font-size: 14px; color: #2d6a4f; font-weight: 600; }
.dash-urgents { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.dash-urgents li { display: grid; grid-template-columns: 200px 1fr; gap: 12px; align-items: baseline; padding: 8px 12px; border-radius: 9px; background: #fff; border: 1px solid rgba(26,35,48,.1); font-size: 14px; }
.dash-urgents li::before { display: none; }
.dash-urgents li.p3 { border-left: 4px solid #b5182b; } .dash-urgents li.p2 { border-left: 4px solid #c2410c; } .dash-urgents li.p1 { border-left: 4px solid #d29a2b; }
.dash-urgents a { color: #1a2330; text-decoration: none; } .dash-urgents a:hover { color: #b5182b; }
.dash-urgents span { color: #3d4a5c; }
.dash-ecart { display: inline-block; padding: 2px 9px; border-radius: 6px; font: 700 12.5px 'Source Sans 3', sans-serif; }
.dash-ecart.ok { background: #d8f3dc; color: #2d6a4f; } .dash-ecart.warn { background: #fdf0db; color: #9a5b24; } .dash-ecart.ko { background: #f7e1e3; color: #b5182b; }
.dash-faible { font: 700 13px 'Source Sans 3', sans-serif; color: #b5182b; } .dash-faible.bilan { color: #5b21b6; }
.dash-remed { display: inline-block; padding: 2px 9px; border-radius: 6px; font: 700 12.5px 'Source Sans 3', sans-serif; }
.dash-remed.ok { background: #d8f3dc; color: #2d6a4f; } .dash-remed.warn { background: #fdf0db; color: #9a5b24; } .dash-remed.ko { background: #f7e1e3; color: #b5182b; }
.dash-row-ko td:first-child { box-shadow: inset 4px 0 0 #b5182b; } .dash-row-warn td:first-child { box-shadow: inset 4px 0 0 #d29a2b; }
@media (max-width: 720px) { .dash-urgents li { grid-template-columns: 1fr; } }

/* colonnes : entêtes sur une ligne, pastilles insécables */
.dash-table th { white-space: nowrap; }
.dash-ecart, .dash-remed, .dash-faible { white-space: nowrap; }
.dash-table td { vertical-align: top; }
.dash-table td .dash-sub { white-space: nowrap; }

/* ── Parcours & impact : traces pseudonymisées, lisibles par le professeur ── */
.dash-modal:has(.dash-trace-section) { max-width: 780px; max-height: min(84vh, 880px); overflow: auto; }
.dash-trace-intro { margin: 0 0 16px; color: var(--ink-3, #526071); font-size: 13px; line-height: 1.55; }
.dash-trace-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-bottom: 18px; }
.dash-trace-kpis > div { padding: 12px; border-radius: 10px; background: #f4f7f4; border: 1px solid #dbe7dc; }
.dash-trace-kpis b { display: block; color: #205c3b; font: 700 22px 'Source Serif 4', Georgia, serif; }
.dash-trace-kpis span { display: block; color: var(--ink-3, #526071); font-size: 11.5px; }
.dash-trace-section { margin-top: 16px; }
.dash-trace-section h3 { margin: 0 0 8px; font: 600 16px 'Source Serif 4', Georgia, serif; }
.dash-trace-list, .dash-trace-timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.dash-trace-list li, .dash-trace-timeline li { display: grid; grid-template-columns: minmax(145px, 0.7fr) 2fr; gap: 10px; padding: 8px 10px; border-radius: 8px; background: #fafaf8; border: 1px solid rgba(26,35,48,.09); font-size: 12.5px; }
.dash-trace-list b, .dash-trace-timeline b { display: block; }
.dash-trace-list span, .dash-trace-timeline span { color: #526071; }
.dash-trace-timeline time { color: #6a7688; font-variant-numeric: tabular-nums; }
.dash-trace-legend { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; color: #526071; font-size: 11.5px; }
.dash-trace-legend span { padding: 3px 7px; border-radius: 999px; background: #f0f4f0; border: 1px solid #dbe7dc; }
.dash-trace-days { display: grid; gap: 14px; }
.dash-trace-day { padding: 11px; border: 1px solid rgba(26,35,48,.1); border-radius: 10px; background: #fcfdfa; }
.dash-trace-day h4 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 0 0 10px; color: #273648; font: 600 14px 'Source Serif 4', Georgia, serif; text-transform: capitalize; }
.dash-trace-day h4 span { color: #6a7688; font: 600 11px 'Source Sans 3', sans-serif; white-space: nowrap; }
.dash-trace-events { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.dash-trace-event { width: 90px; min-height: 112px; display: grid; grid-template-rows: 60px auto; gap: 5px; }
.dash-trace-icon { display: grid; place-items: center; align-content: center; gap: 3px; padding: 6px; border-radius: 9px; background: #edf5ef; border: 1px solid #cfe2d3; color: #205c3b; text-decoration: none; transition: transform .12s ease, background .12s ease; }
.dash-trace-icon:hover, .dash-trace-icon:focus-visible { background: #dcefe0; transform: translateY(-2px); outline: 2px solid #2d6a4f; outline-offset: 2px; }
.dash-trace-icon b { font-size: 23px; line-height: 1; font-family: 'Source Sans 3', sans-serif; }
.dash-trace-icon time { color: #35546f; font: 700 11px 'Source Sans 3', sans-serif; font-variant-numeric: tabular-nums; }
.dash-trace-event-text { min-width: 0; color: #526071; font-size: 10.5px; line-height: 1.25; overflow-wrap: anywhere; }
.dash-trace-event-text b { display: block; color: #2c3a4b; font-size: 11px; }
.dash-trace-resource { display: block; margin-top: 2px; color: #526071; text-decoration: none; }
a.dash-trace-resource:hover, a.dash-trace-resource:focus-visible { color: #205c3b; text-decoration: underline; }
@media (max-width: 560px) { .dash-trace-kpis { grid-template-columns: 1fr; } .dash-trace-list li, .dash-trace-timeline li { grid-template-columns: 1fr; } }

/* ── Modération des liens externes (bloc surveillance → validation prof) ── */
.dash-moderation { margin: 22px 0 8px; }
.dash-mod-wrap {
  border: 1px solid #e6c9a8;
  background: linear-gradient(180deg, #fffaf3, #fdf3e6);
  border-radius: 14px;
  padding: 18px 20px 20px;
}
.dash-mod-wrap > h2 {
  font: 600 19px 'Source Serif 4', Georgia, serif;
  color: var(--ink, #1a2330);
  margin: 0 0 4px;
  display: flex; align-items: center; gap: 10px;
}
.dash-mod-count {
  font: 700 12px 'Source Sans 3', system-ui, sans-serif;
  background: #b5651d; color: #fff;
  min-width: 22px; height: 22px; padding: 0 7px;
  border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
}
.dash-mod-lead { color: var(--ink-2, #3d4a5c); font-size: 13.5px; margin: 0 0 14px; max-width: 70ch; }
.dash-mod-card {
  background: #fff;
  border: 1px solid var(--paper-3, #e3e0d8);
  border-radius: 11px;
  padding: 14px 16px;
  margin-top: 12px;
}
.dash-mod-card.is-busy { opacity: 0.55; pointer-events: none; }
.dash-mod-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.dash-mod-head h3 { font: 600 16px 'Source Serif 4', Georgia, serif; color: var(--ink, #1a2330); margin: 0; }
.dash-mod-tag {
  font: 700 10px 'Source Sans 3', system-ui, sans-serif;
  letter-spacing: 0.05em; text-transform: uppercase;
  background: #fbe3cc; color: #a14e12;
  padding: 3px 8px; border-radius: 999px;
}
.dash-mod-note { color: var(--ink-2, #3d4a5c); font-size: 13px; margin: 0 0 12px; max-width: 74ch; }
.dash-mod-form { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.dash-mod-url {
  flex: 1 1 320px;
  border: 1px solid var(--paper-3, #d8d4cc);
  border-radius: 8px; padding: 9px 11px;
  font-size: 13.5px; color: var(--ink, #1a2330); background: #fff;
}
.dash-mod-url:focus { outline: none; border-color: var(--accent, #2d6a4f); box-shadow: 0 0 0 3px rgba(45,106,79,0.12); }
.dash-mod-preview {
  border: 1px solid var(--accent, #2d6a4f); background: #fff; color: var(--accent, #2d6a4f);
  border-radius: 8px; padding: 9px 14px; font: 600 13px 'Source Sans 3', system-ui, sans-serif; cursor: pointer;
}
.dash-mod-preview:hover { background: var(--accent-soft, #d8f3dc); }
.dash-mod-view { margin: 4px 0 12px; }
.dash-mod-view iframe {
  width: 100%; max-width: 520px; aspect-ratio: 16 / 9; border: 0;
  border-radius: 10px; background: #000;
}
.dash-mod-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.dash-mod-accept {
  border: 0; background: var(--accent, #2d6a4f); color: #fff;
  border-radius: 8px; padding: 9px 16px; font: 600 13px 'Source Sans 3', system-ui, sans-serif; cursor: pointer;
}
.dash-mod-accept:hover:not(:disabled) { background: var(--accent-2, #40916c); }
.dash-mod-accept:disabled { background: #c7cdc9; cursor: not-allowed; }
.dash-mod-refuse {
  border: 1px solid var(--paper-3, #d8d4cc); background: #fff; color: var(--ink-2, #3d4a5c);
  border-radius: 8px; padding: 9px 16px; font: 600 13px 'Source Sans 3', system-ui, sans-serif; cursor: pointer;
}
.dash-mod-refuse:hover { background: var(--paper-2, #eeecea); }
