/* Zespot : compléments au style commun des Zoutils (style.css, repris de Zely et Zedjo) */
.main { max-width: none; min-width: 0; }
.table-wrap { max-width: 100%; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.btn.danger-fill { background: var(--danger); border-color: var(--danger); color: #fff; }
.alerte { border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); background: color-mix(in srgb, var(--warn) 10%, var(--surface)); padding: 10px 12px; border-radius: 8px; margin-bottom: 14px; font-size: 13px; }
.info { border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent); background: var(--brand-soft); padding: 10px 12px; border-radius: 8px; margin-bottom: 14px; font-size: 13px; }
.badge.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.spin { display: inline-block; width: 10px; height: 10px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: tourne .8s linear infinite; margin-right: 6px; vertical-align: -1px; }
@keyframes tourne { to { transform: rotate(360deg); } }
.nav .titre-groupe { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 14px 12px 4px; }
.nav a .compteur { margin-left: auto; font-size: 11px; background: var(--danger); color: #fff; border-radius: 99px; padding: 0 6px; font-weight: 700; }
.side select { margin-bottom: 10px; }

/* Barre du haut */
.topbar { display: flex; gap: 10px; align-items: center; margin-bottom: 18px; }
.recherche-globale { position: relative; flex: 1; max-width: 520px; }
.recherche-globale input { padding-left: 34px; border-radius: 999px; }
.recherche-globale::before { content: "🔍"; position: absolute; left: 12px; top: 9px; font-size: 13px; opacity: .6; }
.suggestions { position: absolute; top: 42px; left: 0; right: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.12); z-index: 60; max-height: 420px; overflow: auto; }
.suggestions a { display: flex; gap: 10px; padding: 9px 12px; color: var(--text); align-items: center; }
.suggestions a:hover, .suggestions a.sel { background: var(--bg); text-decoration: none; }

