/* Mes shops : bandeau « toutes tes boutiques » + une carte par boutique (logo, CA cumulé, courbe, chiffres). */
.shx { display: flex; flex-direction: column; gap: var(--sp-5); }
.shx-label { display: block; color: var(--muted); font-size: var(--t-2xs); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }

/* ---------- Logos (boutique ou plateforme) ---------- */
.shx-logo {
  position: relative; display: grid; place-items: center; flex: none; width: 52px; height: 52px; border-radius: 15px;
  color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, var(--card));
  border: 1px solid color-mix(in srgb, var(--brand) 24%, var(--line));
  box-shadow: var(--highlight), 0 8px 18px -12px color-mix(in srgb, var(--brand) 70%, transparent);
}
.shx-logo svg { width: 27px; height: 27px; }
.shx-logo--sm { width: 30px; height: 30px; border-radius: 9px; }
.shx-logo--sm svg { width: 16px; height: 16px; }
.shx-logo--img { background: var(--chart-surface); border-color: var(--line); }
.shx-logo--img img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.shx-logo__pf {
  position: absolute; right: -5px; bottom: -5px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px;
  color: var(--brand); background: var(--chart-surface); border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--line));
}
.shx-logo__pf svg { width: 13px; height: 13px; }
:root[data-theme="dark"] .shx-logo { background: color-mix(in srgb, var(--brand) 20%, #0c1424); color: color-mix(in srgb, var(--brand) 72%, #ffffff); }

/* ---------- Bandeau : toutes les boutiques ---------- */
.shx-hero {
  position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--sp-5) var(--sp-7);
  padding: var(--sp-6) var(--sp-7); border-radius: 20px; background: var(--card); border: 1px solid var(--line-strong);
  box-shadow: var(--highlight), var(--shadow-card); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
}
.shx-hero::before {
  content: ""; position: absolute; inset: -40% auto auto -10%; width: 60%; height: 140%; pointer-events: none;
  background: radial-gradient(closest-side, var(--accent-soft), transparent); opacity: 0.9;
}
.shx-hero > * { position: relative; }
.shx-eyebrow {
  display: inline-flex; align-items: center; gap: 6px; width: fit-content; margin-bottom: var(--sp-4); padding: 4px 10px 4px 8px;
  border-radius: var(--r-pill); color: var(--accent-ink); background: var(--accent-soft); font-size: var(--t-xs); font-weight: 600;
}
.shx-eyebrow svg { width: 14px; height: 14px; }
.shx-hero__main { display: flex; flex-direction: column; }
.shx-hero__main strong { margin-top: 6px; font-size: clamp(2.25rem, 1.5rem + 2.2vw, 3.25rem); font-weight: 680; line-height: 1.05; letter-spacing: -0.03em; }
.shx-hero__main p { margin: 10px 0 0; color: var(--muted); font-size: var(--t-sm); }
.shx-hero__kpis { display: flex; align-self: end; margin: 0; border-radius: 14px; background: var(--well); border: 1px solid var(--line); }
.shx-hero__kpis div { padding: 12px 20px; }
.shx-hero__kpis div + div { border-left: 1px solid var(--line); }
.shx-hero__kpis dt { color: var(--ink-2); font-size: var(--t-xs); white-space: nowrap; }
.shx-hero__kpis dd { margin: 3px 0 0; font-size: var(--t-xl); font-weight: 650; letter-spacing: -0.02em; }

.shx-split { grid-column: 1 / -1; }
.shx-split__bar { display: flex; gap: 3px; height: 10px; }
.shx-split__bar span { flex-basis: 0; min-width: 6px; border-radius: 4px; background: var(--c); }
.shx-split__legend { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 12px 0 0; padding: 0; list-style: none; }
.shx-split__legend li { display: inline-flex; align-items: center; gap: 8px; font-size: var(--t-sm); }
.shx-split__legend i { width: 8px; height: 8px; border-radius: 3px; background: var(--c); }
.shx-split__name { color: var(--ink-2); }
.shx-split__pct { color: var(--ink); font-weight: 600; }

/* ---------- Cartes boutique ---------- */
.shx-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); }
.shx-card {
  position: relative; overflow: hidden; display: flex; flex-direction: column; min-width: 0; padding: 22px 24px 18px;
  border-radius: 18px; background: var(--card); border: 1px solid var(--line);
  box-shadow: var(--highlight), var(--shadow-card); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  transition: transform var(--dur) var(--ease), border-color var(--dur-fast), box-shadow var(--dur) var(--ease), background var(--dur-fast);
}
/* Halo à la couleur de la boutique qui suit le pointeur. */
.shx-card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity var(--dur) var(--ease);
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--c) 11%, transparent), transparent 65%);
}
.shx-card > * { position: relative; }
@media (hover: hover) {
  .shx-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--c) 28%, var(--line-strong)); background: var(--card-hover); box-shadow: var(--highlight), var(--shadow-pop); }
  .shx-card:hover::before { opacity: 1; }
}

