/* Atelier de l'après-midi : cas GxP Data Buddy.
   Complète assets/styles.css, qui reste la base commune aux deux pages. */

:root {
  --f-demande: #2663EB;
  --f-acces:   #10B981;
  --f-reponse: #7C3BED;
  --f-global:  #7F7F7F;
  --dot: #D7261E;
  --dot-ink: #FFFFFF;
}

/* ---------- barre de groupe ---------- */
.groupbar {
  display: flex; align-items: flex-end; gap: 12px 18px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.groupbar #f-groupe, .groupbar #f-groupe2 { flex: 0 1 240px; min-width: 180px; margin-right: auto; }
.groupbar select { height: 40px; }
.groupbar.attente select { border-color: var(--accent); }
.modes button { padding: 9px 18px; font-size: 13.5px; height: 40px; }

/* ---------- formulaire ---------- */
.band-hint { margin: 0; font-size: 12.5px; color: var(--ink-faint); }
form.dbform { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.dbform #f-titre, .dbform #f-descr { grid-column: 1; }
.dbform #f-famille { grid-column: 2; grid-row: 1 / span 2; }
@media (max-width: 820px) {
  form.dbform { grid-template-columns: 1fr; }
  .dbform #f-famille { grid-column: 1; grid-row: auto; }
}
.cnt { font-size: 10px; letter-spacing: .04em; color: var(--ink-faint); text-transform: none; }

.famband { display: grid; grid-template-columns: 1fr; gap: 7px; }
.famband > label {
  display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: center;
  cursor: pointer; background: var(--surface-2);
  border: 1px solid var(--line); border-left: 4px solid var(--fc);
  border-radius: var(--r-s); padding: 7px 10px 8px;
}
.famband > label:hover, .famband > label:has(input:checked) { background: var(--accent-soft); }
.famband > label:has(input:checked) { border-color: var(--fc); }
.famband > label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }
.famband input { margin: 0; width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }
.famband em { display: block; font-style: normal; font-size: 13px; font-weight: 600; }
.famband span.h { display: block; font-size: 11.5px; line-height: 1.35; color: var(--ink-faint); margin-top: 2px; }
.field.bad .famband { outline: 1px solid var(--z-red); outline-offset: 3px; border-radius: var(--r-s); }

[data-f="demande"] { --fc: var(--f-demande); }
[data-f="acces"]   { --fc: var(--f-acces); }
[data-f="reponse"] { --fc: var(--f-reponse); }
[data-f="global"]  { --fc: var(--f-global); }

/* ---------- barre de vote ---------- */
.votebar { display: flex; align-items: center; gap: 14px 24px; flex-wrap: wrap; justify-content: space-between; }
.vote-l h2 { font-size: 17px; }
.vote-l p { margin: 3px 0 0; font-size: 13px; color: var(--ink-soft); }
.vote-r { display: flex; align-items: center; gap: 12px 22px; flex-wrap: wrap; }
.budget { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-soft); }
.budget .slots { display: flex; gap: 5px; }
.budget .slots i {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--dot); box-shadow: 0 1px 2px rgba(0,0,0,.3);
}
.budget .slots i.used { background: transparent; border: 1.5px dashed var(--line-strong); box-shadow: none; }
.budget b { font-family: var(--mono); font-weight: 600; color: var(--ink); }

/* ---------- mur par famille ---------- */
.wall-head .btn.small { padding: 6px 12px; font-size: 12.5px; }

