/* 2Bshop PRO. Vue générale = DA 2Bshop (fond clair, rail sombre, couleurs à sens fixe).
   Page boutique = MÊME structure, couleurs et polices de la boutique via les variables posées sur .ws */
:root {
  --rail: #0B0D12; --rail-ink: #8B93A3; --gold: #E3B54C;
  --bg: #F4F5F7; --card: #FFFFFF; --ink: #0F172A; --muted: #64748B; --line: #E5E7EB; --soft: #F1F3F6;
  --dark: #0B0D12; --dark-ink: #F8FAFC; --hot: #E3B54C;
  --c-visits: #2563EB; --c-orders: #16A34A; --c-accounts: #7C3AED; --c-bad: #DC2626; --c-up: #16A34A; --c-down: #DC2626;
  --r: 14px; --f-display: 'Inter', system-ui, sans-serif; --f-text: 'Inter', system-ui, sans-serif;
  --head-w: 700; --head-case: none; --head-sp: -0.02em;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.45 var(--f-text); -webkit-font-smoothing: antialiased; }
body { overflow-x: hidden; }
button, select, input { font: inherit; color: inherit; }
a { color: inherit; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- connexion ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--card); }
.login__side { background: var(--rail); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login__brand { font-weight: 800; font-size: 22px; letter-spacing: -0.02em; }
.login__brand b { color: var(--gold); }
.login__title { font-size: 44px; line-height: 1.05; font-weight: 800; letter-spacing: -0.03em; max-width: 460px; margin: 0; }
.login__chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; max-width: 520px; }
.login__chips span { border: 1px solid #2A2F3A; border-radius: 999px; padding: 6px 12px; font-size: 13px; color: #C9CED8; display: inline-flex; gap: 8px; align-items: center; }
.login__chips i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.login__foot { color: var(--rail-ink); font-size: 12px; }
.login__form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.login__form form { width: 100%; max-width: 360px; display: grid; gap: 14px; }
.login__form h2 { margin: 0 0 6px; font-size: 26px; letter-spacing: -0.02em; }
.login__form p { margin: 0 0 8px; color: var(--muted); }
.field { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.field input { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-size: 15px; color: var(--ink); background: #fff; outline: none; }
.field input:focus { border-color: var(--ink); }
.btn { border: 0; border-radius: 10px; background: var(--ink); color: #fff; padding: 13px 16px; font-weight: 600; cursor: pointer; }
.err { color: var(--c-bad); min-height: 20px; font-size: 13px; }

/* ---------- coque : rail + espace de travail ---------- */
.shell { display: flex; min-height: 100vh; }
.rail { position: fixed; z-index: 20; left: 12px; top: 12px; bottom: 12px; width: 64px; background: var(--rail); border-radius: 20px; display: flex; flex-direction: column; align-items: center; padding: 14px 0; gap: 6px; box-shadow: 0 10px 30px rgba(11, 13, 18, .18); }
.rail__logo { width: 40px; height: 40px; border-radius: 12px; background: #161A22; color: var(--gold); display: grid; place-items: center; font-weight: 800; font-size: 15px; margin-bottom: 8px; text-decoration: none; }
.rail__sep { width: 28px; height: 1px; background: #232834; margin: 6px 0; }
.rail a.ri { position: relative; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: var(--rail-ink); text-decoration: none; transition: background .15s; }
.rail a.ri:hover { background: #161A22; color: #fff; }
.rail a.ri.on { background: #1E2430; color: #fff; }
.rail a.ri.on::before { content: ''; position: absolute; left: -10px; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; background: var(--gold); }
.rail .dot { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; font-size: 13px; overflow: hidden; }
.rail .dot img { width: 100%; height: 100%; object-fit: contain; }
.rail .tip { position: absolute; left: 54px; white-space: nowrap; background: var(--rail); color: #fff; font-size: 12px; padding: 5px 9px; border-radius: 8px; opacity: 0; pointer-events: none; transform: translateX(-4px); transition: .15s; }
.rail a.ri:hover .tip { opacity: 1; transform: none; }
.rail__grow { flex: 1; }
.rail .live-dot { position: absolute; right: 6px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: #22C55E; box-shadow: 0 0 0 2px var(--rail); }

.ws { flex: 1; min-width: 0; margin-left: 88px; padding: 18px 24px 48px 8px; background: var(--bg); color: var(--ink); font-family: var(--f-text); min-height: 100vh; }
.wrap { max-width: 1400px; margin: 0 auto; }

/* barre du haut : hauteur fixe pour ne jamais bouger entre les pages */
.top { height: 52px; display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.top__crumb { color: var(--muted); font-size: 13px; white-space: nowrap; }
.top__crumb b { color: var(--ink); font-weight: 600; }
.top__grow { flex: 1; }
.pill { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 13px; white-space: nowrap; }
.pill i { width: 8px; height: 8px; border-radius: 50%; background: #22C55E; box-shadow: 0 0 0 3px rgba(34, 197, 94, .18); }
.pill.off i { background: #A1A1AA; box-shadow: none; }
.select { height: 34px; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 0 34px 0 14px; font-size: 13px; font-weight: 600; cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }

/* bandeau d'en-tête (vue générale et boutique : même gabarit, même hauteur) */
.hero { background: var(--dark); color: var(--dark-ink); border-radius: var(--r); padding: 26px 28px; display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; min-height: 132px; position: relative; overflow: hidden; }
.hero__logo { height: 34px; display: flex; align-items: center; color: var(--dark-ink); }
.hero__logo svg { height: 100%; width: auto; max-width: 260px; }
.hero__logo .wordmark, .hero__brand { font-family: var(--f-display); font-weight: var(--head-w); text-transform: var(--head-case); letter-spacing: var(--head-sp); font-size: 30px; line-height: 1; }
.hero__brand b { color: var(--gold); }
.hero__sub { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13px; opacity: .85; }
.hero__sub a { text-decoration: none; border-bottom: 1px solid currentColor; }
.hero__badge { display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; padding: 7px 12px; font-size: 12.5px; font-weight: 600; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16); white-space: nowrap; }
.hero__badge i { width: 8px; height: 8px; border-radius: 50%; background: #22C55E; }
.hero__badge.warn i { background: #F59E0B; }
.hero__right { display: grid; gap: 8px; justify-items: end; }
.hero__accent { position: absolute; right: -40px; bottom: -60px; width: 220px; height: 220px; border-radius: 50%; background: var(--hot); opacity: .14; pointer-events: none; }

/* cartes */
.grid { display: grid; gap: 14px; margin-top: 14px; }
.g-kpi { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-map { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; min-width: 0; }
.card__h { display: flex; align-items: center; gap: 10px; min-height: 30px; margin-bottom: 12px; }
.card__h h3 { margin: 0; font-size: 15px; font-weight: 700; font-family: var(--f-display); text-transform: var(--head-case); letter-spacing: var(--head-sp); font-weight: var(--head-w); }
.card__h .grow { flex: 1; }
.card__h small { color: var(--muted); font-size: 12px; }
.hint { color: var(--muted); font-size: 12.5px; }

.kpi { position: relative; padding: 16px 18px 14px; }
.kpi__l { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.kpi__l i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.kpi__v { font-family: var(--f-display); font-weight: var(--head-w); font-size: 30px; line-height: 1.1; letter-spacing: -0.02em; margin: 10px 0 6px; white-space: nowrap; }
.kpi__d { font-size: 12px; font-weight: 600; white-space: nowrap; color: var(--muted); }
.kpi__d.up { color: var(--c-up); }
.kpi__d.down { color: var(--c-down); }

/* graphique */
.chart { position: relative; height: 240px; }
.chart svg { width: 100%; height: 100%; display: block; overflow: visible; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.legend i { width: 10px; height: 10px; border-radius: 2px; }
.tt { position: absolute; pointer-events: none; background: var(--ink); color: var(--card); padding: 8px 10px; border-radius: 8px; font-size: 12px; line-height: 1.5; white-space: nowrap; z-index: 5; transform: translate(-50%, calc(-100% - 14px)); }

/* boutiques (vue générale) */
.shops { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.shop { text-decoration: none; border-radius: 14px; overflow: hidden; background: var(--card); border: 1px solid var(--line); display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }
.shop:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(15, 23, 42, .08); }
.shop__top { height: 64px; padding: 0 16px; display: flex; align-items: center; gap: 10px; }
.shop__top .lg { height: 24px; display: flex; align-items: center; flex: 1; min-width: 0; }
.shop__top .lg svg { height: 100%; width: auto; max-width: 150px; }
.shop__top .lg .wordmark { font-size: 22px; }
.shop__live { font-size: 11.5px; font-weight: 600; display: inline-flex; gap: 6px; align-items: center; opacity: .9; white-space: nowrap; }
.shop__live i { width: 7px; height: 7px; border-radius: 50%; background: #22C55E; }
.shop__body { padding: 14px 16px 16px; display: grid; gap: 12px; }
.shop__nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.shop__nums div { min-width: 0; }
.shop__nums b { display: block; font-size: 17px; font-weight: 700; white-space: nowrap; }
.shop__nums span { font-size: 11px; color: var(--muted); white-space: nowrap; }
.shop__foot { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--muted); }
.spark { height: 34px; }
.spark svg { width: 100%; height: 100%; display: block; }

/* carte du monde */
.seg { display: inline-flex; background: var(--soft); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; padding: 6px 11px; border-radius: 8px; font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.map { position: relative; aspect-ratio: 960 / 470; }
.map svg { width: 100%; height: 100%; display: block; }
.map path { stroke: var(--card); stroke-width: .5; transition: opacity .1s; }
.map path:hover { opacity: .75; }
.rows { display: grid; gap: 2px; }
.row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.row:last-child { border-bottom: 0; }
.row__k { display: flex; align-items: center; gap: 8px; min-width: 0; }
.row__k span { overflow-wrap: anywhere; }
.row__v { font-weight: 700; text-align: right; white-space: nowrap; }
.row__v small { color: var(--muted); font-weight: 500; margin-left: 6px; }
.bar { grid-column: 1 / -1; height: 5px; border-radius: 3px; background: var(--soft); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 3px; }
.cc { font-size: 10.5px; font-weight: 700; color: var(--muted); background: var(--soft); border-radius: 4px; padding: 1px 5px; flex: none; }
.empty { color: var(--muted); font-size: 13px; padding: 18px 0; text-align: center; line-height: 1.5; }

/* parcours d'achat */
.funnel { display: grid; gap: 10px; }
.funnel__s { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; font-size: 13px; }
.funnel__s b { white-space: nowrap; }
.funnel__s em { font-style: normal; color: var(--muted); font-size: 12px; margin-left: 6px; }

/* tableaux */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-size: 11.5px; color: var(--muted); font-weight: 600; padding: 0 8px 8px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 9px 8px 9px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .r { text-align: right; padding-right: 0; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: var(--soft); white-space: nowrap; }
.tbl-wrap { overflow-x: auto; }

/* robots */
.robots { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.robots b { font-family: var(--f-display); font-size: 26px; color: var(--c-bad); font-weight: var(--head-w); }
.code { font-family: ui-monospace, Menlo, monospace; font-size: 12px; background: var(--soft); border-radius: 6px; padding: 8px 10px; overflow-wrap: anywhere; display: block; margin-top: 6px; }

.loading { padding: 80px 0; text-align: center; color: var(--muted); }

@media (max-width: 1200px) { .g-kpi { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 980px) {
  .g-3, .g-2, .g-map { grid-template-columns: minmax(0, 1fr); }
  .login { grid-template-columns: 1fr; }
  .login__side { padding: 32px 24px; min-height: 260px; }
  .login__title { font-size: 32px; }
}
@media (max-width: 640px) {
  .rail { left: 0; right: 0; top: auto; bottom: 0; width: auto; height: 64px; border-radius: 0; flex-direction: row; padding: 0 8px; overflow-x: auto; justify-content: flex-start; }
  .rail__logo { margin: 0 4px 0 0; flex: none; }
  .rail__sep { width: 1px; height: 28px; margin: 0 4px; }
  .rail a.ri { flex: none; }
  .rail a.ri.on::before { left: 12px; right: 12px; top: auto; bottom: -8px; width: auto; height: 3px; }
  .rail .tip, .rail__grow { display: none; }
  .ws { margin-left: 0; padding: 12px 16px 90px; }
  .g-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { grid-template-columns: 1fr; padding: 20px; }
  .hero__right { justify-items: start; }
  .kpi__v { font-size: 24px; }
  .top__crumb { display: none; }
  .chart { height: 200px; }
}
/* logos des boutiques composés de texte HTML (Lampi) */
.logo-mark { display: inline-flex; height: 100%; }
.logo-mark svg { height: 100%; width: auto; }
.logo-word { font-family: var(--f-display); font-weight: 800; letter-spacing: -0.03em; font-size: 28px; line-height: 1; margin-left: 10px; }
.shop__top .logo-word { font-size: 21px; margin-left: 8px; }
