* { box-sizing: border-box; }
/* Palette (mode clair par défaut ; body.dark redéfinit tout) */
:root {
  --text: #1d2630;
  --muted: #5a6a7a;
  --line: #eef1f4;
  --input-bg: #ffffff;
  --input-border: #d0d6db;
  --sub-card: #f8fafc;
  --btn-soft: #eef1f4;
  --track: #e8edf2;
  --chip-bg: #ffffff;
  --planned-mark: #15803d;
  --today-bg: #eef2ff;
  --today-border: #c7d2fe;
  --danger-bg: #fee2e2;
  --danger-text: #dc2626;
}
body.dark {
  --text: #e7eaee;
  --muted: #9aa4b1;
  --line: #2a2f3a;
  --input-bg: #20252f;
  --input-border: #3a4150;
  --sub-card: #232833;
  --btn-soft: #2a2f3a;
  --track: #2f3542;
  --chip-bg: #2a303c;
  --planned-mark: #4ade80;
  --today-bg: #232c44;
  --today-border: #3b4a6b;
  --danger-bg: rgba(248, 113, 113, 0.14);
  --danger-text: #f87171;
}


html { scrollbar-gutter: stable; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg, #f4f6f8);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  transition: background 0.25s;
}

.hidden { display: none !important; }

/* ---- Login ---- */
#login-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  background: var(--card, #fff);
  border-radius: 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  padding: 32px 24px;
  width: 100%;
  max-width: 360px;
  text-align: center;
}
.login-logo { font-size: 40px; margin-bottom: 8px; }
.login-card h1 { font-size: 24px; margin: 0 0 6px; }
.login-sub { font-size: 14px; color: var(--muted); margin: 0 0 20px; }
.login-card input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--input-border);
  font-size: 16px;
  font-family: inherit;
  margin-bottom: 10px;
  background: var(--input-bg);
  color: var(--text);
}
.login-card button {
  width: 100%;
  padding: 13px;
  border: none;
  border-radius: 12px;
  background: var(--accent, #2563eb);
  color: white;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 4px;
}
.login-card button:disabled { opacity: 0.6; }
.login-error { color: #e74c3c; font-size: 14px; margin-top: 12px; font-weight: 600; }

/* ---- App ---- */
#app-view {
  max-width: 560px;
  margin: 0 auto;
  padding: 18px 16px calc(24px + env(safe-area-inset-bottom));
}
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.app-header h1 { font-size: 22px; margin: 0; }
.app-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
/* Déconnexion — au bas de la page Réglages */
#logout-btn {
  width: 100%;
  border: none;
  border-radius: 12px;
  background: var(--danger-bg);
  color: var(--danger-text);
  padding: 13px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 4px;
}

.card {
  background: var(--card, #fff);
  border-radius: 16px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.07);
  padding: 16px;
  margin-bottom: 14px;
}
.card h2 { font-size: 16px; margin: 0 0 12px; }
.card-title-row {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 10px;
}
/* Le compteur se colle à droite; un bouton éventuel le suit proprement. */
.card-title-row .team-count, .card-title-row .big-count { margin-left: auto; }
.card-title-row h2 { margin-bottom: 12px; }
.big-count { font-size: 22px; font-weight: 800; color: var(--accent, #2563eb); }
.empty-msg { text-align: center; color: var(--muted); font-size: 15px; line-height: 1.5; margin: 8px 0; }

/* Donut */
.donut-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}
#donut-container svg { display: block; }
#donut-legend { flex: 1; min-width: 150px; }
.donut-legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  padding: 3px 0;
}
.donut-legend-row--empty { opacity: 0.55; }
.donut-legend-dot {
  width: 11px; height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
}
.donut-legend-name { flex: 1; }
.donut-legend-val { font-weight: 700; }

/* Bar chart */
.bar-chart { width: 100%; overflow-x: auto; }
.bar-chart svg { display: block; }