.flux {
  display: grid; gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.col {
  background: var(--surface); border: 1px solid var(--line);
  border-top: 3px solid var(--fc); border-radius: var(--r-m);
  padding: 11px 11px 13px; min-width: 0;
  display: flex; flex-direction: column; gap: 10px;
}
.col.global { grid-column: 1 / -1; }
.col-head { display: grid; grid-template-columns: 1fr minmax(0, auto) 1fr; align-items: baseline; gap: 8px; }
.col-head h3 { grid-column: 2; font-size: 15px; color: var(--fc); text-align: center; }
.col-head .eyebrow { grid-column: 3; justify-self: end; }
.col-sub { margin: -6px 0 0; font-size: 11.5px; color: var(--ink-faint); line-height: 1.35; }
.col-notes { display: grid; gap: 10px; grid-template-columns: 1fr; align-content: start; }
.col.global .col-notes { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.col-notes:empty::after { content: attr(data-vide); font-size: 12.5px; color: var(--ink-faint); padding: 6px 2px; }
.flux .col:not(.global) { position: relative; }
.flux .col:not(.global):not(:nth-child(3))::after {
  content: ""; position: absolute; right: -12px; top: 14px; width: 10px; height: 10px;
  border-top: 2px solid var(--line-strong); border-right: 2px solid var(--line-strong);
  transform: rotate(45deg);
}
@media (max-width: 900px) {
  .flux { grid-template-columns: 1fr; }
  .flux .col:not(.global)::after { display: none; }
}

.rnote {
  background: var(--note); border: 1px solid var(--note-line);
  border-left: 4px solid var(--fc); border-radius: 2px;
  padding: 9px 11px 10px; box-shadow: var(--shadow); position: relative;
  display: flex; flex-direction: column; gap: 5px;
}
.rnote .title { font-family: var(--serif); font-size: 15px; font-weight: 600; line-height: 1.25; padding-right: 20px; }
.rnote .descr { font-size: 12.5px; color: var(--ink-soft); line-height: 1.4; }
.rnote .foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.gchip {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .06em;
  padding: 2px 6px; border-radius: 2px; border: 1px solid var(--line-strong); color: var(--ink-soft);
}
.gchip.mine { border-color: var(--accent); color: var(--accent-ink); }
.rnote .kill {
  position: absolute; top: 5px; right: 5px; width: 20px; height: 20px;
  border: 0; border-radius: 2px; background: transparent; color: var(--ink-faint);
  font-size: 18px; line-height: 1; cursor: pointer;
}
.rnote .kill:hover { background: var(--z-red-bg); color: var(--z-red); }

/* pastilles collées sur le post-it */
.dots { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.dotp {
  appearance: none; border: 0; padding: 0; cursor: default;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--dot); color: var(--dot-ink);
  font-family: var(--mono); font-size: 9.5px; font-weight: 600; line-height: 20px; text-align: center;
  box-shadow: 0 1px 2px rgba(0,0,0,.35), inset 0 -2px 0 rgba(0,0,0,.15);
}
.dotp.mine { outline: 2px solid var(--ink); outline-offset: 1px; }
.vote .rnote:has(.dotp.mine) { box-shadow: 0 0 0 2px var(--dot), var(--shadow); }
.vote.plein .rnote:has(.dotp.mine) { cursor: pointer; }
.total {
  font-family: var(--mono); font-size: 10px; color: var(--dot); font-weight: 600; letter-spacing: .04em;
}

/* mode vote */
.vote .rnote { cursor: pointer; }
.vote .rnote:hover { box-shadow: var(--shadow-lift); }
.vote .rnote .kill { display: none; }
.vote.plein .rnote { cursor: default; }
.rnote.pop { animation: pop .25s ease-out; }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.03); } 100% { transform: scale(1); } }
.rnote.top { box-shadow: 0 0 0 2px var(--dot), var(--shadow); }

.switch button:disabled { opacity: .45; cursor: not-allowed; }
.votebar .chk-in { font-size: 13.5px; height: auto; }

/* ---------- plan d'action ---------- */
.inspecteur {
  margin: 0 0 16px; padding: 12px 16px;
  border-left: 4px solid var(--accent); background: var(--surface);
  border-radius: var(--r-s); box-shadow: var(--shadow);
}
.inspecteur h2 { font-size: 20px; color: var(--accent-ink); margin-top: 2px; }
.inspecteur .devise { margin: 2px 0 0; font-style: italic; color: var(--ink-soft); }
.inspecteur { display: flex; align-items: flex-start; gap: 18px; }
.insp-txt { flex: 1; min-width: 0; }
.insp-q { margin: 10px 0 2px; padding-left: 20px; display: flex; flex-direction: column; gap: 5px; }
.insp-q li { font-size: 14px; line-height: 1.45; color: var(--ink); font-weight: 600; }
.insp-q li::marker { color: var(--accent); }
.insp-photo {
  flex: none; width: 120px; height: 150px; object-fit: cover; object-position: top;
  border-radius: var(--r-s); border: 1px solid var(--line); box-shadow: var(--shadow);
}
@media (max-width: 620px) { .insp-photo { width: 84px; height: 105px; } }

