:root {
  --fond: #f5f7fa;
  --blanc: #fff;
  --surface2: #f0f3f8;
  --bord: #e2e8f0;
  --bord2: #cbd5e1;
  --texte: #1e293b;
  --discret: #64748b;
  --clair: #94a3b8;
  --bleu: #1a56db;
  --bleu-survol: #1648c4;
  --bleu-clair: #e8f0fe;
  --vert: #16a34a; --vert-fond: #dcfce7;
  --orange: #ea580c; --orange-fond: #ffedd5;
  --rouge: #dc2626; --rouge-fond: #fee2e2;
  --jaune: #d97706; --jaune-fond: #fef3c7;
  --violet: #6d28d9; --violet-fond: #ede9fe;
  --gris-fond: #f1f5f9;
  --rayon: 10px;
  --ombre: 0 1px 4px rgba(0,0,0,.08);
  --ombre-forte: 0 4px 16px rgba(0,0,0,.1);
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  font-size: 13.5px;
  color: var(--texte);
  background: var(--fond);
}
body.modale-ouverte { overflow: hidden; }
a { color: var(--bleu); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2 { margin: 0; }
small { color: var(--discret); }
.mono { font-family: var(--mono); font-size: 12.5px; }
.centre { text-align: center; }
.droite { text-align: right; }

/* --- Structure : menu à gauche + contenu --- */
.app { display: flex; min-height: 100vh; }
.menu {
  width: 230px; flex-shrink: 0; background: var(--blanc); border-right: 1px solid var(--bord);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.marque { display: flex; gap: 10px; align-items: center; padding: 18px 16px; border-bottom: 1px solid var(--bord); }
.marque .logo { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 9px; background: var(--bleu); font-size: 17px; }
.marque strong, .marque small { display: block; }
.marque small { font-size: 11px; }
.menu nav { padding: 10px; flex: 1; overflow-y: auto; }
.menu nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px;
  color: var(--discret); font-weight: 500;
}
.menu nav a:hover { background: var(--surface2); color: var(--texte); text-decoration: none; }
.menu nav a.actif { background: var(--bleu-clair); color: var(--bleu); font-weight: 600; }
.pastille { margin-left: auto; min-width: 20px; padding: 1px 6px; border-radius: 999px; background: var(--orange); color: #fff; font-size: 11px; font-weight: 700; text-align: center; }
.menu .pied { padding: 12px 16px; border-top: 1px solid var(--bord); }
.menu .pied small { display: block; overflow: hidden; text-overflow: ellipsis; margin-bottom: 8px; }
main { flex: 1; min-width: 0; }
.barre {
  display: flex; align-items: center; gap: 12px; padding: 12px 24px; background: rgba(255,255,255,.95);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--bord); position: sticky; top: 0; z-index: 5; min-height: 57px;
}
.barre h1 { font-size: 18px; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
#bascule-menu { display: none; font-size: 18px; }
.contenu { padding: 24px; max-width: 1500px; }
.voile { display: none; }

/* --- Boutons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 13px;
  border: 1px solid var(--bord); border-radius: 8px; background: var(--blanc); color: var(--texte);
  font: inherit; font-weight: 600; font-size: 12.5px; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--surface2); text-decoration: none; }
.btn.principal { background: var(--bleu); border-color: var(--bleu); color: #fff; }
.btn.principal:hover { background: var(--bleu-survol); }
.btn.discret { border-color: transparent; background: transparent; color: var(--bleu); padding: 5px 8px; }
.btn.discret:hover { background: var(--bleu-clair); }
.btn.icone { padding: 5px 8px; font-size: 13px; }
.btn.large { width: 100%; padding: 9px; }
.btn:disabled { cursor: default; opacity: .7; }

/* --- Cartes et tableaux --- */
.carte-bloc { background: var(--blanc); border: 1px solid var(--bord); border-radius: var(--rayon); box-shadow: var(--ombre); margin-bottom: 20px; padding: 16px 20px; }
.carte-bloc.sans-marge { padding: 0; overflow-x: auto; }
.carte-bloc > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: -16px -20px 14px; padding: 14px 20px; border-bottom: 1px solid var(--bord); }
.carte-bloc.sans-marge > header { margin: 0; }
.carte-bloc > header h2 { font-size: 14px; font-weight: 600; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; color: var(--discret); padding: 10px 12px; background: var(--surface2); border-bottom: 1px solid var(--bord); white-space: nowrap; }
.table th.droite { text-align: right; }
.table th.centre { text-align: center; }
.table th a.tri { color: inherit; }
.table th a.tri.actif { color: var(--bleu); }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--bord); vertical-align: middle; }
.table th:first-child, .table td:first-child { padding-left: 20px; }
.table th:last-child, .table td:last-child { padding-right: 20px; }
.table tr:last-child td { border-bottom: 0; }
.table tr[data-href] { cursor: pointer; }
.table tr[data-href]:hover td { background: #fafbfd; }
.table form { margin: 0; }
.table td small { font-family: var(--mono); font-size: 11.5px; }
.table td .mono, .table td.droite, .sans-coupure { white-space: nowrap; }
.tronque { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.actions-ligne { white-space: nowrap; text-align: right; }
.vide { text-align: center; padding: 36px 10px; color: var(--discret); }
.vide .grand { font-size: 38px; }
.discret-texte, .aide { color: var(--discret); margin: 0 0 12px; }
.code-masque { font-family: var(--mono); cursor: help; color: var(--clair); }
.code-masque:hover, .code-masque:focus { color: var(--texte); font-size: 0; outline: none; }
.code-masque:hover::after, .code-masque:focus::after { content: attr(data-code); font-size: 12.5px; font-weight: 600; }

/* --- Statuts --- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; background: var(--gris-fond); color: var(--discret); white-space: nowrap; }
.s-recu, .c-a_commander { background: var(--jaune-fond); color: var(--jaune); }
.s-diagnostic, .c-commandee { background: var(--bleu-clair); color: var(--bleu); }
.s-attente_accord { background: var(--orange-fond); color: var(--orange); }
.s-attente_piece, .c-expediee { background: #fce7f3; color: #be185d; }
.s-en_cours { background: var(--violet-fond); color: var(--violet); }
.s-termine, .c-recue { background: var(--vert-fond); color: var(--vert); }
.s-remis, .c-terminee { background: var(--gris-fond); color: var(--discret); }
.s-annule, .c-annulee { background: var(--rouge-fond); color: var(--rouge); }
.badge.rouge { background: var(--rouge-fond); color: var(--rouge); }
/* Statut modifiable : un bouton-pastille qui ouvre un petit menu. */
/* Largeur fixe (celle du libellé le plus long) : la colonne ne bouge pas quand le statut change. */
.statut-bouton { display: flex; width: 172px; justify-content: space-between; border: 0; border-radius: 6px; font: inherit; font-size: 11px; font-weight: 600; gap: 6px; padding: 4px 10px 4px 9px; cursor: pointer; }
.statut-bouton .libelle { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; }
.statut-bouton + .badge.retard { display: inline-block; margin-top: 4px; }
/* Tableau de bord : réparations et commandes l'un sous l'autre, mêmes colonnes aux mêmes largeurs. */
/* Sur téléphone : le bouton de statut prend la largeur de son texte, et un long nom de client passe à la ligne
   au lieu de pousser le statut hors de l'écran. */
@media (max-width: 900px) {
  .statut-bouton { width: auto; max-width: 100%; }
  .table-jumelle th, .table-jumelle td { padding-left: 8px; padding-right: 8px; }
  .table-jumelle td:nth-child(2) .sans-coupure, .table-jumelle td:nth-child(3).sans-coupure { white-space: normal; }
  .table-jumelle td.actions-ligne .btn.icone { padding-left: 6px; padding-right: 6px; }
}
/* Largeurs fixes pour les colonnes courtes ; les autres se partagent le reste à parts égales.
   Entre 901 et 1199 px de large, la panne (ou la réparation) et le code (ou le fournisseur) sont masqués :
   ils se lisent en ouvrant la ligne. */
@media (min-width: 901px) {
  .table-jumelle { table-layout: fixed; }
  .table-jumelle th:nth-child(1) { width: 118px; }
  .table-jumelle th:nth-child(6) { width: 166px; }
  .table-jumelle th:nth-child(7) { width: 92px; }
  .table-jumelle th:nth-child(8) { width: 84px; }
  .table-jumelle th:nth-child(9) { width: 112px; }
  .table-jumelle th, .table-jumelle td { padding-left: 8px; padding-right: 8px; }
  .table-jumelle th:nth-child(4), .table-jumelle td:nth-child(4), .table-jumelle th:nth-child(5), .table-jumelle td:nth-child(5) { display: none; }
  .table-jumelle td { overflow: hidden; text-overflow: ellipsis; }
  .table-jumelle td:nth-child(2) .sans-coupure, .table-jumelle td:nth-child(3).sans-coupure { white-space: normal; }
  .table-jumelle td.tronque { max-width: none; }
  .table-jumelle .statut-bouton { width: 100%; max-width: 172px; }
}
@media (min-width: 1200px) {
  .table-jumelle th:nth-child(4), .table-jumelle td:nth-child(4), .table-jumelle th:nth-child(5), .table-jumelle td:nth-child(5) { display: table-cell; }
  .table-jumelle th:nth-child(1) { width: 124px; }
  .table-jumelle th:nth-child(5) { width: 104px; }
  .table-jumelle th:nth-child(6) { width: 200px; }
  .table-jumelle th:nth-child(7) { width: 104px; }
  .table-jumelle th:nth-child(8) { width: 96px; }
  .table-jumelle th:nth-child(9) { width: 116px; }
  .table-jumelle th, .table-jumelle td { padding-left: 12px; padding-right: 12px; }
}
.statut-bouton:hover { filter: brightness(.96); }
.statut-bouton .pt { width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.statut-bouton .chevron { font-size: 7px; opacity: .6; margin-left: 1px; }
.statut-menu { position: fixed; z-index: 90; background: var(--blanc); border: 1px solid var(--bord2); border-radius: 10px; box-shadow: var(--ombre-forte); min-width: 190px; overflow: hidden; padding: 4px 0; }
.statut-option { display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 14px; border: 0; background: none; font: inherit; font-size: 12.5px; font-weight: 500; color: var(--texte); cursor: pointer; white-space: nowrap; text-align: left; }
.statut-option .point { width: 7px; height: 7px; margin-right: 0; }
.statut-option:hover, .statut-option:focus { background: var(--surface2); outline: none; }
.statut-option.actif { background: var(--bleu-clair); color: var(--bleu); font-weight: 600; }
.point { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; background: var(--jaune); }
.point.s-diagnostic { background: var(--bleu); }
.point.s-attente_accord { background: var(--orange); }
.point.s-attente_piece { background: #db2777; }
.point.s-en_cours { background: var(--violet); }
.point.s-termine { background: var(--vert); }
.point.s-recu { background: var(--jaune); }
.point.s-remis { background: var(--clair); }
.point.s-annule { background: var(--rouge); }

/* --- Barre de filtres : recherche, pastilles de statut, choix d'affichage --- */
.filtres { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.recherche { position: relative; }
.recherche .loupe { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: 12px; opacity: .6; }
.recherche input[type=search] { width: 240px; padding-left: 30px; }
.filtres > input[type=search] { max-width: 360px; }
.filtres > select { width: auto; }
.pastilles { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.pastilles a, .pastilles span.actif { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; color: var(--discret); background: var(--blanc); border: 1px solid var(--bord); }
.pastilles a:hover { text-decoration: none; border-color: var(--bord2); }
.pastilles .actif { background: var(--bleu-clair); color: var(--bleu); border-color: var(--bleu); }
.compte { background: var(--surface2); border-radius: 999px; padding: 1px 7px; font-size: 11px; color: var(--discret); font-weight: 700; }
.pastilles .actif .compte { background: var(--bleu); color: #fff; }
.choix-vue { display: flex; border: 1px solid var(--bord); border-radius: 8px; overflow: hidden; margin-left: auto; }
.choix-vue a { display: flex; align-items: center; justify-content: center; padding: 6px 11px; font-size: 14px; line-height: 1; color: var(--discret); background: var(--blanc); }
.choix-vue a:hover { text-decoration: none; background: var(--surface2); }
.choix-vue a.actif { background: var(--bleu); color: #fff; }
.proposition { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; margin-bottom: 16px; background: var(--bleu-clair); border: 1px dashed var(--bleu); border-radius: var(--rayon); }
.onglets { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 14px; }
.onglets a { display: flex; gap: 6px; padding: 7px 12px; border-radius: 8px; color: var(--discret); font-weight: 600; }
.onglets a:hover { background: var(--blanc); text-decoration: none; }
.onglets a.actif { background: var(--blanc); color: var(--bleu); border: 1px solid var(--bord); }
.onglets-fiche { display: flex; flex-wrap: wrap; border-bottom: 2px solid var(--bord); margin-bottom: 16px; }
.onglets-fiche a { display: flex; gap: 6px; align-items: center; padding: 10px 16px; font-size: 13px; font-weight: 600; color: var(--discret); border-bottom: 3px solid transparent; margin-bottom: -2px; }
.onglets-fiche a:hover { text-decoration: none; color: var(--texte); }
.onglets-fiche a.actif { color: var(--bleu); border-bottom-color: var(--bleu); }
.pagination { display: flex; gap: 12px; align-items: center; justify-content: center; margin-bottom: 20px; }

/* --- Réparations en colonnes --- */
.tableau { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(175px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.colonne { background: var(--surface2); border-radius: var(--rayon); padding: 10px; min-height: 200px; border: 2px solid transparent; }
.colonne.cible { border-color: var(--bleu); background: var(--bleu-clair); }
.colonne h2 { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; display: flex; align-items: center; margin-bottom: 10px; }
.colonne h2 .compte { margin-left: auto; background: var(--blanc); }
.cartes { display: flex; flex-direction: column; gap: 8px; min-height: 60px; }
.carte { display: block; background: var(--blanc); border: 1px solid var(--bord); border-radius: 8px; padding: 10px; color: var(--texte); cursor: grab; box-shadow: var(--ombre); }
.carte:hover { text-decoration: none; border-color: var(--bleu); }
.carte.glisse { opacity: .4; }
.carte-haut { display: flex; justify-content: space-between; align-items: center; }
.carte-haut small { font-size: 10.5px; }
.carte-appareil { font-weight: 600; margin-top: 4px; }
.carte-client { color: var(--bleu); font-size: 12.5px; margin-top: 2px; }
.carte-probleme { color: var(--discret); font-size: 12.5px; margin-top: 3px; }
.age { font-size: 11px; color: var(--discret); font-weight: 700; }
.age.orange { color: var(--orange); }
.age.rouge { color: var(--rouge); }

/* --- Clients en grille --- */
.grille-cartes { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-bottom: 20px; }
.carte-client-grille { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; background: var(--blanc); border: 1px solid var(--bord); border-radius: var(--rayon); box-shadow: var(--ombre); color: var(--texte); }
.carte-client-grille:hover { text-decoration: none; border-color: var(--bleu); }
.carte-client-grille strong { font-size: 14px; }
.carte-client-grille span { color: var(--discret); font-size: 12.5px; }
.carte-client-grille small { margin-top: 6px; }

/* --- Champs de formulaire --- */
.formulaire { max-width: 980px; }
.grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0 14px; }
.rangee { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.rangee.trois { grid-template-columns: 1fr 1fr 1fr; }
.champ { margin-bottom: 14px; position: relative; min-width: 0; }
.champ label { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .3px; color: var(--discret); margin-bottom: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.champ label .precision { font-weight: 400; text-transform: none; letter-spacing: 0; }
.requis { color: var(--rouge); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search],
input[type=date], input[type=url], select, textarea {
  width: 100%; padding: 8px 11px; border: 1px solid var(--bord2); border-radius: 8px; font: inherit; background: var(--blanc); color: var(--texte);
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid #bfdbfe; border-color: var(--bleu); }
input.mono { font-family: var(--mono); }
input.choisi { background: var(--bleu-clair); border-color: var(--bleu); font-weight: 600; }
.champ.en-erreur input, .champ.en-erreur select, .champ.en-erreur textarea { border-color: var(--rouge); }
.msg-erreur { display: block; color: var(--rouge); margin-top: 3px; }
.boutons { display: flex; gap: 8px; margin-bottom: 30px; }
.message { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; background: var(--vert-fond); color: #166534; border: 1px solid #bbf7d0; }
.message.error { background: var(--rouge-fond); color: #991b1b; border-color: #fecaca; }

/* --- Suggestions sous un champ --- */
.ac { position: relative; flex: 1; min-width: 0; }
.ac input.avec-vider { padding-right: 30px; }
.ac-vider { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--discret); font-size: 17px; line-height: 1; cursor: pointer; }
.ac-vider:hover { background: var(--surface2); color: var(--texte); }
/* La croix se cache quand le champ est vide (il montre alors son texte d'exemple). */
.ac input:placeholder-shown + .ac-vider { display: none; }
.ac-liste { position: absolute; top: 100%; left: 0; right: 0; margin-top: 4px; background: var(--blanc); border: 1px solid var(--bord); border-radius: 8px; box-shadow: var(--ombre-forte); z-index: 20; max-height: 230px; overflow-y: auto; }
.ac-option { padding: 8px 12px; cursor: pointer; border-bottom: 1px solid var(--gris-fond); }
.ac-option:last-child { border-bottom: 0; }
.ac-option:hover, .ac-option.actif { background: var(--bleu-clair); }
.ac-option small { margin-left: 8px; }
.ac-option.ac-action { color: var(--bleu); font-weight: 600; }
.rangee-client { display: flex; gap: 6px; }
.puces { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.puce { padding: 4px 10px; border-radius: 20px; font: inherit; font-size: 11px; font-weight: 600; border: 1px solid var(--bord); background: var(--surface2); color: var(--discret); cursor: pointer; }
.puce:hover { border-color: var(--bord2); }
.puce.active { background: var(--bleu); border-color: var(--bleu); color: #fff; }
/* Choix « portable / tour » : deux gros boutons, celui qui est coché passe en bleu. */
.choix-format { display: flex; gap: 8px; }
.choix-format label { flex: 1; margin: 0; overflow: visible; text-transform: none; letter-spacing: 0; cursor: pointer; }
.choix-format input { position: absolute; opacity: 0; pointer-events: none; }
.choix-format span { display: block; text-align: center; padding: 8px 10px; border: 1px solid var(--bord2); border-radius: 8px; background: var(--blanc); color: var(--texte); font-size: 13px; font-weight: 600; }
.choix-format span:hover { background: var(--surface2); }
.choix-format input:checked + span { background: var(--bleu); border-color: var(--bleu); color: #fff; }
.choix-format input:focus-visible + span { outline: 2px solid #bfdbfe; }
details.plus { margin-top: 4px; }
details.plus summary { cursor: pointer; color: var(--bleu); font-weight: 600; font-size: 12.5px; margin-bottom: 12px; }

/* --- Fenêtres par-dessus la page --- */
.modale-fond { position: fixed; inset: 0; background: rgba(15,23,42,.5); backdrop-filter: blur(3px); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modale { background: var(--blanc); border-radius: 14px; width: 100%; max-width: 580px; max-height: 92vh; display: flex; flex-direction: column; box-shadow: var(--ombre-forte); }
.modale-large { max-width: 700px; }
.modale-etroite { max-width: 380px; }
.modale form { display: flex; flex-direction: column; min-height: 0; }
.modale-tete { display: flex; align-items: center; justify-content: space-between; padding: 16px 22px; border-bottom: 1px solid var(--bord); }
.modale-tete h2 { font-size: 16px; font-weight: 700; }
.modale-fermer { border: 0; background: none; font-size: 22px; line-height: 1; color: var(--discret); cursor: pointer; padding: 2px 8px; border-radius: 6px; }
.modale-fermer:hover { background: var(--surface2); }
.modale-corps { padding: 18px 22px 6px; overflow-y: auto; }
.modale-pied { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--bord); }
.schema { width: 240px; height: 240px; max-width: 100%; touch-action: none; user-select: none; background: var(--surface2); border-radius: 12px; }
.schema.petit { width: 96px; height: 96px; vertical-align: middle; }
.schema circle { fill: var(--bord2); }
.schema circle.actif { fill: var(--bleu); }
.schema line { stroke: var(--bleu); stroke-width: 6; stroke-linecap: round; opacity: .55; }
.schema text { fill: #fff; font-size: 13px; font-weight: 700; text-anchor: middle; dominant-baseline: central; pointer-events: none; }

/* --- Facturation --- */
.alerte { background: var(--rouge-fond); border: 1px solid #fecaca; border-radius: var(--rayon); padding: 14px 18px; margin-bottom: 16px; color: #991b1b; }
.alerte p { margin: 4px 0 10px; }
.alerte.orange { background: var(--orange-fond); border-color: #fdba74; color: #9a3412; }
.alerte.orange p { margin-bottom: 0; }
.f-brouillon { background: var(--gris-fond); color: var(--discret); }
.f-emis, .f-payee, .f-accepte { background: var(--vert-fond); color: var(--vert); }
.f-a_payer, .f-en_attente { background: var(--jaune-fond); color: var(--jaune); }
.f-partielle { background: var(--orange-fond); color: var(--orange); }
.f-refuse, .f-a_rembourser { background: var(--rouge-fond); color: var(--rouge); }
.f-creditee { background: var(--violet-fond); color: var(--violet); }
.editeur { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; align-items: start; }
.editeur-apercu { position: sticky; top: 77px; }
.editeur-boutons { display: flex; flex-direction: column; gap: 8px; }
.editeur-boutons .aide { font-size: 12px; margin: 2px 0 0; }
.champ.etroit { max-width: 260px; }
.lignes-tete, .ligne { display: grid; grid-template-columns: minmax(0, 1fr) 76px 108px 84px 96px 34px; gap: 8px; align-items: center; }
.lignes-tete { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .3px; color: var(--discret); margin-bottom: 6px; }
.ligne { margin-bottom: 8px; }
.ligne-total { text-align: right; font-weight: 600; white-space: nowrap; }
#doc-ajouter-ligne { margin-top: 4px; }
#doc-totaux .detail-ligne.discret .detail-cle, #doc-totaux .detail-ligne.discret .detail-valeur { font-size: 12px; font-weight: 500; color: var(--discret); }
#doc-totaux .detail-ligne.total { border-top: 2px solid var(--texte); margin-top: 6px; padding-top: 8px; font-size: 16px; }
#doc-totaux .detail-ligne.total .detail-cle { color: var(--texte); font-weight: 700; }
.fiche-document { grid-template-columns: minmax(0, 1fr) 330px; }
.feuille { padding: 34px 38px; overflow-x: auto; }
.feuille .doc { min-width: 560px; }
.pile { display: flex; flex-direction: column; gap: 8px; }
.pile form { margin: 0; }
.rangee-boutons { display: flex; flex-wrap: wrap; gap: 6px; }
.btn.danger { color: var(--rouge); }
.paiement { border-top: 1px solid var(--bord); margin-top: 12px; padding-top: 12px; }
.detail-valeur form { margin-left: 6px; }

/* --- Diagnostics d'ordinateur --- */
.carte-bloc > header form { margin: 0; }
.ligne-diagnostic { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--bord); color: var(--texte); }
.ligne-diagnostic:first-of-type { border-top: 0; }
.ligne-diagnostic:hover { text-decoration: none; color: var(--bleu); }
.etapes { margin: 0 0 14px; padding-left: 22px; line-height: 1.9; }
.etapes small.bloc { display: block; line-height: 1.5; }
.etapes small code { font-family: var(--mono); background: var(--surface2); padding: 1px 5px; border-radius: 4px; color: var(--texte); }
.commande { display: flex; align-items: center; gap: 10px; margin: 6px 0; }
.commande code { flex: 1; min-width: 0; padding: 12px 14px; border-radius: 8px; background: #0f172a; color: #e2e8f0; font-family: var(--mono); font-size: 15px; overflow-x: auto; white-space: nowrap; user-select: all; }
.attente-etat { display: flex; align-items: center; gap: 8px; font-weight: 600; margin: 0; }
.constats { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.constat { display: flex; gap: 12px; align-items: flex-start; padding: 10px 14px; border-radius: 8px; border-left: 4px solid var(--bord2); background: var(--gris-fond); }
.constat p { margin: 3px 0 0; color: var(--discret); }
.constat p.conseil { color: var(--texte); }
.constat-niveau { flex-shrink: 0; width: 92px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; padding-top: 2px; }
.constat.critique { border-left-color: var(--rouge); background: var(--rouge-fond); }
.constat.critique .constat-niveau { color: var(--rouge); }
.constat.attention { border-left-color: var(--orange); background: var(--orange-fond); }
.constat.attention .constat-niveau { color: var(--orange); }
.constat.ok { border-left-color: var(--vert); background: var(--vert-fond); }
.constat.ok .constat-niveau { color: var(--vert); }
.deux-colonnes.egales { grid-template-columns: 1fr 1fr; }
details.rubrique { border-top: 1px solid var(--bord); padding: 8px 0; }
details.rubrique:first-of-type { border-top: 0; }
details.rubrique summary { cursor: pointer; font-weight: 600; }
.alerte-compte { background: var(--rouge-fond); color: var(--rouge); }
.evenement { padding: 6px 0 6px 12px; border-left: 2px solid var(--bord); margin: 6px 0; font-size: 12.5px; overflow-wrap: anywhere; }
.evenement small { display: block; }
.modale-moyenne { max-width: 460px; }
.modale-pied .a-gauche { margin-right: auto; }
.rangee.large-etroit { grid-template-columns: 3fr 1fr; }
.msg-ok { display: block; color: var(--vert); margin-top: 3px; }
form.en-ligne { display: inline; }
.ligne-attente { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--bord); overflow-wrap: anywhere; }
.ligne-attente:first-of-type { border-top: 0; }
.rangee-client > input { flex: 1; min-width: 0; }

/* --- Fenêtre de détail d'une réparation --- */
.detail-grille { display: grid; grid-template-columns: 1fr 1fr; gap: 0 26px; }
.detail-section { margin-bottom: 18px; }
.detail-section h4 { margin: 0 0 8px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--discret); padding-bottom: 6px; border-bottom: 1px solid var(--bord); }
.detail-ligne { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; }
.detail-cle { color: var(--discret); white-space: nowrap; }
.detail-valeur { font-weight: 600; text-align: right; min-width: 0; overflow-wrap: anywhere; }
.detail-valeur.orange { color: var(--orange); }
.detail-valeur.vert { color: var(--vert); }
.detail-valeur.rouge, .detail-texte.rouge { color: var(--rouge); }
.detail-texte { margin: 0 0 8px; white-space: pre-line; }
.detail-texte.discret { color: var(--discret); }
.detail-historique { max-height: 190px; overflow-y: auto; }
.detail-evenement { padding: 6px 0 6px 12px; border-left: 2px solid var(--bord); margin-bottom: 4px; }
.detail-evenement small { display: block; font-size: 11px; }
.resume { background: var(--fond); border-radius: 8px; padding: 8px 12px; margin-bottom: 16px; }

/* --- Étiquette : aperçu et état de DYMO Connect --- */
.etiquette-cadre { display: flex; justify-content: center; margin-bottom: 18px; }
/* L'aperçu est dessiné par etiquette.js aux mêmes positions que l'impression (57 × 32 mm). */
.etiquette { box-sizing: content-box; position: relative; width: 342px; max-width: 100%; aspect-ratio: 57 / 32; background: #fff; border: 2px solid #222; border-radius: 6px; font-family: "Segoe UI", Arial, sans-serif; color: #000; box-shadow: 2px 2px 8px rgba(0,0,0,.15); overflow: hidden; }
.etat-dymo { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 8px; font-size: 12px; font-weight: 600; background: var(--surface2); border: 1px solid var(--bord); margin-bottom: 14px; }
.voyant { width: 8px; height: 8px; border-radius: 50%; background: var(--clair); flex-shrink: 0; }
.voyant.vert { background: var(--vert); }
.voyant.jaune { background: var(--jaune); }
.voyant.rouge { background: var(--rouge); }
.aide-dymo { font-size: 12px; color: var(--discret); background: var(--jaune-fond); border: 1px solid #fde68a; border-radius: 8px; padding: 10px 12px; line-height: 1.7; margin-bottom: 12px; }
.aide-dymo .btn { margin-top: 6px; }
.aide-dymo .btn.discret { margin-top: 0; padding: 0 2px; text-decoration: underline; }

/* --- Fiches --- */
.deux-colonnes { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 20px; align-items: start; }
.details { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin: 0; }
.details .large { grid-column: 1 / -1; }
.details dt { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .3px; color: var(--discret); margin-bottom: 2px; }
.details dd { margin: 0; }
.statuts { display: flex; flex-wrap: wrap; gap: 6px; }
.statuts .btn.actuel { background: var(--bleu); border-color: var(--bleu); color: #fff; opacity: 1; }
.note { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 14px; }
.historique { list-style: none; margin: 0; padding: 0; }
.historique li { padding: 9px 0; border-top: 1px solid var(--bord); }
.historique li small { display: block; }
.secret { font-family: var(--mono); font-weight: 600; }

/* --- Pages sans menu (connexion) --- */
.page-seule { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.carte-seule { background: var(--blanc); border: 1px solid var(--bord); border-radius: 14px; box-shadow: var(--ombre); padding: 28px; width: 100%; max-width: 380px; }
.carte-seule h1 { font-size: 20px; text-align: center; margin-bottom: 16px; }
.carte-seule p { color: var(--discret); }
.logo-seul { font-size: 36px; text-align: center; }

/* --- Fiche de dépôt imprimable --- */
.page-ticket { background: var(--blanc); }
.ticket { max-width: 520px; margin: 0 auto; padding: 24px; }
.ticket h1 { font-size: 20px; margin-top: 14px; }
.ticket-numero { font-size: 30px; font-weight: 700; margin: 6px 0 16px; }
.ticket dt { font-size: 11px; text-transform: uppercase; color: var(--discret); margin-top: 10px; }
.ticket dd { margin: 0; font-size: 15px; }
.ticket-pied { margin-top: 22px; border-top: 1px dashed var(--clair); padding-top: 12px; color: var(--discret); }
@media print { .sans-impression { display: none; } .ticket { padding: 0; } }

/* --- Téléphone et petite fenêtre --- */
@media (max-width: 900px) {
  .menu { position: fixed; left: 0; top: 0; z-index: 30; transform: translateX(-100%); transition: transform .2s; }
  .menu.ouvert { transform: none; }
  .menu.ouvert + .voile { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 20; }
  #bascule-menu { display: inline-flex; }
  .barre { padding: 10px 14px; }
  .contenu { padding: 14px; }
  .deux-colonnes, .deux-colonnes.egales, .editeur, .fiche-document { grid-template-columns: 1fr; }
  .constat { flex-direction: column; gap: 2px; }
  .commande { flex-direction: column; align-items: stretch; }
  .editeur-apercu { position: static; }
  .lignes-tete { display: none; }
  .ligne { grid-template-columns: 1fr 1fr 1fr 34px; padding-bottom: 8px; border-bottom: 1px solid var(--bord); }
  .ligne [data-champ="designation"] { grid-column: 1 / -1; }
  .ligne-total { grid-column: 1 / 4; text-align: left; }
  .feuille { padding: 16px; }
  .tableau { grid-auto-columns: 78vw; }
  .masque-mobile { display: none; }
  .table th, .table td { padding: 10px; }
  .recherche, .recherche input[type=search] { width: 100%; }
  .rangee, .rangee.trois, .rangee.large-etroit, .detail-grille { grid-template-columns: 1fr; }
  .modale-pied { flex-wrap: wrap; }
  .modale-fond { padding: 0; align-items: flex-end; }
  .modale { max-height: 96vh; border-radius: 14px 14px 0 0; }
}

/* ---------- Parc de machines ---------- */
.pastille.rouge { background: var(--rouge); margin-left: auto; }
.constat-texte { flex: 1; min-width: 0; }
.constat-action { flex-shrink: 0; margin: 0; align-self: center; color: var(--discret); }
.constat.vue { opacity: .65; }
.ligne-formulaire { display: flex; gap: 8px; margin-bottom: 12px; }
.ligne-formulaire input { flex: 1; min-width: 0; }
.boutons-ligne { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 12px; }
.boutons-ligne form { margin: 0; }
.commande.petite code { font-size: 12px; padding: 9px 12px; }
/* Fenêtre « Installer l'agent » : deux façons de faire, l'une sous l'autre. */
.methode + .methode { border-top: 1px solid var(--bord); margin-top: 16px; padding-top: 14px; }
.methode + .aide { margin-top: 16px; }
/* Page RMM : titre d'un groupe de machines dans le tableau, et une ligne de la fenêtre « Groupes ». */
.table tr.groupe-titre td { background: var(--surface2); padding: 8px 12px; font-size: 13px; }
.table tr.groupe-titre small { color: var(--discret); margin-left: 6px; font-family: inherit; font-size: 12px; }
.ligne-groupe { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.ligne-groupe > small { color: var(--discret); }
/* Un champ (ou une liste) et son bouton, sur une même ligne, même dans une fenêtre. */
.groupe-form { display: flex; align-items: center; gap: 8px; flex: 1 1 240px; margin: 0; }
.modale form.groupe-form, .modale-corps .ligne-groupe form { flex-direction: row; }
.groupe-form.large { flex-wrap: wrap; flex: 0 0 auto; }
.ligne-groupe .groupe-form { flex: 1 1 180px; }
.ligne-groupe .groupe-form input[type="text"] { flex-basis: 80px; min-width: 80px; }
.ligne-groupe .groupe-form select { flex: 0 1 170px; }
.ligne-groupe { border-bottom: 1px solid var(--bord); padding-bottom: 10px; }
.groupe-form input[type="text"] { flex: 1 1 130px; min-width: 110px; width: auto; margin: 0; }
.groupe-form select { flex: 1 1 150px; min-width: 0; width: auto; max-width: 100%; margin: 0; padding: 8px 10px; border: 1px solid var(--bord2); border-radius: 8px; background: var(--blanc); font: inherit; }
.groupe-form .btn { flex: 0 0 auto; width: auto; margin: 0; }
.boutons-ligne .groupe-form { flex: 0 1 auto; }
.boutons-ligne .groupe-form select { flex: 0 1 170px; }
/* Fenêtre « Groupes » : une grille, pour que tout soit aligné d'une ligne à l'autre. Les formulaires
   s'effacent (display: contents) et leurs champs se rangent directement dans les colonnes. */
.modale.large { max-width: 820px; }
.grille-groupes { display: grid; grid-template-columns: minmax(130px, 1fr) 190px 180px 112px 96px; gap: 10px 10px; align-items: center; margin-bottom: 14px; }
.grille-groupes .tete, .grille-groupes .rang, .grille-groupes .rang form { display: contents; }
.grille-groupes .tete span { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; color: var(--discret); }
.grille-groupes input[type="text"], .grille-groupes select { width: 100%; min-width: 0; margin: 0; height: 38px; padding: 0 10px; border: 1px solid var(--bord2); border-radius: 8px; background: var(--blanc); font: inherit; box-sizing: border-box; }
.grille-groupes .btn { width: 100%; height: 38px; margin: 0; justify-content: center; box-sizing: border-box; }
.grille-groupes .type { font-size: 13px; line-height: 1.25; }
.grille-groupes .type small { display: block; color: var(--discret); font-size: 11px; }
.grille-groupes .rang.nouveau > form > * { margin-top: 8px; }
@media (max-width: 760px) {
  .grille-groupes { grid-template-columns: 1fr 1fr; }
  .grille-groupes .tete { display: none; }
  .grille-groupes .rang input[type="text"] { grid-column: 1 / -1; margin-top: 10px; }
  .grille-groupes .rang > span:empty { display: none; }
}
/* Cloche des notifications (page RMM) : sur téléphone, l'icône seule. */
@media (max-width: 600px) { .cloche-texte { display: none; } }
/* Ce qui ne se montre que sur téléphone (le nombre d'alertes à côté de l'état, la colonne « Alertes » y étant cachée). */
.seul-mobile { display: none; }
@media (max-width: 900px) { .seul-mobile { display: inline-flex; } }
.sous-titre { font-size: 13px; margin: 18px 0 6px; }
.champ label.case { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--texte); white-space: normal; }
.champ label.case input { width: auto; flex-shrink: 0; }
.champ small.aide { display: block; margin: 4px 0 0; font-size: 12px; }
.deux-colonnes > * { min-width: 0; }
.journal-machine { padding: 6px 0; border-top: 1px solid var(--bord); }
.journal-machine small { display: block; color: var(--discret); overflow-wrap: anywhere; }
.carte-bloc p, .constat, .evenement, .detail-ligne { overflow-wrap: anywhere; }

/* ---------- Sécurité du compte ---------- */
.qr { margin: 10px 0; line-height: 0; }
.qr svg { display: block; width: 240px; max-width: 100%; height: auto; aspect-ratio: 1; border: 1px solid var(--bord); border-radius: 8px; background: #fff; }
.cle-secret { display: inline-block; margin-top: 4px; font-family: var(--mono); font-size: 13px; letter-spacing: .5px; background: var(--surface2); padding: 4px 8px; border-radius: 6px; color: var(--texte); user-select: all; overflow-wrap: anywhere; }
.ligne-formulaire.etroite { max-width: 380px; }
.liste-codes { columns: 2; max-width: 380px; margin: 0 0 14px; padding-left: 26px; line-height: 2; }
.liste-codes li { font-size: 15px; letter-spacing: .5px; }
.aide-code { font-size: 12px; margin: 14px 0 0; text-align: center; line-height: 1.7; }
@media print { .menu, .barre, .voile, .message { display: none !important; } }

/* ---------- Machines de clients ---------- */
.ligne-client { margin: 0; }
small.erreur { display: block; color: var(--rouge); margin-top: 4px; font-size: 12px; }
.ticket.accord { max-width: 720px; font-size: 14px; line-height: 1.55; }
.ticket.accord h1 { font-size: 21px; margin-bottom: 18px; }
.ticket.accord h2 { font-size: 14px; margin: 18px 0 4px; }
.ticket.accord p { margin: 0 0 8px; }
form.en-ligne { display: inline; }
.accord-acceptation { margin-top: 22px; padding-top: 16px; border-top: 2px solid var(--bord); }
.accord-acceptation input[type="text"] { width: 100%; font-size: 16px; }
.accord-acceptation .btn { width: 100%; padding: 14px; font-size: 16px; }
.accord-signature { margin-top: 18px; padding-top: 10px; border-top: 1px solid var(--bord); font-weight: 600; }
.ligne-a-remplir { display: inline-block; min-width: 300px; border-bottom: 1px solid var(--texte); height: 1.1em; vertical-align: bottom; }
.ligne-a-remplir.courte { min-width: 130px; }
.signatures { margin-top: 26px; }
.deux-signatures { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 14px; }
.cadre-signature { height: 90px; border: 1px solid var(--bord2); border-radius: 6px; margin-top: 6px; }

.alerte.verte { background: #dcfce7; border-color: #86efac; color: #166534; }
.alerte.verte p { margin-bottom: 0; }

/* ---------- Assistant IA du RMM ---------- */
/* Réglages (page Paramètres) : le compteur des crédits du mois. */
.credits { background: var(--gris-fond); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 12px 14px; margin: 0 0 16px; }
.credits-ligne { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; margin-bottom: 8px; }
.credits small { color: var(--discret); }
.credits small.aide { display: block; margin: 8px 0 0; font-size: 12px; line-height: 1.5; }
.jauge { height: 10px; background: var(--blanc); border: 1px solid var(--bord); border-radius: 20px; overflow: hidden; }
.jauge span { display: block; height: 100%; min-width: 2px; background: var(--vert); border-radius: 20px; }
.jauge span.haute { background: var(--orange); }
.jauge span.pleine { background: var(--rouge); }
.credits-mois { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; font-size: 12px; color: var(--discret); }
.credits-mois li { background: var(--blanc); border: 1px solid var(--bord); border-radius: 20px; padding: 2px 10px; }
.apres-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 12px; }
.apres-form small.aide { margin: 0; font-size: 12px; }

/* Fiche d'une machine : le bouton (ordinateur) ou la barre (téléphone) qui ouvre la conversation. */
.assistant-barre { position: fixed; right: 22px; bottom: 22px; z-index: 40; display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 30px; background: var(--bleu); color: #fff; font: inherit; font-weight: 600; padding: 12px 18px; box-shadow: var(--ombre-forte); cursor: pointer; }
.assistant-barre:hover { background: var(--bleu-survol); }
.assistant-barre-texte, .assistant-barre-envoi { display: none; }
body.assistant-ouvert .assistant-barre { display: none; }
.assistant-espace { display: none; }

/* La conversation : un panneau à droite sur ordinateur, tout l'écran sur téléphone. */
.assistant { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); z-index: 40; display: flex; flex-direction: column; background: var(--fond); border-left: 1px solid var(--bord); box-shadow: var(--ombre-forte); }
.assistant[hidden] { display: none; }
.assistant-tete { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--blanc); border-bottom: 1px solid var(--bord); }
.assistant-tete strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }
.assistant-fil { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 14px 12px; display: flex; flex-direction: column; gap: 10px; }
.assistant-bulle { max-width: 88%; padding: 9px 12px; border-radius: 14px; line-height: 1.5; font-size: 14px; overflow-wrap: anywhere; }
.assistant-bulle p { margin: 0; white-space: pre-wrap; }
.assistant-bulle.gerant { align-self: flex-end; background: var(--bleu); color: #fff; border-bottom-right-radius: 4px; }
.assistant-bulle.ia { align-self: flex-start; background: var(--blanc); border: 1px solid var(--bord); border-bottom-left-radius: 4px; }
.assistant-bulle.attente { color: var(--discret); font-style: italic; }
.assistant-accueil { margin: auto 6px; text-align: center; color: var(--discret); line-height: 1.6; }
.assistant-accueil p { margin: 0 0 10px; }
.assistant-accueil p.petit { font-size: 12.5px; }
.assistant-propositions { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--bord); display: flex; flex-direction: column; gap: 8px; }
.assistant-titre-actions { color: var(--discret); font-size: 12px; }
.assistant-action { margin: 0; display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.assistant-action small { color: var(--discret); font-size: 12px; }
.assistant-note { margin: 0; padding: 0 14px; font-size: 12.5px; color: #9a3412; }
.assistant-note:not(:empty) { padding: 8px 14px; background: var(--orange-fond); border-top: 1px solid #fed7aa; }
.assistant-saisie { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px 6px; background: var(--blanc); border-top: 1px solid var(--bord); margin: 0; }
.assistant-saisie textarea { flex: 1; min-width: 0; resize: none; max-height: 140px; border: 1px solid var(--bord); border-radius: 18px; padding: 9px 14px; font: inherit; font-size: 16px; line-height: 1.4; background: var(--fond); }
.assistant-saisie .btn { border-radius: 50%; width: 42px; height: 42px; padding: 0; justify-content: center; flex-shrink: 0; font-size: 17px; }
.assistant-pied { margin: 0; padding: 2px 14px calc(8px + env(safe-area-inset-bottom)); background: var(--blanc); color: var(--clair); font-size: 11.5px; text-align: center; }

@media (max-width: 900px) {
  /* Téléphone : une barre en bas de la fiche, qui ressemble à une zone de saisie ; y toucher ouvre la conversation. */
  .assistant-barre { left: 0; right: 0; bottom: 0; border-radius: 0; background: var(--blanc); color: var(--texte); border-top: 1px solid var(--bord); box-shadow: 0 -2px 10px rgba(0,0,0,.06); padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); font-weight: 400; }
  .assistant-barre:hover { background: var(--blanc); }
  .assistant-barre-texte { display: block; flex: 1; text-align: left; background: var(--fond); border: 1px solid var(--bord); border-radius: 18px; padding: 9px 14px; color: var(--discret); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .assistant-barre-envoi { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: var(--bleu); color: #fff; font-size: 16px; flex-shrink: 0; }
  .assistant-barre-bouton { display: none; }
  .assistant-espace { display: block; height: calc(70px + env(safe-area-inset-bottom)); }
  .assistant { left: 0; width: auto; z-index: 60; border-left: 0; height: 100dvh; bottom: auto; }
  .assistant-tete { padding-top: calc(10px + env(safe-area-inset-top)); }
  body.assistant-ouvert { overflow: hidden; }
}
@media print { .assistant, .assistant-barre, .assistant-espace { display: none !important; } }
