/* Suivi clients Synaps — la feuille unique de l'application et de la page
   de connexion. Les polices sont celles du site synaps.re, servies d'ici :
   aucune requête ne part ailleurs (la CSP ne l'autoriserait pas). */
@font-face {
  font-family: 'Archivo'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url('/polices/archivo-latin-var.woff2') format('woff2');
}
@font-face {
  font-family: 'Newsreader'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url('/polices/newsreader-latin-var.woff2') format('woff2');
}
/* Mise en page : un bandeau de chiffres, les relances du jour, puis le tunnel
   en colonnes (ou la liste) ; la fiche client s'ouvre en tiroir à droite. */
:root {
  --papier: #F4F1E9;
  --papier-2: #ECE8DD;
  --carte: #FBFAF6;
  --encre: #14110F;
  --encre-2: rgba(20,17,15,.70);
  --encre-3: rgba(20,17,15,.52);
  --filet: rgba(20,17,15,.13);
  --filet-fort: rgba(20,17,15,.34);
  --orange: #C34111;
  --orange-texte: #C34111;
  --orange-pale: rgba(195,65,17,.10);
  --vert: #2F6B3C;
  --vert-pale: rgba(47,107,60,.12);
  --rouge: #A3261B;
  --rouge-pale: rgba(163,38,27,.10);
  --voile: rgba(20,17,15,.38);
  --titre: 'Archivo', 'Arial Narrow', Arial, sans-serif;
  --texte: 'Archivo', Arial, sans-serif;
  --plume: 'Newsreader', Georgia, serif;
  --chiffre: ui-monospace, 'SF Mono', 'Cascadia Mono', Consolas, monospace;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --papier: #14110F; --papier-2: #1D1A17; --carte: #211D1A; --encre: #F4F1E9;
  --encre-2: rgba(244,241,233,.74); --encre-3: rgba(244,241,233,.54);
  --filet: rgba(244,241,233,.12); --filet-fort: rgba(244,241,233,.32);
  --orange: #C34111; --orange-texte: #EE7A4C; --orange-pale: rgba(238,122,76,.14);
  --vert: #7FC08C; --vert-pale: rgba(127,192,140,.14); --rouge: #F0806F; --rouge-pale: rgba(240,128,111,.13);
  --voile: rgba(0,0,0,.55); color-scheme: dark;
} }
:root[data-theme="dark"] {
  --papier: #14110F; --papier-2: #1D1A17; --carte: #211D1A; --encre: #F4F1E9;
  --encre-2: rgba(244,241,233,.74); --encre-3: rgba(244,241,233,.54);
  --filet: rgba(244,241,233,.12); --filet-fort: rgba(244,241,233,.32);
  --orange: #C34111; --orange-texte: #EE7A4C; --orange-pale: rgba(238,122,76,.14);
  --vert: #7FC08C; --vert-pale: rgba(127,192,140,.14); --rouge: #F0806F; --rouge-pale: rgba(240,128,111,.13);
  --voile: rgba(0,0,0,.55); color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { background: var(--papier); color: var(--encre); }
body { margin: 0; font-family: var(--texte); font-size: 14px; line-height: 1.45; padding: env(safe-area-inset-top,0px) 20px calc(48px + env(safe-area-inset-bottom,0px)); -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--orange-texte); outline-offset: 2px; }
.num { font-family: var(--chiffre); font-variant-numeric: tabular-nums; }

