/* data.importpublic.com : rapport d'analyse dans l'esprit de Looker Studio
   Toile grise, pages de rapport blanches, cartes de score, graphiques sobres. */
:root {
  --fond: #f1f3f4;
  --page: #ffffff;
  --bord: #dadce0;
  --bord-leger: #e8eaed;
  --texte: #202124;
  --texte-2: #5f6368;
  --texte-3: #80868b;
  --bleu: #1a73e8;
  --bleu-clair: #e8f0fe;
  --orange: #e8710a;
  --hausse: #188038;
  --hausse-fond: #e6f4ea;
  --baisse: #d93025;
  --baisse-fond: #fce8e6;
  --police: "Roboto", "Segoe UI", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--fond); color: var(--texte); font: 14px/1.45 var(--police); }
button, input, select { font: inherit; color: inherit; }
svg { display: block; }

/* Barre d'application */
.barre { position: sticky; top: 0; z-index: 20; background: var(--page); border-bottom: 1px solid var(--bord);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px;
  padding: 8px max(16px, env(safe-area-inset-right, 0px)) 8px max(16px, env(safe-area-inset-left, 0px)); }
.barre-gauche { display: flex; align-items: center; gap: 12px; min-width: 0; }
.marque { width: 36px; height: 36px; border-radius: 8px; background: var(--bleu); display: grid; place-items: center; flex: none; }
.marque svg { width: 22px; height: 22px; fill: #fff; }
.marque .accent { fill: #ffb27a; }
.titre-rapport { display: flex; flex-direction: column; min-width: 0; }
.titre-rapport b { font-size: 1.05rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.titre-rapport small { color: var(--texte-3); font-size: .78rem; }
.barre-droite { display: flex; align-items: center; gap: 10px; flex: none; }
.utilisateur { display: inline-flex; align-items: center; gap: 8px; color: var(--texte-2); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: #ffe6d5; color: #c2410c; display: grid; place-items: center; font-weight: 700; }
.lien-texte { background: none; border: 0; color: var(--bleu); font-weight: 500; cursor: pointer; padding: 6px 8px; border-radius: 6px; }
.lien-texte:hover { background: var(--bleu-clair); }

/* Contrôles du rapport (pages + filtres sur une ligne) */
.controles { position: sticky; top: 60px; z-index: 15; background: var(--page); border-bottom: 1px solid var(--bord);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px;
  padding: 0 max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px)); }
.pages { display: flex; overflow-x: auto; scrollbar-width: none; }
.pages button { border: 0; background: none; padding: 14px 16px 12px; color: var(--texte-2); font-weight: 500; cursor: pointer;
  border-bottom: 3px solid transparent; white-space: nowrap; }
.pages button:hover { color: var(--texte); background: #f8f9fa; }
.pages button.actif { color: var(--bleu); border-bottom-color: var(--bleu); }
.filtres-rapport { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 0; }
.controle { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--bord); border-radius: 6px; padding: 0 4px 0 10px; height: 36px; background: #fff; }
.controle span { color: var(--texte-3); font-size: .78rem; font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.controle select { border: 0; background: transparent; height: 34px; padding: 0 4px; font-weight: 500; cursor: pointer; }
.controle select:focus { outline: none; }
.controle:focus-within { border-color: var(--bleu); box-shadow: 0 0 0 2px var(--bleu-clair); }
.dates-perso { display: inline-flex; align-items: center; gap: 6px; }
.dates-perso input { height: 36px; border: 1px solid var(--bord); border-radius: 6px; padding: 0 8px; background: #fff; }
.bouton-icone { width: 36px; height: 36px; border: 1px solid var(--bord); border-radius: 6px; background: #fff; display: grid; place-items: center; cursor: pointer; }
.bouton-icone svg { width: 18px; height: 18px; fill: none; stroke: var(--texte-2); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bouton-icone:hover { background: #f8f9fa; }
.bouton-icone.tourne svg { animation: tourne .8s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }

/* Page du rapport */
main { padding: 20px max(16px, env(safe-area-inset-right, 0px)) 40px max(16px, env(safe-area-inset-left, 0px)); }
.page-rapport { background: var(--page); border: 1px solid var(--bord); border-radius: 8px; box-shadow: 0 1px 2px rgba(60, 64, 67, .08);
  padding: 20px; max-width: 1600px; margin: 0 auto; }
.entete-page { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 16px;
  padding-bottom: 12px; border-bottom: 1px solid var(--bord-leger); }
.entete-page h1 { margin: 0; font-size: 1.35rem; font-weight: 500; }
.entete-page p { margin: 0; color: var(--texte-3); font-size: .85rem; }
.grille { display: grid; gap: 16px; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.g3 { grid-column: span 12; } .g4 { grid-column: span 12; } .g6 { grid-column: span 12; } .g8 { grid-column: span 12; } .g12 { grid-column: span 12; }
@media (min-width: 640px) { .g3 { grid-column: span 6; } }
@media (min-width: 1000px) {
  .g3 { grid-column: span 3; } .g4 { grid-column: span 4; } .g6 { grid-column: span 6; } .g8 { grid-column: span 8; }
}

/* Composants */
.composant { border: 1px solid var(--bord-leger); border-radius: 8px; padding: 14px 16px; min-width: 0; background: #fff; }
.composant h2 { margin: 0 0 2px; font-size: .95rem; font-weight: 500; }
.composant .aide { margin: 0 0 10px; color: var(--texte-3); font-size: .78rem; }
.zone-graphique { position: relative; height: 260px; }
.zone-graphique.haute { height: 300px; }

/* Cartes de score */
.score { display: flex; flex-direction: column; gap: 4px; }
.score .libelle { color: var(--texte-2); font-size: .82rem; font-weight: 500; }
.score .valeur { font-size: 1.85rem; font-weight: 400; letter-spacing: -.01em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.score .ecart { display: inline-flex; align-items: center; gap: 4px; font-size: .8rem; font-weight: 500; padding: 2px 8px; border-radius: 4px; width: max-content; }
.score .ecart.hausse { color: var(--hausse); background: var(--hausse-fond); }
.score .ecart.baisse { color: var(--baisse); background: var(--baisse-fond); }
.score .ecart.neutre { color: var(--texte-2); background: #f1f3f4; }
.score .compare { color: var(--texte-3); font-size: .75rem; }
.score.alerte .valeur { color: #c2410c; }

/* Tableaux */
.tableau-conteneur { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th { text-align: left; font-weight: 500; color: var(--texte-2); background: #f8f9fa; border-bottom: 1px solid var(--bord); padding: 8px 10px; font-size: .8rem; white-space: nowrap; }
td { border-bottom: 1px solid var(--bord-leger); padding: 8px 10px; white-space: nowrap; }
td.num, th.num { text-align: right; }
td.rang { color: var(--texte-3); width: 1%; }
tr:hover td { background: #f8f9fa; }
.barre-cellule { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.barre-cellule i { display: block; height: 10px; border-radius: 0 4px 4px 0; background: var(--bleu); min-width: 2px; }
.barre-cellule.orange i { background: var(--orange); }
.pastille { display: inline-block; font-size: .72rem; font-weight: 500; padding: 2px 8px; border-radius: 10px; background: #f1f3f4; color: var(--texte-2); }

/* Entonnoir */
.entonnoir { display: grid; gap: 10px; }
.etape-entonnoir { display: grid; grid-template-columns: 120px minmax(0, 1fr) 60px; align-items: center; gap: 10px; }
.etape-entonnoir span { color: var(--texte-2); font-size: .85rem; }
.etape-entonnoir b { text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }
.etape-entonnoir .piste { background: #f1f3f4; border-radius: 0 4px 4px 0; height: 22px; }
.etape-entonnoir .piste i { display: block; height: 100%; background: var(--bleu); border-radius: 0 4px 4px 0; }

/* Divers */
.chargement, .vide { text-align: center; color: var(--texte-3); padding: 48px 16px; }
.erreur { background: var(--baisse-fond); color: var(--baisse); border-radius: 6px; padding: 12px 14px; }
.connexion { max-width: 400px; margin: 48px auto; background: #fff; border: 1px solid var(--bord); border-radius: 8px; padding: 28px; }
.connexion h1 { font-size: 1.4rem; font-weight: 500; margin: 0 0 6px; }
.connexion p { color: var(--texte-2); margin: 0 0 18px; }
.connexion label { display: block; font-size: .85rem; font-weight: 500; margin: 12px 0 6px; color: var(--texte-2); }
.connexion input { width: 100%; height: 44px; border: 1px solid var(--bord); border-radius: 6px; padding: 0 12px; }
.connexion input:focus { outline: none; border-color: var(--bleu); box-shadow: 0 0 0 2px var(--bleu-clair); }
.bouton-bleu { width: 100%; height: 44px; margin-top: 18px; border: 0; border-radius: 6px; background: var(--bleu); color: #fff; font-weight: 500; cursor: pointer; }
.bouton-bleu:hover { background: #1765cc; }
.bouton-bleu:disabled { opacity: .6; cursor: wait; }
.legende-tableau { margin-top: 8px; }
.legende-tableau summary { cursor: pointer; color: var(--bleu); font-size: .8rem; font-weight: 500; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--bleu); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .bouton-icone.tourne svg { animation: none; } }
@media (max-width: 720px) {
  .titre-rapport small { display: none; }
  .utilisateur .nom { display: none; }
  .controles { top: 60px; }
  .page-rapport { padding: 14px; }
}

/* Partage et éditeur de rapports */
.bouton-partage { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 16px; border: 0; border-radius: 18px;
  background: var(--bleu); color: #fff; font-weight: 500; cursor: pointer; }
.bouton-partage:hover { background: #1765cc; }
.bouton-partage svg { width: 16px; height: 16px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.panneau { border: 0; border-radius: 10px; padding: 20px; width: min(520px, calc(100vw - 32px)); box-shadow: 0 12px 40px rgba(60, 64, 67, .3); color: var(--texte); }
.panneau.large { width: min(1000px, calc(100vw - 32px)); }
.panneau::backdrop { background: rgba(32, 33, 36, .45); }
.panneau-entete { display: flex; align-items: center; justify-content: space-between; margin: 0 0 6px; }
.panneau-entete h2 { margin: 0; font-size: 1.15rem; font-weight: 500; }
.panneau .aide { color: var(--texte-3); font-size: .82rem; margin: 6px 0 12px; }
.ligne-partage { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; }
.ligne-partage input, .ligne-partage select, .editeur-champs input, .editeur-champs select {
  height: 40px; border: 1px solid var(--bord); border-radius: 6px; padding: 0 10px; background: #fff; min-width: 0; width: 100%; }
.bouton-bleu.court { width: auto; height: 40px; margin: 0; padding: 0 18px; }
.partage { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--bord-leger); }
.partage b { font-weight: 500; overflow-wrap: anywhere; }
.partage select { height: 34px; border: 1px solid var(--bord); border-radius: 6px; padding: 0 6px; background: #fff; }
.editeur { display: grid; gap: 18px; }
.editeur-champs { display: grid; gap: 10px; align-content: start; }
.editeur-champs label { display: grid; gap: 4px; font-size: .8rem; font-weight: 500; color: var(--texte-2); }
.editeur-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.editeur-apercu .composant { min-height: 300px; }
@media (min-width: 820px) { .editeur { grid-template-columns: 300px minmax(0, 1fr); } }

.liste-rapports { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.carte-rapport { border: 1px solid var(--bord); border-radius: 8px; padding: 16px; background: #fff; cursor: pointer; text-align: left; display: grid; gap: 6px; }
.carte-rapport:hover { border-color: var(--bleu); box-shadow: 0 1px 6px rgba(26, 115, 232, .15); }
.carte-rapport b { font-size: 1rem; font-weight: 500; color: var(--texte); }
.carte-rapport span { color: var(--texte-3); font-size: .8rem; }
.carte-rapport.nouveau { border-style: dashed; color: var(--bleu); place-content: center; text-align: center; min-height: 110px; font-weight: 500; }
.outils-rapport { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.titre-editable { font-size: 1.35rem; font-weight: 500; border: 1px solid transparent; border-radius: 6px; padding: 2px 6px; margin-left: -6px; background: none; min-width: 0; width: 100%; }
.titre-editable:hover, .titre-editable:focus { border-color: var(--bord); outline: none; }
.composant .outils-graphique { float: right; display: flex; gap: 2px; }
.outils-graphique button { border: 0; background: none; color: var(--texte-3); cursor: pointer; padding: 2px 6px; border-radius: 4px; font-size: .8rem; }
.outils-graphique button:hover { background: #f1f3f4; color: var(--texte); }
.bouton-secondaire { height: 36px; padding: 0 14px; border: 1px solid var(--bord); border-radius: 6px; background: #fff; color: var(--bleu); font-weight: 500; cursor: pointer; }
.bouton-secondaire:hover { background: var(--bleu-clair); }
.bouton-danger { color: var(--baisse); }