/* Team list */
.team-count { font-size: 13px; color: var(--muted); font-weight: 600; }
.team-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 2px;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}
.team-row:last-child { border-bottom: none; }
.team-row--out { opacity: 0.45; }
.team-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.team-dot--in    { background: #2ecc71; }
.team-dot--break { background: #f39c12; }
.team-dot--out   { background: #cbd5e1; }
.team-name { flex: 1; font-weight: 600; }
.team-status { font-size: 13px; color: var(--muted); font-weight: 600; }

/* My hours */
.hours-select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--input-border);
  font-size: 15px;
  font-family: inherit;
  background: var(--input-bg);
  color: var(--text);
  margin-bottom: 10px;
}
.hours-dates {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--muted);
}
.hours-dates label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
.hours-dates input {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--input-border);
  font-size: 14px;
  font-family: inherit;
  background: var(--input-bg);
  color: var(--text);
}
.hours-dates button {
  border: none;
  border-radius: 10px;
  background: var(--accent, #2563eb);
  color: white;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.hours-range { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.hours-breakdown-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  padding: 5px 0;
  color: var(--text);
}
.hours-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 16px;
  padding: 10px 0 4px;
  border-top: 1px solid var(--line);
  margin-top: 6px;
}
.hours-total-row strong { color: var(--accent, #2563eb); }
.hours-days-title { font-size: 14px; margin: 14px 0 6px; }
.hours-day-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 2px;
  border-bottom: 1px solid var(--line);
}
.hours-day-row:last-child { border-bottom: none; }
.hours-day-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hours-day-date { font-size: 14px; font-weight: 700; text-transform: capitalize; }
.hours-day-segs { font-size: 12.5px; color: var(--muted); }
.hours-day-total { font-size: 14px; font-weight: 700; flex-shrink: 0; }

/* Refresh */
.refresh-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}
#refresh-btn {
  border: none;
  border-radius: 10px;
  background: var(--btn-soft);
  color: var(--text);
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

/* Schedule */
.sched-week-title {
  font-size: 12.5px;
  color: var(--muted);
  margin: 14px 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.sched-week-title:first-of-type { margin-top: 2px; }
.sched-week-total { text-transform: none; letter-spacing: 0; font-weight: 700; color: var(--accent, #2563eb); }

.sched-day {
  background: var(--sub-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 8px;
}
.sched-day--today {
  background: var(--today-bg);
  border-color: var(--today-border);
}
.sched-day--past { opacity: 0.55; }
.sched-day-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
  flex-wrap: wrap;
}
.sched-day-name { font-size: 14px; font-weight: 700; }
.sched-today-badge {
  background: var(--accent, #2563eb);
  color: white;
  font-size: 10.5px;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 8px;
  margin-left: 8px;
  vertical-align: 2px;
}
.sched-day-times { font-size: 13.5px; }
.sched-shift { font-weight: 700; color: var(--accent, #2563eb); white-space: nowrap; }
.sched-off { color: var(--muted); font-weight: 600; }
.sched-none { color: #b45309; font-weight: 600; font-size: 13px; }

.sched-track {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: var(--track);
  overflow: hidden;
}
.sched-track--none {
  background: repeating-linear-gradient(45deg, var(--sub-card) 0 6px, var(--track) 6px 12px);
}
.sched-bar {
  position: absolute;
  top: 0; bottom: 0;
  background: var(--accent, #2563eb);
  border-radius: 999px;
}
.sched-bar-pause {
  position: absolute;
  top: 2px; bottom: 2px;
  background: #bfdbfe;
  border-radius: 999px;
}
.sched-pause-txt { font-size: 12px; color: var(--muted); margin-top: 5px; }

/* Ma journée (ligne du temps en direct) */
.myday-track {
  position: relative;
  height: 26px;
  background: var(--track);
  border: 1px solid var(--input-border);
  border-radius: 6px;
  overflow: hidden;
}
.myday-seg { position: absolute; top: 0; height: 100%; }
.myday-seg--planned { background: rgba(46, 204, 113, 0.16); }
.myday-seg--work { background: #2ecc71; }
.myday-seg--out { background: #e74c3c; }
/* Manqué (retard / départ hâtif) : ambre rayé — distinct de la pause orange. */
.myday-seg--miss { background: repeating-linear-gradient(45deg, #d97706 0 5px, #fcd9a0 5px 10px); }
/* Pause : orange plein, comme la ligne du temps de la gestion. */
.myday-seg--break { background: #f39c12; }
.myday-now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--text); opacity: 0.55; }
.myday-axis { position: relative; height: 16px; margin-top: 4px; }
.myday-tick { position: absolute; transform: translateX(-50%); font-size: 10.5px; color: var(--muted); }
.myday-caption { font-size: 13.5px; color: var(--text); margin-top: 4px; }
.myday-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.myday-legend span { display: flex; align-items: center; gap: 5px; }
.myday-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.myday-dot--work { background: #2ecc71; }
.myday-dot--out { background: #e74c3c; }
.myday-dot--miss { background: repeating-linear-gradient(45deg, #d97706 0 3px, #fcd9a0 3px 6px); }
.myday-dot--break { background: #f39c12; }

/* Ma journée : lignes prévues + écarts */
.myday-marks { position: relative; height: 32px; margin-bottom: 3px; }
.myday-mark-label {
  position: absolute;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  white-space: nowrap;
  line-height: 1.25;
}
.myday-mark-label--left  { align-items: flex-start; }
.myday-mark-label--right { align-items: flex-end; }
.myday-mark-label b { font-size: 12px; font-weight: 800; color: var(--planned-mark); }
.myday-mark-label i { font-style: normal; font-size: 10.5px; font-weight: 700; color: var(--muted); }
.myday-mark-label i.myday-delta--ok   { color: #16a34a; }
.myday-mark-label i.myday-delta--out  { color: #e74c3c; }
.myday-mark-label i.myday-delta--miss { color: #d97706; }
.myday-mark-label--pause b { color: #d97706; font-size: 11px; }
.myday-mark-label--pause i { color: #d97706; opacity: .8; }
.myday-mark {
  position: absolute;
  top: 0; bottom: 0;
  width: 2px;
  background: var(--planned-mark);
}
.myday-status { font-size: 13px; color: var(--text); margin-top: 6px; display: flex; flex-direction: column; gap: 3px; }
.myday-delta { font-weight: 700; color: var(--muted); }
.myday-delta--ok   { color: #16a34a; }
.myday-delta--out  { color: #e74c3c; }
.myday-delta--miss { color: #d97706; }

/* Notifications push */
.notif-card { padding: 12px 16px; }
.notif-row { display: flex; align-items: center; gap: 12px; }
#notif-label { flex: 1; font-size: 13.5px; color: var(--text); line-height: 1.45; }
#notif-btn {
  border: none;
  border-radius: 10px;
  background: var(--accent, #2563eb);
  color: white;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}

/* Cloche de notifications dans l'entête */
.app-header-actions { display: flex; align-items: center; gap: 8px; }
#notif-bell {
  border: none;
  border-radius: 10px;
  background: var(--btn-soft);
  padding: 8px 12px;
  font-size: 15px;
  cursor: pointer;
  line-height: 1;
}
#notif-bell.notif-bell--on { background: #dcfce7; }

/* Page Réglages */
.settings-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.settings-head h2 { font-size: 18px; margin: 0; }
#settings-back {
  border: none;
  border-radius: 10px;
  background: var(--btn-soft);
  color: var(--text);
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
#settings-btn {
  border: none;
  border-radius: 10px;
  background: var(--btn-soft);
  padding: 8px 12px;
  font-size: 15px;
  cursor: pointer;
  line-height: 1;
}
.settings-label { font-size: 13px; font-weight: 600; color: var(--muted); margin: 10px 0 8px; }
.swatch-row { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch {
  width: 40px; height: 40px;
  border-radius: 12px;
  border: 2px solid rgba(0,0,0,0.08);
  cursor: pointer;
  padding: 0;
}
.swatch--on { border-color: var(--text); box-shadow: 0 0 0 2px var(--card) inset; }

/* Détail d'un groupe (pointe de pizza touchée) */
.donut-legend-row { cursor: pointer; border-radius: 8px; padding-left: 4px; padding-right: 4px; }
.donut-legend-row--on { background: var(--btn-soft); font-weight: 700; }
.donut-legend-row--empty { cursor: default; }
#donut-detail {
  margin-top: 12px;
  background: var(--sub-card);
  border: 1px solid var(--line);
  border-left: 4px solid #cbd5e1;
  border-radius: 12px;
  padding: 12px 14px;
}
.donut-detail-title { font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.donut-detail-names { display: flex; flex-wrap: wrap; gap: 6px; }
.kid-chip {
  background: var(--chip-bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.kid-chip--sel {
  border-color: var(--accent, #2563eb);
  box-shadow: 0 0 0 2px var(--accent, #2563eb) inset;
  opacity: 1;
}
.donut-detail-empty { font-size: 13px; color: var(--muted); }

/* Barre de double confirmation du pointage enfant */
.kid-confirm {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--chip-bg);
  font-size: 13.5px;
}
.kid-confirm--err { color: #e74c3c; font-weight: 600; }
.kid-confirm-txt { margin-bottom: 8px; }
.kid-confirm-btns { display: flex; gap: 8px; }
.kid-confirm-yes {
  flex: 1;
  border: none;
  border-radius: 10px;
  background: #16a34a;
  color: #fff;
  font-weight: 700;
  font-size: 13.5px;
  padding: 9px 12px;
}
.kid-confirm-yes--out { background: #dc2626; }
.kid-confirm-yes:disabled { opacity: 0.6; }
.kid-confirm-no {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  font-weight: 700;
  font-size: 13.5px;
  padding: 9px 14px;
}

/* Mode clair / sombre */
.mode-row { display: flex; gap: 8px; }
.mode-btn {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--btn-soft);
  color: var(--text);
  padding: 9px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.mode-btn--on { background: var(--accent, #2563eb); border-color: var(--accent, #2563eb); color: #fff; }

/* Navigation de semaine (Mon horaire) */
.sched-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.sched-nav-label {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}
#sched-week-label { font-size: 14px; font-weight: 700; }
.sched-nav .sched-week-total { font-size: 12.5px; }
#sched-prev, #sched-next, #hours-nav-prev, #hours-nav-next {
  border: none;
  border-radius: 10px;
  background: var(--btn-soft);
  color: var(--text);
  width: 38px;
  height: 38px;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
  flex-shrink: 0;
}
#sched-prev:disabled, #sched-next:disabled { opacity: 0.35; cursor: default; }
#hours-nav { margin-top: 10px; }
.hours-nav-reset {
  border: 1px solid var(--line); background: var(--sub-card); color: var(--muted);
  font-size: 12px; font-weight: 700; padding: 5px 11px; border-radius: 999px; cursor: pointer; white-space: nowrap;
}
.hours-nav-reset.is-now { background: var(--accent, #2563eb); border-color: var(--accent, #2563eb); color: #fff; }

/* Répartition des locaux (glisser-déposer) */
.disp-hint { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }
.disp-unassigned {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 44px;
  padding: 8px;
  border: 1.5px dashed var(--input-border);
  border-radius: 12px;
  margin-bottom: 12px;
  align-items: center;
}
.disp-empty { font-size: 13px; color: var(--muted); }
.disp-name {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--sub-card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.disp-name i { width: 9px; height: 9px; border-radius: 50%; }
.disp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas:
    "poup  jaune"
    "bleu  jaune"
    "bleu  orange"
    "rouge orange";
  grid-template-rows: minmax(64px, auto) minmax(30px, auto) minmax(64px, auto) minmax(64px, auto);
  gap: 10px;
}
.disp-room {
  border-radius: 14px;
  border: 2px solid;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
}
.disp-room-head { font-size: 12.5px; font-weight: 800; margin-bottom: 6px; }
.disp-room-count { opacity: 0.65; font-weight: 700; }
/* Rangées fixes pour visualiser les ratios : 4 enfants par rangée (2 rangées
   pleines = 1 éducatrice à 1:8), 5 par rangée à la pouponnière (1 rangée
   pleine = 1 éducatrice à 1:5) et au local rouge (2 rangées pleines = 1:10).
   Revert : flex + flex-wrap, carrés 38px. */
.disp-room-kids {
  display: grid; grid-template-columns: repeat(var(--kidcols, 4), minmax(0, 38px));
  gap: 6px; align-content: flex-start; flex: 1;
}
/* Local partagé (Bleu 1 + Bleu 2…) : le conteneur empile les blocs de
   sous-groupes; la grille de carrés est dans .disp-subgrp-kids. */
.disp-room-kids.disp-room-kids--grouped { display: flex; flex-direction: column; gap: 0; }
.disp-room-kids .disp-kid, .disp-subgrp-kids .disp-kid {
  width: auto; height: auto; aspect-ratio: 1 / 1; max-width: 38px;
}
/* Carré-photo : contour à la couleur du groupe, photo au centre. */
.disp-kid--photo {
  background: transparent !important;
  border: 2.5px solid;
  padding: 0;
  overflow: hidden;
  box-sizing: border-box;
}
.disp-kid--photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
}
.disp-kid {
  width: 38px; height: 38px;
  border-radius: 10px;
  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,0.25);
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
/* Couleur du local : --rc posé en ligne sur la case (Dev → Locaux). */
.disp-room { --rc: #94a3b8; border-color: var(--rc); background: color-mix(in srgb, var(--rc) 11%, transparent); }
.disp-room-head { color: var(--rc); }
/* Vue Sieste : fil des créneaux sous les groupes */
.disp-sleep-slots { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; padding-top: 6px; border-top: 1px dashed color-mix(in srgb, var(--rc) 40%, transparent); font-size: 11px; line-height: 1.3; }
.disp-sleep-slot { display: flex; gap: 6px; align-items: baseline; }
.disp-sleep-slot b { flex: none; font-weight: 800; }
.disp-sleep-slot span { min-width: 0; }
.disp-sleep-slot i { font-style: normal; opacity: .7; }
.disp-sleep-slot u { text-decoration: none; font-weight: 700; color: #2563eb; }
.disp-sleep-empty { font-size: 11px; opacity: .6; font-style: italic; }
.disp-room-edu--visiting { font-style: italic; }
.disp-room-edu--warn { color: #b45309; font-weight: 800; }
.disp-subgrp-label em { font-style: normal; font-weight: 600; text-transform: none; letter-spacing: 0; opacity: .8; margin-left: 4px; }
.sleep-note--leave { color: #b91c1c; }
.sleep-note--bad { color: #b91c1c; background: rgba(239,68,68,.1); border-radius: 10px; padding: 8px 10px; }
.sleep-note--ok { color: #15803d; }
.sleep-note--warn { color: #b45309; }
.disp-drop-hover { outline: 3px solid var(--accent, #2563eb); outline-offset: 2px; }
.disp-ghost {
  position: fixed;
  z-index: 999;
  width: 44px; height: 44px;
  margin: -22px 0 0 -22px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.3);
  pointer-events: none;
}
.disp-no-select { user-select: none; -webkit-user-select: none; }

/* Détail de groupe : étoile favori + liste des absents */
#donut-detail { position: relative; }
.donut-fav-btn {
  position: absolute; top: 6px; right: 8px;
  border: none; background: transparent; cursor: pointer;
  font-size: 22px; line-height: 1; padding: 6px;
  color: var(--muted);
}
.donut-fav-btn--on { color: #f59e0b; }
.donut-detail-title { padding-right: 34px; }
.donut-detail-subtitle { font-size: 13px; font-weight: 700; color: var(--muted); margin: 12px 0 6px; }
.kid-chip--absent { opacity: 0.55; font-weight: 500; }

/* ---- Barre d'onglets (Dashboard / Mes infos) ---- */
#app-view { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
#tab-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex; justify-content: center; gap: 0;
  background: var(--card);
  border-top: 1px solid var(--line);
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
}
#tab-bar .tab-btn {
  flex: 1; max-width: 280px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  border: none; background: transparent; cursor: pointer;
  font-size: 12px; font-weight: 600; color: var(--muted);
  padding: 6px 0;
}
#tab-bar .tab-btn .tab-icon { font-size: 20px; line-height: 1; }
#tab-bar .tab-btn.active { color: var(--accent, #2563eb); }

/* ---- Ordre de départ ---- */
.cutrank-explain { font-size: 14px; line-height: 1.5; margin: 0 0 10px; }
.cutrank-bank {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--sub-card); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 12px; font-size: 13.5px; margin-bottom: 10px;
}
.cutrank-note { font-size: 12.5px; color: var(--muted); line-height: 1.45; margin: 0; }

/* Bouton « ? » de l'ordre de départ */
.cutrank-help {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; margin-left: 6px; vertical-align: 2px;
  border: 1px solid var(--line); border-radius: 50%;
  background: var(--sub-card); color: var(--muted);
  font-size: 12px; font-weight: 700; cursor: pointer; padding: 0;
}

/* Bulle « nom complet » sur un carré d'initiales */
#disp-bubble {
  position: fixed; z-index: 200; transform: translate(-50%, -100%);
  background: var(--text); color: var(--card);
  padding: 6px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 700; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity 0.15s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}
#disp-bubble.on { opacity: 1; }

/* Sous-groupes dans un local partagé (Bleu 1 / Bleu 2, Orange 1 / 2) */
.disp-subgrp { margin-bottom: 6px; }
.disp-subgrp-label { font-size: 10.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 3px; }
.disp-subgrp-kids { display: grid; grid-template-columns: repeat(var(--kidcols, 4), minmax(0, 38px)); gap: 4px; }

/* Sélecteur Réel | Proposé du tableau de répartition (vue unique) */
.disp-view-switch {
  display: flex; gap: 0; margin: 0 0 12px;
  background: var(--sub-card); border: 1px solid var(--line);
  border-radius: 999px; padding: 3px; width: fit-content;
}
.disp-view-btn {
  border: none; background: none; color: var(--muted);
  font-size: 13px; font-weight: 700; padding: 5px 18px;
  border-radius: 999px; cursor: pointer;
}
.disp-view-btn.active { background: var(--accent, #2563eb); color: #fff; }

/* Indicateur de coupure sous Réel | Proposé */
.cut-status {
  font-size: 13px; font-weight: 600; border-radius: 8px;
  padding: 8px 10px; margin: 0 0 10px;
}
.cut-status--green  { color: #15803d; background: rgba(34, 197, 94, 0.12); }
.cut-status--yellow { color: #a16207; background: rgba(234, 179, 8, 0.16); }
.cut-status--red    { color: #b91c1c; background: rgba(239, 68, 68, 0.13); }

/* Répartition proposée (vue Proposé du tableau) */
#suggest-head { margin-bottom: 4px; }
.suggest-mode {
  display: flex; align-items: center; gap: 9px;
  font-size: 13.5px; font-weight: 600; color: var(--muted);
  margin: 0 0 10px; cursor: pointer;
}
.suggest-mode input { width: 17px; height: 17px; accent-color: var(--accent, #2563eb); }
.suggest-cut {
  font-size: 13px; font-weight: 600; color: #15803d;
  background: rgba(34, 197, 94, 0.12); border-radius: 8px;
  padding: 7px 10px; margin-bottom: 8px;
}
.suggest-leave-title {
  font-size: 13px; font-weight: 700; margin: 2px 0 6px;
}
.suggest-leave-title span { font-weight: 500; color: var(--muted); font-size: 12px; margin-left: 4px; }
.suggest-leave-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.suggest-leave {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--input-border); border-radius: 999px;
  padding: 6px 10px; user-select: none;
}
.suggest-leave input { width: 16px; height: 16px; margin: 0; accent-color: #b91c1c; }
.suggest-leave.is-leaving { background: rgba(239, 68, 68, 0.10); border-color: rgba(239, 68, 68, 0.45); }
.suggest-leave.is-leaving .suggest-leave-name { text-decoration: line-through; opacity: 0.75; }
.suggest-leave.is-cut { background: rgba(34, 197, 94, 0.12); border-color: rgba(34, 197, 94, 0.45); }
.suggest-leave-tag { font-size: 11px; font-weight: 700; border-radius: 6px; padding: 1px 6px; }
.suggest-leave-tag--out { color: #b91c1c; background: rgba(239, 68, 68, 0.14); }
.suggest-leave-tag--cut { color: #15803d; background: rgba(34, 197, 94, 0.16); }
.suggest-note {
  font-size: 12.5px; font-weight: 600; color: #b45309;
  background: rgba(234, 179, 8, 0.12); border-radius: 8px;
  padding: 6px 10px; margin-bottom: 8px;
}
.disp-room-edus { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.disp-room-edu {
  font-size: 11px; font-weight: 700; color: var(--muted);
  background: var(--sub-card); border: 1px solid var(--line);
  border-radius: 999px; padding: 2px 8px;
}

/* « Rester connectée » sur l'écran de connexion */
.login-remember { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); margin: 2px 0 4px; cursor: pointer; }
.login-remember input { width: 17px; height: 17px; accent-color: var(--accent, #2563eb); }

/* Bouton « Modifier » du tableau de répartition */
.disp-edit-btn {
  align-self: center; margin-left: auto; border: 1px solid var(--line); background: var(--sub-card);
  color: var(--muted); font-size: 12.5px; font-weight: 700;
  padding: 5px 12px; border-radius: 999px; cursor: pointer;
}
/* En-tête du tableau : de l'air entre le bouton Modifier et les locaux. */
.disp-title-row { align-items: center; margin-bottom: 12px; }
.disp-title-row h2 { margin-bottom: 0; }
.disp-edit-btn--on { background: var(--accent, #2563eb); border-color: var(--accent, #2563eb); color: #fff; }
/* En mode modification, toucher un enfant ne fait pas défiler la page —
   nécessaire pour que l'appui long fonctionne au doigt. */
.disp-editing .disp-kid, .disp-editing .disp-name { touch-action: none; }

/* Case « volontaire pour être coupée aujourd'hui » */
.cutrank-vol { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 600; margin: 4px 0 10px; cursor: pointer; }
.cutrank-vol input { width: 18px; height: 18px; accent-color: var(--accent, #2563eb); }

/* Lien PDF de l'horaire complet (en-tête de « Mon horaire ») */
.sched-pdf-link {
  margin-left: auto; font-size: 13px; font-weight: 600;
  color: var(--muted); text-decoration: none;
  background: var(--btn-soft); border-radius: 8px; padding: 6px 10px;
  white-space: nowrap;
}
.sched-pdf-link:active { opacity: 0.7; }
/* Mode aide (Proposé) : bouton bascule par personne */
.suggest-leave-tag--helper { color: #0369a1; background: rgba(14, 165, 233, 0.16); }
