/* Mode sombre, mêmes couleurs que la check-list Carmin (liste-a-faire).
   Tout passe par ces variables : changer de thème ne touche qu'à ce bloc. */
:root {
  color-scheme: dark;
  --fond: #0b0d12;
  --texte: #e6e9f0;
  --doux: #94a3b8;        /* textes secondaires */
  --discret: #64748b;     /* intitulés en petites capitales */
  --carte: rgba(255, 255, 255, .03);
  --carte-forte: rgba(255, 255, 255, .07);
  --bord: rgba(255, 255, 255, .10);
  --bord-fort: rgba(255, 255, 255, .25);
  --rouge: #e0231a;
  --rouge-doux: rgba(224, 35, 26, .16);
  --rouge-texte: #fda4af;
  --vert: rgba(52, 211, 153, .12);
  --vert-bord: rgba(52, 211, 153, .30);
  --vert-texte: #a7f3d0;
  --ambre: rgba(251, 191, 36, .10);
  --ambre-bord: rgba(251, 191, 36, .30);
  --ambre-texte: #fde68a;
}
* { box-sizing: border-box; }
html, body { background: var(--fond); }
/* Sur ordinateur, la même largeur que sur téléphone : une colonne centrée. */
body { position: relative; max-width: 440px; margin: 0 auto; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--texte); }

.entete { padding: 24px 12px 4px; text-align: center; }
.logo { display: block; height: 40px; width: auto; max-width: 80%; margin: 0 auto 4px; }
.nom-projet { color: var(--discret); font-size: .75rem; letter-spacing: .05em; text-transform: uppercase; }
main { max-width: 440px; margin: 0 auto; padding: 8px 16px 48px; }
h1 { font-size: 1.3rem; text-align: center; margin: 8px 0 16px; }
h2 { font-size: 1.05rem; margin: 0; }
p { color: var(--doux); }
.erreur { color: var(--rouge-texte); min-height: 1.2em; margin: 8px 0; }
.info { color: var(--doux); font-size: .9rem; }

.bouton { font: inherit; color: var(--texte); padding: 10px 14px; border: 1px solid var(--bord); border-radius: 12px;
  background: var(--carte); cursor: pointer; min-height: 44px; transition: border-color .15s, background .15s; }
.bouton:hover { border-color: var(--bord-fort); background: var(--carte-forte); }
.bouton:disabled { opacity: .35; cursor: default; }
/* Boutons principaux : la couleur du vendeur connecté (--accent, posé par app.js). */
.bouton.actif, .bouton.principal { background: var(--accent, var(--rouge)); border-color: var(--accent, var(--rouge)); color: #0b0d12; font-weight: 600; }
.bouton.discret { border-color: transparent; background: transparent; color: var(--doux); text-decoration: underline; }
.bouton.icone { width: 44px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.bouton.icone svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; }
.grille-noms { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.grille-noms .bouton { padding: 16px; font-size: 1.05rem; font-weight: 600; border-radius: 16px; }
input, select { font: inherit; color: var(--texte); background: #12151c; padding: 10px;
  border: 1px solid var(--bord); border-radius: 10px; min-height: 44px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent, var(--rouge)); outline-offset: -1px; }
/* Rend l'icône de l'horloge visible sur fond sombre. */
input[type="time"]::-webkit-calendar-picker-indicator { filter: invert(1) opacity(.55); cursor: pointer; }
input[type="checkbox"] { min-height: 0; width: 18px; height: 18px; accent-color: var(--accent, var(--rouge)); }
.code { width: 100%; text-align: center; font-size: 1.6rem; letter-spacing: .5em; margin: 8px 0; }
.colonne { display: flex; flex-direction: column; gap: 8px; }

.barre { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; color: var(--doux); }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 22px 0 8px; }
.nav h2 { text-align: center; flex: 1; }
.statut { text-align: center; padding: 10px; border-radius: 12px; margin-bottom: 10px;
  background: var(--ambre); border: 1px solid var(--ambre-bord); color: var(--ambre-texte); }
.statut.ok { background: var(--vert); border-color: var(--vert-bord); color: var(--vert-texte); }
.outils { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }

