:root {
  --fond: #f5f6f8; --carte: #fff; --texte: #1d2430; --muet: #6b7280; --bord: #dde1e7;
  --primaire: #1f5fbf; --primaire-fonce: #174a97; --ok: #15803d; --attention: #b45309; --erreur: #b91c1c;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--texte); background: var(--fond); }
a { color: var(--primaire); }
h1 { font-size: 1.5rem; margin: 0 0 1rem; }
h2 { font-size: 1.15rem; margin: 1.5rem 0 .6rem; }
code, .mono, pre { font-family: var(--mono); font-size: .85em; }
pre { white-space: pre-wrap; margin: 0; }
small { color: var(--muet); }

.entete { display: flex; align-items: center; gap: 1.5rem; padding: 0 1.25rem; height: 52px; background: #14213d; color: #fff; }
.entete .marque { color: #fff; font-weight: 700; text-decoration: none; letter-spacing: .02em; }
.entete nav { display: flex; gap: .15rem; flex: 1; overflow-x: auto; }
.entete nav a { color: #c9d3e6; text-decoration: none; padding: .4rem .7rem; border-radius: 6px; white-space: nowrap; }
.entete nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.entete nav a.actif { background: rgba(255,255,255,.16); color: #fff; }
.entete .moi { display: flex; align-items: center; gap: .75rem; }
.entete .moi a { color: #fff; text-decoration: none; }
.inline { display: inline; }
button.lien { background: none; border: 0; color: #c9d3e6; cursor: pointer; font: inherit; padding: 0; }
button.lien:hover { color: #fff; text-decoration: underline; }

.contenu { max-width: 1200px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }
.bandeau { padding: .6rem 1.25rem; font-weight: 600; }
.bandeau.critique { background: #fee2e2; color: var(--erreur); border-bottom: 1px solid #fca5a5; }
.flash { padding: .6rem .9rem; border-radius: 6px; margin-bottom: 1rem; }
.flash.ok { background: #dcfce7; color: var(--ok); }
.flash.erreur { background: #fee2e2; color: var(--erreur); }
.flash.attention { background: #fef3c7; color: var(--attention); }
.flash ul { margin: 0; padding-left: 1.2rem; }
.note { color: var(--muet); font-size: .9em; }

.carte { background: var(--carte); border: 1px solid var(--bord); border-radius: 8px; padding: 1.25rem; }
.formulaire { max-width: 560px; }
label { display: block; margin-bottom: .9rem; font-weight: 500; }
label input, label select, label textarea { display: block; width: 100%; margin-top: .3rem; padding: .5rem .6rem; border: 1px solid var(--bord); border-radius: 6px; font: inherit; background: #fff; }
label.case { display: flex; align-items: center; gap: .5rem; }
label.case input { width: auto; margin: 0; }
.actions { display: flex; gap: .6rem; margin-top: 1.2rem; }
button, .bouton { display: inline-block; padding: .5rem .9rem; border-radius: 6px; border: 1px solid var(--bord); background: #fff; color: var(--texte); font: inherit; cursor: pointer; text-decoration: none; }
button.principal, .bouton.principal { background: var(--primaire); border-color: var(--primaire); color: #fff; }
button.principal:hover, .bouton.principal:hover { background: var(--primaire-fonce); }
.bouton.secondaire { color: var(--texte); }
button.danger { background: var(--erreur); border-color: var(--erreur); color: #fff; }

.tableau { width: 100%; border-collapse: collapse; background: var(--carte); border: 1px solid var(--bord); border-radius: 8px; overflow: hidden; }
.tableau th, .tableau td { padding: .5rem .7rem; border-bottom: 1px solid var(--bord); text-align: left; vertical-align: top; }
.tableau th { background: #eef1f5; font-weight: 600; font-size: .85em; text-transform: uppercase; letter-spacing: .03em; color: var(--muet); }
.tableau tr:last-child td { border-bottom: 0; }
.tableau tr.inactif td { color: var(--muet); }
.tableau td.vide { text-align: center; color: var(--muet); padding: 1.5rem; }
.tableau.journal td.details { max-width: 420px; }
.tableau.journal details summary { cursor: pointer; color: var(--primaire); }

.badge { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .8em; font-weight: 600; background: #e5e7eb; }
.badge.role-admin { background: #fde68a; color: #78350f; }
.badge.role-operateur { background: #bfdbfe; color: #1e3a8a; }
.badge.role-lecteur { background: #e5e7eb; color: #374151; }
.badge.gris { background: #e5e7eb; color: #6b7280; }

.tuiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.tuile { background: var(--carte); border: 1px solid var(--bord); border-radius: 8px; padding: .9rem 1rem; display: flex; flex-direction: column; }
.tuile .chiffre { font-size: 1.7rem; font-weight: 700; }
.tuile .legende { color: var(--muet); font-size: .85em; }

.filtres { display: flex; flex-wrap: wrap; gap: .7rem; align-items: flex-end; background: var(--carte); border: 1px solid var(--bord); border-radius: 8px; padding: .9rem 1rem; margin-bottom: 1rem; }
.filtres label { margin: 0; font-size: .85em; }
.filtres input, .filtres select { width: auto; min-width: 120px; }
.pagination { display: flex; gap: .3rem; flex-wrap: wrap; margin-top: 1rem; }
.pagination a { padding: .25rem .6rem; border: 1px solid var(--bord); border-radius: 4px; text-decoration: none; background: #fff; }
.pagination a.actif { background: var(--primaire); color: #fff; border-color: var(--primaire); }

.page-connexion { display: grid; place-items: center; min-height: 100vh; }
.carte.connexion { width: 360px; }
.carte.connexion h1 { text-align: center; margin-bottom: 1.2rem; }
.carte.connexion button { width: 100%; }

.colonnes { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 800px) { .colonnes { grid-template-columns: 1fr; } }
dl.fiche { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0; }
dl.fiche dt { color: var(--muet); }
dl.fiche dd { margin: 0; }
.badge.etat-nouvelle { background: #e5e7eb; color: #374151; }
.badge.etat-chauffe { background: #fef3c7; color: #92400e; }
.badge.etat-active, .badge.etat-actif { background: #dcfce7; color: #166534; }
.badge.etat-pause { background: #dbeafe; color: #1e3a8a; }
.badge.etat-grillee, .badge.etat-rouge { background: #fee2e2; color: #991b1b; }
.badge.etat-orange { background: #ffedd5; color: #9a3412; }
.badge.etat-repos { background: #e5e7eb; color: #374151; }
.badge.sante-vert { background: #dcfce7; color: #166534; }
.badge.sante-orange { background: #ffedd5; color: #9a3412; }
.badge.sante-rouge { background: #fee2e2; color: #991b1b; }
small.attention { color: var(--attention); }
.badge.temp-froid { background: #e5e7eb; color: #374151; }
.badge.temp-a_repondu { background: #dbeafe; color: #1e3a8a; }
.badge.temp-interesse { background: #fef3c7; color: #92400e; }
.badge.temp-client { background: #dcfce7; color: #166534; }
.ligne-libre { display: flex; gap: 2%; margin-bottom: .4rem; }
.ligne-libre input { padding: .4rem .5rem; border: 1px solid var(--bord); border-radius: 6px; font: inherit; }
.badge.camp-brouillon { background: #e5e7eb; color: #374151; }
.badge.camp-active { background: #dcfce7; color: #166534; }
.badge.camp-pause { background: #dbeafe; color: #1e3a8a; }
.badge.camp-terminee { background: #f3f4f6; color: #6b7280; }
.badge.cl-interesse { background: #dcfce7; color: #166534; }
.badge.cl-question { background: #dbeafe; color: #1e3a8a; }
.badge.cl-absent { background: #f3f4f6; color: #6b7280; }
.badge.cl-mauvais_contact { background: #fef3c7; color: #92400e; }
.badge.cl-pas_interesse { background: #e5e7eb; color: #374151; }
.badge.cl-desinscription { background: #fee2e2; color: #991b1b; }
.badge.cl-rejet { background: #fee2e2; color: #991b1b; }
.badge.cl-autre { background: #fef3c7; color: #92400e; }
a.tuile:hover { border-color: var(--primaire); }
