/* ===================================================================
   DidaPy — espace projet (page élève /projets et onglet « Projets » du panneau enseignant)
   =================================================================== */
.proj { max-width: 1000px; margin: 0 auto; padding: 0 20px 60px; }
.proj .page-head { padding-left: 0; padding-right: 0; }
.proj input:not([type=checkbox]), .proj textarea, .proj select {
  font: 14px Inter, sans-serif; padding: 6px 9px; border: 1px solid var(--border2); border-radius: 7px; background: var(--panel); color: var(--text); min-width: 0; }
.proj textarea { resize: vertical; }
.pj-head h1 { margin-top: 12px; }
.pj-head .pj-st { margin-left: 6px; }
.pj-h { margin: 0; font-size: 18px; }

/* état d'un projet ou d'une tâche */
.pj-st { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 99px; background: var(--bg2); color: var(--muted); white-space: nowrap; }
.pj-live, .pj-t-doing { background: var(--accent-soft); color: var(--accent); }
.pj-soon, .pj-t-todo { background: var(--amber-soft); color: var(--amber); }
.pj-over, .pj-t-done { background: var(--green-soft); color: var(--green); }
.pj-locked { background: var(--red-soft); color: var(--red); }

/* équipes à rejoindre */
.pj-instr summary { cursor: pointer; font-weight: 600; margin: 6px 0; }
.pj-teams { list-style: none; padding: 0; margin: 12px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.pj-team { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--panel2); display: flex; flex-direction: column; gap: 6px; }
.pj-team.mine { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.pj-team-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.pj-team-act { margin-top: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* onglets et formulaires de l'équipe */
.pj-tabs { margin-top: 6px; }
.pj-form h3 { margin-bottom: 10px; }
.pj-form .chk { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; margin: 4px 0 10px; }
.pj-scroll { overflow-x: auto; margin-bottom: 14px; }
.pj-groups { border: 1px solid var(--border); border-radius: 9px; padding: 6px 12px 8px; margin: 0 0 10px; display: flex; gap: 14px; flex-wrap: wrap; }
.pj-groups legend { font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 0 4px; }
.pj-groups .chk { display: inline-flex; gap: 6px; align-items: center; font-size: 13.5px; }

/* tâches */
.pj-tasks { display: flex; flex-direction: column; gap: 8px; }
.pj-task { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--border); border-left: 4px solid var(--amber); border-radius: 9px; background: var(--panel); }
.pj-task.st-doing { border-left-color: var(--accent); }
.pj-task.st-done { border-left-color: var(--green); }
.pj-task.st-done b { text-decoration: line-through; color: var(--muted); }
.pj-task.mine { background: color-mix(in srgb, var(--accent-soft) 35%, var(--panel)); }
.pj-task-main { flex: 1 1 260px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pj-note { color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.pj-meter { height: 8px; min-width: 70px; border-radius: 99px; background: var(--bg2); overflow: hidden; }
.pj-meter.wide { max-width: 420px; margin-bottom: 14px; }
.pj-meter i { display: block; height: 100%; background: var(--green); border-radius: 99px; }
.pj-prog td:nth-child(n+2):not(:last-child) { text-align: center; }

/* frise du planning */
.pj-frise { position: relative; padding: 0 2px; overflow: hidden; }
.pj-scale { position: relative; height: 22px; border-bottom: 1px solid var(--border2); font-size: 11px; color: var(--faint); }
.pj-tick { position: absolute; bottom: 3px; padding-left: 3px; border-left: 1px solid var(--border2); white-space: nowrap; line-height: 1; height: 14px; }
.pj-lanes { position: relative; margin-top: 6px; }
.pj-empty { margin: 4px 0; }
.pj-bar { position: absolute; height: 24px; line-height: 24px; padding: 0 7px; border-radius: 6px; background: var(--accent); color: var(--accent-ink);
  font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-sizing: border-box; }
.pj-bar.done { background: var(--green); }
.pj-mile { position: absolute; height: 24px; display: flex; align-items: center; gap: 4px; transform: translateX(-7px); font-size: 12px; font-weight: 600; white-space: nowrap; }
.pj-mile i { width: 12px; height: 12px; background: var(--amber); transform: rotate(45deg); flex: none; border-radius: 2px; }
.pj-mile.done i { background: var(--green); }
.pj-mile span { background: color-mix(in srgb, var(--panel) 80%, transparent); padding: 0 3px; border-radius: 4px; }
.pj-today { position: absolute; top: -6px; bottom: 0; border-left: 2px dashed var(--red); }
.pj-mile.left { flex-direction: row-reverse; transform: translateX(calc(-100% + 7px)); }
.pj-today-l { display: inline-block; width: 0; height: 12px; border-left: 2px dashed var(--red); margin-left: 8px; }
.pj-dues { position: relative; height: 12px; border-top: 1px dashed var(--border); margin-top: 4px; }
.pj-due { position: absolute; top: 2px; width: 8px; height: 8px; border-radius: 50%; transform: translateX(-4px); background: var(--amber); }
.pj-due.st-doing { background: var(--accent); } .pj-due.st-done { background: var(--green); }
.pj-legend { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 10px 0 0; }
.pj-bar-l, .pj-mile-l, .pj-due-l { display: inline-block; width: 14px; height: 10px; border-radius: 3px; background: var(--accent); margin-left: 8px; }
.pj-mile-l { width: 9px; height: 9px; background: var(--amber); transform: rotate(45deg); border-radius: 1px; }
.pj-due-l { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); }

/* documents */
.pj-drop { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; border-style: dashed; }
.pj-drop.over { border-color: var(--accent); background: var(--accent-soft); }
.pj-drop #pjUpMsg { flex-basis: 100%; }
.pj-drop #pjUpMsg:empty { display: none; }
.pj-files a, .pj-docs a { overflow-wrap: anywhere; }
.ok { color: var(--green); }

/* panneau enseignant */
.adm .pj-adm-team .pj-tname { font: 700 16px Inter, sans-serif; flex: 0 1 260px; }
.pj-adm-team .pj-tsize { width: 64px; }
.pj-adm-team h4 { margin: 12px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); }
.pj-adm-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 18px; }
.pj-mem, .pj-free, .pj-docs { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
.pj-mem li, .pj-free li { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pj-mem select, .pj-free select { margin-left: auto; }
.pj-keep { margin-top: 12px; align-items: flex-end; }

@media (max-width: 760px) {
  .proj { padding: 0 16px 50px; }
  .pj-adm-grid { grid-template-columns: 1fr; }
  .pj-frise { min-width: 0; }
  .pj-tick:nth-child(even) { display: none; }
  .pj-mem select, .pj-free select { margin-left: 0; }
}
