/* We Go Club — hiérarchie visuelle globale V2.1
   Accent de section, jamais au détriment des statuts, avertissements et droits. */
body.crm-v2-shell {
  --crm-ui-bg: var(--color-background);
  --crm-ui-ink: var(--color-text);
}
body.crm-v2-shell #view {
  --crm-area: var(--color-primary);
  --crm-area-soft: var(--module-soft);
  --crm-area-border: var(--module-border);
}
/* Un seul bleu pour la navigation dans tous les portails : les nuances
   précédentes par module pouvaient rappeler des couleurs de statut.
   Conserver les marqueurs d'emplacement, pas les distinctions d'alerte. */
body.crm-v2-shell #view[data-crm-route="reservations"],
body.crm-v2-shell #view[data-crm-route="options"],
body.crm-v2-shell #view[data-crm-route="clients"],
body.crm-v2-shell #view[data-crm-route="a-completer"],
body.crm-v2-shell #view[data-crm-route="departs"],
body.crm-v2-shell #view[data-crm-route="pointage"],
body.crm-v2-shell #view[data-crm-route="villes-depart"],
body.crm-v2-shell #view[data-crm-route="programmes"],
body.crm-v2-shell #view[data-crm-route="caisse"],
body.crm-v2-shell #view[data-crm-route="caisse-agence"],
body.crm-v2-shell #view[data-crm-route="paiements"],
body.crm-v2-shell #view[data-crm-route="avoirs"],
body.crm-v2-shell #view[data-crm-route="factures"],
body.crm-v2-shell #view[data-crm-route="fidelite"],
body.crm-v2-shell #view[data-crm-route="messages"],
body.crm-v2-shell #view[data-crm-route="statistiques"],
body.crm-v2-shell #view[data-crm-route="pilotage"],
body.crm-v2-shell #view[data-crm-route="admin"] {
  --crm-area: var(--color-primary);
  --crm-area-soft: var(--module-soft);
  --crm-area-border: var(--module-border);
}

body.crm-v2-shell #view:not(.admin-v2) .page-head .title-ic { color:var(--crm-area); }
body.crm-v2-shell #view:not(.admin-v2) .crm-v2-section-label { color:var(--crm-area); }
body.crm-v2-shell #view:not(.admin-v2) .crm-v2-section-label::before { background:var(--crm-area); }
body.crm-v2-shell #view:not(.admin-v2) .tabs a.on { border-bottom-color:var(--crm-area); color:var(--crm-area); }
body.crm-v2-shell #view:not(.admin-v2) .seg .on,
body.crm-v2-shell #view:not(.admin-v2) .seg a.on,
body.crm-v2-shell #view:not(.admin-v2) .seg button.on { color:var(--crm-area); background:var(--crm-area-soft); }
body.crm-v2-shell #view:not(.admin-v2) .card-head:has(h2),
body.crm-v2-shell #view:not(.admin-v2) .card-head:has(h3) { border-bottom-color:var(--crm-area-border); }
body.crm-v2-shell #view:not(.admin-v2) .card-head h2,
body.crm-v2-shell #view:not(.admin-v2) .card-head h3 { color:var(--color-text); }
body.crm-v2-shell #view:not(.admin-v2) .card:has(> .card-head) { border-top:2px solid var(--crm-area-border); }
body.crm-v2-shell #view:not(.admin-v2) .kpi:not(.kpi-warn) { border-top:2px solid var(--crm-area-border); }
body.crm-v2-shell #view:not(.admin-v2) .kpi .value { color:var(--color-text); }
body.crm-v2-shell #view:not(.admin-v2) .bk-form-step.is-complete { border-color:var(--crm-area-border); }
body.crm-v2-shell #view:not(.admin-v2) .bk-form-step.is-complete .bk-form-step-num { color:var(--crm-area); }

