/* gp-planning-m10.css — M10 « Planning + Tournée du jour » (maquette MAQUETTE_planning_tournee, plan PLAN_LOT_M10 validé 26/09).
   Tout est limité à #view-planning.m10 (posé par js/planning-m10.js sous l'habillage iOS) : aucun autre écran n'est touché.
   Mesures = maquette (± 2 px ; hauteurs en content-box comme la maquette : barre 48 + 1, bandeau 30 + 1, case 58 + 2 × 4…) ;
   couleurs = jetons M1 (cit-ds.css) et table C7 ; sombre par les mêmes sélecteurs que cit-ds.css.
   Retour arrière : retirer ce fichier et js/planning-m10.js d'app.html. */
:root, .cit-theme-clair {
  --m10-ligne: #dcdce1;           /* traits de structure de la maquette (barre, en-tête de grille, panneau) */
  --m10-sep: #aeb4bf;             /* PL8 : trait entre deux techniciens */
  --m10-alt: #f7f8fa;             /* PL8 : fond alterné */
  --m10-sel-ligne: #f2f7fe; --m10-sel-case: #eaf2fe; --m10-we: #f2f2f5;
  --m10-label: #3a3a3c;           /* segments non choisis, jours */
  --m10-carte-fond: #eef3f8;      /* fond de la petite carte de tournée */
  --m10-bandeau-trait: #f5d9a8; --m10-dom: #1c1c1e;
  --m10-ombre-seg: 0 1px 2px rgba(0,0,0,0.12);
  --m10-j-fond: #ececef; --m10-j-texte: #3a3a3c;
  /* C7 : couleur de l'état (trait, heures) / fond de la carte */
  --m10-c: #1a7f37; --m10-c-f: #eef8f1;      /* Confirmée : vert */
  --m10-a: #ff9500; --m10-a-f: #fff6ea;      /* En attente, Réservée : orange */
  --m10-r: #0a66d6; --m10-r-f: #eef4fd;      /* Réalisée, Terminée : bleu */
  --m10-v: #7a3db8; --m10-v-f: #f1e8fb;      /* À valider : violet */
  --m10-k: #d70015; --m10-k-f: #fdeeee;      /* À risque : rouge */
  --m10-x: #8e8e93; --m10-x-f: #f2f2f4;      /* Annulée, Expirée : gris */
  --m10-bc: #1a7f37; --m10-bc-f: #e3f4e8; --m10-br: #0a58c2; --m10-br-f: #e5effd;   /* pastilles d'état du panneau */
}
:root[data-theme="dark"], .cit-theme-sombre {
  --m10-ligne: #3a3a3c; --m10-sep: #4a4f58; --m10-alt: #232326;
  --m10-sel-ligne: #152236; --m10-sel-case: #1a2a42; --m10-we: #202023;
  --m10-label: #d1d1d6; --m10-carte-fond: #1a2230; --m10-bandeau-trait: #5a3d12; --m10-dom: #636366;
  --m10-ombre-seg: 0 1px 2px rgba(0,0,0,0.5); --m10-j-fond: #2c2c2e; --m10-j-texte: #d1d1d6;
  --m10-c: #4cd964; --m10-c-f: #10301b; --m10-a: #ff9f0a; --m10-a-f: #3a2708; --m10-r: #64b0ff; --m10-r-f: #0b2a4a;
  --m10-v: #d08cff; --m10-v-f: #2e1a3b; --m10-k: #ff7b72; --m10-k-f: #3b1414; --m10-x: #98989f; --m10-x-f: #2c2c2e;
  --m10-bc: #4cd964; --m10-bc-f: #10301b; --m10-br: #64b0ff; --m10-br-f: #0b2a4a;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --m10-ligne: #3a3a3c; --m10-sep: #4a4f58; --m10-alt: #232326;
    --m10-sel-ligne: #152236; --m10-sel-case: #1a2a42; --m10-we: #202023;
    --m10-label: #d1d1d6; --m10-carte-fond: #1a2230; --m10-bandeau-trait: #5a3d12; --m10-dom: #636366;
    --m10-ombre-seg: 0 1px 2px rgba(0,0,0,0.5); --m10-j-fond: #2c2c2e; --m10-j-texte: #d1d1d6;
    --m10-c: #4cd964; --m10-c-f: #10301b; --m10-a: #ff9f0a; --m10-a-f: #3a2708; --m10-r: #64b0ff; --m10-r-f: #0b2a4a;
    --m10-v: #d08cff; --m10-v-f: #2e1a3b; --m10-k: #ff7b72; --m10-k-f: #3b1414; --m10-x: #98989f; --m10-x-f: #2c2c2e;
    --m10-bc: #4cd964; --m10-bc-f: #10301b; --m10-br: #64b0ff; --m10-br-f: #0b2a4a;
  }
}