form.noteform { grid-template-columns: minmax(0, 7fr) minmax(0, 2fr) minmax(0, 3fr); }
.noteform #f-texte { grid-column: 1; }
.noteform #f-type { grid-column: 2; }
.noteform #f-question { grid-column: 3; }
@media (max-width: 900px) {
  form.noteform { grid-template-columns: 1fr; }
  .noteform #f-type, .noteform #f-question { grid-column: 1; }
}
.noteform textarea { min-height: 112px; }
.qband { display: flex; flex-direction: column; gap: 7px; }
.qband > label {
  display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: start; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--line); border-left: 4px solid var(--accent);
  border-radius: var(--r-s); padding: 7px 10px; font-size: 12.5px; line-height: 1.35;
}
.qband > label:hover, .qband > label:has(input:checked) { background: var(--accent-soft); }
.qband > label:has(input:checked) { border-color: var(--accent); }
.qband input { margin: 2px 0 0; width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }
.qband b { font-family: var(--mono); font-size: 11px; margin-right: 4px; }
.field.bad .qband { outline: 1px solid var(--z-red); outline-offset: 3px; border-radius: var(--r-s); }

.qcols { display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .qcols { grid-template-columns: 1fr; } }
.qcol {
  background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--accent);
  border-radius: var(--r-m); padding: 11px 11px 13px; min-width: 0;
  display: flex; flex-direction: column; gap: 10px;
}
.qcol-head { display: flex; gap: 8px; align-items: baseline; }
.qcol-head .k { font-family: var(--mono); font-size: 11px; font-weight: 600; color: var(--accent-ink); }
.qcol-head h3 { font-family: var(--sans); font-size: 13.5px; font-weight: 600; line-height: 1.35; }
.qcol-head .eyebrow { margin-left: auto; }
.qnotes { display: flex; flex-direction: column; gap: 10px; }
.qnotes:empty::after { content: attr(data-vide); font-size: 12.5px; color: var(--ink-faint); padding: 6px 2px; }
.pnote {
  background: var(--note); border: 1px solid var(--note-line); border-left: 4px solid var(--accent);
  border-radius: 2px; padding: 9px 30px 10px 11px; box-shadow: var(--shadow); position: relative;
  font-size: 13.5px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere;
}
.pnote .kill {
  position: absolute; top: 5px; right: 5px; width: 20px; height: 20px;
  border: 0; border-radius: 2px; background: transparent; color: var(--ink-faint);
  font-size: 18px; line-height: 1; cursor: pointer;
}
.pnote .kill:hover { background: var(--z-red-bg); color: var(--z-red); }

/* types de note : actions, souhaits et idées, points de réflexion */
[data-t="action"]    { --tc: var(--z-play);    --tbg: var(--z-play-bg); }
[data-t="souhait"]   { --tc: var(--z-control); --tbg: var(--z-control-bg); }
[data-t="reflexion"] { --tc: var(--z-drift);   --tbg: var(--z-drift-bg); }

.tband { display: flex; flex-direction: column; gap: 7px; }
.tband > label {
  display: flex; gap: 8px; align-items: center; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--line); border-left: 4px solid var(--tc);
  border-radius: var(--r-s); padding: 8px 10px; font-size: 13px; font-weight: 600;
}
.tband > label:hover, .tband > label:has(input:checked) { background: var(--tbg); }
.tband > label:has(input:checked) { border-color: var(--tc); }
.tband input { margin: 0; width: 15px; height: 15px; accent-color: var(--tc); cursor: pointer; }
.field.bad .tband { outline: 1px solid var(--z-red); outline-offset: 3px; border-radius: var(--r-s); }

.qsec { display: flex; flex-direction: column; gap: 8px; padding-top: 8px; border-top: 1px dashed var(--line-strong); }
.qsec-head { display: flex; align-items: center; gap: 7px; }
.qsec-head i { width: 10px; height: 10px; border-radius: 2px; background: var(--tc); }
.qsec-head span { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--tc); font-weight: 600; }
.qsec-head em { margin-left: auto; font-style: normal; font-family: var(--mono); font-size: 10px; color: var(--ink-faint); }
.pnote[data-t] { background: var(--tbg); border-color: color-mix(in srgb, var(--tc) 30%, transparent); border-left-color: var(--tc); padding-right: 34px; }
.pnote .move {
  position: absolute; right: 5px; width: 20px; height: 17px; border: 0; border-radius: 2px;
  background: transparent; color: var(--ink-faint); font-size: 11px; line-height: 1; cursor: pointer;
}
.pnote .move.up { top: 27px; }
.pnote .move.down { top: 44px; }
.pnote .move:hover { background: var(--surface); color: var(--ink); }
.pnote .move:disabled { opacity: .25; cursor: default; background: transparent; }
.pnote { min-height: 66px; }
