/* Digi-Veille : couleurs Digi-Certif (bleu nuit, orange), police système simple */
:root {
  --navy: #1B2A4A;
  --navy-deep: #0F1E36;
  --orange: #E8500A;
  --orange-l: #FFF0E8;
  --cream: #F9F6F1;
  --grey-50: #F8F9FA;
  --grey-200: #E5E7EB;
  --grey-400: #9CA3AF;
  --grey-700: #374151;
  --green: #059669;
  --green-l: #D1FAE5;
  --bleu-clair: #93A5C4;
  --texte: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --display: var(--texte);
}
* { box-sizing: border-box; }
html { font-size: 15px; }
body { margin: 0; font-family: var(--texte); color: var(--grey-700); background: #F5F6F8; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--navy); }
a:hover { color: var(--orange); }
small { display: block; color: var(--grey-700); font-size: 0.87rem; }
h1, h2 { font-weight: 600; margin: 0; color: var(--navy); }
h1 { font-size: 1.5rem; line-height: 1.2; }
h2 { font-size: 1rem; margin: 2rem 0 0.75rem; }
h2:first-child { margin-top: 0; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

/* Bandeau et onglets */
.bandeau { background: #fff; color: var(--navy); height: 52px; border-bottom: 1px solid var(--grey-200); padding: 0 32px; display: flex; align-items: center; justify-content: space-between; }
.logo { font-weight: 600; font-size: 1.05rem; color: var(--navy); text-decoration: none; margin: 0; }
.logo span { color: var(--orange); }
.logo em { font-style: normal; font-weight: 400; font-size: 1.05rem; color: var(--grey-400); margin-left: 0.5rem; }
a.logo:hover { color: var(--navy); }
.bandeau-droite { display: flex; gap: 1.5rem; font-size: 0.87rem; color: var(--grey-400); }
.bandeau-droite a { color: var(--grey-700); }
.onglets { background: #fff; border-bottom: 1px solid var(--grey-200); padding: 0 32px; display: flex; gap: 0.25rem; overflow-x: auto; }
.onglets a { padding: 0.75rem 0.75rem 0.6rem; text-decoration: none; color: var(--grey-700); border-bottom: 2px solid transparent; white-space: nowrap; font-size: 0.93rem; }
.onglets a:hover { color: var(--navy); }
.onglets a.actif { color: var(--navy); border-bottom-color: var(--orange); font-weight: 600; }
.onglets b { font-weight: 400; font-size: 0.78rem; background: var(--grey-50); color: var(--grey-700); border: 1px solid var(--grey-200); border-radius: 99px; padding: 0.1rem 0.5rem; margin-left: 0.2rem; }
.alerte small { color: #991B1B; margin-top: 0.2rem; }
.alerte { background: #FEE2E2; color: #991B1B; padding: 0.8rem 32px; border-bottom: 1px solid #FCA5A5; }
main { max-width: 1500px; margin: 0 auto; padding: 28px 32px 64px; }

/* Accueil */
.chiffres { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 1rem; margin-bottom: 2.5rem; }
.chiffre { background: #fff; border: 1px solid var(--grey-200); border-radius: 8px; padding: 1rem 1.2rem; }
.chiffre p { margin: 0; }
.chiffre .valeur { font-weight: 600; font-size: 1.9rem; line-height: 1.1; color: var(--navy); font-variant-numeric: tabular-nums; }
.chiffre .nom { font-weight: 500; margin-top: 0.35rem; color: var(--navy); }
.chiffre .detail { color: var(--grey-700); font-size: 0.87rem; margin-top: 0.15rem; }
.chiffre.principal { border-top: 3px solid var(--orange); }
.chiffre.principal .valeur { font-size: 2.3rem; }
.deux-colonnes { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(280px, 1fr); gap: 2.5rem; align-items: start; }
.rappels, .signaux, .journal { list-style: none; margin: 0; padding: 0; }
.rappels li { background: #fff; border: 1px solid var(--grey-200); border-left: 3px solid var(--orange); border-radius: 6px; padding: 0.6rem 0.8rem; margin-bottom: 0.5rem; }
.rappels a { font-weight: 600; text-decoration: none; }
.rappels p { margin: 0.3rem 0 0; font-size: 0.9rem; }
.execution { background: #fff; border: 1px solid var(--grey-200); border-radius: 6px; padding: 0.8rem; margin: 0; font-size: 0.92rem; }
.execution.erreur { border-color: #FCA5A5; background: #FEF2F2; }
.note-bas { color: var(--grey-700); font-size: 0.87rem; margin: 0.4rem 0 0; }
.vide { color: var(--grey-700); background: #fff; border: 1px dashed var(--grey-200); border-radius: 6px; padding: 0.9rem 1rem; margin: 0; }
.vide.grand { padding: 2.5rem; text-align: center; max-width: 720px; margin: 2rem auto; }
code { background: var(--grey-200); border-radius: 4px; padding: 0.1rem 0.35rem; font-size: 0.9em; }

/* Tableaux */
.tableau { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--grey-200); border-radius: 8px; overflow: hidden; }
.tableau th { text-align: left; font-weight: 500; font-size: 0.8rem; color: var(--grey-400); background: #FAFAFB; padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--grey-200); position: sticky; top: 0; z-index: 1; }
.tableau td { padding: 0.65rem 0.8rem; border-bottom: 1px solid var(--grey-200); vertical-align: top; }
.tableau tr:last-child td { border-bottom: 0; }
.tableau .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tableau .fort { font-weight: 600; color: var(--navy); }
.synthese td:first-child a { font-weight: 600; text-decoration: none; }
.synthese small { max-width: 62ch; }
.fiches tbody tr:hover { background: #FAFAFB; }
.fiches tr.traitee { opacity: 0.55; }
.fiches tr.traitee:hover, .fiches tr.traitee:focus-within { opacity: 1; }
.organisme { min-width: 220px; max-width: 320px; }
.organisme > a:first-child { font-weight: 600; text-decoration: none; }
.aussi { display: inline-block; margin-top: 0.3rem; margin-right: 0.3rem; font-size: 0.8rem; background: var(--grey-50); border: 1px solid var(--grey-200); border-radius: 4px; padding: 0 0.4rem; text-decoration: none; color: var(--grey-700); }
.signal { max-width: 340px; }
.signal time { font-weight: 500; font-variant-numeric: tabular-nums; }
.activite { max-width: 260px; }
.contact a { font-weight: 600; white-space: nowrap; text-decoration: none; }
.discret { color: var(--grey-400); }
.note { display: inline-block; min-width: 2.6rem; text-align: center; font-weight: 500; font-size: 0.87rem; color: var(--navy); padding: 0.15rem 0.3rem; border-radius: 4px; background: linear-gradient(to right, #FED7AA calc(var(--n) * 1%), var(--grey-50) calc(var(--n) * 1%)); border: 1px solid var(--grey-200); }

/* En-tête de liste et filtres */
.entete-liste { display: flex; justify-content: space-between; align-items: flex-end; gap: 2rem; margin-bottom: 1.25rem; }
.resume { margin: 0.35rem 0 0; color: var(--grey-700); max-width: 75ch; }
.compteur { margin: 0; white-space: nowrap; color: var(--grey-700); }
.compteur strong { font-weight: 600; font-size: 1.15rem; color: var(--navy); }
.filtres { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-end; margin-bottom: 1rem; }
.filtres label { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.87rem; color: var(--grey-700); }
.filtres .recherche { flex: 1; min-width: 200px; max-width: 340px; }
select, input[type=text], input[type=search], input[type=date], input[type=password], textarea { font: inherit; color: var(--navy); background: #fff; border: 1px solid #D1D5DB; border-radius: 6px; padding: 0.4rem 0.55rem; }
.filtres select { max-width: 300px; }
button, .bouton-secondaire { font: inherit; font-weight: 500; border-radius: 6px; padding: 0.42rem 0.95rem; cursor: pointer; text-decoration: none; border: 1px solid var(--navy); }
button { background: var(--navy); color: #fff; }
button:hover { background: var(--navy-deep); }
.bouton-secondaire { background: #fff; color: var(--navy); border-color: #D1D5DB; margin-left: auto; }
.bouton-secondaire:hover { border-color: var(--orange); }

/* État d'un prospect */
.suivi { display: flex; flex-direction: column; gap: 0.3rem; align-items: flex-start; }
select.etat { font-weight: 500; font-size: 0.87rem; border-radius: 99px; padding: 0.25rem 0.65rem; border-width: 1px; cursor: pointer; }
select.etat[data-etat=a_appeler] { background: var(--orange-l); color: #9A3412; border-color: #FED7AA; }
select.etat[data-etat=a_rappeler] { background: #FEF3C7; color: #92400E; border-color: #FDE68A; }
select.etat[data-etat=rdv] { background: #DBEAFE; color: #1E40AF; border-color: #BFDBFE; }
select.etat[data-etat=gagne] { background: var(--green-l); color: #065F46; border-color: #6EE7B7; }
select.etat[data-etat=pas_interesse], select.etat[data-etat=hors_cible] { background: var(--grey-200); color: var(--grey-700); border-color: var(--grey-200); }
select.etat[data-etat=ne_plus_contacter] { background: #FEE2E2; color: #991B1B; border-color: #FCA5A5; }
select.etat option { background: #fff; color: var(--navy); }
.rappel { font-size: 0.87rem; padding: 0.2rem 0.4rem; }
input.commentaire { width: 100%; min-width: 180px; border-color: transparent; background: transparent; }
input.commentaire:hover, input.commentaire:focus { border-color: var(--grey-200); background: #fff; }
textarea.commentaire { width: 100%; resize: vertical; }
.suivi-fiche small { margin-top: 0.3rem; }

/* Fiche */
.signaux li { background: #fff; border: 1px solid var(--grey-200); border-left: 3px solid var(--orange); border-radius: 6px; padding: 0.7rem 0.9rem; margin-bottom: 0.5rem; }
.signaux li.ferme { border-left-color: var(--grey-400); color: var(--grey-700); }
.signaux time { color: var(--grey-700); margin-left: 0.5rem; }
.signaux p { margin: 0.25rem 0 0; }
.journal li { padding: 0.35rem 0; border-bottom: 1px solid var(--grey-200); }
.journal time { color: var(--grey-700); margin-right: 0.5rem; font-variant-numeric: tabular-nums; }
.infos { margin: 0; background: #fff; border: 1px solid var(--grey-200); border-radius: 6px; padding: 0.3rem 0.9rem; }
.infos dt { color: var(--grey-700); font-size: 0.87rem; margin-top: 0.55rem; }
.infos dd { margin: 0 0 0.55rem; overflow-wrap: anywhere; }
.liens { margin: 0.6rem 0 0; font-size: 0.92rem; }

/* Pages et message */
.pages { display: flex; justify-content: center; align-items: center; gap: 1.5rem; margin-top: 1.25rem; color: var(--grey-700); }
.pages a { font-weight: 600; }
#message { position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%); background: var(--navy-deep); color: #fff; padding: 0.55rem 1.1rem; border-radius: 6px; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
#message.visible { opacity: 1; }
#message.erreur { background: #991B1B; }

/* Connexion */
.page-connexion { background: #F5F6F8; min-height: 100vh; display: grid; place-items: center; }
.connexion { background: #fff; border: 1px solid var(--grey-200); border-radius: 8px; padding: 2rem; width: min(360px, 90vw); display: flex; flex-direction: column; gap: 0.6rem; }
.connexion .logo { color: var(--navy-deep); margin-bottom: 0.8rem; }
.connexion .logo em { color: var(--grey-400); }
.connexion label { font-size: 0.9rem; color: var(--grey-700); }
.connexion button { background: var(--orange); border-color: var(--orange); margin-top: 0.5rem; padding: 0.6rem; }
.connexion button:hover { background: #C74408; }
.erreur { color: #991B1B; margin: 0; font-size: 0.9rem; }

@media (max-width: 1000px) {
  .chiffres { grid-template-columns: 1fr 1fr; }
  .deux-colonnes { grid-template-columns: 1fr; }
  .tableau.fiches { display: block; overflow-x: auto; }
  .entete-liste { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) { #message { transition: none; } }