/* ── la page : pleine hauteur, seule la grille défile (PL1) ── */
html[data-skin="ios"] .page-content:has(#view-planning.m10.active) { padding: 0 !important; overflow: hidden !important; display: flex; flex-direction: column; }
#view-planning.m10.active { flex: 1 1 auto; min-height: 0; display: flex !important; flex-direction: column; padding: 0 !important; margin: 0 !important; }
#view-planning.m10 { font-size: 12px; color: var(--cit-text); background: var(--cit-bg); }
#view-planning.m10 [hidden] { display: none !important; }
#view-planning.m10 > div:not([id^="m10-"]):not(#planning-tabs-content) { display: none !important; }   /* ancienne rangée Jour | Semaine | Mois */
#view-planning.m10 #planning-tabs-content { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
#view-planning.m10 #planning-tabs-content > div[id^="plan-view-"][style*="block"] { flex: 1 1 auto; min-height: 0; display: flex !important; flex-direction: column; overflow: auto; }
#view-planning.m10 .calendar-toolbar,
#view-planning.m10 #planning-conflict-summary,
#view-planning.m10 #planning-tournee-details { display: none !important; }
#view-planning.m10 #plan-view-semaine > [data-tab-content="semaine"] { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }

/* ── A. barre de 48 px (maquette) ── */
/* 30 + 2 × 9 = 48 px sur une ligne (maquette) ; écran étroit : la barre passe sur deux lignes au lieu de couper les boutons */
#m10-barre { min-height: 30px; box-sizing: content-box; flex-shrink: 0; background: var(--cit-surface); border-bottom: 1px solid var(--m10-ligne);
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 9px 14px; font-size: 13px; position: relative; z-index: 30; white-space: nowrap; }
#m10-barre > * { flex-shrink: 0; }
#m10-barre .m10-seg { display: flex; gap: 2px; padding: 2px; border-radius: 8px; background: var(--cit-fill); }
#m10-barre .m10-seg button { height: 24px; padding: 0 10px; border-radius: 6px; border: 0; font: inherit; font-size: 12px; background: transparent;
  color: var(--m10-label); cursor: pointer; }
#m10-barre .m10-seg button[aria-pressed="true"] { background: var(--cit-surface); box-shadow: var(--m10-ombre-seg); font-weight: 600; color: var(--cit-text); }
#m10-barre .m10-nav { width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--cit-border); background: var(--cit-surface); color: var(--cit-text);
  cursor: pointer; padding: 0; }
#m10-barre .m10-libelle { font-weight: 700; font-variant-numeric: tabular-nums; }
#m10-barre .m10-bouton, #m10-barre .m10-date { height: 28px; padding: 0 8px; border-radius: 7px; border: 1px solid var(--cit-border); background: var(--cit-surface);
  color: var(--cit-text); font: inherit; font-size: 12px; cursor: pointer; box-sizing: border-box; }
#m10-barre .m10-bouton.m10-large { padding: 0 10px; }
#m10-barre .m10-ressort { flex-grow: 1; }
#m10-barre .m10-plein { height: 30px; padding: 0 12px; border-radius: 8px; border: 0; background: var(--cit-accent); color: #ffffff; font: inherit; font-size: 12px;
  font-weight: 600; cursor: pointer; }
.m10-pop { position: absolute; top: 44px; z-index: 300; min-width: 220px; max-height: 380px; overflow: auto; background: var(--cit-surface); color: var(--cit-text);
  border: 1px solid var(--cit-border); border-radius: 10px; box-shadow: 0 10px 34px rgba(0,0,0,0.22); padding: 6px; font-size: 13px; white-space: normal; }