.shx-card__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3) 14px; }
.shx-card__id { flex: 1 1 160px; min-width: 0; }
.shx-card__id h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 1.0625rem; font-weight: 650; letter-spacing: -0.01em; }
.shx-card__id p { display: flex; flex-wrap: wrap; align-items: center; gap: 0 7px; margin: 3px 0 0; color: var(--muted); font-size: var(--t-sm); overflow-wrap: anywhere; }
.shx-sep { width: 3px; height: 3px; flex: none; border-radius: 50%; background: var(--faint); }
.shx-new { padding: 2px 7px; border-radius: var(--r-pill); color: var(--accent-ink); background: var(--accent-soft); font-size: var(--t-2xs); font-style: normal; font-weight: 650; }

.shx-state {
  display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 10px; border-radius: var(--r-pill);
  color: var(--ink-2); background: var(--chip); font-size: var(--t-xs); font-weight: 600; white-space: nowrap;
}
.shx-state i { position: relative; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.shx-state--live { color: var(--ok); background: var(--ok-soft); }
.shx-state--live i { background: var(--live); }
.shx-state--live i::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--live); animation: shx-ping 2.4s var(--ease) infinite; }
.shx-state--idle { color: var(--muted); }

.shx-figure { margin-top: 22px; }
.shx-figure strong { display: block; margin-top: 6px; font-size: clamp(1.75rem, 1.35rem + 1.1vw, 2.25rem); font-weight: 680; line-height: 1.08; letter-spacing: -0.025em; }
.shx-figure p { margin: 6px 0 0; color: var(--muted); font-size: var(--t-sm); }

.shx-empty {
  display: flex; align-items: center; justify-content: center; gap: 8px; height: 112px; margin-top: 18px;
  border: 1px dashed var(--line-strong); border-radius: 12px; color: var(--muted); font-size: var(--t-sm);
}
.shx-empty svg { width: 16px; height: 16px; }

.shx-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--line); }
.shx-facts div { min-width: 0; padding: 0 12px; }
.shx-facts div:first-child { padding-left: 0; }
.shx-facts div + div { border-left: 1px solid var(--line); }
.shx-facts dt { color: var(--muted); font-size: var(--t-xs); white-space: nowrap; }
.shx-facts dd { margin: 3px 0 0; font-size: var(--t-base); font-weight: 600; }

/* ---------- Courbe du CA cumulé ---------- */
.growth { margin: 18px 0 0; }
.growth__plot { position: relative; height: 96px; touch-action: pan-y; cursor: crosshair; }
.growth__plot svg { display: block; width: 100%; height: 100%; overflow: visible; }
.growth__line { fill: none; stroke: var(--c); stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round; }
.growth__end, .growth__dot { position: absolute; width: 9px; height: 9px; border-radius: 50%; translate: -50% -50%; background: var(--c); }
.growth__end { box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 18%, transparent); transition: opacity var(--dur-fast); }
.growth__dot { opacity: 0; border: 2px solid var(--chart-surface); width: 11px; height: 11px; transition: opacity var(--dur-fast); }
.growth__cross { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px dashed var(--line-strong); opacity: 0; transition: opacity var(--dur-fast); }
.growth__tip {
  position: absolute; top: -6px; display: flex; flex-direction: column; gap: 1px; padding: 6px 10px; border-radius: 9px; pointer-events: none;
  background: var(--tip-bg); border: 1px solid var(--line); box-shadow: var(--shadow-pop); opacity: 0; translate: 0 4px;
  transition: opacity var(--dur-fast), translate var(--dur-fast); white-space: nowrap;
}
.growth__tip span { color: var(--muted); font-size: var(--t-2xs); }
.growth__tip strong { font-size: var(--t-sm); font-weight: 650; }
.growth__plot.is-hover .growth__dot, .growth__plot.is-hover .growth__cross, .growth__plot.is-hover .growth__tip { opacity: 1; translate: 0 0; }
.growth__plot.is-hover .growth__dot { translate: -50% -50%; }
.growth__plot.is-hover .growth__end { opacity: 0; }
.growth__axis { display: flex; justify-content: space-between; margin-top: 8px; color: var(--muted); font-size: var(--t-2xs); font-weight: 500; }

