/* CHANTYBAT — identité visuelle (06/11/2026, demande de Yann : « un environnement comme l'iPhone, inspiré d'Apple »,
   harmonisé sur TOUTES les pages). Une seule feuille pour l'application ; les pages n'ajoutent que leur mise en page propre.
   Principes : fond gris très clair, cartes blanches arrondies sans bordure avec ombre douce, barre du haut translucide,
   onglets en « commande segmentée », boutons en pilule, liens sans soulignement, icônes Lucide (jamais d'emoji). */

:root {
    --fond:#f5f5f7; --surface:#ffffff; --surface-2:#fbfbfd;
    --texte:#1d1d1f; --texte-2:#6e6e73; --texte-3:#86868b;
    --trait:rgba(0,0,0,.08); --trait-fort:#d2d2d7;
    --accent:#0071e3; --accent-survol:#0077ed; --lien:#0066cc; --accent-clair:#e8f1fc;
    --vert:#248a3d; --vert-vif:#34c759; --vert-clair:#e9f8ee;
    --orange:#c93400; --orange-vif:#ff9f0a; --orange-clair:#fff4e5;
    --rouge:#d70015; --rouge-vif:#ff3b30; --rouge-clair:#ffecec;
    --violet:#8944ab; --gris-clair:#f2f2f4;
    --ombre:0 1px 2px rgba(0,0,0,.04), 0 6px 20px rgba(0,0,0,.05);
    --ombre-forte:0 2px 6px rgba(0,0,0,.06), 0 14px 36px rgba(0,0,0,.10);
    --rayon:18px; --rayon-moyen:12px; --rayon-petit:10px;
    /* anciens noms, gardés pour les styles posés dans les pages */
    --bleu:var(--lien); --bleu-clair:var(--accent-clair); --ocre:#a05a00; --gris:var(--texte-2);
    --police:-apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI Variable Text", "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing:border-box; }
html { -webkit-text-size-adjust:100%; }
body { font-family:var(--police); margin:0; background:var(--fond); color:var(--texte); font-size:15px; line-height:1.47;
    -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale; letter-spacing:-.003em; }
::selection { background:rgba(0,113,227,.18); }

/* ---------- icônes Lucide ---------- */
.ic { width:16px; height:16px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; flex:none; vertical-align:-3px; }
.ic-petite { width:13px; height:13px; vertical-align:-2px; }
.ic-grande { width:20px; height:20px; }
.avec-icone { display:inline-flex; align-items:center; gap:6px; }

/* ---------- barre du haut translucide ---------- */
header.barre-app { position:sticky; top:0; z-index:1000; display:flex; align-items:center; gap:22px; flex-wrap:wrap;
    padding:10px 24px; background:rgba(255,255,255,.72); -webkit-backdrop-filter:saturate(180%) blur(20px); backdrop-filter:saturate(180%) blur(20px);
    border-bottom:1px solid var(--trait); color:var(--texte); }
