:root {
  --fond: #f3f4f6;
  --carte: #ffffff;
  --texte: #1f2937;
  --doux: #6b7280;
  --marine: #1f3864;
  --vert: #027a48;
  --vert-fond: #ecfdf3;
  --orange: #b54708;
  --orange-fond: #fffaeb;
  --rouge: #b42318;
  --rouge-fond: #fef3f2;
  --bord: #e5e7eb;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.4 system-ui, "Segoe UI", Arial, sans-serif; color: var(--texte); background: var(--fond); }
h1, h2 { margin: 0; }
button, .bouton { font: inherit; cursor: pointer; }

/* Connexion */
.page-connexion { display: grid; place-items: center; min-height: 100vh; }
.boite-connexion { background: var(--carte); padding: 32px; border-radius: 10px; width: 360px; box-shadow: 0 2px 12px rgba(0,0,0,.08); }
.boite-connexion h1 { color: var(--marine); font-size: 24px; }
.sous-titre, .aide { color: var(--doux); margin: 4px 0 16px; }
.aide { margin: 16px 0 0; font-size: 13px; }
.message:empty { display: none; }
.message { background: var(--rouge-fond); color: var(--rouge); padding: 8px 10px; border-radius: 6px; }
.boite-connexion label { display: block; margin: 12px 0 4px; font-weight: 600; }
.boite-connexion input { width: 100%; padding: 9px 10px; border: 1px solid #c7ccd4; border-radius: 6px; font: inherit; }
.boite-connexion button { width: 100%; margin-top: 18px; padding: 10px; background: var(--marine); color: #fff; border: 0; border-radius: 6px; font-weight: 600; }

/* En-tête */
.entete { display: flex; align-items: center; gap: 24px; padding: 12px 20px; background: var(--marine); color: #fff; }
.entete h1 { font-size: 20px; }
.entete .titre p { margin: 2px 0 0; opacity: .85; }
.compteurs { display: flex; gap: 12px; margin-left: auto; }
.compteur { background: rgba(255,255,255,.12); border-radius: 8px; padding: 6px 14px; text-align: center; min-width: 110px; }
.compteur strong { display: block; font-size: 22px; }
.compteur span { font-size: 12px; opacity: .9; }
.actions { display: flex; align-items: center; gap: 8px; }
.actions form { margin: 0; }
.actions button { padding: 7px 12px; border-radius: 6px; border: 0; background: #fff; color: var(--marine); font-weight: 600; }
.actions button.secondaire { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.5); }
.maj { margin: 0; font-size: 12px; opacity: .85; }
.bandeau { margin: 0; padding: 8px 20px; background: var(--orange-fond); color: var(--orange); font-weight: 600; }

/* Colonnes */
.colonnes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; padding: 14px 20px; }
.colonnes h2 { font-size: 15px; color: var(--marine); margin-bottom: 8px; text-transform: uppercase; letter-spacing: .5px; }
.cartes { display: flex; flex-direction: column; gap: 10px; }
.cartes.ligne { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 0 20px 20px; }
.vide { color: var(--doux); font-style: italic; margin: 0; }

.carte { background: var(--carte); border: 1px solid var(--bord); border-left: 4px solid var(--marine); border-radius: 8px; padding: 10px 12px; cursor: pointer; }
.carte:hover, .carte:focus { box-shadow: 0 2px 10px rgba(31,56,100,.18); outline: none; }
.carte p { margin: 3px 0; }
.carte-tete { display: flex; justify-content: space-between; gap: 8px; }
.num { font-weight: 700; font-variant-numeric: tabular-nums; }
.client { font-weight: 600; }
.infos { color: var(--doux); font-size: 13px; }
.infos.fort { color: var(--texte); font-weight: 600; }
.etat { font-weight: 600; }
.delai { font-weight: 700; padding: 3px 8px; border-radius: 5px; display: inline-block; }
.delai.vert { color: var(--vert); background: var(--vert-fond); }
.delai.orange { color: var(--orange); background: var(--orange-fond); }
.delai.rouge { color: var(--rouge); background: var(--rouge-fond); }
.delai.gris { color: var(--doux); background: var(--fond); }
.telephone { font-size: 16px; font-weight: 700; }
.mention { font-size: 13px; background: var(--fond); padding: 5px 8px; border-radius: 5px; }
.etat-alerte { border-left-color: var(--rouge); background: var(--rouge-fond); }
.etat-retractation, .etat-incoherent, .etat-terminee { border-left-color: #98a2b3; }

.boutons { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.bouton { display: flex; flex-direction: column; padding: 8px 12px; border-radius: 6px; text-decoration: none; background: var(--marine); color: #fff; border: 0; text-align: left; }
.bouton:hover { background: #162a4d; }
.bouton-libelle { font-weight: 700; font-size: 15px; }
.bouton-mode { font-size: 12px; opacity: .9; }
.bouton.grise { background: #e5e7eb; color: #6b7280; cursor: not-allowed; }

/* Terminées */
.terminees { margin: 0 20px 20px; background: var(--carte); border-radius: 8px; border: 1px solid var(--bord); }
.terminees summary { padding: 10px 14px; font-weight: 600; color: var(--marine); cursor: pointer; }
.terminees .cartes.ligne { padding: 0 14px 14px; }

/* Historique */
.historique { position: fixed; top: 0; right: 0; bottom: 0; width: 620px; max-width: 100%; background: var(--carte); box-shadow: -4px 0 20px rgba(0,0,0,.18); overflow-y: auto; padding: 16px 20px; }
.historique-tete { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.historique-tete h2 { font-size: 17px; color: var(--marine); }
.historique-tete button { padding: 6px 12px; border: 1px solid var(--bord); background: #fff; border-radius: 6px; }
.historique ol.chrono { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--bord); }
.historique ol.chrono > li { padding: 0 0 14px 14px; position: relative; }
.historique ol.chrono > li::before { content: ""; position: absolute; left: -6px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--marine); }
.historique time { display: block; color: var(--doux); font-size: 12px; }
.historique ul { margin: 4px 0 0; padding-left: 16px; color: #374151; }

/* Connexion Google */
.bouton-google { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 18px; padding: 10px; border: 1px solid #c7ccd4; border-radius: 6px; color: var(--texte); text-decoration: none; font-weight: 600; background: #fff; }
.bouton-google:hover { background: var(--fond); }

/* Onglets et rapport */
.onglets { display: flex; align-items: center; gap: 4px; padding: 8px 20px 0; border-bottom: 1px solid var(--bord); background: #fff; }
.onglet { padding: 8px 14px; border: 0; border-bottom: 3px solid transparent; background: none; color: var(--doux); font-weight: 600; }
.onglet.actif { color: var(--marine); border-bottom-color: var(--marine); }
.rapport { margin-left: auto; display: flex; align-items: center; gap: 8px; padding-bottom: 6px; }
.rapport label, .barre label { font-weight: 600; color: var(--marine); }
select, input[type="search"] { font: inherit; padding: 5px 8px; border: 1px solid #c7ccd4; border-radius: 6px; background: #fff; }
.bouton-petit { padding: 6px 12px; border-radius: 6px; background: var(--marine); color: #fff; text-decoration: none; font-weight: 600; }

/* Vues admin */
.vue { padding: 14px 20px; }
#vue-tableau { padding: 0; }
.barre { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.grille-compteurs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.bloc { background: #fff; border: 1px solid var(--bord); border-left: 4px solid var(--marine); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.bloc strong { font-size: 22px; color: var(--marine); }
.bloc-titre { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; color: var(--doux); }
.bloc-detail { font-size: 12.5px; color: var(--doux); }
.bloc.orange { border-left-color: var(--orange); }
.bloc.rouge { border-left-color: var(--rouge); background: var(--rouge-fond); }
.titre-bloc { font-size: 15px; color: var(--marine); margin: 6px 0 8px; }
.aide-titre { font-weight: 400; font-size: 12.5px; color: var(--doux); }
.defile { overflow-x: auto; background: #fff; border: 1px solid var(--bord); border-radius: 8px; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { background: var(--marine); color: #fff; text-align: left; padding: 7px 8px; white-space: nowrap; font-weight: 600; }
.table th.triable { cursor: pointer; }
.table td { padding: 6px 8px; border-bottom: 1px solid var(--bord); }
.table tbody tr:nth-child(even) { background: #f9fafb; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table.compacte { font-size: 12.5px; }
.lien { border: 0; background: none; padding: 0; color: var(--marine); font-weight: 600; text-decoration: underline; cursor: pointer; font: inherit; }

/* Fiche conseiller */
.fiche h3 { font-size: 14px; color: var(--marine); margin: 16px 0 6px; }
.fiche ol, .fiche ul { margin: 0; padding-left: 20px; }
.serie { display: flex; flex-direction: column; gap: 6px; }
.serie-ligne { display: grid; grid-template-columns: 130px 1fr 170px; align-items: center; gap: 8px; font-size: 13px; }
.serie-barre { height: 12px; background: var(--fond); border-radius: 6px; overflow: hidden; }
.serie-rempli { display: block; height: 100%; background: var(--vert); }
.serie-val { color: var(--doux); }
