/* ---- Dev 2 → Scénarios : bac à sable de répartition des groupes ---- */
.sc-saved { font-size: 12px; color: var(--muted, #888); }
.sc-saved.ok { color: #16a34a; }
.sc-saved.bad { color: #dc2626; }

.sc-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 4px 0 12px; position: relative; }
.sc-days { display: flex; gap: 4px; flex-wrap: wrap; }
.sc-day {
  border: 1px solid rgba(127,127,127,.35); background: transparent; color: inherit; font: inherit; font-size: 13px; font-weight: 600;
  padding: 6px 12px; border-radius: 999px; cursor: pointer; transition: background .12s, border-color .12s;
}
.sc-day:hover { background: rgba(127,127,127,.12); }
.sc-day.active { background: var(--accent); border-color: var(--accent); color: #fff; }
body:not([data-theme="light"]) .sc-day.active { color: #111; }
.sc-day-n { font-weight: 700; opacity: .7; font-size: 11px; margin-left: 2px; }
.sc-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; }
.sc-actions .secondary-btn, .sc-actions .primary-btn { margin: 0; padding: 6px 12px; font-size: 13px; }
.sc-mini { font-size: 11px; color: var(--muted, #888); }

/* Fenêtre « Copier vers… » */
.sc-copy-pop {
  position: absolute; right: 0; top: 100%; z-index: 20; margin-top: 6px; padding: 10px 12px; min-width: 200px;
  background: #fff; color: #0f172a; border: 1px solid #e2e8f0; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.18);
  display: flex; flex-direction: column; gap: 4px; font-size: 13px;
}
body:not([data-theme="light"]) .sc-copy-pop { background: #2a2a2e; color: #e4e4e7; border-color: #3a3a3e; }
.sc-copy-title { font-weight: 700; margin-bottom: 4px; }
.sc-copy-pop label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.sc-copy-actions { display: flex; gap: 6px; margin-top: 8px; }
.sc-copy-actions button { margin: 0; padding: 5px 10px; font-size: 12px; }

/* Période de comparaison pour le risque de débordement. */
.sc-hist { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 0 0 10px; font-size: 13px; }
.sc-hist label { display: inline-flex; align-items: center; gap: 4px; }
.sc-hist input[type=date] { font: inherit; font-size: 12.5px; padding: 3px 6px; border-radius: 6px; border: 1px solid rgba(127,127,127,.4); background: transparent; color: inherit; }
.sc-hist-lbl { font-weight: 700; }
.sc-hist-note { font-size: 12px; color: var(--muted, #888); }
.sc-col-n[data-cap] { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 2px; }
/* Risque de débordement sous l'en-tête : vert < 5 %, ambre < 20 %, rouge au-delà. */
.sc-risk { margin: 0 8px 6px; padding: 3px 8px; border-radius: 8px; font-size: 11.5px; line-height: 1.3; cursor: help; }
.sc-risk b { font-size: 13px; }
.sc-risk-sub { opacity: .75; }
.sc-risk--na { color: var(--muted, #888); font-style: italic; }
.sc-risk--ok { background: rgba(34,197,94,.18); color: #15803d; }
.sc-risk--warn { background: rgba(245,158,11,.22); color: #b45309; }
.sc-risk--bad { background: rgba(239,68,68,.2); color: #b91c1c; }
body:not([data-theme="light"]) .sc-risk--ok { color: #86efac; }
body:not([data-theme="light"]) .sc-risk--warn { color: #fcd34d; }
body:not([data-theme="light"]) .sc-risk--bad { color: #fca5a5; }

/* Le tableau : une colonne par groupe, toutes de même largeur. */
.sc-board { display: grid; grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr)); gap: 10px; align-items: stretch; }
.sc-col {
  --rc: #94a3b8;
  display: flex; flex-direction: column; min-height: 360px; border-radius: 14px;
  border: 2px solid var(--rc); background: color-mix(in srgb, var(--rc) 10%, transparent);
  transition: box-shadow .12s, background .12s;
}
.sc-col.sc-over, .sc-pool.sc-over { box-shadow: 0 0 0 3px color-mix(in srgb, var(--rc, #94a3b8) 55%, transparent); background: color-mix(in srgb, var(--rc, #94a3b8) 22%, transparent); }
.sc-col-head { display: flex; align-items: center; gap: 6px; padding: 8px 10px 4px; font-weight: 800; font-size: 13px; color: var(--rc); min-width: 0; cursor: grab; border-radius: 12px 12px 0 0; }
.sc-col-head:hover { background: color-mix(in srgb, var(--rc) 18%, transparent); }
.sc-col-head:active { cursor: grabbing; }
.sc-col--dragging { opacity: .4; }
/* Repère d'insertion quand on déplace une colonne : barre à gauche ou à droite. */
.sc-col { position: relative; }
.sc-col.sc-ins-left::before, .sc-col.sc-ins-right::after { content: ''; position: absolute; top: 0; bottom: 0; width: 4px; border-radius: 2px; background: var(--accent); }
.sc-col.sc-ins-left::before { left: -7px; }
.sc-col.sc-ins-right::after { right: -7px; }
.sc-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--rc); flex: none; }
.sc-col-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.sc-col-n { font-size: 12px; font-weight: 800; opacity: .8; }
.sc-col--over .sc-col-n { color: #dc2626; opacity: 1; }
.sc-col--over { border-style: dashed; }

/* L'emplacement de l'éducatrice en haut de chaque colonne. */
.sc-col-edu { padding: 0 8px 8px; display: flex; flex-direction: column; gap: 4px; }
.sc-col-edu select[data-slot]:last-of-type { font-weight: 400; opacity: .8; border-style: dashed; }
.sc-col-ratio { font-size: 10.5px; color: var(--muted, #888); padding: 0 2px; }
.sc-col-ratio--short { color: #dc2626; font-weight: 700; }
body:not([data-theme="light"]) .sc-col-ratio--short { color: #fca5a5; }
.sc-col-edu select {
  width: 100%; font: inherit; font-size: 12.5px; font-weight: 600; padding: 5px 6px; border-radius: 8px;
  border: 1.5px solid color-mix(in srgb, var(--rc) 55%, transparent); background: rgba(255,255,255,.85); color: #0f172a; cursor: pointer;
}
body:not([data-theme="light"]) .sc-col-edu select { background: rgba(0,0,0,.35); color: #e4e4e7; }
.sc-col-edu--empty select { border-style: dashed; font-weight: 400; opacity: .8; }
.sc-col-edu select[data-slot]:last-of-type { border-style: dashed; }

/* Les enfants : carrés-photo (contour couleur du groupe) ou initiales. */
.sc-col-kids { flex: 1; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 6px; padding: 4px 8px 10px; min-height: 80px; }
.sc-kid { display: flex; flex-direction: column; align-items: center; width: 44px; cursor: grab; user-select: none; -webkit-user-select: none; }
.sc-kid:active { cursor: grabbing; }
.sc-kid--dragging { opacity: .35; }
.sc-kid-name { font-size: 10px; line-height: 1.1; margin-top: 2px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted, #888); }
.sc-hide-names .sc-kid-name { display: none; }
.sc-hide-names .sc-kid { width: 38px; }
.sc-sq {
  width: 38px; height: 38px; border-radius: 8px; box-sizing: border-box; flex: none;
  display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 13px; font-weight: 800;
  text-shadow: 0 1px 2px rgba(0,0,0,.25); pointer-events: none;
  background-image: linear-gradient(180deg, rgba(255,255,255,.28), rgba(255,255,255,0) 55%, rgba(0,0,0,.08));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), inset 0 -1.5px 3px rgba(0,0,0,.12), 0 3px 6px -3px rgba(0,0,0,.25);
}
.sc-sq--photo { position: relative; background: transparent !important; background-image: none; border: 2.5px solid; padding: 0; overflow: hidden; box-shadow: none; }
.sc-sq--photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 5.5px; display: block; pointer-events: none; -webkit-user-drag: none; }
/* Enfant placé ailleurs que dans son groupe habituel. */
.sc-kid--away .sc-sq { outline: 2px dashed rgba(0,0,0,.4); outline-offset: -3px; }
body:not([data-theme="light"]) .sc-kid--away .sc-sq { outline-color: rgba(255,255,255,.55); }
.sc-col-empty { font-size: 12px; color: var(--muted, #888); font-style: italic; padding: 4px 2px; }

/* En bas : non placés (enfants = zone de dépôt, éducatrices = liste). */
.sc-pools { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; margin-top: 14px; }
.sc-pool { border: 2px dashed rgba(127,127,127,.45); border-radius: 14px; min-height: 90px; transition: box-shadow .12s, background .12s; }
.sc-pool-head { padding: 8px 10px 4px; font-weight: 800; font-size: 13px; }
.sc-pool-body { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 8px 10px; }
.sc-edu-chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px;
  border: 1.5px solid var(--rc, #94a3b8); background: color-mix(in srgb, var(--rc, #94a3b8) 14%, transparent);
}
.sc-edu-chip i { width: 9px; height: 9px; border-radius: 50%; background: var(--rc, #94a3b8); }

@media (max-width: 900px) {
  .sc-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sc-pools { grid-template-columns: 1fr; }
}
