/* =============================================================================
   styles.css — identité 2good : palette tirée du logo
   -----------------------------------------------------------------------------
   Toutes les couleurs sont des « variables » (--nom) définies une seule fois
   ici : changer une teinte = changer une ligne.
   ========================================================================== */
:root {
  --fond: #F4F5F2;          /* gris très clair, lisible au soleil */
  --carte: #FFFFFF;
  --encre: #1B2421;         /* texte principal */
  --encre-2: #3C4641;       /* texte secondaire */
  --encre-3: #57615C;       /* texte discret (contraste ≥ 4.5:1 sur blanc) */
  --trait: #E1E5E2;
  --neutre: #E6EAE7;        /* boutons secondaires */
  --vert: #1A5C2E;          /* vert foncé du « ood » : actions principales */
  --vert-fonce: #134621;
  --bleu: #1452B8;          /* bleu du « 2 » : nouveaux leads */
  --bleu-fond: #E1EDFD;
  --orange: #8A3412;        /* retards */
  --orange-fond: #FBE6D9;
  --jaune: #F6C21A;         /* œil du caméléon : accents */
  --rayon: 16px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--encre);
  background: var(--fond);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--fond); -webkit-text-size-adjust: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--vert); }
img { display: block; max-width: 100%; }

.app { max-width: 560px; margin: 0 auto; min-height: 100vh; padding-bottom: 96px; }
.chargement { padding: 40px 20px; color: var(--encre-3); }