.jour { border: 1px solid var(--bord); border-radius: 16px; padding: 14px; margin-bottom: 10px; background: var(--carte); }
.jour.weekend { background: rgba(224, 35, 26, .05); border-color: rgba(224, 35, 26, .22); }
.jour h2 { margin-bottom: 6px; text-transform: capitalize; }
.puces { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
/* --c : la couleur du vendeur, posée par app.js. */
.puce { background: color-mix(in srgb, var(--c, #94a3b8) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--c, #94a3b8) 55%, transparent);
  color: var(--c, var(--texte)); border-radius: 999px; padding: 4px 10px; font-size: .9rem; }
.puce.moi { font-weight: 700; }

/* --- Calendrier du mois --- */
.calendrier { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-bottom: 8px; }
.entete-jour { text-align: center; font-size: .68rem; color: var(--discret); text-transform: uppercase;
  letter-spacing: .03em; padding-bottom: 2px; }
.case { position: relative; min-height: 66px; padding: 4px 3px; display: flex; flex-direction: column; gap: 3px;
  align-items: stretch; text-align: left; font: inherit; color: var(--texte); cursor: pointer;
  background: var(--carte); border: 1px solid var(--bord); border-radius: 10px; }
.case:hover { border-color: var(--bord-fort); }
.case .num { font-size: .78rem; font-weight: 600; line-height: 1; padding: 2px 2px 0; }
.case.hors { opacity: .35; }
.case.aujourdhui .num { color: var(--rouge-texte); }
.case.choisi { border-color: var(--rouge); box-shadow: inset 0 0 0 1px var(--rouge); }
.case.validee { border-bottom: 2px solid rgba(52, 211, 153, .55); }
.coche { position: absolute; top: 3px; right: 4px; font-size: .7rem; font-weight: 700; color: #34d399; }
.pastilles { display: flex; flex-wrap: wrap; gap: 2px; }
.pastille { display: inline-flex; align-items: center; justify-content: center; width: 19px; height: 16px;
  border-radius: 5px; font-size: .58rem; font-weight: 700; border: 1.5px solid var(--c); }
.pastille.travaille { background: var(--c); color: #0b0d12; }
.pastille.dispo { color: var(--c); background: transparent; }
.pastille.secondaire { opacity: .45; }
.reste { font-size: .6rem; color: var(--doux); align-self: center; }
.legende { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: .82rem; color: var(--doux); margin: 4px 0 14px; }
.nom-legende { display: inline-flex; align-items: center; gap: 5px; }
.nom-legende i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legende .aide { flex-basis: 100%; font-size: .74rem; color: var(--discret); }
.detail { scroll-margin-top: 8px; }
.planning { margin: 6px 0; font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.panneau { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px;
  padding: 8px; background: var(--carte-forte); border: 1px solid var(--bord); border-radius: 12px; }
.admin { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--bord); }
.admin .ligne { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; }
.admin select { flex: 1; min-width: 140px; }

/* Accueil : un prénom par ligne, sur un fond entièrement de sa couleur. */
.grille-noms { grid-template-columns: 1fr; }
.bouton.nom-couleur, .bouton.nom-couleur:hover { background: var(--c); border-color: var(--c); color: #0b0d12; }
.bouton.nom-couleur:hover { filter: brightness(1.08); }

/* Écran du code : tout est de la couleur du vendeur (--c). */
.ecran-code { --c: #94a3b8; display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 18px 0 8px; border-radius: 24px;
  background: radial-gradient(ellipse at top, color-mix(in srgb, var(--c) 20%, transparent), transparent 70%); }
.ecran-code p { margin: 0; }
.ecran-code .prenom { font-size: 1.7rem; font-weight: 800; color: var(--c); }
.ecran-code .info { color: var(--doux); }
/* Memes espaces que le pave des autres sites : 32 px avant les ronds, puis
   12 px, une ligne de message reservee de 20 px, 12 px jusqu'au pave. */
.ecran-code .erreur { min-height: 20px; font-size: 14px; line-height: 20px; margin-top: 4px; }
/* Pave a code : le meme que sur tous les autres sites (touches neutres).
   Les ronds prennent la couleur de l'ecran, ici celle du vendeur. */
.ronds { display: flex; gap: 16px; margin: 24px 0 0; }
.rond { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--c); transition: background .1s; }
.rond.plein { background: var(--c); }
.secoue { animation: secouer .35s; }
@keyframes secouer { 25% { transform: translateX(-9px); } 75% { transform: translateX(9px); } }
.clavier { display: grid; grid-template-columns: repeat(3, 72px); gap: 14px 22px; margin-top: 4px; }
.touche { width: 72px; height: 72px; border-radius: 50%; padding: 0;
  font: 500 1.7rem/1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--texte); cursor: pointer; transition: background .08s;
  background: rgba(127, 127, 127, .12); border: 1px solid rgba(127, 127, 127, .25);
  touch-action: manipulation; -webkit-tap-highlight-color: transparent; user-select: none; }
.touche:active { background: var(--c); border-color: var(--c); color: #0b0d12; }
.touche.vide { visibility: hidden; }
.touche.effacer { background: transparent; border-color: transparent; color: var(--c); font-size: 1.5rem; }
.ecran-code { position: relative; }
.ecran-code .fermer { color: var(--c); border-color: color-mix(in srgb, var(--c) 45%, transparent); }

/* Détail d'un jour (partager la journée) : fenêtre au centre, par-dessus le tableau. */
body.bloque { overflow: hidden; }
.fond-feuille { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .6);
  display: flex; align-items: center; justify-content: center; padding: 16px; }
.feuille { position: relative; width: 100%; max-width: 380px; max-height: 88vh; overflow-y: auto;
  background: #12151c; border: 1px solid var(--bord); border-radius: 20px;
  padding: 18px 16px; animation: monter .18s ease-out; }
.feuille .statut { margin-right: 44px; }
.feuille .actions { justify-content: flex-end; }
.fermer { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border-radius: 999px;
  border: 1px solid var(--bord); background: var(--carte); color: var(--texte); font-size: 1rem; cursor: pointer; }
@keyframes monter { from { transform: translateY(40px); opacity: 0; } }
.palette { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 8px 0; }
.echantillon { width: 44px; height: 44px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; padding: 0; }
.echantillon.choisi { border-color: var(--fond); box-shadow: 0 0 0 2px #fff; }
.echantillon:disabled { opacity: .2; cursor: not-allowed; }

/* --- Tableau du mois : dates en lignes, vendeurs en colonnes (mode sombre) --- */
.tableau { width: 100%; border-collapse: separate; border-spacing: 3px; table-layout: fixed;
  user-select: none; -webkit-user-select: none; margin: 0 -3px; width: calc(100% + 6px); }
.tableau th, .tableau td { padding: 0; }
.tableau thead th { position: sticky; top: 0; background: var(--fond); z-index: 1; height: 76px; vertical-align: bottom; }
.tableau .coin, .tableau .date { width: 46px; }
/* Les prénoms en haut des colonnes : le sien sur fond plein, les autres en contour. */
/* Prénoms calés en bas de leur case. */
.tableau thead th.nom-v { border-radius: 8px; vertical-align: bottom; padding-bottom: 4px; box-shadow: inset 0 0 0 1.5px var(--c); }
.tableau thead th.nom-v.moi { background: var(--c); }
.nom-v span { display: inline-block; writing-mode: vertical-rl; transform: rotate(180deg); font-size: .78rem;
  font-weight: 700; padding: 6px 0; color: var(--c); white-space: nowrap; }
.nom-v.moi span { color: #0b0d12; font-weight: 800; }

/* Le rond du compte, en haut à droite de la page. */
/* Le logo laisse la place au rond à droite. */
.logo { max-width: calc(100% - 130px); height: auto; max-height: 40px; }
.compte { position: absolute; top: 16px; right: 12px; z-index: 20; display: flex; flex-direction: column;
  align-items: center; gap: 8px; }
.rond-compte { width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer; font: inherit;
  font-size: .9rem; font-weight: 800; background: var(--c); color: #0b0d12; }
.compte.ouvert .rond-compte { box-shadow: 0 0 0 3px var(--fond), 0 0 0 5px var(--c); }
.menu-compte { display: flex; flex-direction: column; gap: 8px; padding: 6px; border-radius: 999px;
  background: #12151c; border: 1px solid var(--bord); animation: monter .15s ease-out; }
.icone-compte { width: 34px; height: 34px; border-radius: 50%; cursor: pointer; display: inline-flex;
  align-items: center; justify-content: center; color: var(--c); background: var(--carte);
  border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); }
.icone-compte svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; }
/* Les jours, calés à droite (contre le tableau). */
.tableau .date { text-align: right; font-size: .74rem; font-weight: 600; padding: 0 5px; color: var(--doux);
  background: var(--carte); border-radius: 8px; cursor: default; white-space: nowrap; }
.tableau tr.weekend .date { color: var(--rouge-texte); background: rgba(224, 35, 26, .07); }
/* Cases du week-end, un tout petit peu plus claires (avant la règle « validée »
   pour qu'une semaine validée reste verte). */
.tableau tr.weekend .cell { background: rgba(255, 255, 255, .05); }
/* Semaine validée : les cases où personne ne travaille verdissent un peu. */
.tableau tr.validee .cell { background: rgba(52, 211, 153, .09); }
.tableau tr.aujourdhui .date { color: #fff; background: var(--rouge); }
.tableau tr.choisi .date { outline: 2px solid var(--accent, var(--rouge)); outline-offset: -2px; }

.cell { border-radius: 7px; overflow: hidden; background: rgba(255, 255, 255, .025); }
/* Séparateur après BB et Florian : un écart plus large que les autres. */
.tableau .espace { width: 4px; padding: 0; }
.zone { height: 30px; display: flex; align-items: center; justify-content: center; font-size: .62rem; font-weight: 700;
  color: var(--c); transition: background .12s; }
/* Week-end : case un peu plus haute (2 × 21 px) pour bien voir les deux moitiés. */
.zone.demi { height: 21px; }
.zone.demi + .zone.demi { border-top: 1px solid var(--fond); }
/* Remplissage proportionnel : de --haut à --bas (posés par app.js). Couleur
   pâle = dispo, couleur pleine = travaille. */
.zone.rempli { --teinte: color-mix(in srgb, var(--c) 45%, transparent);
  background: linear-gradient(to bottom, transparent var(--haut), var(--teinte) var(--haut) var(--bas), transparent var(--bas)); }
.zone.rempli.travaille { --teinte: var(--c); }
.zone.travaille { color: #0b0d12; font-size: .8rem; }
/* Au doigt : on glisse dans sa propre colonne ; ailleurs (admins), on touche
   case par case et la page peut défiler. */
.zone.mienne { cursor: pointer; touch-action: pan-y; -webkit-touch-callout: none; }
.cell.propre .zone.mienne { touch-action: pan-y; } /* une case à la fois : la page défile au doigt */
.cell.propre { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 40%, transparent); }
.zone.apercu-plus { background: color-mix(in srgb, var(--c) 45%, transparent); outline: 2px dashed var(--c); outline-offset: -2px; }
.zone.apercu-moins { background: transparent; outline: 2px dashed var(--discret); outline-offset: -2px; }
/* Légende en haut du tableau : un petit dessin par état. */
.legende { margin: 4px 0 10px; }
.legende .exemples { display: flex; flex-wrap: wrap; gap: 6px; }
.puce-legende { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px 4px 5px; border-radius: 999px;
  background: var(--carte); border: 1px solid var(--bord); font-size: .78rem; color: var(--texte); }
.ex { width: 18px; height: 18px; border-radius: 5px; display: inline-block; flex: none; }
.ex.pale { background: color-mix(in srgb, var(--c) 45%, transparent); }
.ex.plein { background: var(--c); }
.ex.demi { background: linear-gradient(var(--c) 0 46%, var(--fond) 46% 54%, color-mix(in srgb, var(--c) 45%, transparent) 54%); }
.ex.coche { border: 2px solid #34d399; background: #34d399; position: relative; }
.ex.coche::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center;
  font-size: .7rem; font-weight: 900; color: #0b0d12; }
.legende .geste { align-self: center; margin-left: 4px; font-size: .78rem; color: var(--discret); }

/* Colonne de validation : un crochet par semaine, avec sa coche. */
.tableau .coin-validation { width: 26px; color: #34d399; font-size: .8rem; vertical-align: bottom; padding-bottom: 6px; }
.valid-col { padding: 2px 0 2px 2px; height: 1px; }
.crochet { display: flex; align-items: center; justify-content: flex-end; width: 100%; height: 100%; min-height: 30px;
  padding: 0 2px 0 0; background: none; cursor: pointer; font: inherit;
  border: 2px solid var(--bord-fort); border-left: 0; border-radius: 0 10px 10px 0; }
.crochet:disabled { cursor: default; }
.coche-semaine { width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--bord-fort); background: var(--fond);
  display: grid; place-items: center; font-size: .78rem; font-weight: 900; color: #0b0d12; }
.crochet { flex-direction: column; justify-content: center; align-items: flex-end; gap: 8px; padding: 4px 3px 4px 0; }
.crochet button { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; display: grid; place-items: center; }
.crochet button:disabled { cursor: default; opacity: .4; }
.crochet .envoyer { width: 22px; height: 22px; color: var(--doux); }
.crochet .envoyer svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.crochet .envoyer:not(:disabled):hover, .crochet .envoyer:not(:disabled):active { color: #34d399; }
/* Mode validation : le crochet de la semaine s'allume. */
.crochet.en-validation { border-color: #34d399; background: rgba(52, 211, 153, .12); }
.crochet.en-validation .coche-semaine { border-color: #34d399; }
.crochet.ok { border-color: #34d399; }
.crochet.ok .coche-semaine { background: #34d399; border-color: #34d399; }
.crochet:not(:disabled):hover .coche-semaine { border-color: #34d399; }

/* Appui long : une bulle au-dessus de la case, comme les accents du clavier. */
.fond-popover { position: fixed; inset: 0; z-index: 60; }
.popover { position: fixed; transform: translate(-50%, calc(-100% - 12px)); padding: 6px; border-radius: 14px;
  background: #2c2f38; border: 1px solid var(--bord-fort); box-shadow: 0 8px 24px rgba(0, 0, 0, .5); }
.popover::after { content: ""; position: absolute; left: 50%; bottom: -7px; width: 12px; height: 12px;
  background: #2c2f38; border-right: 1px solid var(--bord-fort); border-bottom: 1px solid var(--bord-fort);
  transform: translateX(-50%) rotate(45deg); }

/* Prénoms cliquables (admins) : codes à réinitialiser. */
.tableau thead th.nom-v.cliquable { cursor: pointer; }

/* Bulle de confirmation au milieu de l'écran. */
.fond-bulle { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .6);
  display: grid; place-items: center; padding: 16px; }
.bulle { --c: var(--accent, var(--rouge)); width: 100%; max-width: 380px; background: #12151c; border: 1px solid var(--bord);
  border-top: 4px solid var(--c); border-radius: 18px; padding: 18px; animation: monter .15s ease-out; }
.bulle p { margin: 0 0 10px; }
.titre-bulle { font-weight: 700; font-size: 1.05rem; color: var(--texte) !important; }
.boutons-bulle { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }
.ligne-code { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0;
  border-top: 1px solid var(--bord); }
.ligne-code small { display: block; color: var(--discret); font-size: .75rem; }

/* Bouton Actualiser, à droite du mois. */
.nav .actualiser { width: 44px; padding: 0; font-size: 1.3rem; }
.actualiser.tourne { animation: tourner .6s linear infinite; }
@keyframes tourner { to { transform: rotate(360deg); } }

/* Détail d'un jour : titre au-dessus du choix de demi-journée. */
.titre-partage { margin: 12px 0 0; font-weight: 600; color: var(--texte); }

/* Interrupteurs de notifications (réglages). */
.ligne-notif { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--bord); cursor: pointer; }
.ligne-notif input { margin-top: 2px; flex: none; }

/* Réglages (roue dentée). */
.titre-reglages { margin: 20px 0 6px; }
textarea.message { width: 100%; font: inherit; color: var(--texte); background: #12151c; padding: 10px;
  border: 1px solid var(--bord); border-radius: 10px; resize: vertical; }
.apercu-message { white-space: pre-wrap; font: inherit; font-size: .9rem; margin: 0 0 10px; padding: 10px 12px;
  background: rgba(37, 211, 102, .08); border: 1px solid rgba(37, 211, 102, .3); border-radius: 12px 12px 12px 2px; }

.vendeur { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--bord); }
.vendeur strong { width: 100px; }
.vendeur .conversation { flex: 1; min-width: 150px; color: var(--doux); }

/* Réglages : une catégorie pliée par notification. */
.retour { margin-bottom: 4px; font-size: 1.3rem; }
.categorie { border: 1px solid var(--bord); border-radius: 14px; background: var(--carte); margin-bottom: 10px; }
.categorie > summary { display: flex; align-items: center; gap: 12px; padding: 14px; cursor: pointer; list-style: none; }
.categorie > summary::-webkit-details-marker { display: none; }
.categorie > summary::after { content: "›"; margin-left: auto; font-size: 1.3rem; color: var(--discret); transition: transform .15s; }
.categorie[open] > summary::after { transform: rotate(90deg); }
.categorie > summary input { flex: none; width: 22px; height: 22px; }
.categorie.coupee .titre-categorie { color: var(--discret); }
.boite-message { padding: 0 14px 14px; }
.boite-message .apercu-message { position: relative; display: block; width: 100%; text-align: left; cursor: pointer; color: var(--texte); }
.boite-message .crayon { position: absolute; top: 6px; right: 8px; color: var(--discret); }
.categorie.coupee .apercu-message { opacity: .45; }
/* Bulle de validation : envoi aux vendeurs coupé. */
.bulle .alerte { color: var(--ambre-texte); }
.bulle .ligne-notif { border-bottom: 0; padding: 4px 0 0; }

/* Réglages : une ligne simple avec sa coche (check-list). */
.categorie.ligne-simple { display: flex; align-items: center; gap: 12px; padding: 14px; cursor: pointer; }
.categorie.ligne-simple input { flex: none; width: 22px; height: 22px; }

/* Réglages : jour et heure de la validation automatique. */
.horaire-auto { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 0 14px 12px; color: var(--texte); }
.horaire-auto select { min-height: 38px; padding: 6px 8px; }
.ligne-simple small { margin-left: 4px; }

/* Aperçu d'ensemble : colonnes un peu plus étroites (le tableau ne s'étire
   plus sur toute la largeur), lignes un peu moins hautes. */
.tableau { width: auto; max-width: 100%; margin: 0 auto; }
.tableau th.nom-v, .tableau td.cell { width: 38px; }
.zone { height: 27px; }
.zone.demi { height: 19px; }

/* Bulle de validation : jours sans vendeur. */
.manques { margin: 0 0 10px; padding: 8px 12px; border-radius: 10px; background: var(--ambre); border: 1px solid var(--ambre-bord); color: var(--ambre-texte); }
.manques p { margin: 0 0 4px; color: var(--ambre-texte); font-weight: 600; }
.manques ul { margin: 0; padding-left: 18px; font-size: .9rem; }
/* Heure d'une demi-journ�e : �crite dans la partie remplie. */
.zone.texte-haut { align-items: flex-start; padding-top: 1px; }
.zone.texte-bas { align-items: flex-end; padding-bottom: 1px; }
.zone { line-height: 1; }

/* Détail d'un jour : la poubelle à droite. */
.actions .a-droite { margin-left: auto; }

/* Réglages : grandes catégories pliables, pliées par défaut. */
.section-reglages > summary.titre-reglages { display: flex; align-items: center; cursor: pointer; list-style: none;
  font-size: 1.05rem; font-weight: 700; padding: 6px 2px; }
.section-reglages > summary::-webkit-details-marker { display: none; }
.section-reglages > summary::after { content: "›"; margin-left: auto; font-size: 1.4rem; color: var(--discret); transition: transform .15s; }
.section-reglages[open] > summary::after { transform: rotate(90deg); }
.section-reglages { border-bottom: 1px solid var(--bord); padding-bottom: 6px; margin-bottom: 4px; }
/* L�gende : la case � Valid� � reste dans son cadre. */
.ex { box-sizing: border-box; }
.ex.coche { border: 0; display: inline-grid; place-items: center; }
.ex.coche::after { position: static; inset: auto; line-height: 1; font-size: .72rem; }

/* Navigation du mois : Actualiser juste sous la fl�che � mois suivant �. */
.nav { align-items: flex-start; }
.nav h2 { line-height: 44px; }
.colonne-nav { display: flex; flex-direction: column; gap: 6px; }

/* R�glages : vider le mois et corbeille. */
.titre-corbeille { margin: 14px 0 6px; font-weight: 600; color: var(--texte); }
.ligne-corbeille { justify-content: space-between; cursor: default; }
.ligne-corbeille small { display: block; margin: 2px 0 0; font-size: .75rem; color: var(--discret); }

/* Jours du mois suivant dans la derni�re semaine : en pointill�s. */
.tableau tr.mois-suivant .cell { background: transparent; outline: 1px dashed var(--bord-fort); outline-offset: -1px; }
.tableau tr.mois-suivant .date { background: transparent; outline: 1px dashed var(--bord-fort); outline-offset: -1px; opacity: .7; }
.tableau tr.mois-suivant .zone { opacity: .75; }

.colonne-nav .actualiser { min-height: 34px; height: 34px; font-size: 1.1rem; }
.nav { margin-bottom: 0; }

/* Le rouge du th�me devient la couleur du vendeur connect� (--accent, pos�e
   par app.js). Seuls le logo et les messages d'erreur restent rouges. */
.tableau tr.weekend .date { color: color-mix(in srgb, var(--accent, var(--c)) 80%, #fff); background: color-mix(in srgb, var(--accent, var(--c)) 9%, transparent); }
.tableau tr.aujourdhui .date { color: #0b0d12; background: var(--accent, var(--c)); }
.jour.weekend { background: color-mix(in srgb, var(--accent, var(--c)) 5%, transparent); border-color: color-mix(in srgb, var(--accent, var(--c)) 22%, transparent); }
.bouton.icone.actif svg { stroke: #0b0d12; }

/* --- R�glages plus soign�s --------------------------------------------- */
.titre-page-reglages { font-size: 1.35rem; margin: 6px 0 14px; }
.section-reglages { border: 1px solid var(--bord); border-radius: 18px; background: #12151c;
  margin-bottom: 12px; padding: 0; overflow: hidden; }
.section-reglages > summary.titre-reglages { gap: 12px; padding: 14px 16px; margin: 0; font-size: 1rem; }
.section-reglages > summary:hover { background: var(--carte-forte); }
.section-reglages[open] > summary { border-bottom: 1px solid var(--bord); }
.pastille-section { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center;
  font-size: 1.05rem; background: color-mix(in srgb, var(--accent, var(--c)) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent, var(--c)) 40%, transparent); }
.pastille-section svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; }
.bouton.avec-icone { display: inline-flex; align-items: center; gap: 6px; }
.bouton.avec-icone svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; }
.grille-admins { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 10px; }
.petit-mois { display: block; font-size: .5rem; font-weight: 500; line-height: 1; margin-top: 2px; text-transform: uppercase; letter-spacing: .02em; }
.nom-section { font-weight: 700; }
.contenu-section { padding: 12px; }
.contenu-section .categorie { background: var(--carte); border-radius: 12px; margin-bottom: 8px; }
.contenu-section .categorie:last-child { margin-bottom: 0; }
.contenu-section > .bouton { width: 100%; margin-bottom: 4px; }
.horaire-auto { padding: 12px 14px; }
.coupee .horaire-auto { opacity: .45; }

/* R�glages : vendeurs (ajouter, renommer, retirer, groupe WhatsApp). */
.ligne-vendeur, .ajout-vendeur { padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.tete-vendeur { display: flex; align-items: center; gap: 8px; }
.tete-vendeur strong { flex: 1; }
.bouton.icone.petit { width: 34px; min-height: 34px; height: 34px; font-size: 1rem; }
.bouton.icone.petit svg { width: 18px; height: 18px; }
.choix-groupe, .champ-nom { width: 100%; min-height: 40px; }
.bulle .champ-nom { margin-bottom: 4px; }

/* L�gende : � Appui long : � suivi des deux ic�nes du d�tail. */
.legende .geste { display: inline-flex; align-items: center; gap: 4px; }
.icone-legende { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px;
  border: 1px solid var(--bord); background: var(--carte); color: var(--texte); }
.icone-legende svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* R�glages : lignes admin plus basses. */
.grille-admins .categorie.ligne-simple { padding: 7px 10px; gap: 8px; min-height: 0; margin-bottom: 0; font-size: .92rem; }
.grille-admins .categorie.ligne-simple input { width: 18px; height: 18px; }

/* Dates : plus cliquables. */
.tableau .date { cursor: default; }

/* Colonnes resserrées : vendeurs 31 px, dates 42 px. */
.tableau th.nom-v, .tableau td.cell { width: 31px; }
.tableau .coin, .tableau .date { width: 42px; }
.tableau .date { font-size: .7rem; padding: 0 4px; }
.nom-v span { font-size: .72rem; }
.zone { font-size: .56rem; }

/* Bouton « envoyer » : même gris que les crochets, avion plus fin. */
.crochet .envoyer { color: var(--bord-fort); }
.crochet .envoyer svg { stroke-width: 1.7; }

/* Admins : colonne en pointillés « + » à droite, pour ajouter un vendeur. */
.tableau thead th.colonne-ajout { width: 26px; cursor: pointer; vertical-align: middle; text-align: center;
  border: 1.5px dashed var(--bord-fort); border-radius: 8px; color: var(--doux); font-size: 1.2rem; font-weight: 600; }
.tableau thead th.colonne-ajout:hover { color: var(--texte); border-color: var(--doux); }
.tableau td.case-ajout { width: 26px; border: 1px dashed var(--bord); border-radius: 7px; }

/* Bulle d'un prénom : icônes « code » et « retirer ». */
.icones-code { display: inline-flex; gap: 6px; }

/* --- Coche de validation : deux états seulement -------------------------
   Gris : semaine pas validée (case vide, crochet gris).
   Vert : semaine validée (case verte avec coche, crochet vert).
   Ni survol, ni mode « validation en cours », ni bouton grisé ne changent
   ces couleurs. */
.crochet, .crochet.en-validation { border-color: var(--bord-fort); background: none; }
.crochet .coche-semaine, .crochet.en-validation .coche-semaine,
.crochet:not(:disabled):hover .coche-semaine { border-color: var(--bord-fort); background: var(--fond); }
.crochet.ok, .crochet.ok.en-validation { border-color: #34d399; }
.crochet.ok .coche-semaine, .crochet.ok:hover .coche-semaine { border-color: #34d399; background: #34d399; color: #0b0d12; }
.crochet .coche-bouton:disabled { opacity: 1; }
.crochet .envoyer svg { stroke-width: 1.5; }

/* Colonnes encore plus étroites : vendeurs 26 px, dates 38 px. */
.tableau th.nom-v, .tableau td.cell { width: 26px; }
.tableau .coin, .tableau .date { width: 38px; }
.tableau .date { font-size: .66rem; padding: 0 3px; }
.nom-v span { font-size: .68rem; }
.zone { font-size: .5rem; }
.tableau thead th.colonne-ajout, .tableau td.case-ajout { width: 22px; }
/* Bulle d'un prénom : boutons parlants (icône + mot), sur une ligne à part. */
.ligne-code.ligne-compte { flex-wrap: wrap; }
.ligne-compte .icones-code { width: 100%; flex-wrap: wrap; }
.bouton.action-icone { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 6px 10px; font-size: .85rem; }
.bouton.action-icone svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
/* Annuler / rétablir : deux flèches qui flottent en bas à gauche. */
.historique { position: fixed; left: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 5; display: flex; gap: 8px; }
.historique .bouton.icone { border-radius: 50%; background: rgba(18, 21, 28, .88); border-color: var(--bord-fort);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .45); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.historique .bouton.icone:disabled { opacity: .3; }
body.bloque .historique { display: none; }
.tableau { margin-bottom: 64px; }

/* Historique des modifications (réglages). */
.journal { max-height: 65vh; overflow-y: auto; padding-right: 4px; }
.jour-journal { margin: 14px 0 6px; font-size: .8rem; color: var(--doux, #9aa3b2); text-transform: capitalize; }
.jour-journal:first-child { margin-top: 0; }
.ligne-journal { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--bord); }
.image-journal { display: flex; align-items: center; gap: 6px; flex: none; }
.fleche-journal { color: var(--bord-fort); font-size: .9rem; }
.mini-case { position: relative; width: 30px; height: 36px; border-radius: 7px; overflow: hidden; display: flex; flex-direction: column;
  border: 1px solid color-mix(in srgb, var(--c) 55%, transparent); background: var(--carte); }
.mini-case .moitie { flex: 1; display: flex; align-items: center; justify-content: center; }
.mini-case .moitie + .moitie { border-top: 1px solid var(--fond); }
.mini-case .moitie.dispo { background: color-mix(in srgb, var(--c) 30%, transparent); }
.mini-case .moitie.travaille { background: var(--c); }
.mini-case .moitie.travaille::after { content: "✓"; color: #0b0d12; font-size: .65rem; font-weight: 700; }
.mini-heure { position: absolute; inset: auto 0 1px; text-align: center; font-size: .5rem; line-height: 1; color: var(--texte); pointer-events: none; }
.texte-journal { display: flex; flex-direction: column; gap: 3px; min-width: 0; font-size: .88rem; }
.pied-journal { color: var(--doux, #9aa3b2); font-size: .75rem; }
.source-journal { display: inline-block; padding: 1px 6px; border-radius: 6px; font-size: .68rem; font-weight: 600; background: var(--carte-forte); }
.source-journal.sheets { background: rgba(52, 168, 83, .22); color: #6fdc8c; }
.source-journal.app { background: color-mix(in srgb, var(--accent, #f87171) 22%, transparent); color: var(--accent, #f87171); }
.source-journal.auto { background: rgba(250, 204, 21, .18); color: #facc15; }
.mini-heure { position: static; font-size: .5rem; line-height: 1; color: var(--texte); }

.popover { display: flex; gap: 6px; }

/* Fenêtre de partage : un seul cadre, la croix ne chevauche rien. */
.feuille .jour { border: 0; background: none; padding: 0; margin: 0; }
.feuille .titre-partage { margin-top: 4px; margin-right: 48px; }

/* Partager la journée : une seule fenêtre, « Disponible » juste au-dessus de Jusqu'à / À partir de. */
.feuille .panneau { background: none; border: 0; padding: 0; margin-top: 0; border-radius: 0; }
.feuille .titre-partage { margin: 2px 48px 6px 0; font-size: .85rem; font-weight: 500; color: var(--doux); }

/* Les prénoms répétés en bas du tableau (lus depuis le haut, collés aux cases). */
.tableau tfoot th { height: 76px; vertical-align: top; }
.tableau tfoot th.nom-v { border-radius: 8px; padding-top: 4px; box-shadow: inset 0 0 0 1.5px var(--c); }
.tableau tfoot th.nom-v.moi { background: var(--c); }
.tableau tfoot th.nom-v.cliquable { cursor: pointer; }

/* Avion « envoyer » : trait de 2 px à l'écran, comme le contour des crochets (icône de 18 px dessinée sur 24). */
.crochet .envoyer svg { stroke-width: 2.67; vector-effect: none; }

/* L'avion garde toujours le même aspect, même sur une semaine passée. */
.crochet .envoyer:disabled { opacity: 1; }
.crochet .envoyer { color: #48494d; } /* = le gris des crochets sur le fond, sans transparence : pas de points plus clairs aux croisements */

/* Sa propre colonne : légère surbrillance, sans contour autour de chaque jour. */
.cell.propre { box-shadow: none; background: rgba(255, 255, 255, .08); }

/* Champ heure vide : juste « : » au centre (au lieu de « --:-- » ou de rien). */
.champ-heure { position: relative; display: inline-flex; }
.champ-heure input { text-align: center; }
.champ-heure input:invalid:not(:focus)::-webkit-datetime-edit { color: transparent; }
.champ-heure input:invalid:not(:focus) { color: transparent; }
.champ-heure:has(input:invalid:not(:focus))::after { content: ":"; position: absolute; inset: 0; display: flex;
  align-items: center; justify-content: center; font-size: 1.1rem; font-weight: 700; color: var(--doux); pointer-events: none; }.tableau tr.weekend .cell.propre { background: rgba(255, 255, 255, .11); }

/* Envoi WhatsApp reussi : une coche se dessine, puis tout s'efface seul. */
.succes { position: fixed; left: 50%; top: 50%; z-index: 80; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 22px 26px 16px;
  border-radius: 20px; background: rgba(18, 21, 28, .94); border: 1px solid var(--vert-bord);
  color: var(--vert-texte); pointer-events: none; animation: succes-vie 1.8s ease forwards; }
.succes p { margin: 0; font-weight: 600; text-align: center; max-width: 240px; }
.coche-anim svg { width: 64px; height: 64px; fill: none; stroke: #34d399; stroke-width: 3;
  stroke-linecap: round; stroke-linejoin: round; }
.coche-anim circle { stroke-dasharray: 145; stroke-dashoffset: 145; animation: succes-trait .45s ease-out forwards; }
.coche-anim path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: succes-trait .3s .4s ease-out forwards; }
@keyframes succes-trait { to { stroke-dashoffset: 0; } }
@keyframes succes-vie { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.85); }
  12% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  80% { opacity: 1; } 100% { opacity: 0; } }

/* Flèches annuler / rétablir : un peu plus loin du bord de l'écran. */
.historique { left: 28px; bottom: calc(28px + env(safe-area-inset-bottom)); }
.tableau { margin-bottom: 84px; }

/* Bulle de l'appui long (admin) : le bouton envoyer glisse de derrière la
   coche quand on valide, et y rentre quand on annule la validation. */
.popover .bouton.icone { position: relative; z-index: 1; }
.popover .envoi-glisse { z-index: 0; max-width: 44px; overflow: hidden;
  transition: transform .28s ease, opacity .2s ease, max-width .28s ease, margin-left .28s ease; }
.popover .envoi-glisse.rentre { max-width: 0; margin-left: -6px; padding: 0; border-width: 0; opacity: 0;
  transform: translateX(-100%); pointer-events: none; }