/* En-tête */
.tete { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding-block: 20px 16px; border-bottom: 1px solid var(--filet-fort); position: sticky; top: env(safe-area-inset-top,0px); background: var(--papier); z-index: 5; }
.marque { font-family: var(--titre); font-weight: 800; font-size: 22px; letter-spacing: -.02em; line-height: 1; }
.marque span { color: var(--orange-texte); }
.marque small { display: block; font-family: var(--plume); font-weight: 500; font-size: 15px; letter-spacing: 0; color: var(--encre-2); margin-top: 3px; }
.tete .droite { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.recherche { border: 1px solid var(--filet-fort); background: var(--carte); border-radius: 999px; padding: 8px 14px; width: 220px; max-width: 100%; }
.bascule { display: inline-flex; border: 1px solid var(--filet-fort); border-radius: 999px; padding: 2px; background: var(--carte); }
.bascule button { border: 0; background: none; padding: 6px 12px; border-radius: 999px; font-weight: 600; font-size: 13px; color: var(--encre-2); }
.bascule button[aria-pressed="true"] { background: var(--encre); color: var(--papier); }
.btn { border: 1px solid var(--filet-fort); background: var(--carte); border-radius: 999px; padding: 8px 14px; font-weight: 600; font-size: 13px; }
.btn:hover { border-color: var(--encre); }
.btn.plein { background: var(--orange); border-color: var(--orange); color: #F4F1E9; }
.btn.plein:hover { filter: brightness(1.08); }
.btn.danger { color: var(--rouge); }
.btn.danger.arme { background: var(--rouge); border-color: var(--rouge); color: var(--papier); }

.bandeau { font-size: 13px; padding: 10px 14px; border-radius: 10px; background: var(--rouge-pale); color: var(--rouge); margin-top: 14px; }

/* Chiffres */
.chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1px; background: var(--filet); border: 1px solid var(--filet); border-radius: 12px; overflow: hidden; margin-top: 18px; }
.chiffre { background: var(--papier); padding: 14px 16px; min-width: 0; }
.chiffre .lib { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--encre-3); font-weight: 600; }
.chiffre .val { font-family: var(--chiffre); font-size: 24px; font-weight: 500; margin-top: 4px; font-variant-numeric: tabular-nums; }
.chiffre .val.orange { color: var(--orange-texte); }
.chiffre .det { font-size: 12px; color: var(--encre-2); margin-top: 2px; }

/* À faire */
.afaire { margin-top: 18px; }
.afaire h2, .filtres .lib { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--encre-3); font-weight: 600; margin: 0 0 8px; }
.afaire ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.afaire li button { display: flex; gap: 8px; align-items: baseline; text-align: left; border: 1px solid var(--filet); background: var(--carte); border-radius: 10px; padding: 8px 12px; max-width: 100%; }
.afaire li button:hover { border-color: var(--filet-fort); }
.afaire .quand { font-family: var(--chiffre); font-size: 12px; font-weight: 500; white-space: nowrap; }
.afaire .quand.retard { color: var(--rouge); }
.afaire .quand.essai { color: var(--orange-texte); }
.afaire .rien { color: var(--encre-3); font-family: var(--plume); font-size: 15px; }