.m10-pop .m10-opt { display: flex; align-items: center; gap: 8px; width: 100%; box-sizing: border-box; min-height: 30px; padding: 4px 8px; border: 0; border-radius: 6px;
  background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.m10-pop button.m10-opt:hover { background: var(--cit-fill); }
.m10-pop .m10-opt .m10-coche { width: 12px; flex-shrink: 0; color: var(--cit-accent-text); font-weight: 700; visibility: hidden; }
.m10-pop .m10-opt[aria-checked="true"] { font-weight: 600; }
.m10-pop .m10-opt[aria-checked="true"] .m10-coche { visibility: visible; }
.m10-pop .m10-opt-leg { cursor: default; }
.m10-pop .m10-titre-pop { padding: 6px 8px 2px; font-size: 11px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--cit-text3); }
.m10-pop hr { border: 0; border-top: 1px solid var(--cit-grid); margin: 6px 4px; }
.m10-pop .m10-leg { display: inline-block; width: 14px; height: 14px; flex-shrink: 0; border-radius: 3px; border-left: 3px solid; box-sizing: border-box; }
.m10-pop [id$="-tech-picker"]:not([hidden]) { display: block !important; position: static !important; box-shadow: none !important; border: 0 !important;
  padding: 0 !important; max-height: none !important; background: transparent !important; min-width: 220px !important; }

/* ── A. bandeau de conflits (30 px, seulement s'il y en a) ── */
#m10-conflits { height: 30px; box-sizing: content-box; flex-shrink: 0; display: flex; align-items: center; gap: 8px; padding: 0 14px; background: var(--cit-warn-weak);
  color: var(--cit-warn-text); font-weight: 500; border-bottom: 1px solid var(--m10-bandeau-trait); white-space: nowrap; overflow: hidden; }
#m10-conflits .m10-cj { cursor: pointer; }
#m10-conflits a { color: inherit; text-decoration: underline; margin-left: 6px; cursor: pointer; }

/* ── B. grille, vue Équipe ── */
#view-planning.m10 .m10-corps { flex: 1 1 auto; min-height: 0; display: flex; position: relative; }
#view-planning.m10 .m10-corps > #planning-calendar { flex: 1 1 auto; min-width: 0; min-height: 0; overflow: auto; margin: 0; padding: 0;
  border: 0 !important; border-radius: 0 !important; box-shadow: none !important; }
.m10-grille { min-height: 100%; background: var(--cit-surface); }
.m10-tete { display: grid; height: 30px; box-sizing: content-box; border-bottom: 1px solid var(--m10-ligne); background: var(--cit-surface2);
  position: sticky; top: 0; z-index: 3; }
