/* crm.batmax.fr — pipeline commercial. Polices système (la politique de sécurité du site n'admet aucune police externe). */
:root {
  color-scheme: light;
  --bg: #f3f5f7;
  --surface: #ffffff;
  --surface-2: #e9edf1;
  --line: #d5dce3;
  --fg: #18222d;
  --muted: #5d6b79;
  --accent: #0b7a75;
  --accent-fg: #ffffff;
  --accent-soft: #d8efed;
  --ia: #3a4fa3;
  --ia-soft: #e1e6f6;
  --warn: #8f4a07;
  --warn-soft: #fbead4;
  --bad: #b3261e;
  --bad-soft: #fbe0de;
  --good: #1d7a3d;
  --good-soft: #dcf1e2;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --grid: #e3e8ed;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #12181f; --surface: #1b232c; --surface-2: #232d38; --line: #2f3b48;
    --fg: #e6ecf2; --muted: #93a2b1; --accent: #4cc2bb; --accent-fg: #08201f; --accent-soft: #14423f;
    --ia: #9fb0ee; --ia-soft: #262f55; --warn: #f0b36b; --warn-soft: #43301a;
    --bad: #f19a93; --bad-soft: #4a2220; --good: #7fd49a; --good-soft: #17381f;
    --series-1: #3987e5; --series-2: #d95926; --grid: #2a3541;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); font: 14px/1.45 var(--font); -webkit-text-size-adjust: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr { position: absolute; left: -9999px; }

/* Connexion */
.connexion { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.connexion .boite { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 24px; width: min(380px, 100%); display: flex; flex-direction: column; gap: 14px; }
.connexion h1 { font-size: 20px; margin: 0; }
.connexion p { margin: 0; color: var(--muted); }
.champ { display: flex; flex-direction: column; gap: 4px; }
.champ label { font-size: 13px; color: var(--muted); }
.champ input, .champ select, .champ textarea { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 9px 10px; width: 100%; min-width: 0; }
.msg { font-size: 13px; min-height: 1.3em; }
.msg.err { color: var(--bad); }
.msg.ok { color: var(--good); }
.btn { background: var(--accent); color: var(--accent-fg); border: 0; border-radius: 6px; padding: 9px 16px; font-weight: 600; }
.btn.second { background: var(--surface-2); color: var(--fg); font-weight: 500; }
.btn.petit { padding: 5px 10px; font-size: 13px; }
.btn[disabled] { opacity: .55; cursor: default; }

/* Entête */
.page { max-width: 1700px; margin: 0 auto; padding: 0 16px 28px; }
.entete { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 12px 0 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.entete h1 { font-size: 18px; margin: 0; flex: 0 0 auto; }
.onglets { display: flex; gap: 2px; background: var(--surface-2); padding: 3px; border-radius: 8px; overflow-x: auto; max-width: 100%; }
.onglets button { border: 0; background: transparent; padding: 6px 12px; border-radius: 6px; color: var(--muted); font-weight: 500; white-space: nowrap; }
.onglets button[aria-selected="true"] { background: var(--surface); color: var(--fg); box-shadow: 0 1px 2px rgba(0,0,0,.14); }
.onglets .n { font-family: var(--mono); font-size: 12px; margin-left: 5px; color: var(--bad); }
.outils { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.outils input[type="search"] { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px; width: 180px; max-width: 100%; }
.compte { color: var(--muted); font-size: 13px; }
.compte button { border: 0; background: none; color: var(--muted); text-decoration: underline; padding: 0 0 0 6px; font-size: 13px; }
.resume { display: flex; flex-wrap: wrap; gap: 4px 24px; color: var(--muted); font-size: 13px; padding-bottom: 10px; }
.resume b { color: var(--fg); font-family: var(--mono); font-weight: 500; }
.bandeau { background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn); border-radius: 6px; padding: 8px 12px; margin-bottom: 10px; font-size: 13px; }

/* Pipeline */
.tableau-colonnes { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: 10px; overflow-x: auto; align-items: start; padding-bottom: 6px; scroll-snap-type: x proximity; }
.col { background: var(--surface-2); border-radius: 8px; padding: 8px; display: flex; flex-direction: column; gap: 8px; min-width: 0; max-height: calc(100dvh - 190px); scroll-snap-align: start; }
.col.sur { outline: 2px dashed var(--accent); outline-offset: -2px; }
.col h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; margin: 2px 4px 0; display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-weight: 600; }
.col h2 .n { color: var(--fg); font-family: var(--mono); }
.col .total { font-family: var(--mono); font-size: 12px; color: var(--muted); margin: -4px 4px 0; min-height: 1.2em; }
.col .liste { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; min-height: 60px; padding-right: 2px; }
.col .vide { color: var(--muted); font-size: 13px; padding: 6px 4px; }
.carte-d { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 9px 10px; display: flex; flex-direction: column; gap: 6px; text-align: left; width: 100%; min-width: 0; cursor: pointer; }
.carte-d:hover { border-color: var(--accent); }
.carte-d.glisse { opacity: .45; }
.carte-d.a-traiter { border-left: 3px solid var(--accent); }
.carte-d .client { font-weight: 600; overflow-wrap: anywhere; }
.carte-d .objet { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rang { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.montant { font-family: var(--mono); font-weight: 500; }
.prochaine { font-size: 12px; display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.pastille { font-family: var(--mono); padding: 1px 6px; border-radius: 4px; background: var(--surface-2); font-size: 12px; }
.pastille.retard { background: var(--bad-soft); color: var(--bad); }
.pastille.bientot { background: var(--warn-soft); color: var(--warn); }
.etiquettes { display: flex; gap: 4px; flex-wrap: wrap; }
.etiq { font-size: 11px; padding: 1px 6px; border-radius: 4px; border: 1px solid var(--line); color: var(--muted); font-family: var(--mono); text-decoration: none; }
a.etiq:hover { border-color: var(--accent); color: var(--fg); }
.etiq.rep { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); font-family: var(--font); font-weight: 600; }
.etiq.mauvais { background: var(--bad-soft); color: var(--bad); border-color: var(--bad); font-family: var(--font); }
.etiq.ia { background: var(--ia-soft); color: var(--ia); border-color: var(--ia); font-family: var(--font); font-weight: 600; }
.etiq.ok { color: var(--good); border-color: var(--good); font-family: var(--font); }
.discret { color: var(--muted); font-size: 12px; }

/* Grille */
.boite-tableau { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
table { border-collapse: collapse; width: 100%; }
.boite-tableau table { min-width: 900px; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface-2); font-weight: 600; white-space: nowrap; }
th button { border: 0; background: none; font: inherit; text-transform: inherit; letter-spacing: inherit; color: inherit; padding: 0; }
tbody tr { cursor: pointer; }
tbody tr:hover td { background: var(--surface-2); }
td.num, th.num { text-align: right; font-family: var(--mono); }

/* Recoupements */
.groupes { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.groupe { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.groupe h3 { margin: 0; font-size: 14px; display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.groupe h3 .gros { font-family: var(--mono); font-size: 22px; }
.groupe h3 .gros.mauvais { color: var(--bad); }
.groupe h3 .gros.bon { color: var(--good); }
.groupe p { margin: 0; color: var(--muted); font-size: 13px; }
.groupe ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; max-height: 280px; overflow-y: auto; }
.groupe li button { border: 0; background: var(--surface-2); border-radius: 4px; padding: 6px 8px; width: 100%; text-align: left; overflow-wrap: anywhere; }

/* Tiroir */
.voile { position: fixed; inset: 0; background: rgba(10, 16, 22, .45); z-index: 20; }
.tiroir { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100%); background: var(--surface); border-left: 1px solid var(--line); z-index: 21; overflow-y: auto; padding: 16px 18px calc(28px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 16px; }
.tiroir .haut { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.tiroir .titre { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.tiroir .titre input { background: transparent; border: 1px solid transparent; border-radius: 6px; padding: 4px 6px; width: 100%; min-width: 0; }
.tiroir .titre input:hover, .tiroir .titre input:focus { border-color: var(--line); background: var(--bg); }
.tiroir .titre .t1 { font-size: 18px; font-weight: 600; }
.tiroir .titre .t2 { color: var(--muted); font-size: 13px; }
.tiroir h3 { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.champs { display: grid; grid-template-columns: 130px 1fr; gap: 8px 12px; align-items: center; }
.champs label { color: var(--muted); font-size: 13px; }
.champs input, .champs select { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 7px 8px; width: 100%; min-width: 0; }
.duo { display: flex; gap: 6px; }
.duo > * { min-width: 0; }
.alerte { border-radius: 6px; padding: 9px 11px; font-size: 13px; display: flex; flex-direction: column; gap: 8px; }
.alerte.ia { background: var(--ia-soft); color: var(--ia); }
.alerte.rep { background: var(--accent-soft); color: var(--accent); }
.alerte .boutons { display: flex; gap: 6px; flex-wrap: wrap; }
.liste-tickets, .liste-devis { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.liste-tickets li, .liste-devis li { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 10px; align-items: baseline; background: var(--bg); border-radius: 6px; padding: 7px 9px; }
.liste-tickets .sous, .liste-devis .sous { grid-column: 2 / 4; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.ajout-ticket { display: flex; gap: 6px; }
.ajout-ticket input { flex: 1; min-width: 0; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; }
.note-saisie { display: flex; flex-direction: column; gap: 6px; }
.note-saisie textarea { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; min-height: 64px; resize: vertical; }
.journal { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.journal li { display: grid; grid-template-columns: 92px 1fr; gap: 3px 10px; font-size: 13px; }
.journal .dt { font-family: var(--mono); color: var(--muted); font-size: 12px; }
.journal .qui { font-weight: 600; font-size: 12px; margin-right: 6px; }
.journal .qui.ia { color: var(--ia); }
.journal .ref { color: var(--muted); font-size: 12px; margin-left: 4px; }

/* Tableau de bord */
.tuiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-bottom: 14px; }
.tuile { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tuile .lib { color: var(--muted); font-size: 13px; }
.tuile .val { font-size: 28px; font-weight: 600; line-height: 1.15; }
.tuile .sub { color: var(--muted); font-size: 13px; }
.graphiques { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 12px; }
.carte-g { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.carte-g header { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.carte-g h3 { margin: 0; font-size: 14px; }
.carte-g .sous { margin: 0; color: var(--muted); font-size: 13px; }
.lien { border: 0; background: none; color: var(--muted); text-decoration: underline; font-size: 12px; padding: 0; white-space: nowrap; }
.entonnoir { display: flex; flex-direction: column; gap: 10px; }
.ligne-e { display: grid; grid-template-columns: 8.5rem 1fr; gap: 10px; align-items: center; }
.ligne-e .lib { font-size: 13px; }
.ligne-e .piste { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ligne-e .barre { height: 20px; background: var(--series-1); border-radius: 0 4px 4px 0; min-width: 2px; flex: 0 0 auto; }
.ligne-e .barre.zero { background: transparent; border-left: 2px solid var(--grid); border-radius: 0; min-width: 0; height: 20px; }
.ligne-e .nb { font-weight: 600; font-variant-numeric: tabular-nums; }
.ligne-e .part { color: var(--muted); font-size: 12px; white-space: nowrap; }
.ligne-e:hover .barre { filter: brightness(1.12); }
svg.col-chart { width: 100%; height: auto; display: block; overflow: visible; }
svg.col-chart text { fill: var(--muted); font-size: 10px; font-family: var(--font); }
svg.col-chart text.val { fill: var(--fg); font-size: 11px; font-weight: 600; }
svg.col-chart .grille { stroke: var(--grid); stroke-width: 1; }
svg.col-chart .rect:hover { filter: brightness(1.12); }
.table-vue { overflow-x: auto; }
.table-vue table { font-size: 13px; }
.bulle { position: fixed; z-index: 40; pointer-events: none; background: var(--fg); color: var(--bg); border-radius: 6px; padding: 7px 10px; font-size: 12px; max-width: 260px; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.bulle .v { font-size: 14px; font-weight: 600; }
.bulle .cle { display: inline-block; width: 12px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }

@media (max-width: 640px) {
  .onglets button { padding: 6px 8px; font-size: 13px; }
  .tableau-colonnes { grid-auto-columns: 84%; }
  .col { max-height: none; }
  .col .liste { max-height: 62dvh; }
  .outils { margin-left: 0; width: 100%; }
  .outils input[type="search"] { flex: 1; width: auto; }
  .champs { grid-template-columns: 1fr; gap: 2px; }
  .champs label { margin-top: 6px; }
  .tiroir { padding-inline: 14px; }
  .ligne-e { grid-template-columns: 6.5rem 1fr; }
  .graphiques { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* Séries des graphiques (validées en clair et en sombre) */
.s1 { fill: var(--series-1); }
.s2 { fill: var(--series-2); }
/* Application installée sur l'écran d'accueil de l'iPhone : on laisse la place à l'encoche */
.entete { padding-top: calc(12px + env(safe-area-inset-top, 0px)); }
.tiroir { padding-top: calc(16px + env(safe-area-inset-top, 0px)); }

/* ===================== Version 2 : clients, tâches, planning ===================== */
.onglets .n.calme { color: var(--muted); }
.onglets.mini { align-self: flex-start; }
.onglets.mini button { padding: 4px 10px; font-size: 13px; }
.pile { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.boutons { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn.danger { color: var(--bad); }
.alerte.mauvais { background: var(--bad-soft); color: var(--bad); }
.barre-vue { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 12px; }
.titre-vue { font-size: 18px; margin: 0; display: flex; gap: 8px; align-items: baseline; }
.titre-vue .n { font-family: var(--mono); font-size: 13px; color: var(--muted); font-weight: 400; }
.barre-vue select, .barre-vue input[type="text"] { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; }
.lien-client { font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--line); }
.lien-client:hover { border-bottom-color: var(--accent); }
.etiq.type { font-family: var(--font); }
.etiq.type.auto { color: var(--warn); border-color: var(--warn); background: var(--warn-soft); }
.etiq.pole, .etiq.etape { font-family: var(--font); }
.etiq.etape { background: var(--surface-2); color: var(--fg); }
.rang .etiq { flex: 0 0 auto; }
.tiroir .titre .lien-titre { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 4px 6px; }
.pied { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 12px; }
.changer-client select { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; max-width: 100%; }

/* Fiche client */
.nom-client { font-size: 20px; font-weight: 600; background: transparent; border: 1px solid transparent; border-radius: 6px; padding: 4px 8px; min-width: 200px; flex: 1 1 260px; }
.nom-client:hover, .nom-client:focus { border-color: var(--line); background: var(--surface); }
.grille-fiche { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.colonne { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.bloc { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.bloc h3 { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.bloc.plus summary { cursor: pointer; color: var(--muted); }
.bloc .champs { grid-template-columns: 150px 1fr; }
.bloc .champs input, .bloc .champs select { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 7px 8px; width: 100%; min-width: 0; }
.interlocuteur { border-left: 2px solid var(--line); padding: 4px 0 4px 10px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.interlocuteur.sous { border-left-color: var(--accent); }
.interlocuteur.edition { border-left-color: var(--accent); background: var(--bg); border-radius: 0 6px 6px 0; padding: 8px 10px; }
.i-tete { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.i-actions { margin-left: auto; display: flex; gap: 10px; }
.i-contact { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; overflow-wrap: anywhere; }
.i-contact a { color: var(--accent); }
.form-interlocuteur { display: flex; flex-direction: column; gap: 10px; }
.form-interlocuteur input[type="checkbox"] { width: auto; }
.dossier-ligne { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 9px 10px; display: flex; flex-direction: column; gap: 5px; cursor: pointer; min-width: 0; }
.dossier-ligne:hover { border-color: var(--accent); }
.dossier-ligne.archive { opacity: .6; }
.tableau-defile { overflow-x: auto; }
.tab-ca { font-size: 13px; min-width: 460px; }
.tab-ca th, .tab-ca td { padding: 6px 8px; }
.tab-ca tfoot td { font-weight: 600; border-top: 2px solid var(--line); border-bottom: 0; }
.tab-ca tr.inactif td { color: var(--muted); }
.tab-ca td.num { font-family: var(--mono); white-space: nowrap; }
.saisie-montant { width: 88px; text-align: right; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; font-family: var(--mono); }
.jauge { height: 5px; background: var(--surface-2); border-radius: 3px; margin-top: 4px; overflow: hidden; }
.jauge span { display: block; height: 100%; background: var(--series-1); border-radius: 0 3px 3px 0; }
.depot-docs { border: 1px dashed var(--line); border-radius: 6px; padding: 10px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.depot-docs.sur { border-color: var(--accent); background: var(--accent-soft); }
.depot-docs.occupe { opacity: .55; }
.depot-docs label.btn { cursor: pointer; }
.liste-docs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.liste-docs li { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; background: var(--bg); border-radius: 6px; padding: 7px 9px; }
.liste-docs li a { overflow-wrap: anywhere; color: var(--accent); }
.liste-docs li .discret { grid-column: 1; }
.liste-docs li .lien { grid-row: 1 / span 2; grid-column: 2; align-self: center; }
.journal .ref.lien { margin-left: 6px; font-size: 12px; }

/* Tâches */
.tache { display: flex; gap: 10px; align-items: flex-start; padding: 7px 4px; border-bottom: 1px solid var(--line); min-width: 0; }
.tache:last-child { border-bottom: 0; }
.coche { flex: 0 0 22px; width: 22px; height: 22px; border: 2px solid var(--muted); border-radius: 50%; background: transparent; color: var(--accent-fg); font-size: 13px; line-height: 1; padding: 0; margin-top: 1px; }
.coche[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); }
.tache.retard .coche { border-color: var(--bad); }
.tache-corps { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.tache-titre { border: 0; background: none; text-align: left; padding: 0; font-weight: 500; overflow-wrap: anywhere; }
.tache.fait .tache-titre { text-decoration: line-through; color: var(--muted); }
.tache-meta { display: flex; gap: 6px 10px; flex-wrap: wrap; align-items: center; font-size: 12px; }
.tache-meta .lien { max-width: 100%; text-align: left; overflow-wrap: anywhere; }
.ajout-tache { display: flex; flex-direction: column; gap: 6px; }
.ajout-ligne { display: flex; gap: 6px; flex-wrap: wrap; }
.ajout-ligne input[type="text"], .ajout-ligne input:not([type]) { flex: 1 1 220px; min-width: 0; }
.ajout-tache input, .ajout-tache select { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; min-width: 0; }
.options-tache { display: flex; gap: 6px; flex-wrap: wrap; }
.faites summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.afaire { display: flex; flex-direction: column; gap: 14px; max-width: 860px; }
.groupe-taches { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px 6px; }
.groupe-taches h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 4px 0 4px; display: flex; gap: 8px; }
.groupe-taches.retard h2 { color: var(--bad); }
.groupe-taches h2 .n { font-family: var(--mono); color: var(--fg); }
.afaire > .ajout-tache { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; }

/* Planning */
.nav-planning { display: flex; gap: 6px; }
.semaine { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; align-items: start; }
.jour { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px; display: flex; flex-direction: column; gap: 6px; min-height: 140px; min-width: 0; }
.jour.auj { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.jour.weekend { background: var(--surface-2); }
.jour header { display: flex; align-items: baseline; gap: 4px; font-size: 13px; color: var(--muted); }
.jour header .n { font-family: var(--mono); font-size: 11px; background: var(--surface-2); border-radius: 8px; padding: 0 6px; }
.jour header .lien { margin-left: auto; font-size: 18px; text-decoration: none; }
.jour .vide { color: var(--muted); font-size: 12px; }
.evt { display: flex; flex-direction: column; gap: 1px; text-align: left; border: 1px solid var(--line); border-left: 3px solid var(--series-1); border-radius: 5px; background: var(--bg); padding: 4px 6px; font-size: 12px; width: 100%; min-width: 0; }
.evt.rdv { border-left-color: var(--series-2); }
.evt.fait { opacity: .55; text-decoration: line-through; }
.evt .heure { font-family: var(--mono); color: var(--muted); }
.evt-titre { overflow-wrap: anywhere; font-weight: 500; }
.retard-planning { background: var(--bad-soft); border-radius: 8px; padding: 6px 12px; margin-bottom: 10px; }
.retard-planning summary { cursor: pointer; color: var(--bad); font-weight: 600; }
.mois { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.entete-mois { font-size: 12px; color: var(--muted); text-align: center; text-transform: uppercase; }
.case { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 4px 5px; min-height: 84px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow: hidden; }
.case.hors { opacity: .45; }
.case.auj { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.case .num { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.mini-evt { font-size: 11px; border-left: 2px solid var(--series-1); padding-left: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-evt.rdv { border-left-color: var(--series-2); }
.mini-evt.fait { opacity: .5; text-decoration: line-through; }

/* Fenêtre centrée */
.voile.haut { z-index: 30; }
.modal { position: fixed; z-index: 31; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(560px, calc(100% - 24px)); max-height: calc(100dvh - 24px); overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; box-shadow: 0 10px 40px rgba(0,0,0,.3); }
.form-modal { display: flex; flex-direction: column; gap: 12px; }
.form-modal h2 { margin: 0; font-size: 18px; }
.form-modal .champs input, .form-modal .champs select, .form-modal .champs textarea { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 7px 8px; width: 100%; min-width: 0; }

@media (max-width: 900px) {
  .grille-fiche { grid-template-columns: 1fr; }
  .semaine { grid-template-columns: 1fr; }
  .jour { min-height: 0; }
  .jour.weekend { display: none; }
}
@media (max-width: 640px) {
  .bloc .champs { grid-template-columns: 1fr; }
  .case { min-height: 64px; }
  .mini-evt { display: none; }
  .barre-vue { gap: 8px; }
}