/* Informations prioritaires : le libellé reste indispensable, la couleur aide. */
body.crm-v2-shell .notice-danger,
body.crm-v2-shell .alert-item.alert-red { border-left:4px solid var(--status-danger); }
body.crm-v2-shell .notice-warn,
body.crm-v2-shell .alert-item.alert-orange { border-left:4px solid var(--status-warning); }
body.crm-v2-shell .notice-ok { border-left:4px solid var(--status-success); }
body.crm-v2-shell .bk-adult-guard { margin:0; border-radius:13px; line-height:1.5; font-weight:570; }
body.crm-v2-shell #pay-mode { align-self:flex-start; flex-wrap:wrap; border-radius:12px; background:var(--color-surface-hover); padding:5px; }
body.crm-v2-shell #pay-mode label { white-space:normal; border-radius:9px; }
body.crm-v2-shell #pay-mode-help { line-height:1.45; margin:1px 0 3px; }
body.crm-v2-shell .split-row { border-left:3px solid var(--color-primary); border-radius:12px; }
body.crm-v2-shell #view .bk-recap-balance { border-top:1px solid var(--color-border); background:var(--color-primary-soft); }
body.crm-v2-shell .ca-blacklist,
body.crm-v2-shell .bk-retained-advance { border-left-width:4px; }
@media (max-width:760px) {
  body.crm-v2-shell #pay-mode { width:100%; }
  body.crm-v2-shell #pay-mode label { flex:1 1 190px; }
}