header.barre-app .marque { display:inline-flex; align-items:center; gap:8px; font-weight:700; font-size:17px; letter-spacing:-.01em; color:var(--texte); text-decoration:none; }
header.barre-app .marque .logo { display:inline-flex; align-items:center; justify-content:center; width:28px; height:28px; border-radius:8px;
    background:linear-gradient(135deg, #34c759, #0a84ff); color:#fff; }
header.barre-app .marque .logo .ic { width:16px; height:16px; }
header.barre-app .marque span.bat { color:var(--vert); }
header.barre-app nav { display:flex; flex-wrap:wrap; gap:4px; flex:1; min-width:0; }
header.barre-app nav a { display:inline-flex; align-items:center; gap:6px; color:var(--texte); text-decoration:none; font-size:14px; padding:6px 12px; border-radius:980px; opacity:.85; }
header.barre-app nav a:hover { opacity:1; background:rgba(0,0,0,.05); text-decoration:none; }
header.barre-app nav a.actif { opacity:1; background:rgba(0,0,0,.06); font-weight:600; }
header.barre-app form { margin:0; }
header.barre-app .compte { display:inline-flex; align-items:center; gap:8px; background:rgba(0,0,0,.05); color:var(--texte); border:0; border-radius:980px;
    padding:6px 14px; font-size:13px; cursor:pointer; }
header.barre-app .compte:hover { background:rgba(0,0,0,.09); }

main { max-width:1240px; margin:0 auto; padding:28px 22px 56px; }

/* ---------- typographie ---------- */
a { color:var(--lien); text-decoration:none; }
a:hover { text-decoration:underline; text-underline-offset:3px; }
h1 { font-size:30px; line-height:1.15; font-weight:700; letter-spacing:-.022em; margin:0 0 8px; color:var(--texte); text-wrap:balance; }
h2 { font-size:19px; line-height:1.25; font-weight:600; letter-spacing:-.012em; margin:26px 0 10px; color:var(--texte); }
h3 { font-size:15px; font-weight:600; letter-spacing:-.005em; }
.discret { color:var(--texte-2); font-size:13px; }
.nowrap { white-space:nowrap; } .num { text-align:right; font-variant-numeric:tabular-nums; white-space:nowrap; }
.montant { font-variant-numeric:tabular-nums; font-weight:600; }
.alerte-texte { color:var(--rouge); }
.avis { background:var(--orange-clair); color:#7a3e00; border-radius:var(--rayon-moyen); padding:12px 16px; }
.fil-ariane { font-size:13px; color:var(--texte-2); margin:0 0 10px; }
.fil-ariane a { color:var(--texte-2); } .fil-ariane a:hover { color:var(--lien); }

/* ---------- boutons et champs ---------- */
button, .bouton { display:inline-flex; align-items:center; justify-content:center; gap:6px; background:var(--accent); color:#fff; border:0; border-radius:980px;
    padding:8px 18px; cursor:pointer; font:inherit; font-size:14px; font-weight:500; line-height:1.3; transition:background .15s, transform .05s; }
button:hover, .bouton:hover { background:var(--accent-survol); text-decoration:none; }
button:active, .bouton:active { transform:scale(.98); }
a.bouton { text-decoration:none; color:#fff; }
.bouton-discret, a.bouton-discret, button.bouton-discret { display:inline-flex; align-items:center; gap:5px; background:rgba(0,0,0,.05); color:var(--texte);
    border:0; border-radius:980px; padding:5px 12px; font-size:13px; font-weight:500; cursor:pointer; text-decoration:none; }
.bouton-discret:hover { background:rgba(0,0,0,.09); text-decoration:none; }
.bouton-discret.actif, a.bouton-discret.actif { background:var(--texte); color:#fff; }
.bouton-danger { background:var(--rouge-clair); color:var(--rouge); }
input, select, textarea { font:inherit; font-size:14px; color:var(--texte); background:#fff; border:1px solid var(--trait-fort); border-radius:var(--rayon-petit);
    padding:8px 12px; transition:border-color .15s, box-shadow .15s; }
input[type=checkbox], input[type=radio] { accent-color:var(--accent); width:16px; height:16px; padding:0; }
input[type=color] { padding:2px; height:36px; width:52px; }
input[type=file] { border-style:dashed; background:var(--surface-2); }
input:focus, select:focus, textarea:focus { outline:none; border-color:var(--accent); box-shadow:0 0 0 4px rgba(0,113,227,.15); }
:focus-visible { outline:3px solid rgba(0,113,227,.45); outline-offset:2px; }
textarea { width:100%; resize:vertical; }
label { font-size:13px; }
.case { display:inline-flex; gap:6px; align-items:center; font-size:14px; }

/* ---------- cartes ---------- */
.carte { background:var(--surface); border-radius:var(--rayon); padding:18px 20px; margin-bottom:16px; box-shadow:var(--ombre); }
.carte h2 { margin-top:0; font-size:17px; display:flex; align-items:center; gap:8px; }
.carte h3 { font-size:14px; margin:16px 0 8px; color:var(--texte); }
.carte-privee { background:linear-gradient(180deg, #fffaf2, #fff); box-shadow:var(--ombre), inset 0 0 0 1px rgba(160,90,0,.18); }
.grille-info { display:grid; grid-template-columns:repeat(auto-fill, minmax(330px, 1fr)); gap:16px; align-items:start; }
.grille-info > .carte { margin-bottom:0; }

/* ---------- pastilles d'état ---------- */
.pastille { display:inline-flex; align-items:center; gap:4px; font-size:12px; font-weight:500; padding:3px 10px; border-radius:980px;
    background:var(--accent-clair); color:var(--lien); text-transform:capitalize; white-space:nowrap; }
.statut-en_cours, .statut-faite, .valid-valide { background:var(--vert-clair); color:var(--vert); }
.statut-receptionne, .statut-clos { background:var(--gris-clair); color:var(--texte-2); }
.statut-a_faire { background:var(--gris-clair); color:var(--texte); }
.statut-suspendu, .valid-refuse { background:var(--rouge-clair); color:var(--rouge); }
.valid-a_valider { background:var(--orange-clair); color:var(--ocre); }

/* ---------- jauges ---------- */
.barre { height:6px; background:rgba(0,0,0,.06); border-radius:3px; overflow:hidden; margin:6px 0; }
.barre span { display:block; height:100%; background:var(--vert-vif); border-radius:3px; }
.jauge { height:10px; background:rgba(0,0,0,.06); border-radius:5px; overflow:hidden; } .jauge span { display:block; height:100%; background:var(--vert-vif); }

/* ---------- onglets : commande segmentée ---------- */
.onglets { display:flex; flex-wrap:wrap; gap:2px; width:fit-content; max-width:100%; background:rgba(118,118,128,.12); border-radius:12px; padding:3px; margin:18px 0 18px; }
.onglets a { display:inline-flex; align-items:center; gap:6px; padding:6px 14px; text-decoration:none; color:var(--texte); font-size:14px; border-radius:9px; white-space:nowrap; }
.onglets a:hover { background:rgba(255,255,255,.55); text-decoration:none; }
.onglets a.actif { background:#fff; font-weight:600; box-shadow:0 1px 3px rgba(0,0,0,.12), 0 1px 1px rgba(0,0,0,.04); }
.onglets .separateur-onglets { width:1px; background:rgba(0,0,0,.12); margin:6px 4px; }
.onglets-tableau { margin-top:0; }
.vues { display:inline-flex; background:rgba(118,118,128,.12); border-radius:10px; padding:2px; }
.vues a { padding:5px 12px; text-decoration:none; color:var(--texte); font-size:13px; border-radius:8px; }
.vues a:hover { text-decoration:none; }
.vues a.actif { background:#fff; font-weight:600; box-shadow:0 1px 3px rgba(0,0,0,.12); }
.filtres-fil { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:12px; }
.filtres-fil a { font-size:13px; padding:5px 12px; border-radius:980px; text-decoration:none; color:var(--texte); background:rgba(0,0,0,.05); }
.filtres-fil a:hover { background:rgba(0,0,0,.09); text-decoration:none; }
.filtres-fil a.actif { background:var(--texte); color:#fff; }

/* ---------- en-têtes de page ---------- */
.entete-page { display:flex; flex-wrap:wrap; gap:12px; align-items:center; justify-content:space-between; margin-bottom:8px; }
.entete-page h1, .entete-page h2 { margin:0; }
.filtres { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.barre-outils { display:flex; flex-wrap:wrap; gap:10px; align-items:center; margin:0 0 14px; }
.en-ligne { display:inline-flex; flex-wrap:wrap; gap:6px; align-items:center; margin:0; }
form.en-ligne + form.en-ligne { margin-left:4px; }
.actions-ligne { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }

/* ---------- en-tête de la fiche chantier ---------- */
.entete-chantier { display:flex; flex-wrap:wrap; justify-content:space-between; gap:20px; background:var(--surface); border-radius:22px; padding:22px 24px; box-shadow:var(--ombre); }
.entete-chantier h1 { font-size:26px; margin-bottom:6px; }
.entete-chantier .client-ligne { display:flex; flex-wrap:wrap; align-items:center; gap:4px 14px; font-size:15px; }
.entete-chantier .client-ligne a, .entete-chantier .adresse-ligne a { display:inline-flex; align-items:center; gap:5px; color:var(--texte-2); }
.entete-chantier .client-ligne a:hover, .entete-chantier .adresse-ligne a:hover { color:var(--lien); text-decoration:none; }
.entete-chantier .adresse-ligne { margin-top:6px; font-size:14px; }
.entete-chantier .chiffres { display:flex; flex-direction:column; gap:6px; min-width:250px; background:var(--surface-2); border-radius:14px; padding:14px 16px; }
.entete-chantier .chiffres .montant-signe { font-size:22px; font-weight:700; letter-spacing:-.02em; }
.liens-camy { display:flex; flex-direction:column; gap:4px; font-size:13px; margin-top:6px; }
.liens-camy a { display:inline-flex; align-items:center; gap:5px; }

/* ---------- listes, tableaux ---------- */
.tableau { width:100%; border-collapse:separate; border-spacing:0; background:var(--surface); font-size:14px; border-radius:14px; overflow:hidden; box-shadow:var(--ombre); }
.tableau th, .tableau td { padding:10px 12px; border-bottom:1px solid rgba(0,0,0,.06); text-align:left; vertical-align:top; }
.tableau tr:last-child td { border-bottom:0; }
.tableau th { background:var(--surface-2); font-weight:500; font-size:12px; color:var(--texte-2); text-transform:uppercase; letter-spacing:.03em; }
.tableau tbody tr:hover td { background:#fafafc; }
.tableau tr.faite td, .tableau tr.faite a { color:var(--texte-3); }
.tableau tr.selection td { background:var(--accent-clair); }
.carte .tableau { box-shadow:none; border-radius:10px; }
.liste-simple { list-style:none; margin:0 0 8px; padding:0; }
.liste-simple li { padding:8px 0; border-bottom:1px solid rgba(0,0,0,.06); display:flex; flex-wrap:wrap; align-items:center; gap:6px; }
.liste-simple li:last-child { border-bottom:0; }
.arbre { list-style:none; margin:0 0 8px; padding:0; } .arbre ul { list-style:none; padding-left:20px; margin:2px 0 6px; } .arbre li { padding:3px 0; }
.arbre-nom { font-weight:600; display:inline-flex; align-items:center; gap:6px; }
.infos dl, .infos-dl { display:grid; grid-template-columns:max-content 1fr; gap:6px 18px; margin:0; }
.infos dt, .infos-dl dt { color:var(--texte-2); } .infos dd, .infos-dl dd { margin:0; overflow-wrap:anywhere; }
pre.notes { white-space:pre-wrap; background:var(--surface); border-radius:var(--rayon-moyen); padding:14px; font-family:inherit; box-shadow:var(--ombre); }
p.notes { background:var(--surface-2); border-radius:10px; padding:8px 10px; white-space:pre-wrap; }
.message-ok, .message-ko { display:flex; align-items:center; gap:8px; padding:10px 16px; border-radius:var(--rayon-moyen); margin:0 0 14px; font-size:14px; }
.message-ok { background:var(--vert-clair); color:var(--vert); } .message-ko { background:var(--rouge-clair); color:var(--rouge); }
.tags { display:flex; flex-wrap:wrap; gap:5px; margin:4px 0 8px; }
.tag { display:inline-flex; align-items:center; gap:3px; color:#fff; font-size:12px; font-weight:500; border-radius:980px; padding:3px 10px; }
.tag-x { display:inline-flex; background:rgba(255,255,255,.25); border:0; color:#fff; padding:1px; border-radius:50%; cursor:pointer; margin-left:3px; }
.tag-x .ic { width:11px; height:11px; }
.puce-couleur { display:inline-block; width:10px; height:10px; border-radius:50%; vertical-align:middle; }
.formulaire-grille { display:grid; grid-template-columns:repeat(auto-fill, minmax(190px, 1fr)); gap:10px 14px; align-items:end; margin:8px 0; }
.formulaire-grille label { display:flex; flex-direction:column; gap:4px; font-size:13px; color:var(--texte-2); }
.formulaire-grille label > input, .formulaire-grille label > select, .formulaire-grille label > textarea { width:100%; }
.formulaire-grille .pleine { grid-column:1 / -1; }
.form-invitation { display:flex; flex-wrap:wrap; gap:12px 16px; align-items:flex-end; background:var(--surface); border-radius:var(--rayon); padding:16px 18px; box-shadow:var(--ombre); }
.form-invitation label { display:flex; flex-direction:column; gap:4px; font-size:13px; color:var(--texte-2); } .form-invitation input { min-width:220px; }
.actions-espace { display:flex; gap:6px; flex-wrap:wrap; } .actions-espace form { margin:0; }
.nouvelle-tache summary { cursor:pointer; font-weight:600; color:var(--lien); list-style:none; display:inline-flex; align-items:center; gap:6px; }
.grille-nombres { display:grid; grid-template-columns:repeat(auto-fill, minmax(140px, 1fr)); gap:12px; margin-bottom:16px; }
.nombre { text-align:center; margin:0; } .nombre .chiffre { font-size:32px; font-weight:700; letter-spacing:-.02em; color:var(--texte); }

/* ---------- fil du chantier ---------- */
.fil { list-style:none; margin:0; padding:0; background:var(--surface); border-radius:var(--rayon); box-shadow:var(--ombre); }
.evt { display:flex; gap:12px; padding:12px 16px; border-bottom:1px solid rgba(0,0,0,.06); }
.evt:last-child { border-bottom:0; }
.evt-icone { display:inline-flex; align-items:center; justify-content:center; width:34px; height:34px; border-radius:50%; background:var(--accent-clair); color:var(--lien); flex:none; }
.evt-icone .ic { width:17px; height:17px; }
.evt-corps { flex:1; min-width:0; }
.evt-tete { font-size:12px; color:var(--texte-2); display:flex; gap:6px; flex-wrap:wrap; }
.evt-montant { margin-left:auto; font-variant-numeric:tabular-nums; color:var(--texte); font-weight:600; }
.evt-titre { font-weight:600; overflow-wrap:anywhere; }
.evt-texte { color:#424245; font-size:14px; white-space:pre-wrap; overflow-wrap:anywhere; max-height:7.5em; overflow:hidden; }
.saisie-note { display:flex; gap:8px; align-items:flex-start; margin-bottom:12px; } .saisie-note textarea { flex:1; }
.galerie { display:grid; grid-template-columns:repeat(auto-fill, minmax(150px, 1fr)); gap:10px; }
.galerie img { width:100%; height:120px; object-fit:cover; border-radius:12px; display:block; background:#e8e8ed; }

/* ---------- échanges client (bulles façon Messages) ---------- */
.fil-echange { list-style:none; padding:0; margin:0 0 14px; display:flex; flex-direction:column; gap:8px; }
.fil-echange li { max-width:78%; padding:10px 14px; border-radius:20px; }
.fil-echange .msg-client { align-self:flex-start; background:#e9e9eb; color:var(--texte); border-bottom-left-radius:6px; }
.fil-echange .msg-equipe { align-self:flex-end; background:#0a84ff; color:#fff; border-bottom-right-radius:6px; }
.fil-echange .msg-equipe .discret, .fil-echange .msg-equipe a { color:rgba(255,255,255,.88); }
.fil-echange a { display:inline-flex; align-items:center; gap:4px; margin:4px 10px 0 0; font-size:13px; }

/* ---------- cartes géographiques ---------- */
.carte-petite { height:200px; border-radius:14px; margin:8px 0; background:#e8e8ed; overflow:hidden; }
.carte-grande { height:400px; border-radius:var(--rayon); margin:8px 0 12px; background:#e8e8ed; box-shadow:var(--ombre); overflow:hidden; }
.leaflet-container { font-family:var(--police) !important; }
.leaflet-popup-content-wrapper { border-radius:14px !important; box-shadow:var(--ombre-forte) !important; }
.leaflet-bar { border:0 !important; box-shadow:var(--ombre) !important; border-radius:10px !important; overflow:hidden; }

/* ---------- tâches, Gantt ---------- */
.gantt { background:var(--surface); border-radius:var(--rayon); overflow-x:auto; font-size:13px; box-shadow:var(--ombre); }
.gantt-tete, .gantt-ligne { display:grid; grid-template-columns:260px minmax(500px, 1fr); min-width:780px; }
.gantt-projets .gantt-tete, .gantt-projets .gantt-ligne { grid-template-columns:280px minmax(500px, 1fr) 150px; min-width:950px; }
.gantt-tete { background:var(--surface-2); color:var(--texte-2); position:sticky; top:0; font-size:12px; }
.gantt-nom { padding:8px 10px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; border-right:1px solid rgba(0,0,0,.06); }
.gantt-heures { padding:8px 10px; border-left:1px solid rgba(0,0,0,.06); white-space:nowrap; }
.gantt-echelle, .gantt-piste { position:relative; min-height:34px; }
.gantt-echelle span { position:absolute; top:9px; font-size:11px; padding-left:4px; border-left:1px solid rgba(0,0,0,.08); height:100%; white-space:nowrap; }
.gantt-jour { position:absolute; top:0; bottom:0; width:2px; background:var(--rouge-vif); }
.gantt-ligne { border-top:1px solid rgba(0,0,0,.05); } .gantt-ligne:hover { background:#fafafc; }
.gantt-barre { position:absolute; top:8px; height:18px; border-radius:6px; overflow:hidden; background:var(--accent); }
.gantt-barre i { display:block; height:100%; background:rgba(255,255,255,.4); }
.gantt-barre.bloquee { background-image:repeating-linear-gradient(45deg, rgba(0,0,0,.22) 0 4px, transparent 4px 8px) !important; }
.gantt-barre.ouverte { border-right:2px dashed #fff; }
.gantt-barre.statut-ouvert { background:var(--accent); } .gantt-barre.statut-en_cours { background:var(--vert-vif); } .gantt-barre.statut-receptionne, .gantt-barre.statut-clos { background:#aeaeb2; }
.gantt-groupe { padding:8px 10px; background:var(--surface-2); font-weight:600; border-top:1px solid rgba(0,0,0,.06); min-width:780px; }
.grille-tache { display:grid; grid-template-columns:minmax(0, 2fr) minmax(260px, 1fr); gap:16px; align-items:start; }
.grille-tache .colonne .carte:last-child { margin-bottom:16px; }
.plan { position:relative; display:inline-block; max-width:100%; cursor:crosshair; }
.plan img { max-width:100%; display:block; border-radius:12px; }
.repere { position:absolute; width:18px; height:18px; margin:-9px 0 0 -9px; border-radius:50%; background:var(--rouge-vif); border:3px solid #fff; box-shadow:0 0 0 2px var(--rouge-vif); }

/* ---------- chat (façon Messages) ---------- */
.chat { display:grid; grid-template-columns:250px minmax(0, 1fr); gap:16px; align-items:start; }
.chat-liste, .docs-arbre { background:var(--surface); border-radius:var(--rayon); padding:10px; display:flex; flex-direction:column; gap:2px; box-shadow:var(--ombre); }
.chat-liste h3, .docs-arbre h3 { font-size:11px; font-weight:600; text-transform:uppercase; color:var(--texte-3); margin:12px 8px 4px; letter-spacing:.06em; }
.chat-liste > a, .docs-arbre > a { display:flex; align-items:center; gap:7px; padding:7px 10px; border-radius:10px; text-decoration:none; color:var(--texte);
    overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:14px; }
.chat-liste > a:hover, .docs-arbre > a:hover { background:rgba(0,0,0,.04); text-decoration:none; }
.chat-liste > a.actif, .docs-arbre > a.actif { background:var(--accent); color:#fff; font-weight:500; }
.chat-liste a.archivee { color:var(--texte-3); }
.chat-liste form { margin:4px 6px; } .chat-liste input { width:150px; }
.choix-membres { display:flex; flex-direction:column; gap:4px; margin:6px; font-size:13px; max-height:200px; overflow:auto; }
.chat-fil { background:var(--surface); border-radius:var(--rayon); padding:12px 14px; box-shadow:var(--ombre); }
.fil-chat { height:55vh; min-height:300px; overflow-y:auto; padding:4px 2px; }
.fil-chat .jour-chat { align-self:center; color:var(--texte-2); font-size:12px; background:var(--gris-clair); border-radius:980px; padding:3px 12px; max-width:none; }
.texte-chat { white-space:pre-wrap; overflow-wrap:anywhere; }
.image-chat { max-width:240px; max-height:200px; border-radius:14px; display:block; margin-top:4px; }
.saisie-chat { display:flex; flex-direction:column; gap:8px; border-top:1px solid rgba(0,0,0,.06); padding-top:10px; }
.saisie-chat label.actif { background:var(--accent-clair); }

/* ---------- documents ---------- */
.docs { display:grid; grid-template-columns:250px minmax(0, 1fr) auto; gap:16px; align-items:start; }
.docs-contenu { min-width:0; }
.docs-contenu .galerie { margin-bottom:12px; }
.docs-detail { width:360px; margin:0; }
.apercu { width:100%; max-height:300px; object-fit:contain; border-radius:12px; background:var(--gris-clair); border:0; }
iframe.apercu { height:300px; }

/* ---------- calendrier ---------- */
.calendrier-defile { overflow-x:auto; background:var(--surface); border-radius:var(--rayon); box-shadow:var(--ombre); }
.calendrier { border-collapse:collapse; width:100%; min-width:900px; font-size:13px; table-layout:fixed; }
.calendrier th, .calendrier td { border:1px solid rgba(0,0,0,.05); padding:5px; vertical-align:top; }
.calendrier th { background:var(--surface-2); color:var(--texte-2); font-weight:500; }
.calendrier th.ressource { background:#fff; color:var(--texte); font-weight:600; text-align:left; width:150px; }
.calendrier tr th:first-child { width:150px; }
.calendrier.serre { min-width:1600px; }
.calendrier .aujourdhui { background:#f2f7fe; } .calendrier th.aujourdhui { color:var(--lien); font-weight:700; }
.calendrier .weekend { background:#fafafa; }
.evt-cal { display:block; border-left:3px solid var(--accent); background:var(--accent-clair); border-radius:6px; padding:4px 6px; margin-bottom:3px; text-decoration:none; color:var(--texte);
    overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.evt-cal:hover { text-decoration:none; filter:brightness(.97); }
.evt-cal small { display:block; color:var(--texte-2); overflow:hidden; text-overflow:ellipsis; }
.evt-cal.faite { opacity:.55; text-decoration:line-through; }
.heures-cal { display:inline-flex; align-items:center; gap:3px; font-size:12px; color:var(--vert); }

/* ---------- anciennes cartes de chantier (encore utilisées ailleurs) ---------- */
.grille-chantiers { display:grid; grid-template-columns:repeat(auto-fill, minmax(260px, 1fr)); gap:14px; }
.carte-chantier { display:flex; flex-direction:column; gap:4px; background:var(--surface); border-radius:var(--rayon); padding:14px 16px; color:inherit; text-decoration:none; box-shadow:var(--ombre); }
.carte-chantier:hover { box-shadow:var(--ombre-forte); text-decoration:none; }
.carte-haut { display:flex; justify-content:space-between; align-items:center; }

/* ---------- écrans étroits ---------- */
@media (max-width:1100px) { .docs { grid-template-columns:210px minmax(0, 1fr); } .docs-detail { grid-column:1 / -1; width:auto; } }
@media (max-width:800px) { .grille-tache, .chat, .docs { grid-template-columns:1fr; } .docs-detail { width:auto; } .fil-chat { height:50vh; } }
@media (max-width:640px) {
    main { padding:18px 14px 40px; }
    header.barre-app { padding:8px 14px; gap:10px; }
    h1 { font-size:24px; }
    .tableau { font-size:13px; display:block; overflow-x:auto; }
    .saisie-note { flex-direction:column; } .saisie-note textarea { width:100%; }
    .grille-info { grid-template-columns:1fr; }
    .carte-grande { height:280px; }
    .onglets { width:100%; overflow-x:auto; flex-wrap:nowrap; }
    .entete-chantier { padding:18px; }
}
@media print { header.barre-app { display:none; } body { background:#fff; } .carte, .tableau { box-shadow:none; } }

/* ---------- en-tête de la fiche chantier : six onglets, famille, barre d'argent (07/11/2026) ---------- */
.ligne-famille { display:flex; flex-wrap:wrap; align-items:center; gap:6px; font-size:12px; font-weight:600; letter-spacing:.03em; text-transform:uppercase; color:var(--c); margin-bottom:6px; }
.rond-famille { display:inline-flex; align-items:center; justify-content:center; width:22px; height:22px; border-radius:7px; background:var(--c); color:#fff; }
.fiche-entete { font-family:"SF Mono", Consolas, monospace; text-transform:none; letter-spacing:0; font-size:12px; color:var(--c); background:color-mix(in srgb, var(--c) 12%, #fff); border-radius:6px; padding:2px 7px; }
.entete-chantier .client-ligne strong { color:var(--texte); }
.chiffres-haut { display:flex; justify-content:space-between; align-items:center; }
.barre-argent { position:relative; height:8px; background:rgba(0,0,0,.07); border-radius:4px; overflow:hidden; margin:4px 0 2px; }
.barre-argent span { position:absolute; left:0; top:0; bottom:0; border-radius:4px; }
.barre-argent .facture { background:#a8d8b9; } .barre-argent .encaisse { background:var(--vert-vif); }
.legende-argent { display:flex; flex-wrap:wrap; gap:2px 12px; font-size:12px; color:var(--texte-2); }
.legende-argent i { display:inline-block; width:8px; height:8px; border-radius:2px; margin-right:4px; vertical-align:0; }
.puce-facture { background:#a8d8b9; } .puce-encaisse { background:var(--vert-vif); }
.onglets .compte, .vues .compte { font-size:11px; font-weight:600; color:var(--texte-2); background:rgba(0,0,0,.06); border-radius:980px; padding:0 6px; min-width:18px; text-align:center; }
.onglets .compte:empty, .vues .compte:empty { display:none; }
.onglets .compte.alerte, .vues .compte.alerte { background:var(--rouge-vif); color:#fff; }
.sous-onglets { margin:-6px 0 16px; }

/* ---------- bloc « À surveiller » (07/11/2026) ---------- */
.a-surveiller { margin:6px 0 18px; }
.a-surveiller > h2 { margin:8px 0 12px; font-size:20px; } .a-surveiller > h2 .discret { font-weight:400; font-size:14px; }
.grille-surveiller { display:grid; grid-template-columns:repeat(auto-fill, minmax(260px, 1fr)); gap:14px; }
.carte-surveiller { background:var(--surface); border-radius:var(--rayon); padding:14px 16px; box-shadow:var(--ombre); display:flex; flex-direction:column; }
.tete-surveiller { display:flex; align-items:flex-start; gap:10px; }
.tete-surveiller b { display:block; font-size:15px; } .tete-surveiller small { display:block; color:var(--texte-2); font-size:12px; line-height:1.35; }
.rond-surveiller { display:inline-flex; align-items:center; justify-content:center; width:34px; height:34px; border-radius:10px; background:color-mix(in srgb, var(--c) 12%, #fff); color:var(--c); flex:none; }
.nb-surveiller { margin-left:auto; font-size:20px; font-weight:700; color:var(--c); font-variant-numeric:tabular-nums; } .nb-surveiller.zero { color:var(--texte-3); }
.total-surveiller { font-size:13px; font-weight:600; color:var(--texte-2); margin:8px 0 4px; font-variant-numeric:tabular-nums; }
.lignes-surveiller { list-style:none; margin:0; padding:0; }
.lignes-surveiller li a { display:flex; justify-content:space-between; gap:8px; padding:7px 8px; margin:0 -8px; border-radius:10px; color:var(--texte); text-decoration:none; font-size:13px; }
.lignes-surveiller li a:hover { background:rgba(0,0,0,.04); text-decoration:none; }
.lignes-surveiller b { display:block; font-weight:500; } .lignes-surveiller small { display:block; color:var(--texte-2); font-size:12px; }
.lignes-surveiller .montant { white-space:nowrap; color:var(--c); }
.carte-surveiller details summary { cursor:pointer; color:var(--lien); font-size:13px; margin-top:4px; }