/* Tableaux de fiches */
.barre-outils { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.barre-outils input[type=text] { width: 260px; }
.barre-outils select { width: auto; }
.table td.case, .table th.case { width: 34px; padding-right: 0; }
.table td .sous { color: var(--muted); font-size: 12px; }
.table th.tri { cursor: pointer; user-select: none; }
.table th.tri:hover { color: var(--text); }
.pagination { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 10px; }
.selection-barre { display: flex; gap: 8px; align-items: center; padding: 8px 12px; background: var(--brand-soft); border-radius: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-size: 12px; font-weight: 700; flex: none; background: var(--c, var(--brand)); }
.avatar.gros { width: 52px; height: 52px; font-size: 20px; }
.avatar.carre { border-radius: 10px; }
.nom-cell { display: flex; gap: 10px; align-items: center; }
.vues { display: flex; gap: 4px; overflow-x: auto; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.vues a { padding: 8px 12px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.vues a.active { color: var(--text); border-color: var(--brand); }
.vues a:hover { text-decoration: none; color: var(--text); }

/* Filtres */
.filtres .groupe { border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin-bottom: 8px; background: var(--bg); }
.filtres .cond { display: grid; grid-template-columns: minmax(140px, 1.2fr) minmax(120px, 1fr) minmax(120px, 1.2fr) auto; gap: 6px; margin-bottom: 6px; align-items: center; }
.filtres .ou { text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); margin: 6px 0; }
@media (max-width: 720px) { .filtres .cond { grid-template-columns: 1fr; } }

/* Kanban */
.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.colonne { flex: 0 0 270px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; display: flex; flex-direction: column; max-height: calc(100vh - 220px); }
.colonne.survol { outline: 2px dashed var(--brand); }
.colonne .tete { padding: 10px 12px; border-bottom: 1px solid var(--line); }
.colonne .tete b { display: block; }
.colonne .cartes-k { padding: 8px; overflow-y: auto; flex: 1; min-height: 60px; }
.carte-k { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin-bottom: 8px; cursor: grab; box-shadow: var(--shadow); }
.carte-k:hover { border-color: var(--brand); }
.carte-k.glisse { opacity: .4; }
.colonne.gagne .tete { border-top: 3px solid var(--ok); border-radius: 10px 10px 0 0; }
.colonne.perdu .tete { border-top: 3px solid var(--danger); border-radius: 10px 10px 0 0; }

/* Fiche */
.fiche { display: grid; grid-template-columns: 300px minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
@media (max-width: 1250px) { .fiche { grid-template-columns: 280px minmax(0, 1fr); } .fiche .col-droite { grid-column: 1 / -1; } }
@media (max-width: 860px) { .fiche { grid-template-columns: 1fr; } }
.fiche .col-gauche, .fiche .col-droite { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; }
@media (max-width: 1250px) { .fiche .col-gauche, .fiche .col-droite { position: static; max-height: none; } }
.entete-fiche { text-align: center; padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.entete-fiche h2 { margin: 8px 0 2px; font-size: 19px; }
.actions-rapides { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.actions-rapides button { display: flex; flex-direction: column; align-items: center; gap: 2px; border: 0; background: none; cursor: pointer; color: var(--muted); font: inherit; font-size: 11px; font-weight: 600; }
.actions-rapides button span { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; font-size: 15px; background: var(--surface); }
.actions-rapides button:hover span { border-color: var(--brand); background: var(--brand-soft); }
.prop { padding: 6px 4px; border-radius: 6px; cursor: pointer; }
.prop:hover { background: var(--bg); }
.prop .l { font-size: 12px; color: var(--muted); font-weight: 600; }
.prop .v { min-height: 20px; word-break: break-word; }
.prop .v.vide { color: var(--muted); }
.prop.edition { background: var(--bg); cursor: default; }
.prop-groupe { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin: 16px 4px 4px; }
.assoc-bloc { margin-bottom: 14px; }
.assoc-bloc h3 { display: flex; justify-content: space-between; align-items: center; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.assoc { display: flex; gap: 10px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; background: var(--surface); }
.assoc .grow { min-width: 0; }
.assoc .grow a { font-weight: 600; }
.assoc .x { visibility: hidden; }
.assoc:hover .x { visibility: visible; }
.etapes-barre { display: flex; gap: 2px; margin: 10px 0; }
.etapes-barre button { flex: 1; border: 0; padding: 7px 4px; font: inherit; font-size: 11px; font-weight: 600; background: var(--bg); color: var(--muted); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.etapes-barre button:first-child { border-radius: 6px 0 0 6px; }
.etapes-barre button:last-child { border-radius: 0 6px 6px 0; }
.etapes-barre button.passee { background: color-mix(in srgb, var(--brand) 25%, var(--surface)); color: var(--text); }
.etapes-barre button.courante { background: var(--brand); color: #fff; }
.etapes-barre button.gagne.courante { background: var(--ok); }
.etapes-barre button.perdu.courante { background: var(--danger); }

/* Timeline */
.timeline { position: relative; }
.evt { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; margin-bottom: 10px; }
.evt .ico { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); font-size: 15px; }
.evt .corps { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; min-width: 0; }
.evt .corps.mini { background: transparent; border: 0; padding: 7px 0; color: var(--muted); font-size: 13px; }
.evt .entete { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.evt .texte { white-space: pre-wrap; margin-top: 6px; word-break: break-word; max-height: 220px; overflow: hidden; position: relative; }
.evt .texte.ouvert { max-height: none; }
.evt .epingle { border-color: var(--brand); }
.evt .pied { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; align-items: center; }
.mois { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 18px 0 10px 44px; }
iframe.email-html { width: 100%; min-height: 300px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; background: var(--bg); border: 1px solid var(--line); font-size: 12px; }
.chip button { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 0; }

/* Composer */
.composer .ligne { display: grid; grid-template-columns: 70px 1fr; gap: 8px; align-items: center; margin-bottom: 8px; }
.composer .ligne label { margin: 0; color: var(--muted); }
.composer textarea { min-height: 260px; font-family: inherit; }
.variables { display: flex; gap: 4px; flex-wrap: wrap; margin: 6px 0; }
.variables button { font-size: 11px; padding: 2px 8px; }

/* Listes génériques */
.liste-cartes { display: grid; gap: 10px; }
.ligne-carte { display: flex; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.ligne-carte.click { cursor: pointer; }
.ligne-carte.click:hover { border-color: var(--brand); }
.ligne-carte .grow { min-width: 0; }
.stats-mini { display: flex; gap: 18px; text-align: center; }
.stats-mini b { display: block; font-size: 18px; }
.stats-mini span { font-size: 11px; color: var(--muted); text-transform: uppercase; font-weight: 600; }
@media (max-width: 720px) { .ligne-carte { flex-wrap: wrap; } }

/* Étapes (séquences, automatisations) */
.etape { border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin-bottom: 4px; background: var(--surface); position: relative; }
.etape .num { position: absolute; left: -12px; top: 12px; width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.fleche { text-align: center; color: var(--muted); font-size: 12px; padding: 4px 0; }
.declencheur { border: 2px solid var(--brand); background: var(--brand-soft); }

/* Graphiques */
.graph-barres { display: grid; gap: 8px; }
.graph-barres .l { display: grid; grid-template-columns: 140px 1fr 90px; gap: 10px; align-items: center; font-size: 13px; }
.graph-barres .l .bar { height: 12px; }
.colonnes-graph { display: flex; gap: 6px; align-items: flex-end; height: 160px; padding-top: 10px; }
.colonnes-graph .c { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; min-width: 0; }
.colonnes-graph .c i { display: block; width: 100%; max-width: 46px; background: var(--brand); border-radius: 4px 4px 0 0; min-height: 2px; }
.colonnes-graph .c i.p { background: color-mix(in srgb, var(--brand) 35%, transparent); }
.colonnes-graph .c span { font-size: 11px; color: var(--muted); white-space: nowrap; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 1000px) { .grid3 { grid-template-columns: 1fr; } }
.kpi .d { font-size: 12px; color: var(--muted); }
.entonnoir .e { margin: 0 auto 4px; background: var(--brand); color: #fff; padding: 6px 10px; border-radius: 6px; text-align: center; font-weight: 600; font-size: 13px; min-width: 120px; }

/* Tâches */
.tache { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--surface); }
.tache:first-child { border-radius: 8px 8px 0 0; }
.tache input[type=checkbox] { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--ok); }
.tache.faite .titre { text-decoration: line-through; color: var(--muted); }
.tache .retard { color: var(--danger); font-weight: 600; }
.liste-taches { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }

/* Devis */
.lignes-devis { min-width: 860px; }
.lignes-devis td input { padding: 6px 8px; min-width: 64px; }
.lignes-devis td { vertical-align: middle; }
.code-bloc { font-family: ui-monospace, Consolas, monospace; font-size: 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px; white-space: pre-wrap; word-break: break-all; }
.apercu-email { border: 1px solid var(--line); border-radius: 8px; width: 100%; height: 560px; background: #fff; }
.editeur-campagne { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 1100px) { .editeur-campagne { grid-template-columns: 1fr; } }
.editeur-campagne textarea { min-height: 420px; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
