/* Couleurs : à remplacer par celles de l'entreprise */
:root {
  --fond: #f4f5f7;
  --carte: #ffffff;
  --texte: #1f2933;
  --texte-doux: #616e7c;
  --bordure: #dde1e6;
  --barre: #0d023e;
  --barre-texte: #e4e7eb;
  --accent: #f2b04a;
  --accent-texte: #0d023e;
  --danger: #c0392b;
  --succes: #2e7d4f;
  --rayon: 10px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--fond);
  color: var(--texte);
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
}
button, input, select { font: inherit; }

/* ---------- Connexion ---------- */
.ecran-connexion {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px;
  background: var(--barre);
}
.logo-connexion { display: block; width: 260px; max-width: 75vw; margin: 0 0 24px; }
.boite-connexion {
  background: var(--carte); border-radius: 14px; padding: 28px 24px; width: 100%; max-width: 340px; text-align: center;
}
.boite-connexion h1 { font-size: 1.3rem; margin: 0 0 4px; }
.boite-connexion p { color: var(--texte-doux); margin: 0 0 20px; font-size: .95rem; }
.points { display: flex; justify-content: center; gap: 12px; margin: 8px 0 20px; height: 18px; }
.points span { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--texte-doux); }
.points span.plein { background: var(--texte); border-color: var(--texte); }
.clavier { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.clavier button {
  height: 60px; border-radius: var(--rayon); border: 1px solid var(--bordure); background: var(--fond);
  font-size: 1.4rem; cursor: pointer;
}
.clavier button:active { background: var(--bordure); }
.clavier button.action { font-size: 1rem; }
.clavier button.entrer { background: var(--accent); color: var(--accent-texte); border-color: var(--accent); }
.message-erreur { color: var(--danger); min-height: 1.3em; margin: 10px 0 0; font-size: .95rem; }

/* ---------- Structure ---------- */
.entete {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px;
  height: 56px; padding: 0 12px; background: var(--barre); color: var(--barre-texte);
}
.bouton-menu {
  width: 44px; height: 44px; border: 0; background: transparent; cursor: pointer;
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px;
}
.bouton-menu span { display: block; width: 22px; height: 2px; background: var(--barre-texte); border-radius: 2px; }
.entete h1 { font-size: 1.05rem; margin: 0; font-weight: 600; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entete .qui { font-size: .85rem; opacity: .8; white-space: nowrap; }

.voile { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 20; opacity: 0; pointer-events: none; transition: opacity .2s; }
.voile.ouvert { opacity: 1; pointer-events: auto; }
.menu {
  position: fixed; top: 0; bottom: 0; left: 0; width: 270px; max-width: 85vw; z-index: 30;
  background: var(--barre); color: var(--barre-texte); transform: translateX(-100%); transition: transform .2s;
  display: flex; flex-direction: column; padding: 16px 0;
}
.menu.ouvert { transform: translateX(0); }
.menu .titre-menu img { width: 170px; height: auto; }
.menu .titre-menu { display: flex; align-items: center; gap: 10px; padding: 0 20px 14px; font-weight: 700; font-size: 1.05rem; border-bottom: 1px solid rgba(255,255,255,.1); margin-bottom: 8px; }
.menu a {
  display: block; padding: 13px 20px; color: var(--barre-texte); text-decoration: none; border-left: 3px solid transparent;
}
.menu a:hover { background: rgba(255,255,255,.06); }
.menu a.actif { background: rgba(255,255,255,.1); border-left-color: var(--accent); font-weight: 600; }
.menu .bas { margin-top: auto; padding: 12px 20px 0; border-top: 1px solid rgba(255,255,255,.1); }
.menu .bas button { width: 100%; padding: 11px; border-radius: var(--rayon); border: 1px solid rgba(255,255,255,.25); background: transparent; color: var(--barre-texte); cursor: pointer; }

@media (min-width: 1000px) {
  .menu { transform: none; }
  .voile { display: none; }
  .bouton-menu { display: none; }
  .entete, .contenu { margin-left: 270px; }
}

.contenu { padding: 16px; max-width: 1000px; }
.contenu h2 { margin: 4px 0 16px; font-size: 1.35rem; }

/* ---------- Éléments ---------- */
.carte { background: var(--carte); border: 1px solid var(--bordure); border-radius: var(--rayon); padding: 16px; margin-bottom: 12px; }
.vide { color: var(--texte-doux); text-align: center; padding: 32px 16px; }
.bouton {
  display: inline-block; padding: 10px 16px; border-radius: var(--rayon); border: 1px solid var(--accent);
  background: var(--accent); color: var(--accent-texte); cursor: pointer; font-weight: 600;
}
.bouton.secondaire { background: var(--carte); color: var(--texte); border-color: var(--bordure); }
.bouton.danger { background: var(--carte); color: var(--danger); border-color: var(--danger); }
.bouton:disabled { opacity: .5; cursor: default; }
.ligne-titre { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.ligne-titre h2 { margin: 0; }

.liste-employes .employe { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.employe .nom { font-weight: 600; }
.employe .details { color: var(--texte-doux); font-size: .9rem; margin-top: 2px; }
.employe .actions { display: flex; gap: 8px; }
.badge { display: inline-block; font-size: .75rem; padding: 2px 8px; border-radius: 99px; background: var(--fond); border: 1px solid var(--bordure); margin-left: 6px; font-weight: 500; }

.formulaire label { display: block; font-weight: 600; font-size: .9rem; margin: 12px 0 4px; }
.formulaire input, .formulaire select {
  width: 100%; padding: 11px 12px; border: 1px solid var(--bordure); border-radius: var(--rayon); background: var(--carte);
}
.formulaire .aide { color: var(--texte-doux); font-size: .85rem; margin-top: 4px; }
.formulaire .boutons { display: flex; gap: 8px; margin-top: 18px; justify-content: flex-end; }

.fenetre { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.fenetre .carte { width: 100%; max-width: 420px; max-height: 90vh; overflow: auto; margin: 0; }
.fenetre h3 { margin: 0 0 4px; }

.tuiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.tuile { background: var(--carte); border: 1px solid var(--bordure); border-radius: var(--rayon); padding: 16px; text-decoration: none; color: var(--texte); }
.tuile strong { display: block; margin-bottom: 4px; }
.tuile span { color: var(--texte-doux); font-size: .9rem; }

.avis { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 50; background: var(--texte); color: #fff; padding: 10px 16px; border-radius: var(--rayon); font-size: .95rem; max-width: 90vw; }
.avis.erreur { background: var(--danger); }

/* ---------- Calculateur ---------- */
.carte h3 { margin: 0 0 10px; font-size: 1.05rem; }
.carte h4 { margin: 16px 0 8px; font-size: .9rem; color: var(--texte-doux); font-weight: 600; }
.aide-calc { font-weight: 400; font-size: .8rem; color: var(--texte-doux); }
.details-calcul { color: var(--texte-doux); font-size: .9rem; margin: -8px 0 12px; }
.contenu:has(.barre-total) { padding-bottom: 110px; }

.calc-grille { display: grid; gap: 12px; }
@media (min-width: 1100px) {
  .calc-grille { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
  .calc-resultats { position: sticky; top: 68px; max-height: calc(100vh - 170px); overflow-y: auto; }
  .contenu:has(.calc-grille) { max-width: 1200px; }
}

.choix { display: flex; flex-wrap: wrap; gap: 8px; }
.choix button {
  padding: 10px 14px; border-radius: 99px; border: 1px solid var(--bordure); background: var(--carte);
  color: var(--texte); cursor: pointer; font-size: .95rem;
}
.choix button.actif { background: var(--barre); color: #fff; border-color: var(--barre); font-weight: 600; }

.ligne-dim, .ligne-extra { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ligne-dim input.num { width: 96px; }
.ligne-extra input:not(.num) { flex: 1; min-width: 0; }
.ligne-extra input.num { width: 110px; }
input.num, .ligne-extra input, .recherche, .formulaire textarea {
  padding: 11px 12px; border: 1px solid var(--bordure); border-radius: var(--rayon); background: var(--carte); font-size: 16px;
}
.formulaire textarea { width: 100%; font: inherit; resize: vertical; }
.fois { color: var(--texte-doux); }
.surf { flex: 1; color: var(--texte-doux); font-size: .9rem; white-space: nowrap; }
.retirer { border: 0; background: none; color: var(--danger); cursor: pointer; padding: 8px 4px; font-size: .85rem; }
.ajouter { border: 1px dashed var(--bordure); background: none; border-radius: var(--rayon); padding: 9px 14px; cursor: pointer; color: var(--texte); }
.compteur { display: inline-flex; align-items: center; border: 1px solid var(--bordure); border-radius: var(--rayon); overflow: hidden; }
.compteur button { width: 48px; height: 44px; border: 0; background: var(--fond); font-size: 1.3rem; cursor: pointer; }
.compteur span { min-width: 48px; text-align: center; font-weight: 600; }

.deux-col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.deux-col .large { grid-column: 1 / -1; }
.deux-col label { margin-top: 4px; }
@media (max-width: 520px) { .deux-col { grid-template-columns: 1fr; } }

.resultat .details { color: var(--texte-doux); font-size: .85rem; }
.tableau-prix { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: .95rem; }
.tableau-prix td { padding: 6px 0; vertical-align: top; }
.tableau-prix td:last-child { text-align: right; white-space: nowrap; padding-left: 12px; }
.tableau-prix .separateur td { border-top: 1px solid var(--bordure); padding-top: 10px; }
.tableau-prix .total td { font-weight: 700; font-size: 1.1rem; border-top: 2px solid var(--texte); padding-top: 10px; }
.commission { margin-top: 12px; padding: 10px 12px; background: #fdf3e2; border-radius: var(--rayon); }
.admin-seulement { border-left: 4px solid var(--accent); }

.barre-total {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; display: flex; align-items: center; gap: 12px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--carte); border-top: 1px solid var(--bordure);
  box-shadow: 0 -4px 16px rgba(0,0,0,.06);
}
@media (min-width: 1000px) { .barre-total { left: 270px; } }
.barre-montants { flex: 1; min-width: 0; }
.barre-montants .grand { font-size: 1.4rem; font-weight: 700; }
.barre-montants .petit { font-size: .85rem; color: var(--texte-doux); }
.barre-total .bouton { padding: 13px 22px; }

.recherche { width: 100%; margin-bottom: 12px; }
.ligne-calcul { display: flex; justify-content: space-between; gap: 12px; text-decoration: none; color: var(--texte); }
.ligne-calcul .nom { font-weight: 600; }
.ligne-calcul .details { color: var(--texte-doux); font-size: .85rem; margin-top: 2px; }
.ligne-calcul .droite { text-align: right; }
.ligne-calcul .montant { font-weight: 700; }
.statut { display: inline-block; margin-top: 4px; font-size: .75rem; padding: 2px 8px; border-radius: 99px; background: var(--fond); border: 1px solid var(--bordure); }
.statut-acceptee { background: #e3f3e9; border-color: #b9dfc7; color: var(--succes); }
.statut-refusee { background: #fbe7e5; border-color: #f0c2bd; color: var(--danger); }
.chiffres .tuile strong { font-size: 1.4rem; margin: 4px 0 0; }
.chiffres { margin-bottom: 12px; }
.details { color: var(--texte-doux); font-size: .9rem; }

.grille-reglages { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px 16px; }
.reglage { display: flex; flex-direction: column; gap: 4px; font-size: .9rem; }
.avec-unite { display: flex; align-items: center; gap: 6px; }
.avec-unite input { width: 120px; padding: 10px 12px; border: 1px solid var(--bordure); border-radius: var(--rayon); font-size: 16px; }
.avec-unite em { font-style: normal; color: var(--texte-doux); font-size: .85rem; }
a.bouton { text-decoration: none; }

.ligne-calcul.avec-action { align-items: center; }
.ligne-calcul .zone-lien { flex: 1; min-width: 0; display: flex; justify-content: space-between; gap: 12px; text-decoration: none; color: var(--texte); }
.bouton.petit { padding: 8px 12px; font-size: .85rem; font-weight: 500; }
@media (max-width: 520px) {
  .ligne-calcul.avec-action { flex-wrap: wrap; }
  .ligne-calcul.avec-action .actions-ligne { margin-left: auto; }
}

/* ---------- Heures ---------- */
.nav-semaine { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.nav-semaine .bouton { width: 44px; padding: 8px 0; font-size: 1.3rem; line-height: 1; text-align: center; }
.nav-semaine .bouton:disabled { opacity: .35; }
.titre-semaine { font-weight: 600; text-align: center; flex: 1; }
.retour-semaine { text-align: center; margin-top: 6px; }
.lien { border: 0; background: none; color: var(--texte-doux); text-decoration: underline; cursor: pointer; font-size: .9rem; }

.form-jour input[type=date], .form-jour input[type=time], .form-jour select { min-height: 46px; -webkit-appearance: none; appearance: none; }
.form-jour .deux-col { grid-template-columns: 1fr 1fr; }
.form-jour .deux-col > div:nth-child(2) { grid-column: auto; }
@media (max-width: 520px) {
  .form-jour .deux-col { grid-template-columns: 1fr 1fr; }
  .form-jour .deux-col > div:nth-child(2), .form-jour .deux-col .large { grid-column: 1 / -1; }
}
.total-jour { margin-top: 12px; font-weight: 600; min-height: 1.3em; }

.tableau-heures { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: .93rem; }
.tableau-heures th { text-align: left; font-size: .8rem; color: var(--texte-doux); font-weight: 600; padding: 6px 4px; border-bottom: 1px solid var(--bordure); }
.tableau-heures td { padding: 9px 4px; border-bottom: 1px solid var(--bordure); vertical-align: top; }
.tableau-heures td:nth-child(3), .tableau-heures td:nth-child(4), .tableau-heures th:nth-child(3), .tableau-heures th:nth-child(4) { text-align: right; white-space: nowrap; }
.tableau-heures tbody tr[data-date] { cursor: pointer; }
.tableau-heures tbody tr[data-date]:hover { background: var(--fond); }
.tableau-heures tr.choisi { background: #fdf3e2; }
.tableau-heures tr.futur td { color: var(--bordure); }
.tableau-heures tfoot td { font-weight: 700; border-bottom: 0; }
.tableau-heures .details { font-size: .8rem; }

.banniere { padding: 12px 14px; border-radius: var(--rayon); margin-bottom: 12px; font-weight: 500; }
.banniere.ok { background: #e3f3e9; color: var(--succes); }
.banniere.attention { background: #fdf3e2; color: #8a5a00; }
.banniere.neutre { background: var(--fond); color: var(--texte-doux); font-weight: 400; }

.entete-employe { display: flex; justify-content: space-between; gap: 12px; }
.entete-employe .nom { font-weight: 700; font-size: 1.05rem; }
.entete-employe .droite { text-align: right; }
.entete-employe .montant { font-weight: 700; font-size: 1.2rem; }
.chiffres-heures { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.chiffres-heures div { background: var(--fond); border-radius: var(--rayon); padding: 8px 10px; }
.chiffres-heures span { display: block; font-size: .75rem; color: var(--texte-doux); }
.chiffres-heures strong { font-size: 1rem; }
@media (max-width: 520px) { .chiffres-heures { grid-template-columns: 1fr 1fr; } }
.alertes { margin: 12px 0 0; padding: 10px 12px 10px 28px; background: #fdf3e2; border-radius: var(--rayon); color: #8a5a00; font-size: .9rem; }
.boutons-employe { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; }
.boutons-employe .details { font-size: .8rem; }
.barre-total .bouton + .bouton, .barre-total a.bouton { white-space: nowrap; }
.heures-reelles { margin-top: 12px; padding: 10px 12px; background: var(--fond); border-radius: var(--rayon); font-size: .9rem; }
@media (max-width: 520px) {
  .barre-total { gap: 8px; }
  .barre-total .bouton { padding: 12px 14px; }
  .barre-montants .grand { font-size: 1.2rem; }
}

.select-couleur { width: 100%; max-width: 360px; padding: 11px 12px; border: 1px solid var(--bordure); border-radius: var(--rayon); background: var(--carte); font-size: 16px; }

/* ---------- Statistiques ---------- */
.choix-periode { margin-bottom: 12px; }
.tuiles-stats { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.tuiles-stats .tuile span { font-size: .85rem; }
.section-stats h4 { margin-top: 18px; }
.titre-section { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.titre-section h3 { margin: 0; }
.aide-section { font-size: .82rem; margin: 6px 0 4px; }
.vide-petit { padding: 10px 0; }
.tableau-defile { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-top: 8px; }
.tableau-stats { width: 100%; border-collapse: collapse; font-size: .9rem; white-space: nowrap; }
.tableau-stats th { text-align: left; font-size: .78rem; color: var(--texte-doux); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--bordure); background: var(--fond); }
.tableau-stats td { padding: 8px; border-bottom: 1px solid var(--bordure); }
.tableau-stats td:not(:first-child), .tableau-stats th:not(:first-child) { text-align: right; }
.tableau-stats tbody tr:nth-child(even) { background: #fafbfc; }
.tableau-stats tfoot td { font-weight: 700; border-top: 2px solid var(--texte); border-bottom: 0; }
.tableau-stats a { color: var(--texte); }
.chiffres-ventes { margin-top: 8px; }
.barre-mois { position: relative; width: 90px; height: 10px; background: var(--fond); border-radius: 5px; overflow: hidden; }
.barre-mois span, .barre-mois i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 5px; }
.barre-mois span { background: #f6d9a6; }
.barre-mois i { background: var(--accent); }
.champ-date { width: 100%; max-width: 220px; padding: 11px 12px; border: 1px solid var(--bordure); border-radius: var(--rayon); min-height: 46px; }
#t-couleurs td:nth-child(2), #t-couleurs th:nth-child(2), #t-relance td:nth-child(2), #t-relance th:nth-child(2) { text-align: left; }
.tableau-stats td:first-child { white-space: normal; min-width: 110px; }
#t-rent td:last-child { font-weight: 600; }

/* ---------- Inventaire ---------- */
.statut-terminee { background: #e4ecf7; border-color: #bccde6; color: #1f4d8a; }
.tuile-alerte { border-color: var(--danger); }
.tuile-alerte strong { color: var(--danger); }
.onglets-inv { margin: 4px 0 12px; }
.onglets-inv button { font-weight: 600; }
.entete-groupe { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.entete-groupe .nom { font-weight: 700; font-size: 1.05rem; }
.lignes-inv { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; margin: 12px 0 10px; }
.ligne-inv { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 11px 12px; border: 1px solid var(--bordure);
  border-radius: var(--rayon); background: var(--carte); cursor: pointer; text-align: left; color: var(--texte); font: inherit; }
.ligne-inv:hover { background: var(--fond); }
.ligne-inv .nom-ligne { font-size: .93rem; }
.ligne-inv .qte { text-align: right; white-space: nowrap; font-size: .85rem; color: var(--texte-doux); }
.ligne-inv .qte strong { font-size: 1.05rem; color: var(--texte); }
.ligne-inv .qte em { display: block; font-style: normal; font-size: .72rem; }
.ligne-inv.alerte { border-color: var(--danger); background: #fdf1f0; }
.ligne-inv.alerte .qte strong { color: var(--danger); }
.ajouter-produit { width: 100%; padding: 14px; margin-bottom: 16px; }
.fenetre-stock .stock-actuel { margin: 4px 0 4px; font-size: 1.05rem; }
.actions-stock { display: grid; gap: 8px; margin-top: 12px; }
.ligne-min { display: flex; gap: 8px; }
.ligne-min input { flex: 1; }
.mouvements { white-space: normal; }
.mouvements td { padding: 6px 4px; }
.negatif { color: var(--danger); font-weight: 600; }
.positif { color: var(--succes); font-weight: 600; }

.entete-groupe { align-items: center; }
.titre-groupe { flex: 1; min-width: 0; }
.titre-groupe[data-plier], .resume-groupe { cursor: pointer; }
.fleche-groupe { flex: none; width: 36px; height: 36px; border: 1px solid var(--bordure); border-radius: 50%; background: var(--carte);
  display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--texte); padding: 0; }
.fleche-groupe svg { transition: transform .15s; transform: rotate(90deg); }
.groupe-inv.plie .fleche-groupe svg { transform: rotate(0deg); }
.groupe-inv.plie .lignes-inv, .groupe-inv.plie .ajouter { display: none; }
.resume-groupe { margin-top: 8px; font-size: .88rem; color: var(--texte-doux); }

/* ---------- Tableau de bord ---------- */
.grille-dash { display: grid; gap: 12px; }
@media (min-width: 760px) { .grille-dash { grid-template-columns: 1fr 1fr; align-items: start; } .dash-actions { grid-column: 1 / -1; } }
.carte-dash { margin: 0; display: block; }
a.lien-carte { text-decoration: none; color: var(--texte); }
a.lien-carte:hover { border-color: #c5cbd3; }
.titre-dash { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.titre-dash h3 { margin: 0; flex: 1; }
.icone { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icone.petite { width: 18px; height: 18px; color: var(--texte-doux); }
.icone.orange { color: #c27a00; }
.icone.vert { color: var(--succes); }
.liste-actions { list-style: none; margin: 0; padding: 0; }
.liste-actions li + li { border-top: 1px solid var(--bordure); }
.liste-actions a { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 2px; color: var(--texte); text-decoration: none; }
.liste-actions a > span { display: flex; flex-direction: column; gap: 2px; }
.liste-actions strong { font-weight: 600; font-size: .95rem; }
.liste-actions .details { font-size: .83rem; }
.rien { color: var(--succes); padding: 6px 0; }
.tableau-dash { width: 100%; border-collapse: collapse; font-size: .92rem; margin-top: 6px; }
.tableau-dash th { font-size: .78rem; color: var(--texte-doux); font-weight: 600; text-align: right; padding: 4px 6px; }
.tableau-dash td { padding: 7px 6px; border-top: 1px solid var(--bordure); }
.tableau-dash td:not(:first-child) { text-align: right; white-space: nowrap; }
.tableau-dash td:first-child { padding-left: 0; }
.tableau-dash tr.fort td, .tableau-dash tfoot td { font-weight: 700; }
.tableau-dash tfoot td { border-top: 2px solid var(--texte); }
.tableau-dash .details { font-size: .78rem; }
.pied-dash { margin-top: 10px; font-size: .88rem; color: var(--texte-doux); }
.pied-dash strong { color: var(--texte); }
.liste-inv-dash { list-style: none; margin: 6px 0 0; padding: 0; }
.liste-inv-dash li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 0; border-top: 1px solid var(--bordure); font-size: .92rem; }
.pastille { display: inline-block; font-size: .75rem; font-weight: 600; padding: 3px 9px; border-radius: 99px; white-space: nowrap; }
.pastille.verte { background: #e3f3e9; color: var(--succes); }
.pastille.rouge { background: #fbe7e5; color: var(--danger); }
.pastille.grise { background: var(--fond); color: var(--texte-doux); }

/* ---------- Pas de zoom ---------- */
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* iPhone zoome sur un champ dont le texte est plus petit que 16 px : on garde 16 px partout */
input, select, textarea { font-size: 16px !important; }

.carte-vendeur { border-left: 4px solid var(--accent); }
.carte-employe .titre-section .nom { font-weight: 700; font-size: 1.05rem; }
[data-groupe="periode-h"] { margin-bottom: 12px; }

/* ---------- Clients ---------- */
.champ-client { position: relative; }
.champ-client label .pastille { margin-left: 6px; vertical-align: middle; }
.suggestions { position: absolute; left: 0; right: 0; top: 100%; z-index: 12; margin-top: 4px; background: var(--carte);
  border: 1px solid var(--bordure); border-radius: var(--rayon); box-shadow: 0 8px 24px rgba(0,0,0,.12); max-height: 340px; overflow-y: auto; }
.suggestions button { display: block; width: 100%; text-align: left; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--bordure);
  background: var(--carte); cursor: pointer; font: inherit; color: var(--texte); }
.suggestions button:hover, .suggestions button:focus { background: var(--fond); }
.suggestions strong { display: block; font-weight: 600; }
.suggestions .details { font-size: .82rem; }
.nouveau-client { padding: 8px 12px; font-size: .8rem; }
@media (min-width: 521px) { .champ-client { grid-column: 1 / -1; } }
.compte-clients { margin: -4px 0 10px; font-size: .85rem; }
.ligne-client .tel { font-size: .9rem; white-space: nowrap; }
.ligne-histo { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--bordure); color: var(--texte); text-decoration: none; }
.ligne-histo > span:first-child { display: flex; flex-direction: column; }
.ligne-histo .droite { text-align: right; display: flex; flex-direction: column; align-items: flex-end; font-weight: 600; }
.formulaire textarea { font: inherit; }

/* ---------- Notifications ---------- */
.cloche { position: relative; background: none; border: 0; color: var(--barre-texte); padding: 6px; cursor: pointer; display: flex; }
.cloche svg { width: 24px; height: 24px; fill: currentColor; }
.badge-cloche { position: absolute; top: 0; right: 0; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 99px; background: var(--accent); color: var(--accent-texte); font-size: .7rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.badge-cloche[hidden] { display: none; }
@keyframes tourner { to { transform: rotate(360deg); } }
#actualiser.tourne svg { animation: tourner .8s linear infinite; }
a.carte.notif { display: block; color: inherit; text-decoration: none; }
.notif.non-lue { border-left: 4px solid var(--accent); }
.date-notif { margin-top: 4px; font-size: .8rem; }

/* ---------- Suivi client ---------- */
.statut-envoyee { background: #fff4e0; border-color: #f2d29a; color: #8a5a00; margin-left: 4px; }
.statut-fac-brouillon { background: var(--fond); }
.statut-fac-a_approuver { background: #fff4e0; border-color: #f2d29a; color: #8a5a00; }
.statut-fac-envoyee { background: #e3f3e9; border-color: #b9dfc7; color: var(--succes); }
.ligne-suivi { margin: 4px 0; }
.ligne-suivi a { color: var(--barre); font-weight: 600; }
.boutons-envoi, .actions-facture, .actions-bon { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 6px; }
.actions-facture a.bouton { text-decoration: none; display: inline-flex; align-items: center; }

/* ---------- Agenda ---------- */
.a-planifier { border-left: 4px solid var(--accent); }
.ligne-planif { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--bordure); }
.ligne-planif:first-of-type { border-top: 0; }
.jour-agenda { margin: 18px 0 6px; }
.titre-jour { font-size: 1rem; margin: 0 0 8px; text-transform: capitalize; }
.jour-agenda.aujourdhui .titre-jour { color: var(--barre); }
.vide-jour { padding: 4px 2px 8px; }
/* Couleurs de l'agenda : jaune = jobs et tâches, vert = rendez-vous (Google Agenda) */
:root { --ag-jaune: #f2b705; --ag-jaune-fond: #fff8dc; --ag-vert: #2e9e5b; --ag-vert-fond: #e6f6ec; }
.bon { border-left: 5px solid var(--c, var(--ag-jaune)); background: var(--cf, var(--ag-jaune-fond)); }
.bon-termine { opacity: .72; }
.legende-agenda { display: flex; gap: 16px; flex-wrap: wrap; font-size: .82rem; color: var(--texte-doux); margin: 4px 2px 10px; }
.legende-agenda span { display: inline-flex; align-items: center; gap: 6px; }
.legende-agenda i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.legende-agenda .l-jaune { background: var(--ag-jaune); }
.legende-agenda .l-vert { background: var(--ag-vert); }
.tete-bon { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.heure-bon { font-size: .85rem; color: var(--texte-doux); font-weight: 600; }
.pastille-statut { font-size: .75rem; font-weight: 600; padding: 3px 9px; border-radius: 99px; white-space: nowrap; background: var(--fond); color: var(--texte-doux); }
.pastille-statut.st-en_cours { background: #fff4e0; color: #8a5a00; }
.pastille-statut.st-termine { background: #e3f3e9; color: var(--succes); }
.lien-adresse, .lien-tel { display: block; width: fit-content; max-width: 100%; margin-top: 6px; color: var(--barre); font-weight: 600; }
.notes-bon { margin-top: 8px; padding: 8px 10px; background: var(--fond); border-radius: 8px; white-space: pre-wrap; font-size: .9rem; }
.statut-bon { margin-top: 12px; }
.statut-bon button.actif.st-en_cours { background: var(--accent); color: var(--accent-texte); border-color: var(--accent); }
.statut-bon button.actif.st-termine { background: var(--succes); border-color: var(--succes); }
.liste-cases { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 4px 0 10px; }
.case { display: flex; align-items: center; gap: 6px; font-weight: normal; }
.fenetre textarea { width: 100%; }

/* ---------- Facturation ---------- */
.titre-groupe-fac { margin: 22px 0 4px; font-size: 1.05rem; }
.ligne-depot { margin-top: 10px; font-size: .92rem; }

/* ---------- Connexions ---------- */
.etapes { padding-left: 20px; margin: 8px 0; line-height: 1.5; }
.etapes li { margin-bottom: 8px; }
code.commande { display: inline-block; background: var(--barre); color: #fff; padding: 3px 8px; border-radius: 6px; font-size: .85rem; margin: 3px 0; word-break: break-all; user-select: all; }
.label-simple { display: block; font-weight: 600; font-size: .9rem; margin: 12px 0 4px; }
.boutons-ligne { margin-top: 12px; display: flex; gap: 10px; flex-wrap: wrap; }
.ligne-min { display: flex; gap: 8px; flex-wrap: wrap; }
.ligne-min input { flex: 1; min-width: 180px; }
.banniere.neutre { background: #fff4e0; border: 1px solid #f2d29a; color: #6b4700; padding: 10px 14px; border-radius: var(--rayon); margin-bottom: 12px; }
.titre-jour { text-transform: none; }
.formulaire .liste-cases label.case { display: flex; flex-direction: row; align-items: center; gap: 8px; margin: 0; font-weight: 500; }
.formulaire .liste-cases input[type=checkbox] { width: 20px; height: 20px; margin: 0; }
.bon .nom { font-weight: 700; }
.actions-ligne { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.details-resend { margin-top: 12px; }
.details-resend summary { cursor: pointer; color: var(--texte-doux); font-size: .9rem; }
.evenement-google { border-left: 5px solid var(--c, var(--ag-jaune)); background: var(--cf, var(--ag-jaune-fond)); }
.pastille-google { font-size: .72rem; font-weight: 600; padding: 3px 8px; border-radius: 99px; white-space: nowrap; background: var(--cp, #fdeeb0); color: var(--ct, #7a5a00); }
.liste-cases.colonne { flex-direction: column; gap: 8px; }
.liste-cases.colonne .case { font-weight: 500; }
.pastille-google { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Agenda : jour, semaine, mois ---------- */
.barre-agenda .choix-periode { margin-bottom: 12px; }
.grille-mois { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--bordure); border: 1px solid var(--bordure); border-radius: var(--rayon); overflow: hidden; margin: 12px 0; }
.entete-mois { background: var(--carte); text-align: center; font-size: .72rem; font-weight: 700; color: var(--texte-doux); padding: 6px 0; text-transform: uppercase; }
.case-mois { background: var(--carte); border: 0; min-height: 92px; padding: 4px 3px; text-align: left; display: flex; flex-direction: column; gap: 2px; cursor: pointer; font: inherit; color: inherit; min-width: 0; }
.case-mois:hover { background: #f7f8fa; }
.case-mois.hors-mois { background: #fafbfc; }
.case-mois.hors-mois .num-jour { color: #b0b8c1; }
.num-jour { font-size: .78rem; font-weight: 600; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; margin-bottom: 2px; }
.case-mois.aujourdhui .num-jour { background: var(--barre); color: #fff; }
.mini-job { display: block; font-size: .66rem; line-height: 1.25; padding: 2px 4px; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--cf, var(--ag-jaune-fond)); color: var(--texte); border-left: 3px solid var(--c, var(--ag-jaune)); }
.mini-job.st-termine { opacity: .6; }
.mini-plus { font-size: .64rem; color: var(--texte-doux); padding-left: 3px; }
@media (min-width: 700px) {
  .case-mois { min-height: 112px; padding: 6px; }
  .mini-job { font-size: .74rem; }
}
@media (max-width: 520px) { .h-mini { display: none; } .mini-job { padding: 2px 3px; } }

/* ---------- Facturation : à recevoir, paiements ---------- */
.resume-recevoir { margin-bottom: 14px; }
.resume-recevoir .titre-section { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.resume-recevoir .montant { font-size: 1.5rem; font-weight: 800; }
.tranches { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
.tranches > div { background: var(--fond); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.tranches span { font-size: .74rem; color: var(--texte-doux); }
.tranches strong { font-size: .95rem; }
.tranches .retard { background: #fdecec; }
.tranches .retard strong { color: var(--danger, #b3261e); }
details.payees { margin-top: 16px; }
details.payees summary { cursor: pointer; font-weight: 700; padding: 8px 0; color: var(--texte-doux); }
.statut-fac-payee { background: #e3f3e9; border-color: #b9dfc7; color: var(--succes); }
.statut-fac-partielle { background: #fff4e0; border-color: #f2d29a; color: #8a5a00; }
.gros-montant { font-size: 1.9rem; font-weight: 800; margin: 6px 0; }
@media (max-width: 420px) { .tranches { grid-template-columns: 1fr; } }
.bouton.danger-discret { background: var(--carte); color: var(--danger); border-color: #e7c4c1; }

/* ---------- Tableau de bord : agenda ---------- */
.agenda-dash-jour { margin-top: 10px; }
.agenda-dash-ligne { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--bordure); }
.agenda-dash-ligne { border-left: 4px solid var(--c, var(--ag-jaune)); padding-left: 8px; }
.agenda-dash-ligne.st-termine { opacity: .65; }
.agenda-dash-ligne .h {font-weight: 700; font-size: .85rem; min-width: 42px; color: var(--texte-doux); }
.agenda-dash-ligne .t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.carte-dash.pleine-largeur { grid-column: 1 / -1; }

/* ---------- Agenda : bouton + en haut ---------- */
.barre-plus { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.barre-plus h2 { margin: 0; }
.bouton-plus { width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--accent); color: #1b1b1b; font-size: 1.9rem; line-height: 1; font-weight: 600; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.menu-ajout { display: flex; flex-direction: column; gap: 10px; }
.menu-ajout .bouton { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 14px 16px; }
.menu-ajout .bouton .details { font-weight: 400; opacity: .85; }

.ligne-cal { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.select-cal-couleur { width: auto; padding: 4px 8px; }
.cal-adresse { display: block; font-size: .75rem; word-break: break-all; }

/* Couleurs choisies */
.coul-jaune { --c: #f2b705; --cf: #fff8dc; --cp: #fdeeb0; --ct: #7a5a00; }
.coul-vert { --c: #2e9e5b; --cf: #e6f6ec; --cp: #cfeedb; --ct: #1b6b3c; }
.coul-bleu { --c: #2f6fdd; --cf: #e8f0fe; --cp: #cfe0fb; --ct: #1a4aa0; }
.coul-rose { --c: #e0589a; --cf: #fdebf4; --cp: #f8cfe3; --ct: #9c2a62; }
.coul-rouge { --c: #d6382f; --cf: #fdeceb; --cp: #f8cdca; --ct: #8f1f19; }
.tete-droite { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.pt-coul { width: 26px; height: 26px; min-width: 26px; padding: 0; border-radius: 50%; border: 3px solid #fff; background: var(--c); box-shadow: 0 0 0 1px var(--bordure); cursor: pointer; }
.palette-coul { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin: 8px 0 12px; }
.rond-coul { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 56px; padding: 8px 0; border-radius: 12px; border: 2px solid transparent; background: var(--cf); cursor: pointer; font: inherit; color: var(--texte); }
.rond-coul::before { content: ''; width: 28px; height: 28px; border-radius: 50%; background: var(--c); }
.rond-coul span { font-size: .72rem; }
.rond-coul.choisi { border-color: var(--c); }

.coul-ciel { --c: #6cb4ee; --cf: #eaf6fe; --cp: #d3eafb; --ct: #1d5f93; }
.menu-ajout .choix-ajout { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; width: 100%; margin-bottom: 8px; background: var(--cf); color: var(--texte); border: 0; border-left: 6px solid var(--c); }
.menu-ajout .choix-ajout .details { font-weight: 400; }
.pastille[hidden] { display: none; }
.titre-section.sous { margin-top: 14px; } .titre-section.sous h4 { margin: 0; font-size: 1rem; }

/* ---------- Notes ---------- */
.note-confidentielle { margin: -4px 0 14px; }
.titre-notes { margin: 18px 0 8px; font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; }
.grille-notes { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.note-carte {
  display: flex; flex-direction: column; gap: 6px; min-height: 130px; padding: 14px; text-decoration: none; color: var(--texte);
  background: var(--carte); border: 1px solid var(--bordure); border-radius: var(--rayon); transition: border-color .15s, box-shadow .15s;
}
.note-carte:hover, .note-carte:focus-visible { border-color: var(--accent); box-shadow: 0 2px 8px rgba(13, 2, 62, .08); outline: none; }
.note-carte-titre { font-weight: 600; display: flex; align-items: center; gap: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-carte-texte {
  flex: 1; color: var(--texte-doux); font-size: .92rem; line-height: 1.4; white-space: pre-line; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 4; line-clamp: 4; -webkit-box-orient: vertical;
}
.note-carte-date { font-size: .78rem; color: var(--texte-doux); }
.note-epingle svg, .bouton-epingle svg { width: 14px; height: 14px; fill: currentColor; flex: none; }
.note-epingle { color: var(--accent); display: inline-flex; }
.actions-note { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.actions-note [hidden] { display: none; }
.bouton-epingle { display: inline-flex; align-items: center; gap: 6px; }
.bouton-epingle.actif { border-color: var(--accent); background: #fdf3df; }
.note-editeur { padding: 18px; }
.note-titre {
  width: 100%; border: 0; border-bottom: 1px solid var(--bordure); padding: 6px 0 12px; margin-bottom: 12px; background: transparent;
  font-size: 1.3rem; font-weight: 600; color: var(--texte); border-radius: 0;
}
.note-titre:focus, .note-texte:focus { outline: none; }
.note-titre:focus { border-bottom-color: var(--accent); }
.note-texte {
  width: 100%; min-height: 50vh; border: 0; padding: 0; background: transparent; resize: none; overflow: hidden;
  font: inherit; line-height: 1.55; color: var(--texte);
}
.note-pied { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--bordure); }
.note-pied.a-enregistrer { color: var(--danger); }

/* Photos de job (internes) */
.note-interne { font-size: .85rem; color: #8a5a00; background: #fff6e0; border: 1px solid #f0d9a0; border-radius: 8px; padding: 6px 10px; margin: 6px 0 10px; }
.grille-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; margin: 8px 0; }
.photo-vignette { position: relative; padding: 0; border: 1px solid #d8d8d8; border-radius: 10px; overflow: hidden; background: #f2f2f2; aspect-ratio: 1; cursor: pointer; }
.photo-vignette img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-vignette span { position: absolute; left: 0; right: 0; bottom: 0; font-size: .72rem; line-height: 1.2; color: #fff; background: rgba(0,0,0,.6); padding: 3px 5px; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo-vignette.en-attente { border-style: dashed; border-color: #c78a00; }
.boutons-photo { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.boutons-photo .bouton { display: inline-flex; align-items: center; gap: 6px; }
.visionneuse { position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,.82); display: flex; align-items: center; justify-content: center; padding: 12px; }
.visionneuse-boite { background: #fff; border-radius: 12px; max-width: 760px; width: 100%; max-height: 100%; overflow: auto; display: flex; flex-direction: column; }
.visionneuse-boite img { width: 100%; max-height: 62vh; object-fit: contain; background: #111; display: block; }
.visionneuse-bas { padding: 10px 14px 14px; }
.visionneuse-bas .vis-legende { width: 100%; box-sizing: border-box; margin: 4px 0 10px; }
.visionneuse-bas .vis-texte { margin: 4px 0 10px; }
.visionneuse-bas .boutons { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }

.photos-bon-zone { margin: 8px 0 2px; }
.photos-bon-zone .lien { display: inline-flex; align-items: center; gap: 6px; }
.photos-bon-zone .grille-photos { margin-top: 6px; }

/* Popup détails de la job */
.carte.bon[data-bon] { cursor: pointer; }
.fenetre .detail-job { max-width: 520px; max-height: 92vh; }
.detail-job h3 { margin: 0; }
.detail-job .tete-bon { margin-bottom: 8px; }
.detail-ligne { padding: 6px 0; border-top: 1px solid #eee; }
.detail-ligne .details { display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; margin-bottom: 2px; }
.titre-photos-job { margin: 14px 0 6px; font-size: 1rem; }

/* Confirmation au client */
.confirm-resume { background: #f4f5f7; border-radius: 10px; padding: 10px 12px; margin: 8px 0; line-height: 1.5; }

/* Mes alertes */
.liste-alertes { display: flex; flex-direction: column; margin-top: 8px; }
.ligne-alerte { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid #eee; font-size: 1rem; }
.ligne-alerte input { width: 22px; height: 22px; flex: none; }

/* Soumission personnalisée */
.boutons-titre { display: flex; gap: 8px; flex-wrap: wrap; }
.ligne-perso { border: 1px solid var(--bordure); border-radius: var(--rayon); padding: 10px; margin-bottom: 10px; }
.ligne-perso > input { width: 100%; box-sizing: border-box; padding: 11px 12px; border: 1px solid var(--bordure); border-radius: var(--rayon); background: var(--carte); font-size: 16px; margin-bottom: 8px; }
.ligne-perso-nombres { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ligne-perso-nombres input.num { width: 92px; }
.ligne-perso-nombres select { padding: 11px 8px; border: 1px solid var(--bordure); border-radius: var(--rayon); background: var(--carte); font-size: 16px; }
.ligne-perso-nombres .surf { flex: 1; text-align: right; min-width: 70px; }