/* ════════ STATISTIQUES V3 : outil de pilotage, sans changement de données ════════ */
body.crm-v2-shell .stats-v3 {
  display:grid; gap:22px; width:100%; max-width:100%;
  min-width:0; grid-template-columns:minmax(0,1fr);
}
body.crm-v2-shell .stats-v3 > *,
body.crm-v2-shell .stats-v3 .stats-block,
body.crm-v2-shell .stats-v3 .stats-visual-grid,
body.crm-v2-shell .stats-v3 .table-wrap {
  min-width:0; max-width:100%;
}
body.crm-v2-shell .stats-v3 .table-wrap { width:100%; overflow-x:auto; }
body.crm-v2-shell .stats-v3 .stats-head { margin:0; padding:3px 0 0; align-items:center; }
body.crm-v2-shell .stats-v3 .stats-overline { color:var(--color-primary); letter-spacing:.15em; font-size:10px; font-weight:790; text-transform:uppercase; }
body.crm-v2-shell .stats-v3 h1 { font-size:clamp(26px,2.4vw,34px); letter-spacing:-.04em; }
body.crm-v2-shell .stats-v3 .stats-subline { color:var(--color-text-secondary); max-width:85ch; font-size:13px; line-height:1.6; margin-top:8px; }
body.crm-v2-shell .stats-v3 .stats-period {
  display:flex; gap:12px; flex-wrap:wrap; align-items:flex-end;
  border:1px solid #e0eaf6; border-radius:19px; padding:16px 18px;
  background:linear-gradient(125deg,#ffffff,#f6faff); box-shadow:0 8px 28px rgba(34,72,123,.04);
  margin:0;
}
body.crm-v2-shell .stats-v3 .stats-period .seg { flex-wrap:wrap; max-width:100%; gap:4px; overflow:visible; background:transparent; border:0; }
body.crm-v2-shell .stats-v3 .stats-period .seg a { border:1px solid #e1eaf6; border-radius:10px; padding:8px 11px; background:#fff; font-size:12px; }
body.crm-v2-shell .stats-v3 .stats-period .seg a.on { background:#e8f2ff; border-color:#92bde9; color:#235eab; }
body.crm-v2-shell .stats-v3 .stats-period .field { min-width:135px; }
body.crm-v2-shell .stats-v3 .stats-period .btn { min-height:42px; }
body.crm-v2-shell .stats-v3 .stats-anchor-nav { display:flex; gap:7px; overflow-x:auto; padding:0 0 5px; scrollbar-width:thin; }
body.crm-v2-shell .stats-v3 .stats-anchor-nav button {
  display:inline-flex; align-items:center; padding:8px 13px; border-radius:99px;
  background:#fff; color:#647991; border:1px solid #e5edf7; font-size:12.5px;
  white-space:nowrap; font-weight:650; font-family:inherit; cursor:pointer; text-decoration:none;
  transition:background .2s,border-color .2s,color .2s;
}
body.crm-v2-shell .stats-v3 .stats-anchor-nav button:hover { background:#e9f3ff; color:#2769b5; border-color:#b9d5f3; }
body.crm-v2-shell .stats-v3 .stats-block { display:grid; gap:14px; scroll-margin-top:110px; min-width:0; }
body.crm-v2-shell .stats-v3 .stats-section-heading { display:flex; justify-content:space-between; align-items:flex-end; gap:12px; flex-wrap:wrap; }
body.crm-v2-shell .stats-v3 .stats-section-heading h2 { color:#203450; font-weight:760; letter-spacing:-.027em; font-size:19px; }
body.crm-v2-shell .stats-v3 .stats-section-heading p { color:#79889b; font-size:12.5px; }
body.crm-v2-shell .stats-v3 .stats-kpis { grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin:0; }
body.crm-v2-shell .stats-v3 .stats-kpis-secondary { grid-template-columns:repeat(3,minmax(0,1fr)); }
body.crm-v2-shell .stats-v3 .stats-kpis .kpi { min-height:140px; padding:20px; position:relative; border:1px solid #e3ebf5; overflow:hidden; }
body.crm-v2-shell .stats-v3 .stats-kpis .kpi::before {
  content:""; position:absolute; left:0; top:0; bottom:0; width:4px; background:var(--stats-kpi-accent,#3c80cc);
}
body.crm-v2-shell .stats-v3 .stats-kpis .kpi .label { font-weight:690; color:#657c96; }
body.crm-v2-shell .stats-v3 .stats-kpis .kpi .value { font-size:clamp(26px,2.2vw,36px); letter-spacing:-.05em; line-height:1.17; margin-top:14px; }
body.crm-v2-shell .stats-v3 .stats-kpis .kpi .hint { margin-top:9px; }
body.crm-v2-shell .stats-v3 .stats-kpis-secondary .kpi { min-height:118px; }
body.crm-v2-shell .stats-v3 .stats-kpis-secondary .kpi .value { font-size:25px; margin-top:8px; }
body.crm-v2-shell .stats-v3 .stats-kpi-blue { --stats-kpi-accent:#397ece; background:linear-gradient(150deg,#fff,#f5f9ff); }
body.crm-v2-shell .stats-v3 .stats-kpi-green { --stats-kpi-accent:#249e80; background:linear-gradient(150deg,#fff,#f3fcf7); }
body.crm-v2-shell .stats-v3 .stats-kpi-cyan { --stats-kpi-accent:#26a0b4; background:linear-gradient(150deg,#fff,#f2fbfd); }
body.crm-v2-shell .stats-v3 .stats-kpi-amber { --stats-kpi-accent:#d3a24c; background:linear-gradient(150deg,#fff,#fffaf0); }
body.crm-v2-shell .stats-v3 .stats-kpi-purple { --stats-kpi-accent:#8372be; background:linear-gradient(150deg,#fff,#f8f6ff); }
body.crm-v2-shell .stats-v3 .stats-kpi-rose { --stats-kpi-accent:#c66d79; background:linear-gradient(150deg,#fff,#fff7f8); }
body.crm-v2-shell .stats-v3 .stats-insights { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px; }
body.crm-v2-shell .stats-v3 .stats-insight { background:#fff; border:1px solid #e1ebf6; border-radius:17px; padding:18px 20px; border-left:4px solid var(--stats-insight-color,#4b89d4); display:grid;gap:8px; align-content:start; min-height:116px; }
body.crm-v2-shell .stats-v3 .stats-insight.is-urgent { --stats-insight-color:#d29039; background:linear-gradient(140deg,#fff,#fffaf2); }
body.crm-v2-shell .stats-v3 .stats-insight.is-good { --stats-insight-color:#28a286; background:linear-gradient(140deg,#fff,#f4fcf9); }
body.crm-v2-shell .stats-v3 .stats-insight.is-info { --stats-insight-color:#4987d0; }
body.crm-v2-shell .stats-v3 .stats-insight-label { font-size:11px;font-weight:790;text-transform:uppercase;letter-spacing:.06em;color:#7a8a9e; }
body.crm-v2-shell .stats-v3 .stats-insight-value { font-size:20px;line-height:1.2;font-weight:750;letter-spacing:-.025em;color:#25405c; }
body.crm-v2-shell .stats-v3 .stats-insight p { font-size:12.5px;color:#647890;line-height:1.55; }
body.crm-v2-shell .stats-v3 .stats-insight a { font-size:12px;font-weight:730; }
body.crm-v2-shell .stats-v3 .stats-main-chart { border-radius:19px;border:1px solid #dce8f6;background:linear-gradient(145deg,#fff,#fbfdff);padding:21px 23px; }
body.crm-v2-shell .stats-v3 .stats-main-chart .colchart { max-height:300px; }
body.crm-v2-shell .stats-v3 .stats-visual-grid { gap:13px; }
body.crm-v2-shell .stats-v3 .stats-visual-grid .card { min-width:0; }
body.crm-v2-shell .stats-v3 .stats-visual-grid h3 { font-size:15.5px;color:#263c59; }
body.crm-v2-shell .stats-v3 .stats-visual-grid .card-pad { padding:22px; }
body.crm-v2-shell .stats-v3 .hbar-fill:not(.s0):not(.s1):not(.s2) { background:linear-gradient(90deg,#317ecf,#74b2e9); }
body.crm-v2-shell .stats-v3 .rank-top td { background:#f3f9ff; }
body.crm-v2-shell .stats-v3 .rank td:first-child { color:#7193bc; }
body.crm-v2-shell .stats-v3 .stats-footnote { font-size:11.5px; color:#768ba2; padding:0 2px; }
body.crm-v2-shell .stats-v3 .stats-detail { border:1px solid #e1eaf6;border-radius:18px;padding:18px 20px;background:#fff; }
body.crm-v2-shell .stats-v3 .stats-detail summary { font-size:14px;color:#385574; }
@media (max-width:1150px) {
  body.crm-v2-shell .stats-v3 .stats-kpis { grid-template-columns:repeat(2,minmax(0,1fr)); }
  body.crm-v2-shell .stats-v3 .stats-insights { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:760px) {
  body.crm-v2-shell .stats-v3 { gap:16px; }
  body.crm-v2-shell .stats-v3 .stats-period { padding:13px;gap:9px; }
  body.crm-v2-shell .stats-v3 .stats-period .seg { width:100%; }
  body.crm-v2-shell .stats-v3 .stats-period .seg a { flex:1 1 auto;text-align:center; }
  body.crm-v2-shell .stats-v3 .stats-period .field { min-width:calc(50% - 10px);flex:1; }
  body.crm-v2-shell .stats-v3 .stats-kpis { gap:9px; }
  body.crm-v2-shell .stats-v3 .stats-kpis .kpi { min-height:120px; padding:14px 13px; }
  body.crm-v2-shell .stats-v3 .stats-kpis .kpi .value { font-size:26px; }
  body.crm-v2-shell .stats-v3 .stats-kpis .kpi .hint { font-size:11px; }
  body.crm-v2-shell .stats-v3 .stats-insights { grid-template-columns:1fr; gap:9px; }
  body.crm-v2-shell .stats-v3 .stats-main-chart { padding:12px 10px; }
  body.crm-v2-shell .stats-v3 .stats-visual-grid { grid-template-columns:1fr; }
  body.crm-v2-shell .stats-v3 .stats-visual-grid .card-pad { padding:15px; }
}
@media (max-width:390px) {
  body.crm-v2-shell .stats-v3 .stats-kpis { grid-template-columns:1fr; }
  body.crm-v2-shell .stats-v3 .stats-kpis .kpi { min-height:108px; }
}
@media (prefers-reduced-motion:reduce) {
  body.crm-v2-shell .stats-v3 .stats-anchor-nav button { transition:none !important; }
}
@media print {
  body.crm-v2-shell .stats-v3 .stats-period,
  body.crm-v2-shell .stats-v3 .stats-anchor-nav { display:none !important; }
  body.crm-v2-shell .stats-v3 .stats-block { break-inside:avoid; }
}