/* --- En-tête -------------------------------------------------------------- */
.entete { padding: 20px 20px 12px; display: flex; flex-direction: column; gap: 4px; }
.entete-ligne { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.entete-date { font-size: 13px; font-weight: 500; color: var(--encre-3); }
.logo { height: 30px; width: auto; }
h1 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.puces { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.puce { font-size: 13px; font-weight: 600; padding: 6px 10px; border-radius: 999px; background: var(--neutre); color: var(--encre-2); }
.puce-bleu { background: var(--bleu-fond); color: var(--bleu); }
.puce-orange { background: var(--orange-fond); color: var(--orange); }

/* --- Liste « aujourd'hui » ------------------------------------------------ */
.liste { padding: 4px 16px; display: flex; flex-direction: column; gap: 12px; }
.carte { background: var(--carte); border-radius: var(--rayon); padding: 14px 14px 12px; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 1px 2px rgba(27, 36, 33, 0.08); }
.carte-haut { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.etiquette { font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--encre-2); }
.etiquette-1 { color: var(--bleu); }
.etiquette-2 { color: var(--orange); }
.quand { font-size: 12px; color: var(--encre-3); text-align: right; }
.carte-lien { text-decoration: none; color: var(--encre); display: flex; flex-direction: column; gap: 2px; }
.titre { font-size: 17px; font-weight: 600; }
.detail { font-size: 14px; color: var(--encre-2); }
.actions { display: flex; gap: 8px; margin-top: 4px; }

/* --- Boutons (zone tactile ≥ 44 px) -------------------------------------- */
.bouton { min-height: 44px; border: 0; border-radius: 12px; padding: 0 14px; font-size: 15px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; background: var(--neutre); color: var(--encre); }
.bouton:focus-visible, .carte-lien:focus-visible { outline: 3px solid var(--bleu); outline-offset: 2px; }
.bouton-principal { background: var(--vert); color: #FFFFFF; flex: 1 1 0; }
.bouton-principal:hover { background: var(--vert-fonce); }
.bouton-icone { min-width: 52px; padding: 0; }
.bouton-danger { background: var(--carte); color: var(--orange); border: 1px solid #E8B9A0; }
.bouton-texte { background: transparent; color: var(--encre-3); font-weight: 500; }
.bouton-large { width: 100%; min-height: 52px; }
.bouton:disabled { opacity: 0.6; cursor: default; }
.icone { width: 20px; height: 20px; flex: 0 0 auto; }

/* --- Vide ----------------------------------------------------------------- */
.vide { padding: 24px 16px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.vide img { width: 180px; height: auto; }
.vide strong { font-size: 18px; }
.vide span { font-size: 15px; color: var(--encre-3); }

/* --- Feuille du bas (résultat d'appel…) ----------------------------------- */
.voile { position: fixed; inset: 0; background: rgba(27, 36, 33, 0.45); display: flex; flex-direction: column; justify-content: flex-end; z-index: 10; }
.feuille { background: var(--carte); border-radius: 20px 20px 0 0; padding: 12px 20px calc(24px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; max-width: 560px; width: 100%; margin: 0 auto; }
.poignee { width: 40px; height: 4px; border-radius: 2px; background: #C9D0CC; align-self: center; }
.feuille h2 { margin: 0; font-size: 20px; }
.sous-titre { font-size: 13px; color: var(--encre-3); }
.grille-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.grille-3 .bouton { min-height: 64px; border-radius: 14px; }
.pile { display: flex; flex-direction: column; gap: 8px; }
.champ { display: flex; flex-direction: column; gap: 6px; }
.champ label { font-size: 14px; font-weight: 600; }
.champ input, .champ select, .champ textarea { min-height: 48px; border: 1px solid #C9D0CC; border-radius: 12px; padding: 10px 12px; background: var(--carte); font-size: 16px; }

/* --- Message temporaire (« Annuler ») ------------------------------------- */
.toast { position: fixed; left: 16px; right: 16px; bottom: calc(92px + env(safe-area-inset-bottom)); max-width: 528px; margin: 0 auto; background: var(--encre); color: #FFFFFF; border-radius: 12px; padding: 4px 4px 4px 14px; font-size: 14px; display: flex; justify-content: space-between; align-items: center; gap: 12px; z-index: 20; }
.toast button { border: 0; background: transparent; color: var(--jaune); font-weight: 600; min-height: 44px; padding: 0 12px; cursor: pointer; }

/* --- Barre de navigation ---------------------------------------------------- */
.nav { position: fixed; left: 0; right: 0; bottom: 0; background: var(--carte); border-top: 1px solid var(--trait); display: flex; justify-content: space-around; padding: 6px 0 calc(8px + env(safe-area-inset-bottom)); z-index: 5; }
.nav a, .nav button { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; font-weight: 500; color: var(--encre-3); text-decoration: none; min-width: 72px; min-height: 48px; justify-content: center; background: none; border: 0; cursor: pointer; }
.nav [aria-current="page"] { color: var(--vert); font-weight: 600; }

/* --- Fiche ---------------------------------------------------------------- */
.fiche { padding: 0 16px 24px; display: flex; flex-direction: column; gap: 14px; }
.retour { display: flex; align-items: center; gap: 8px; padding: 16px 16px 8px; }
.cases { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.case { background: var(--carte); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.case-titre { font-size: 12px; color: var(--encre-3); }
.case-valeur { font-size: 17px; font-weight: 600; overflow-wrap: anywhere; }
.case-note { font-size: 13px; color: var(--encre-3); }
.bloc { background: var(--carte); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.bloc h2 { margin: 0; font-size: 15px; }
.bloc p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--encre-2); white-space: pre-line; overflow-wrap: anywhere; }
.historique { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.historique li { display: flex; gap: 10px; }
.point { width: 10px; height: 10px; border-radius: 50%; background: #C9D0CC; margin-top: 5px; flex: 0 0 auto; }
.historique strong { font-size: 14px; }
.historique span { font-size: 13px; color: var(--encre-3); white-space: pre-line; overflow-wrap: anywhere; }

/* --- Connexion ------------------------------------------------------------ */
.connexion { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; gap: 24px; padding: 32px 24px; }
.connexion-haut { display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; }
.connexion-haut .logo { height: 56px; }
.connexion-haut .avatar { width: 120px; height: auto; }
.connexion p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--encre-2); }
.erreur { color: var(--orange); font-weight: 600; }
.petit { font-size: 13px !important; color: var(--encre-3) !important; }

/* --- Pipeline : colonnes qui défilent horizontalement ----------------------
   scroll-snap : chaque glissement s'arrête net au début d'une colonne. */
.colonnes { display: flex; gap: 12px; overflow-x: auto; padding: 4px 16px 16px; scroll-snap-type: x mandatory; scroll-padding-left: 16px; -webkit-overflow-scrolling: touch; }
.colonne { flex: 0 0 min(85vw, 320px); scroll-snap-align: start; background: var(--neutre); border-radius: var(--rayon); padding: 10px; display: flex; flex-direction: column; gap: 8px; align-self: flex-start; }
.colonne-entete { display: flex; justify-content: space-between; align-items: center; padding: 4px 4px 0; }
.colonne-entete h2 { margin: 0; font-size: 16px; }
.colonne-resume { margin: 0 4px; font-size: 13px; color: var(--encre-2); }
.colonne-vide { margin: 8px 4px; font-size: 14px; color: var(--encre-3); }
.carte-pipeline { gap: 6px; }
.alerte { font-size: 13px; font-weight: 600; color: var(--orange); }

/* --- Code de connexion et installation ------------------------------------ */
/* « hidden » doit gagner sur « display: inline-flex » des boutons. */
[hidden] { display: none !important; }
/* Gros chiffres espacés : lisibles et faciles à vérifier d'un coup d'œil. */
.champ .champ-code { font-size: 28px; font-weight: 600; letter-spacing: 0.4em; text-align: center; font-variant-numeric: tabular-nums; }
.bouton-installer { background: var(--carte); color: var(--vert); border: 1px solid var(--vert); }
.aide-installation { margin: 0; font-size: 14px; color: var(--encre-3); }