/* Filtres */
.filtres { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: center; margin-top: 20px; }
.filtres .groupe { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.filtres .lib { margin: 0 4px 0 0; }
.puce { border: 1px solid var(--filet-fort); background: none; border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 600; color: var(--encre-2); }
.puce[aria-pressed="true"] { background: var(--encre); border-color: var(--encre); color: var(--papier); }

/* Tunnel */
.tunnel { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(236px, 1fr); gap: 12px; overflow-x: auto; margin-top: 16px; padding-bottom: 10px; align-items: start; }
.colonne { background: var(--papier-2); border-radius: 12px; padding: 10px; min-height: 120px; min-width: 0; }
.colonne header { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 2px 4px 10px; }
.colonne h3 { margin: 0; font-family: var(--titre); font-size: 13px; font-weight: 700; letter-spacing: -.005em; }
.colonne .compte { font-family: var(--chiffre); font-size: 12px; color: var(--encre-3); }
.colonne .aide { font-size: 11.5px; color: var(--encre-3); padding: 0 4px 8px; margin-top: -6px; }
.colonne .pile { display: flex; flex-direction: column; gap: 8px; }
.colonne.perdu { opacity: .8; }

.carte { background: var(--carte); border: 1px solid var(--filet); border-radius: 10px; padding: 10px 12px; text-align: left; width: 100%; display: flex; flex-direction: column; gap: 6px; position: relative; }
.carte:hover { border-color: var(--filet-fort); }
.carte.pheno { box-shadow: inset 3px 0 0 var(--orange); }
.carte .nom { font-family: var(--titre); font-weight: 700; font-size: 14.5px; line-height: 1.2; padding-right: 26px; overflow-wrap: anywhere; }
.carte .sous { font-size: 12px; color: var(--encre-2); overflow-wrap: anywhere; }
.carte .suite { font-size: 12px; color: var(--encre-2); border-top: 1px dashed var(--filet); padding-top: 6px; display: flex; gap: 6px; }
.carte .suite .d { font-family: var(--chiffre); white-space: nowrap; }
.carte .suite .d.retard { color: var(--rouge); font-weight: 500; }
.avance { position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--filet-fort); background: var(--papier); display: grid; place-items: center; font-size: 13px; line-height: 1; padding: 0; color: var(--encre-2); }
.avance:hover { background: var(--encre); color: var(--papier); border-color: var(--encre); }
.etiquettes { display: flex; flex-wrap: wrap; gap: 4px; }
.et { font-size: 11px; font-weight: 600; border-radius: 4px; padding: 1px 6px; background: var(--papier-2); color: var(--encre-2); white-space: nowrap; }
.et.pheno { background: var(--orange-pale); color: var(--orange-texte); }
.et.ex { background: none; border: 1px dashed var(--filet-fort); color: var(--encre-3); }
.vide-col { font-size: 13px; color: var(--encre-3); padding: 8px 4px; font-family: var(--plume); }

/* Liste */
.liste-boite { overflow-x: auto; margin-top: 16px; border: 1px solid var(--filet); border-radius: 12px; }
table { border-collapse: collapse; width: 100%; min-width: 860px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--filet); vertical-align: top; font-size: 13px; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--encre-3); font-weight: 600; background: var(--papier-2); position: sticky; top: 0; }
tbody tr { cursor: pointer; }
tbody tr:hover td { background: var(--papier-2); }
td .nom { font-weight: 700; }
td .sous { color: var(--encre-2); font-size: 12px; }
.etape-pill { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--papier-2); white-space: nowrap; }
.etape-pill.fin { background: var(--vert-pale); color: var(--vert); }
.etape-pill.perdu { background: var(--rouge-pale); color: var(--rouge); }

/* Vide */
.accueil { margin: 48px auto; max-width: 520px; text-align: center; }
.accueil h2 { font-family: var(--titre); font-size: 24px; letter-spacing: -.02em; margin: 0 0 8px; text-wrap: balance; }
.accueil p { color: var(--encre-2); margin: 0 0 18px; }