/* ---------- Page vide ---------- */
.shx-none { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 64px 24px; text-align: center; border-radius: 20px; background: var(--card); border: 1px dashed var(--line-strong); }
.shx-none > svg { width: 28px; height: 28px; color: var(--accent); }
.shx-none h1 { margin: 6px 0 0; font-size: var(--t-xl); }
.shx-none p { margin: 0 0 8px; color: var(--muted); }

/* ---------- Entrée animée (une fois, en arrivant sur la page) ---------- */
.shx.is-intro .shx-hero, .shx.is-intro .shx-card { animation: shx-rise 620ms var(--ease) backwards; animation-delay: calc(var(--i, 0) * 70ms + 40ms); }
.shx.is-intro .growth__plot svg { animation: shx-reveal 1300ms var(--ease) backwards; animation-delay: calc(var(--i, 0) * 70ms + 260ms); }
.shx.is-intro .growth__end { animation: shx-pop 460ms var(--ease) backwards; animation-delay: calc(var(--i, 0) * 70ms + 1250ms); }
.shx.is-intro .shx-split__bar { animation: shx-reveal 1100ms var(--ease) backwards; animation-delay: 260ms; }
.shx.is-intro .shx-split__legend li { animation: shx-fade 400ms var(--ease) backwards; animation-delay: 700ms; }

@keyframes shx-rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes shx-reveal { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes shx-pop { from { opacity: 0; scale: 0.2; } }
@keyframes shx-fade { from { opacity: 0; } }
@keyframes shx-ping { 0% { opacity: 0.55; transform: scale(1); } 70%, 100% { opacity: 0; transform: scale(2.8); } }

@media (prefers-reduced-motion: reduce) {
  .shx *, .shx *::before, .shx *::after { animation: none !important; transition: none !important; }
}

/* ---------- Petits écrans ---------- */
@media (max-width: 1180px) {
  /* Le gros total et le bloc de chiffres se chevauchaient entre 861 et ~920 px : on les empile. */
  .shx-hero { grid-template-columns: minmax(0, 1fr); }
  .shx-hero__kpis { align-self: start; justify-self: start; }
}
@media (max-width: 1080px) {
  .shx-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 380px) {
  .shx-hero__kpis div { min-width: 0; padding: 10px 10px; }
  .shx-hero__kpis dt { white-space: normal; }
  .shx-hero__kpis dd { font-size: var(--t-lg); }
}
@media (max-width: 760px) {
  .shx-hero { grid-template-columns: minmax(0, 1fr); padding: var(--sp-5); }
  .shx-hero__kpis { align-self: stretch; justify-self: stretch; }
  .shx-hero__kpis div { flex: 1; padding: 10px 14px; }
  .shx-card { padding: 18px 18px 16px; }
  .shx-facts div { padding: 0 8px; }
}
/* Pied de carte étroit : « 30 derniers jours » et « Commandes » côte à côte, les frais en dessous. */
.shx-card { container-type: inline-size; }
@container (max-width: 360px) {
  .shx-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 12px; }
  .shx-facts div:nth-child(3) { grid-column: 1 / -1; padding: 12px 0 0; border-left: 0; border-top: 1px solid var(--line); }
}