.m10-tete > div { border-right: 1px solid var(--cit-grid); display: flex; align-items: center; padding: 0 8px; font-weight: 600; color: var(--m10-label); white-space: nowrap; overflow: hidden; }
.m10-tete > div:first-child { padding: 0; }
.m10-tete > div.is-today { color: var(--cit-accent-text); }
.m10-tete > div.m10-sd { justify-content: center; padding: 0; color: var(--cit-text3); font-size: 11px; font-weight: 400; border-right: 0; }
.m10-ligne { display: grid; border-bottom: 2px solid var(--m10-sep); background: var(--cit-surface); }
.m10-ligne.is-impair { background: var(--m10-alt); }
.m10-ligne.is-sel { background: var(--m10-sel-ligne); }
.m10-nom { display: flex; align-items: center; gap: 8px; padding: 0 10px; border-right: 1px solid var(--cit-grid); min-width: 0; }
.m10-nom[data-tech] { cursor: pointer; }
.m10-ligne.is-sel .m10-nom { box-shadow: inset 3px 0 0 var(--cit-accent); }
.m10-nom .m10-av { width: 26px; height: 26px; flex-shrink: 0; border-radius: 13px; color: #ffffff; font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.m10-nom .m10-av.is-vide { background: var(--cit-fill); }
.m10-nom .m10-n { font-size: 13px; font-weight: 600; }
.m10-case { min-height: 58px; box-sizing: content-box; padding: 4px; display: flex; flex-direction: column; gap: 4px; border-right: 1px solid var(--cit-grid); min-width: 0; }
.m10-case.is-sel { outline: 2px solid var(--cit-accent); outline-offset: -2px; background: var(--m10-sel-case); }
.m10-case.m10-sd { background: var(--m10-we); border-right: 0; padding: 0; min-height: 0; }
.m10-carte { border-radius: 6px; padding: 3px 6px; line-height: 15px; border-left: 3px solid var(--m10-x); background: var(--m10-x-f); color: var(--cit-text);
  cursor: pointer; position: relative; }
.m10-carte:focus-visible { outline: 2px solid var(--cit-accent); outline-offset: 1px; }
.m10-carte .m10-l1 { display: flex; justify-content: space-between; gap: 4px; }
.m10-carte .m10-l1 > span:first-child { display: flex; align-items: center; gap: 4px; }
.m10-carte .m10-h { font-weight: 600; font-variant-numeric: tabular-nums; }
.m10-carte .m10-j { padding: 0 4px; border-radius: 4px; background: var(--m10-j-fond); color: var(--m10-j-texte); font-size: 10px; font-weight: 700; line-height: 14px; }
.m10-carte .m10-ot { font-weight: 700; font-variant-numeric: tabular-nums; }
.m10-carte .m10-do { font-size: 10px; font-weight: 600; color: var(--cit-text2); }
.m10-carte .m10-t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m10-carte .m10-cl { color: var(--cit-text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m10-carte .m10-suppr { position: absolute; bottom: 3px; right: 4px; margin: 0; }
.m10-st-c { --m10-e: var(--m10-c); --m10-ef: var(--m10-c-f); } .m10-st-a { --m10-e: var(--m10-a); --m10-ef: var(--m10-a-f); }
.m10-st-r { --m10-e: var(--m10-r); --m10-ef: var(--m10-r-f); } .m10-st-v { --m10-e: var(--m10-v); --m10-ef: var(--m10-v-f); }
.m10-st-k { --m10-e: var(--m10-k); --m10-ef: var(--m10-k-f); } .m10-st-x { --m10-e: var(--m10-x); --m10-ef: var(--m10-x-f); }
.m10-carte[class*="m10-st-"], .m10-leg[class*="m10-st-"] { border-left-color: var(--m10-e); background: var(--m10-ef); }
.m10-carte[class*="m10-st-"] .m10-h { color: var(--m10-e); }

/* ── C. panneau de droite, 330 px, « Tournée | Détail » ; replié = fine bande (PL2) ── */
.m10-panneau { width: 330px; flex-shrink: 0; box-sizing: border-box; background: var(--cit-surface2); border-left: 1px solid var(--m10-ligne); display: flex; flex-direction: column;
  overflow: hidden; color: var(--cit-text); font-size: 12px; }
.m10-panneau.is-replie { width: 34px; }
.m10-panneau.is-replie > :not(.m10-p-tete) { display: none; }
.m10-panneau.is-replie .m10-p-tete { padding: 0; justify-content: center; }
.m10-panneau.is-replie .m10-p-tete > :not(.m10-replier) { display: none; }
.m10-p-tete { height: 44px; box-sizing: content-box; flex-shrink: 0; display: flex; align-items: center; gap: 8px; padding: 0 12px; background: var(--cit-surface);
  border-bottom: 1px solid var(--cit-grid); }
.m10-p-tete .m10-seg { display: flex; gap: 2px; padding: 2px; border-radius: 8px; background: var(--cit-fill); }
.m10-p-tete .m10-seg button { height: 24px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: var(--cit-text2); font: inherit; font-size: 12px;
  display: inline-flex; align-items: center; cursor: pointer; }
.m10-p-tete .m10-seg button[aria-pressed="true"] { background: var(--cit-surface); box-shadow: var(--m10-ombre-seg); font-weight: 600; color: var(--cit-text); }
.m10-p-tete .m10-ressort { flex-grow: 1; }
.m10-replier { width: 28px; height: 28px; border-radius: 7px; border: 0; background: var(--cit-fill); color: var(--cit-text); cursor: pointer; padding: 0; flex-shrink: 0; }
.m10-t-tete { padding: 10px 12px; background: var(--cit-surface); border-bottom: 1px solid var(--cit-grid); flex-shrink: 0; }
.m10-t-titre { font-size: 15px; font-weight: 600; }
.m10-t-chiffres { display: flex; gap: 12px; margin-top: 4px; color: var(--cit-text2); font-variant-numeric: tabular-nums; }
.m10-t-chiffres b { color: var(--cit-text); }
.m10-t-carte { margin-top: 8px; border-radius: 8px; background: var(--m10-carte-fond); display: block; }
.m10-t-carte path { stroke: var(--cit-accent); }
.m10-t-carte .m10-pt { fill: var(--cit-accent); }
.m10-t-carte .m10-pd { fill: var(--m10-dom); }
.m10-t-note { margin-top: 6px; color: var(--cit-warn-text); font-size: 11px; }
.m10-arrets { list-style: none; margin: 0; padding: 8px 12px; flex-grow: 1; overflow: auto; }
.m10-arrets .m10-trajet { color: var(--cit-text2); padding: 6px 4px 4px 34px; font-size: 11px; }
.m10-arrets .m10-ecart { height: 8px; }
.m10-arrets .m10-arret { display: flex; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--cit-surface); box-shadow: 0 0 0 1px var(--cit-grid); cursor: pointer; }
.m10-arrets .m10-arret.is-dom { cursor: default; }
.m10-arrets .m10-num { width: 22px; height: 22px; flex-shrink: 0; border-radius: 11px; color: #ffffff; font-weight: 700; display: flex; align-items: center; justify-content: center;
  background: var(--cit-accent); }
.m10-arrets .m10-arret.is-dom .m10-num { background: var(--m10-dom); }
.m10-arrets .m10-a-corps { min-width: 0; flex-grow: 1; }
.m10-arrets .m10-a-l1 { display: flex; justify-content: space-between; }
.m10-arrets .m10-a-l1 b { font-variant-numeric: tabular-nums; }
.m10-arrets .m10-a-t { font-weight: 600; }
.m10-arrets .m10-a-adr { color: var(--cit-text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m10-arrets .m10-a-msg { color: var(--cit-warn-text); font-size: 11px; margin-top: 2px; }
.m10-arrets .m10-info { color: var(--cit-text2); padding: 6px 4px; }
.m10-badge { align-self: flex-start; padding: 1px 7px; border-radius: 9px; font-size: 10px; font-weight: 600; white-space: nowrap; }
.m10-badge.m10-st-c { color: var(--m10-bc); background: var(--m10-bc-f); } .m10-badge.m10-st-r { color: var(--m10-br); background: var(--m10-br-f); }
.m10-badge.m10-st-a { color: var(--cit-warn-text); background: var(--cit-warn-weak); } .m10-badge.m10-st-v { color: var(--m10-v); background: var(--m10-v-f); }
.m10-badge.m10-st-k { color: var(--cit-danger-text); background: var(--cit-danger-weak); } .m10-badge.m10-st-x { color: var(--cit-neutral-text); background: var(--cit-neutral-weak); }
.m10-p-pied { height: 52px; box-sizing: content-box; flex-shrink: 0; display: flex; align-items: center; gap: 8px; padding: 0 12px; background: var(--cit-surface);
  border-top: 1px solid var(--cit-grid); }
.m10-p-pied button, .m10-p-pied a { flex-grow: 1; height: 32px; box-sizing: border-box; border-radius: 8px; border: 1px solid var(--cit-border); background: var(--cit-surface);
  color: var(--cit-text); font: inherit; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; text-align: center; text-decoration: none; }
.m10-p-pied .m10-principal { border: 0; background: var(--cit-accent); color: #ffffff; font-weight: 600; }
.m10-p-pied [disabled] { opacity: .45; cursor: default; }
.m10-optim { padding: 8px 12px; background: var(--cit-accent-weak); color: var(--cit-accent-text); font-weight: 600; border-bottom: 1px solid var(--cit-grid); flex-shrink: 0; }
.m10-detail { padding: 12px; overflow: auto; flex-grow: 1; }
.m10-detail .m10-d-tete { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.m10-detail .m10-d-ot { font-weight: 700; font-variant-numeric: tabular-nums; }
.m10-detail h2 { margin: 8px 0 10px; font-size: 15px; font-weight: 600; }
.m10-detail .m10-d-ligne { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--cit-grid); }
.m10-detail .m10-d-ligne span { color: var(--cit-text2); flex-shrink: 0; }
.m10-detail .m10-d-ligne b { font-weight: 500; text-align: right; }
.m10-detail .m10-d-actions { display: flex; gap: 8px; margin: 12px 0; }
.m10-detail .m10-d-actions > * { flex-grow: 1; height: 32px; box-sizing: border-box; border-radius: 8px; border: 1px solid var(--cit-border); background: var(--cit-surface);
  color: var(--cit-text); font: inherit; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.m10-detail .m10-d-actions .m10-principal { border: 0; background: var(--cit-accent); color: #ffffff; font-weight: 600; }
.m10-detail .m10-aide { color: var(--cit-text2); line-height: 18px; margin: 0; }
.m10-detail .m10-aide b { color: var(--cit-text); font-weight: 600; }

/* ── F. moins de 1100 px : le panneau passe en surimpression depuis la droite (PL5) ── */
@media (max-width: 1099px) {
  #view-planning.m10 .m10-panneau { position: absolute; top: 0; right: 0; bottom: 0; z-index: 20; }
  #view-planning.m10 .m10-panneau:not(.is-replie) { box-shadow: -10px 0 34px rgba(0,0,0,0.22); }
  #view-planning.m10 .m10-corps:has(> .m10-panneau:not([hidden])) > #planning-calendar { margin-right: 34px; }
}