/* Tiroir */
.voile { position: fixed; inset: 0; background: var(--voile); z-index: 20; }
.tiroir { position: fixed; top: 0; right: 0; bottom: 0; width: min(600px, 100%); background: var(--papier); border-left: 1px solid var(--filet-fort); z-index: 21; display: flex; flex-direction: column; padding-top: env(safe-area-inset-top,0px); padding-bottom: env(safe-area-inset-bottom,0px); }
.tiroir .haut { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px 12px; border-bottom: 1px solid var(--filet); }
.tiroir .haut input { font-family: var(--titre); font-size: 22px; font-weight: 800; letter-spacing: -.02em; border: 0; background: none; padding: 0; width: 100%; min-width: 0; }
.tiroir .haut .etat { font-size: 12px; color: var(--encre-3); margin-top: 4px; }
.tiroir .fermer { margin-left: auto; flex: none; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--filet-fort); background: var(--carte); font-size: 18px; line-height: 1; }
.tiroir .corps { overflow-y: auto; padding: 16px 20px 28px; display: flex; flex-direction: column; gap: 22px; }
.tiroir section h4 { margin: 0 0 10px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--encre-3); font-weight: 600; display: flex; gap: 8px; align-items: baseline; }
.tiroir section h4 .p { text-transform: none; letter-spacing: 0; font-weight: 400; font-family: var(--chiffre); color: var(--orange-texte); }
.etapes { display: flex; flex-wrap: wrap; gap: 6px; }
.etapes button { border: 1px solid var(--filet-fort); background: none; border-radius: 999px; padding: 5px 10px; font-size: 12px; font-weight: 600; color: var(--encre-2); }
.etapes button.passe { border-color: transparent; background: var(--papier-2); color: var(--encre-3); }
.etapes button[aria-pressed="true"] { background: var(--encre); border-color: var(--encre); color: var(--papier); }
.etapes button.perdu[aria-pressed="true"] { background: var(--rouge); border-color: var(--rouge); }
.champs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.champs .large { grid-column: 1 / -1; }
.champ { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.champ label, .champ .l { font-size: 12px; color: var(--encre-2); font-weight: 500; }
.champ input, .champ select, .champ textarea { border: 1px solid var(--filet-fort); background: var(--carte); border-radius: 8px; padding: 8px 10px; width: 100%; min-width: 0; }
.champ textarea { resize: vertical; min-height: 80px; line-height: 1.45; }
.cases { display: flex; flex-wrap: wrap; gap: 6px; }
.case { display: inline-flex; gap: 6px; align-items: center; border: 1px solid var(--filet-fort); border-radius: 8px; padding: 6px 10px; font-size: 13px; background: var(--carte); cursor: pointer; }
.case input { accent-color: var(--orange); margin: 0; }
.case .prix { font-family: var(--chiffre); font-size: 11.5px; color: var(--encre-3); }
.bloc-opt { border: 1px solid var(--filet); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 10px; background: var(--carte); }
.bloc-opt.actif { border-color: var(--orange); background: var(--orange-pale); }
.bloc-opt .ligne { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; }
.bloc-opt .ligne strong { font-family: var(--titre); }
.bloc-opt .ligne .prix { font-family: var(--chiffre); font-size: 12px; color: var(--encre-2); }
.interrupteur { display: inline-flex; gap: 8px; align-items: center; font-size: 13px; font-weight: 600; cursor: pointer; }
.interrupteur input { accent-color: var(--orange); width: 16px; height: 16px; margin: 0; }
.journal { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.journal li { display: grid; grid-template-columns: 84px 1fr; gap: 10px; font-size: 13px; }
.journal .d { font-family: var(--chiffre); font-size: 12px; color: var(--encre-3); }
.ajout-journal { display: flex; gap: 8px; margin-top: 10px; }
.ajout-journal input { flex: 1; min-width: 0; border: 1px solid var(--filet-fort); background: var(--carte); border-radius: 8px; padding: 8px 10px; }
.pied-tiroir { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding-top: 6px; border-top: 1px solid var(--filet); }
.note-ex { font-size: 12.5px; padding: 8px 10px; border: 1px dashed var(--filet-fort); border-radius: 8px; color: var(--encre-2); }

@media (max-width: 640px) {
  body { padding: 0 16px 40px; }
  .recherche { width: 100%; }
  .tete .droite { margin-left: 0; width: 100%; }
  .champs { grid-template-columns: 1fr; }
  .tunnel { grid-auto-columns: 82%; }
}
@media (prefers-reduced-motion: no-preference) {
  .tiroir { animation: entre .18s ease-out; }
  @keyframes entre { from { transform: translateX(24px); opacity: .6; } }
}

/* Ce qui remplace les styles en ligne (la CSP les refuse). */
.chiffre .val small { font-size: 13px; }
.porte { position: relative; }
.haut .titre { flex: 1; min-width: 0; }
.cases.espace { margin-bottom: 10px; }
.pile-options { display: flex; flex-direction: column; gap: 10px; }
.fin-essai { padding: 8px 0; }
.retard { color: var(--rouge); }
.btn.discret { border-color: transparent; background: none; color: var(--encre-2); }
.btn.discret:hover { border-color: var(--filet-fort); }
.tete form { margin: 0; }

/* La page de connexion */
.connexion { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; }
.connexion form { width: min(360px, 100%); display: flex; flex-direction: column; gap: 14px; }
.connexion .marque { font-size: 34px; }
.connexion .marque small { font-size: 18px; margin-top: 6px; }
.connexion label { font-size: 12px; color: var(--encre-2); font-weight: 500; display: flex; flex-direction: column; gap: 6px; }
.connexion input { border: 1px solid var(--filet-fort); background: var(--carte); border-radius: 10px; padding: 12px 14px; font-size: 16px; }
.connexion .btn { padding: 12px 16px; font-size: 15px; }
.connexion .erreur { color: var(--rouge); font-size: 13px; margin: 0; }

/* Les réseaux : une pastille par compte, la couleur dit l'état. */
.reseaux { display: flex; flex-wrap: wrap; gap: 4px; }
.rs { font-size: 11px; font-weight: 600; border-radius: 999px; padding: 1px 8px; white-space: nowrap; border: 1px solid transparent; }
.rs.ok { background: var(--vert-pale); color: var(--vert); }
.rs.expire-bientot { background: var(--orange-pale); color: var(--orange-texte); }
.rs.a-reconnecter, .rs.coupe { background: var(--rouge-pale); color: var(--rouge); }
.rs.pub { background: none; border-color: var(--filet-fort); color: var(--encre-2); }
.rs.pub.actif { border-color: var(--vert); color: var(--vert); }
.rs.pub.aconnecter { border-style: dashed; }
.rs.vide { color: var(--encre-3); font-weight: 400; padding-left: 0; }
.comptes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.comptes li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; font-size: 13px; }
.comptes .cnom { font-weight: 600; overflow-wrap: anywhere; }
.comptes .cnom a { color: inherit; }
.comptes .cetat { font-size: 12px; color: var(--encre-2); }
.comptes .cetat.a-reconnecter, .comptes .cetat.coupe { color: var(--rouge); }
.bloc-opt p { margin: 0; font-size: 12.5px; }
.pub-ligne { display: grid; grid-template-columns: 1fr 1.4fr 1fr auto; gap: 6px; align-items: center; }
.pub-ligne select, .pub-ligne input, select.choix { border: 1px solid var(--filet-fort); background: var(--carte); border-radius: 8px; padding: 6px 8px; min-width: 0; }
.btn.petit { padding: 5px 10px; font-size: 12px; }
.sous { color: var(--encre-2); font-size: 12px; }

/* À faire : en bas, replié par défaut. */
details.afaire { margin-top: 24px; border-top: 1px solid var(--filet); padding-top: 14px; }
details.afaire summary { cursor: pointer; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--encre-3); font-weight: 600; margin-bottom: 10px; }
.filtres { margin-top: 16px; }
@media (max-width: 640px) { .pub-ligne { grid-template-columns: 1fr 1fr; } }

/* Sur téléphone, la liste passe d'un tableau à des cartes empilées :
   un tableau de cinq colonnes ne tient pas dans 390 px. */
@media (max-width: 700px) {
  .liste-boite { border: 0; overflow: visible; }
  .liste-boite table { min-width: 0; }
  .liste-boite thead { display: none; }
  .liste-boite tbody { display: flex; flex-direction: column; gap: 10px; }
  .liste-boite tr { display: flex; flex-direction: column; gap: 8px; background: var(--carte); border: 1px solid var(--filet); border-radius: 12px; padding: 12px 14px; }
  .liste-boite td { border: 0; padding: 0; }
  .liste-boite tbody tr:hover td { background: none; }
}
