/* Skineli · espace d'Élise · même univers que l'accueil. Une définition par composant, jetons en tête, media queries en fin. */
:root {
  --plum: #421c45;
  --plum-2: #5a2d5f;
  --accent: #8956a0;
  --logo-s: #c48ee0;
  --accent-2: #a2638b;
  --lavender: #e2d7f0;
  --bg: #eee8f5;
  --paper: #fffcff;
  --tint: #efe6f6;
  --tint-2: #f7f1fb;
  --muted: #725c77;
  --line: #e5d8eb;
  --line-2: #d4bbdf;
  --ok: #5f9a72;
  --ok-tint: #e3f0e6;
  --warn: #b0663a;
  --warn-tint: #f8e8dc;
  --perso: #ece7ef;
  --r-sm: 10px;
  --r: 16px;
  --r-lg: 26px;
  --r-pill: 999px;
  --shadow: 0 18px 60px -24px rgba(66, 28, 69, .28);
  --shadow-sm: 0 6px 18px -10px rgba(66, 28, 69, .3);
  --transition: .18s ease;
  --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --sans: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --heure: 60px;          /* hauteur d'une heure dans la semaine */
  --sidebar: 250px;
  --panneau: 420px;
  color: var(--plum);
  background: var(--bg);
  font-family: var(--sans);
  font-synthesis: none;
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
html { overscroll-behavior: none; overflow-x: hidden; scrollbar-gutter: stable; }
body { margin: 0; overflow-x: clip; min-height: 100svh; background: linear-gradient(180deg, #f4f0fa 0%, var(--bg) 45%, #e8e0f1 100%); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
html [hidden] { display: none; }   /* bat .modal, .toast (une classe) sans !important */
.ico { width: 20px; height: 20px; flex-shrink: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

/* ---- Connexion ---- */
.connexion { min-height: 100svh; display: grid; place-items: center; padding: 24px 16px; }
.connexion-carte { width: 100%; max-width: 400px; background: var(--paper); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 36px 28px 30px; text-align: center; }
.connexion-carte .wordmark { font-size: 46px; }
.connexion-carte h1 { font-family: var(--serif); font-weight: 500; font-size: 28px; margin: 18px 0 6px; }
.connexion-carte p { color: var(--muted); margin: 0 0 22px; line-height: 1.5; }
.connexion-carte form { display: grid; gap: 12px; }
.connexion-erreur { color: var(--warn); font-size: 14px; min-height: 20px; margin: 0; }

/* ---- Architecture cockpit JBC : menu à gauche, contenu, assistante à droite ---- */
.app { display: flex; min-height: 100svh; }
.sidebar { width: var(--sidebar); flex-shrink: 0; position: sticky; top: 0; height: 100svh; display: flex; flex-direction: column; padding: 18px 14px 20px; background: var(--paper); border-right: 1.5px solid var(--line); overflow-y: auto; scrollbar-width: none; }
.sidebar::-webkit-scrollbar { display: none; }
.compte { display: flex; align-items: center; gap: 12px; padding: 8px 8px 18px; margin-bottom: 8px; border-bottom: 1.5px solid var(--line); }
.compte img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: var(--tint); }
.compte b { display: block; font-family: var(--serif); font-weight: 500; font-size: 20px; line-height: 1.1; }
.compte small { color: var(--muted); font-size: 13px; }
.nav { display: grid; gap: 3px; margin-top: 8px; }
.nav a, .nav button { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; background: none; text-align: left; text-decoration: none; color: var(--muted); font-size: 15px; font-weight: 600; padding: 11px 12px; border-radius: var(--r-sm); transition: background var(--transition), color var(--transition); }
.nav a:hover, .nav button:hover { background: var(--tint); color: var(--plum); }
.nav a[aria-current="page"] { background: var(--plum); color: #fff; }
.nav .sep { height: 1.5px; background: var(--line); margin: 8px 6px; }
.nav-nb { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: var(--r-pill); background: var(--logo-s); color: var(--plum); font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.nav-nb.gris { background: var(--tint); color: var(--muted); }
.nav a[aria-current="page"] .nav-nb { background: rgba(255, 255, 255, .2); color: #fff; }
.nav-nb[hidden] { display: none; }
.sidebar-bas { margin-top: auto; padding-top: 16px; }
.sidebar-bas .nav a, .sidebar-bas .nav button { font-size: 14px; padding: 8px 12px; font-weight: 500; }
.sidebar-bas .wordmark { display: block; margin: 18px 12px 0; top: 0; font-size: 34px; }
.wordmark { position: relative; font-family: Anton, Impact, 'Arial Narrow Bold', sans-serif; font-weight: 400; font-size: 44px; text-transform: uppercase; white-space: nowrap; letter-spacing: -.5px; text-decoration: none; color: #141018; line-height: 1; }
.wordmark span { color: var(--logo-s); }
.main { flex: 1; min-width: 0; }
.topbar { display: none; }
.tabbar { display: none; }

/* ---- Mon assistante : carte à droite, plus large et moins haute, calée en bas (modèle du cockpit de Romain, 09/10) ---- */
.panneau-ia { width: var(--panneau); flex-shrink: 0; position: sticky; top: 0; height: 100svh; display: flex; flex-direction: column; justify-content: flex-end; padding: 18px 18px 18px 0; }
.pia-carte { height: min(780px, 100%); display: flex; flex-direction: column; overflow: hidden; background: var(--paper); border: 2.5px solid var(--logo-s); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.pia-tete { display: flex; align-items: center; gap: 10px; padding: 14px 14px 12px 16px; border-bottom: 1.5px solid var(--line); }
.pia-tete img { width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%; object-fit: cover; background: var(--tint); }
.pia-tete > span { min-width: 0; flex: 1; }
.pia-tete b { display: block; font-family: var(--serif); font-weight: 500; font-size: 19px; line-height: 1.15; }
.pia-tete small { color: var(--muted); font-size: 12.5px; }
.point { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); margin-right: 6px; vertical-align: 1px; }
.pia-btn { flex-shrink: 0; width: 36px; height: 36px; border: 0; border-radius: var(--r-sm); background: none; color: var(--muted); display: grid; place-items: center; transition: transform var(--transition); }
.pia-btn:hover { transform: translateY(-1px); color: var(--plum); }
.pia-tete .pia-fermer { display: none; }
.pia-fil { flex: 1; min-height: 120px; overflow-y: auto; overscroll-behavior: contain; padding: 16px 16px 8px; scrollbar-width: none; }
.pia-fil::-webkit-scrollbar { display: none; }
.pia-accueil { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 34px 6px 10px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.pia-accueil img { width: 74px; height: 74px; border-radius: 50%; object-fit: cover; background: var(--tint); }
.pia-accueil b { color: var(--plum); font-family: var(--serif); font-weight: 500; font-size: 20px; }
.pia-accueil p { margin: 0; }
.bulle { max-width: 90%; margin: 0 0 12px; font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.bulle p { margin: 0 0 .65em; }
.bulle p:last-child { margin-bottom: 0; }
.bulle p.puce { position: relative; padding-left: 1em; margin-bottom: .4em; }
.bulle p.puce::before { content: '-'; position: absolute; left: 0; }
.bulle.assistant { padding: 11px 15px; border-radius: 18px 18px 18px 6px; background: var(--tint); }
.bulle.user { width: fit-content; margin-left: auto; padding: 10px 14px; border-radius: 18px 18px 6px 18px; background: var(--plum); color: #fff; white-space: pre-wrap; text-align: right; }
.bulle.erreur { background: var(--warn-tint); color: var(--warn); }
.bulle .outil { display: flex; align-items: center; gap: 8px; font-size: 13px; font-style: italic; color: var(--muted); }
.bulle .outil i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: clignote 1.1s infinite; }
@keyframes clignote { 50% { opacity: .25; } }
.pia-bas { padding: 4px 14px 14px; }
.pia-suggestions { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 10px; }
.pia-suggestions[hidden] { display: none; }
.pia-suggestions button { padding: 7px 12px; border: 1.5px solid var(--line-2); border-radius: var(--r-pill); background: var(--paper); font-size: 13px; font-weight: 600; color: var(--plum); text-align: left; transition: transform var(--transition); }
.pia-suggestions button:hover { transform: translateY(-1px); }
.pia-form { display: flex; flex-direction: column; gap: 2px; padding: 6px 8px 8px; border: 1.5px solid var(--line-2); border-radius: var(--r-lg); background: #fff; }
.pia-form:focus-within { border-color: var(--accent); }
.pia-form textarea { width: 100%; max-height: 180px; padding: 8px 8px 4px; border: 0; outline: none; background: transparent; resize: none; font: 16px/1.45 var(--sans); color: var(--plum); scrollbar-width: none; }
.pia-outils { display: flex; align-items: center; gap: 6px; }
.pia-espace { flex: 1; }
.pia-micro, .pia-envoyer { width: 40px; height: 40px; }
.pia-envoyer { background: var(--plum); border-color: var(--plum); color: #fff; }
.pia-envoyer:hover { background: var(--plum-2); }
.pia-annuler, .pia-enreg { display: none; }
.pia-annuler { width: 32px; height: 32px; border: 0; border-radius: 50%; background: var(--tint); color: var(--plum); place-items: center; }
.pia-enreg { align-items: center; gap: 8px; font-weight: 700; font-variant-numeric: tabular-nums; font-size: 14px; }
.pia-enreg i { width: 9px; height: 9px; border-radius: 50%; background: var(--warn); animation: clignote 1.1s infinite; }
.pia-form.enreg .pia-annuler { display: grid; }
.pia-form.enreg .pia-enreg { display: inline-flex; }
.pia-form.enreg textarea { display: none; }
.pia-form.enreg .pia-micro { background: var(--warn); border-color: var(--warn); color: #fff; }
.pia-bouton { display: none; position: fixed; right: 20px; bottom: 20px; z-index: 50; width: 60px; height: 60px; padding: 0; border: 3px solid var(--paper); border-radius: 50%; background: var(--tint); box-shadow: var(--shadow); }
.pia-bouton img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.pia-bouton .pt { position: absolute; top: -4px; right: -4px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: var(--r-pill); background: var(--logo-s); color: var(--plum); font-size: 12px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--paper); }
.pia-bouton .pt[hidden] { display: none; }
.voile { display: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* l'activité de l'assistante du site (accueil) */
.pia-chiffres { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.pia-chiffres div { background: var(--tint-2); border-radius: var(--r-sm); padding: 10px 8px; text-align: center; }
.pia-chiffres b { display: block; font-family: var(--serif); font-size: 24px; font-weight: 500; line-height: 1.1; }
.pia-chiffres small { font-size: 11px; color: var(--muted); line-height: 1.2; display: block; }
.pia-titre { font-size: 12px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--accent); font-weight: 700; margin: 4px 0 10px; }
.pia-conv { background: var(--tint-2); border-radius: var(--r); padding: 12px 14px; margin-bottom: 8px; font-size: 14px; line-height: 1.4; }
.pia-conv small { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.pia-conv p { margin: 0 0 4px; }
.pia-conv .tag { display: inline-block; margin-top: 4px; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: var(--r-pill); background: var(--tint); color: var(--accent); }
.pia-note { color: var(--muted); font-size: 14px; line-height: 1.5; }
.site-ia { grid-column: 1 / -1; }

/* mes notes (fenêtre) */
.note-ajout { display: flex; gap: 8px; align-items: end; margin-bottom: 16px; }
.note-ajout .champ { flex: 1; }
.notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.note { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--tint-2); font-size: 15px; line-height: 1.4; }
.note > span { flex: 1; min-width: 0; }
.note small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.note.faite > span { color: var(--muted); text-decoration: line-through; }
.coche { flex-shrink: 0; border: 0; background: none; padding: 0; color: var(--accent); }
.coche .ico { width: 22px; height: 22px; }

/* ---- Accueil ---- */
.accueil-grille { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 14px; }
.accueil-grille .carte { padding: 20px 22px; }
.accueil-grille h2 { font-size: 16px; margin: 0 0 14px; display: flex; align-items: center; gap: 8px; }
.accueil-grille h2 a { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--accent); text-decoration: none; }
.journee { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.journee li button { display: flex; gap: 14px; align-items: center; width: 100%; border: 0; text-align: left; background: var(--tint-2); border-radius: var(--r); padding: 12px 14px; border-left: 4px solid var(--accent); }
.journee li button.perso, .journee li button.off { border-left-color: #a99aae; }
.journee li button.fait { border-left-color: var(--ok); }
.journee .h { font-family: var(--serif); font-size: 20px; min-width: 64px; }
.journee small { display: block; color: var(--muted); font-size: 13px; }

/* ---- Contenu ---- */
.vue { max-width: 1400px; margin: 0 auto; padding: 26px clamp(16px, 3vw, 44px) 60px; }
.vue-tete { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.vue-tete h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(30px, 3.2vw, 42px); letter-spacing: -.8px; margin: 0; line-height: 1.05; }
.vue-tete h1 em { font-style: italic; color: var(--accent); font-weight: 400; }
.vue-tete .sous { color: var(--muted); margin: 6px 0 0; font-size: 15px; }
.vue-tete .actions { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }

/* ---- Boutons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1.5px solid var(--plum); background: var(--plum); color: #fff; padding: 12px 18px; border-radius: var(--r); font-size: 15px; font-weight: 600; text-decoration: none; box-shadow: var(--shadow-sm); transition: background var(--transition), color var(--transition), transform var(--transition); }
.btn:hover { background: var(--plum-2); border-color: var(--plum-2); }
.btn:active { transform: translateY(1px); }
.btn.clair { background: var(--paper); color: var(--plum); box-shadow: none; }
.btn.clair:hover { background: var(--tint); }
.btn.petit { padding: 8px 12px; font-size: 14px; border-radius: var(--r-sm); }
.btn.danger { background: var(--paper); color: var(--warn); border-color: var(--warn); box-shadow: none; }
.btn:disabled { opacity: .55; cursor: wait; }
.rond { border: 1.5px solid var(--line-2); background: var(--paper); width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--plum); transition: background var(--transition); }
.rond:hover { background: var(--tint); }
.rond:disabled { opacity: .35; cursor: default; }

/* ---- Champs (blanc pur, 16 px : pas de zoom sur iPhone) ---- */
.champ { display: grid; gap: 6px; text-align: left; }
.champ > span { font-size: 13px; font-weight: 600; color: var(--muted); }
.champ input, .champ select, .champ textarea, .recherche input { width: 100%; font-size: 16px; background: #fff; border: 1.5px solid var(--line-2); border-radius: var(--r-sm); padding: 11px 13px; transition: border-color var(--transition); }
.champ textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
.champ input:focus, .champ select:focus, .champ textarea:focus, .recherche input:focus { border-color: var(--accent); outline: none; }
.grille-champs { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grille-champs .large { grid-column: 1 / -1; }
.recherche { position: relative; flex: 1; min-width: 220px; max-width: 420px; }
.recherche .ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.recherche input { padding-left: 42px; border-radius: var(--r-pill); }

/* ---- Cartes et tuiles ---- */
.carte { background: var(--paper); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); border: 1px solid #fff; }
.tuiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.tuile { min-width: 0; background: var(--paper); border-radius: var(--r); box-shadow: var(--shadow-sm); padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; }
.tuile b { font-size: 12px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.tuile .gros { font-family: var(--serif); font-size: 38px; font-weight: 500; line-height: 1.1; }
.tuile small { color: var(--muted); font-size: 13px; line-height: 1.4; }
.tuile.alerte .gros { color: var(--warn); }
.vide { text-align: center; padding: 46px 20px; color: var(--muted); line-height: 1.55; }
.vide strong { display: block; font-family: var(--serif); font-weight: 500; font-size: 24px; color: var(--plum); margin-bottom: 6px; }
.vide .btn { margin-top: 18px; }

/* ---- Agenda ---- */
.semaine-nav { display: flex; align-items: center; gap: 8px; }
.semaine-nav .libelle { font-weight: 600; min-width: 200px; text-align: center; border: 0; background: none; padding: 8px 4px; }
.demandes { margin-bottom: 18px; padding: 18px 20px; background: var(--tint-2); border: 1.5px dashed var(--line-2); border-radius: var(--r-lg); }
.demandes h2 { display: flex; align-items: center; gap: 10px; font-size: 16px; margin: 0 0 12px; }
.demandes h2 img { width: 30px; height: 30px; border-radius: 50%; }
.demandes-liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(330px, 100%), 1fr)); gap: 10px; }
.demande { background: var(--paper); border-radius: var(--r); padding: 14px 16px; display: grid; gap: 4px; box-shadow: var(--shadow-sm); }
.demande .qui { font-weight: 700; }
.demande .quoi, .demande .quand { font-size: 14px; color: var(--muted); }
.demande .quand { color: var(--plum); font-weight: 600; }
.demande .boutons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.semaine { display: grid; grid-template-columns: 54px repeat(7, minmax(0, 1fr)); overflow: clip; }   /* clip et pas hidden : hidden ferait de la carte le conteneur du sticky des en-têtes */
.semaine .entete { position: sticky; top: 0; z-index: 2; background: var(--paper); padding: 12px 6px 10px; text-align: center; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.semaine .entete b { display: block; font-family: var(--serif); font-size: 24px; font-weight: 500; color: var(--plum); line-height: 1.1; }
.semaine .entete.auj b { color: #fff; background: var(--accent); width: 38px; height: 38px; line-height: 38px; border-radius: 50%; margin: 2px auto 0; font-size: 20px; }
.semaine .entete.ferme { color: #b9a7bf; }
.heures { position: relative; }
.heures span { position: absolute; right: 8px; font-size: 12px; color: var(--muted); transform: translateY(-50%); }
.jour { position: relative; border-left: 1px solid var(--line); background: repeating-linear-gradient(180deg, transparent 0, transparent calc(var(--heure) - 1px), var(--line) calc(var(--heure) - 1px), var(--line) var(--heure)); cursor: copy; }
.jour.ferme { background-color: #f6f2f8; }
.jour .maintenant { position: absolute; left: 0; right: 0; height: 2px; background: var(--accent-2); z-index: 1; pointer-events: none; }
.evt { position: absolute; left: 4px; right: 4px; border: 0; text-align: left; overflow: hidden; border-radius: var(--r-sm); padding: 6px 8px; font-size: 13px; line-height: 1.25; background: var(--lavender); color: var(--plum); border-left: 4px solid var(--accent); cursor: pointer; transition: transform var(--transition), box-shadow var(--transition); }
.evt:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); z-index: 3; }
.evt b { display: block; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.evt small { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.evt.perso, .evt.off { background: var(--perso); border-left-color: #a99aae; }
.evt.fait { background: var(--ok-tint); border-left-color: var(--ok); }
.evt.absent { background: var(--warn-tint); border-left-color: var(--warn); }
.evt.demande-evt { background: var(--paper); border: 1.5px dashed var(--accent); border-left-width: 4px; }
.jours-liste { display: none; }

/* ---- Clientes ---- */
.liste { list-style: none; margin: 0; padding: 6px; }
.ligne-cliente { display: flex; align-items: center; gap: 14px; width: 100%; border: 0; background: none; text-align: left; padding: 12px 14px; border-radius: var(--r); transition: background var(--transition); }
.ligne-cliente:hover { background: var(--tint-2); }
.initiales { width: 42px; height: 42px; flex-shrink: 0; border-radius: 50%; background: var(--tint); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 15px; }
.ligne-cliente .nom { font-weight: 600; }
.ligne-cliente .infos { font-size: 14px; color: var(--muted); }
.ligne-cliente .droite { margin-left: auto; text-align: right; font-size: 13px; color: var(--muted); white-space: nowrap; }
.lettre { font-family: var(--serif); font-size: 20px; color: var(--accent); padding: 14px 14px 4px; }
.fiche-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin: 4px 0 18px; }
.historique { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.historique li { background: var(--tint-2); border-radius: var(--r-sm); padding: 10px 12px; font-size: 14px; }
.historique li small { color: var(--muted); }
.bloc-titre { font-size: 12px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--accent); font-weight: 700; margin: 22px 0 10px; }

/* ---- Stocks ---- */
.produits { display: grid; gap: 10px; padding: 8px; }
.cat-titre { font-family: var(--serif); font-size: 20px; color: var(--accent); margin: 12px 10px 2px; }
.produit { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: var(--r); background: var(--tint-2); }
.produit .nom { font-weight: 600; border: 0; background: none; padding: 0; text-align: left; }
.produit .details { font-size: 13px; color: var(--muted); }
.produit .qte { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.produit .qte output { min-width: 64px; text-align: center; font-weight: 700; font-size: 18px; }
.produit .qte output small { display: block; font-size: 11px; color: var(--muted); font-weight: 500; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: var(--r-pill); background: var(--warn-tint); color: var(--warn); margin-left: 8px; vertical-align: 1px; }

/* ---- Statistiques ---- */
.titre-section { font-family: var(--serif); font-weight: 500; font-size: 22px; margin: 6px 0 12px; }
.titre-section small { font-family: var(--sans); font-size: 13px; color: var(--muted); margin-left: 8px; }
.stats-grille { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 14px; }
.stats-grille .carte { padding: 20px 22px; }
.stats-grille h2 { font-size: 16px; margin: 0 0 4px; }
.stats-grille .note { font-size: 13px; color: var(--muted); margin: 0 0 16px; }
.barres { display: flex; align-items: flex-end; gap: 6px; height: 200px; padding-top: 22px; border-bottom: 1px solid var(--line-2); }
.barre { position: relative; flex: 1; min-width: 0; background: var(--accent); border-radius: 4px 4px 0 0; }
.barre span { position: absolute; left: 50%; bottom: 100%; transform: translateX(-50%); font-size: 12px; font-weight: 700; padding-bottom: 3px; }
.barre::after { content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 24px); transform: translateX(-50%); background: var(--plum); color: #fff; font-size: 12px; white-space: nowrap; padding: 6px 10px; border-radius: var(--r-sm); opacity: 0; pointer-events: none; transition: opacity var(--transition); z-index: 2; }
.barre:nth-child(-n+6)::after { left: 0; transform: none; }   /* 12 mois : les bulles partent vers l'intérieur de la carte */
.barre:nth-last-child(-n+6)::after { left: auto; right: 0; transform: none; }
.barre:hover::after { opacity: 1; }
.barres-axe { display: flex; gap: 6px; margin-top: 6px; }
.barres-axe span { flex: 1; min-width: 0; overflow: hidden; text-align: center; font-size: 12px; color: var(--muted); }
.top { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.top li { display: grid; gap: 5px; font-size: 14px; }
.top .jauge { height: 8px; border-radius: 4px; background: var(--tint); overflow: hidden; }
.top .jauge i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }

/* ---- Encaissements ---- */
.pile { display: grid; gap: 14px; align-content: start; }
.paiements { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.paiement { display: flex; align-items: center; gap: 14px; width: 100%; border: 0; text-align: left; background: var(--tint-2); border-radius: var(--r); padding: 12px 14px; border-left: 4px solid var(--accent); transition: transform var(--transition); }
.paiement:hover:not(:disabled) { transform: translateY(-1px); }
.paiement.echec { border-left-color: #a99aae; opacity: .7; cursor: default; }
.paiement .montant { font-family: var(--serif); font-size: 21px; min-width: 92px; }
.paiement .quoi { min-width: 0; }
.paiement .quoi b { display: block; font-weight: 600; font-size: 15px; }
.paiement .quoi small { color: var(--muted); font-size: 13px; }
.paiement .badge { margin-left: 6px; }
.rappro { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; color: var(--muted); text-align: right; max-width: 45%; }
.rappro.ok { color: var(--ok); }
.rappro.a-faire { color: var(--accent); padding: 4px 10px; border-radius: var(--r-pill); background: var(--paper); border: 1.5px dashed var(--line-2); }
.rappro .ico { flex-shrink: 0; width: 16px; height: 16px; }
.barres.jours { gap: 2px; height: 150px; }
.barres.jours .barre:nth-child(-n+6)::after { left: 0; transform: none; }
.bandeau-alerte { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; padding: 12px 16px; border-radius: var(--r); background: var(--warn-tint); color: var(--warn); font-weight: 600; }
.demandes h2 .ico { color: var(--warn); }
.lien-btn { border: 0; background: none; padding: 0; color: var(--accent); font-size: 13px; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.note-bas { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); font-size: 13px; text-align: center; margin: 22px 0 0; }
.note-bas .ico { flex-shrink: 0; }
.br-mobile { display: none; }

/* ---- Devis et factures ---- */
.filtres { justify-content: flex-start; margin: 0; padding: 16px 16px 6px; }
.docs { padding: 8px 16px 16px; }
.doc.devis { border-left-color: var(--logo-s); }
.doc.brouillon { border-left-style: dashed; background: var(--paper); box-shadow: inset 0 0 0 1.5px var(--line); }
.rappro.statut-payee, .rappro.statut-accepte { color: var(--ok); }
.rappro.statut-emise { color: var(--warn); }
.rappro.statut-refuse { color: #a99aae; }
.ligne-doc { display: grid; grid-template-columns: minmax(0, 1fr) 70px 96px 90px 40px; gap: 8px; align-items: end; padding: 12px; margin-bottom: 8px; border-radius: var(--r); background: var(--tint-2); }
.ligne-doc .champ.large { grid-column: auto; }
.lignes-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 16px; }
.lignes-actions .remises { font-size: 13px; color: var(--muted); }
.totaux-doc { display: flex; justify-content: flex-end; gap: 18px; flex-wrap: wrap; padding: 14px 16px; margin-bottom: 16px; border-radius: var(--r); background: var(--tint); font-size: 14px; color: var(--muted); }
.totaux-doc b { color: var(--plum); margin-left: 4px; }
.totaux-doc .ttc b { font-family: var(--serif); font-size: 20px; }
.seul-mobile { display: none; }

/* ---- Modale (pattern JBC : scroll invisible, croix fixe, champs blancs) ---- */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(66, 28, 69, .5); }
.modal__content { position: relative; width: 100%; max-width: 620px; max-height: calc(100svh - 32px); display: flex; flex-direction: column; overflow: hidden; background: var(--paper); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.modal__scroll { overflow-y: auto; padding: 30px 28px 8px; scrollbar-width: none; -ms-overflow-style: none; }
.modal__scroll::-webkit-scrollbar { display: none; width: 0; }
.modal__close { position: absolute; top: 12px; right: 12px; z-index: 2; border: 0; background: var(--paper); width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.modal__close:hover { background: var(--tint); color: var(--plum); }
.modal h2 { font-family: var(--serif); font-weight: 500; font-size: 28px; text-align: center; margin: 0 36px 6px; }
.modal .intro { text-align: center; color: var(--muted); margin: 0 0 20px; font-size: 15px; }
.modal__bas { display: flex; gap: 10px; padding: 16px 28px 22px; border-top: 1px solid var(--line); }
.modal__bas .btn { flex: 1; }
.modal__bas .annuler { background: var(--paper); color: var(--plum); border-color: var(--plum); box-shadow: none; }
.modal__bas .annuler:hover { background: var(--tint); }
.modal__bas .supprimer { flex: 0 0 auto; }
.choix-type { display: flex; gap: 8px; justify-content: center; margin-bottom: 18px; flex-wrap: wrap; }
.choix-type button { border: 1.5px solid var(--line-2); background: var(--paper); padding: 9px 14px; border-radius: var(--r-pill); font-weight: 600; font-size: 14px; }
.choix-type button[aria-pressed="true"] { background: var(--plum); border-color: var(--plum); color: #fff; }

/* ---- Message bref ---- */
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 80; transform: translateX(-50%); background: var(--plum); color: #fff; padding: 12px 18px; border-radius: var(--r-pill); font-size: 15px; box-shadow: var(--shadow); max-width: calc(100vw - 32px); text-align: center; }
.toast.erreur { background: var(--warn); }

/* ---- Paliers ---- */
@media (max-width: 1400px) {
  /* le panneau de l'assistante devient un tiroir, ouvert par la bulle d'Élise */
  .panneau-ia { position: fixed; right: 0; top: 0; bottom: 0; z-index: 55; height: auto; width: min(440px, 100%); padding: 12px; transform: translateX(105%); transition: transform var(--transition); }
  .app.pia-ouvert .panneau-ia { transform: none; }
  .pia-carte { height: 100%; }
  .pia-tete .pia-fermer { display: grid; }
  .pia-bouton { display: block; }
  .app.pia-ouvert .pia-bouton { display: none; }
  .app.pia-ouvert .voile { display: block; position: fixed; inset: 0; z-index: 54; background: rgba(66, 28, 69, .3); }
}
@media (max-width: 1024px) {
  :root { --sidebar: 220px; }
  .stats-grille, .accueil-grille { grid-template-columns: minmax(0, 1fr); }
  .semaine-nav .libelle { min-width: 0; }
}
@media (max-width: 760px) {
  .sidebar { display: none; }
  .topbar { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 30; height: 64px; padding: 0 16px; background: rgba(240, 235, 247, .94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1.5px solid #d8cce2; }
  .topbar .wordmark { font-size: 34px; top: 3px; }
  .tabbar { display: flex; justify-content: space-around; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; padding: 8px 6px calc(8px + env(safe-area-inset-bottom)); background: rgba(255, 252, 255, .97); border-top: 1.5px solid var(--line); }
  .tabbar a { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); text-decoration: none; padding: 6px 2px; border-radius: var(--r); }
  .tabbar a[aria-current="page"] { background: var(--tint); color: var(--plum); }
  .paiement { flex-wrap: wrap; gap: 4px 12px; }
  .paiement .montant { min-width: 0; }
  .rappro { margin-left: 0; max-width: 100%; text-align: left; flex-basis: 100%; }
  .rappro.a-faire { flex-basis: auto; }
  .br-mobile { display: inline; }
  .seul-mobile { display: inline-flex; }
  .ligne-doc { grid-template-columns: 1fr 1fr 1fr 40px; }
  .ligne-doc .champ.large { grid-column: 1 / -1; }
  .totaux-doc { justify-content: space-between; gap: 6px 14px; }
  .pia-bouton { bottom: calc(84px + env(safe-area-inset-bottom)); right: 14px; width: 54px; height: 54px; }
  .panneau-ia { width: 100%; padding: 0; }
  .pia-carte { border-radius: 0; border: 0; }
  .vue { padding: 20px 16px 110px; }
  .vue-tete .actions { margin-left: 0; width: 100%; }
  .vue-tete .actions .btn { flex: 1; }
  .semaine { display: none; }
  .jours-liste { display: grid; gap: 14px; }
  .jours-liste h3 { font-family: var(--serif); font-weight: 500; font-size: 20px; margin: 0 0 8px; }
  .jours-liste h3 small { font-family: var(--sans); font-size: 13px; color: var(--muted); margin-left: 6px; }
  .jours-liste .evt { position: static; display: block; width: 100%; margin-bottom: 8px; padding: 10px 12px; font-size: 15px; }
  .jours-liste .rien { color: var(--muted); font-size: 14px; margin: 0; }
  .semaine-nav { width: 100%; justify-content: space-between; }
  .semaine-nav .btn[data-sem="0"] { display: none; }   /* sur téléphone : toucher la semaine ramène à aujourd'hui */
  .grille-champs { grid-template-columns: 1fr; }
  .ligne-cliente .droite { display: none; }
  .produit { flex-wrap: wrap; }
  .produit .qte { width: 100%; justify-content: flex-end; }
  .modal { padding: 0; align-items: end; }
  .modal__content { max-height: 94svh; border-radius: var(--r-lg) var(--r-lg) 0 0; }
  .modal__scroll { padding: 28px 18px 8px; }
  .modal__bas { padding: 14px 18px calc(14px + env(safe-area-inset-bottom)); flex-wrap: wrap; }
  .toast { bottom: 96px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
