/* V5 · PAGE STATISTIQUES (PC) — chiffres du jour en tuiles (groupe r12, valeur en Title 1), tableaux en vue liste du Finder
   (en-tête de colonnes sous un filet, une ligne sur deux teintée, chiffres tabulaires). Présentation seulement :
   js/journal.js, js/analytics.js et js/vinted-perf.js ne changent pas. */

html.v5 #view-analytics{ padding: 0; max-width: none; }
html.v5 #view-analytics > div{ box-sizing: border-box; max-width: 980px; margin: 0 auto; padding: 20px 24px 60px; }

/* chiffres clés */
html.v5 .vt-stats-bar.j-kpi{ display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1px; margin: 0 0 16px; padding: 0; border: 0; border-radius: var(--v5-r-groupe); background: var(--v5-separateur); overflow: hidden; }
html.v5 .j-kpi .vt-stat{ display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 12px 14px; border: 0; border-radius: 0; background: var(--v5-carte); }
html.v5 .j-kpi .vt-stat .num{ font-size: var(--v5-t-22); font-weight: var(--v5-g-gras); line-height: var(--v5-i-22); letter-spacing: -.01em; color: var(--v5-texte); font-variant-numeric: tabular-nums; }
html.v5 .j-kpi .vt-stat .lbl2{ font-size: var(--v5-t-13); line-height: 16px; color: var(--v5-texte); }
html.v5 .j-kpi .vt-stat-sub{ font-size: var(--v5-t-11); line-height: 14px; color: var(--v5-texte-3); font-variant-numeric: tabular-nums; }

/* titres de section et messages */
html.v5 #journal-body > .lbl{ margin: 22px 12px 6px; font-size: var(--v5-t-13); font-weight: var(--v5-g-fort); color: var(--v5-texte); }
html.v5 #journal-body > .status-line{ margin: 0 12px 4px; }
html.v5 #journal-body > .empty{ padding: 28px 16px; border-radius: var(--v5-r-groupe); background: var(--v5-fond-groupe); }

/* tableaux : vue en liste */
html.v5 .j-table{ margin: 0; padding: 0; border: 0; border-radius: 0; background: none; }
html.v5 .j-ligne{ min-height: 28px; padding: 0 12px; border: 0; border-radius: var(--v5-r-sel); font-size: var(--v5-t-13); font-variant-numeric: tabular-nums; }
html.v5 .j-ligne:not(.j-entete):nth-child(odd){ background: var(--v5-rempli-4); }
html.v5 .j-ligne.j-entete{ min-height: 26px; border-radius: 0; box-shadow: inset 0 calc(-1 * var(--v5-trait-fort)) 0 var(--v5-separateur); }
html.v5 .j-ligne.j-entete span{ font-size: var(--v5-t-11); font-weight: var(--v5-g-fort); color: var(--v5-texte-2); }

/* période des statistiques (11/10) : la liste déroulante était posée dans un second cadre arrondi (« verre ») — un cadre dans un cadre.
   Le cadre extérieur disparaît, la liste se suffit. */
html.v5 #view-analytics#view-analytics .range-select-wrap{ display: inline-flex; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
html.v5 #view-analytics .date-range-row{ display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* 11/10 — lignes des tableaux : le texte est centré dans la hauteur de la ligne (il collait en haut de la bande teintée) ;
   tuiles : une valeur ou un libellé long ne passe pas à la ligne au milieu d'un mot, les tuiles gardent la même hauteur */
html.v5 .j-ligne{ align-items: center; }
html.v5 .j-kpi .vt-stat{ min-width: 0; }
html.v5 .j-kpi .vt-stat .num{ white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 12/10 — quatre chiffres de tête (ventes, encaissé, favoris, messages) : en 3 + 1, la quatrième tuile restait seule et le vide était rempli par la couleur du filet.
   Selon la place réelle de la page : 4 sur une ligne dès 680 px, sinon 2 × 2. Autres nombres de tuiles : inchangé. */
html.v5 #journal-body{ container-type: inline-size; }
@container (min-width: 680px){ html.v5 .vt-stats-bar.j-kpi:has(> :nth-child(4):last-child){ grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@container (max-width: 679px){ html.v5 .vt-stats-bar.j-kpi:has(> :nth-child(4):last-child){ grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* 12/10 — avertissement de données (« les favoris sont datés du moment où l'extension les a vus… ») : une note encadrée (fond teinté, texte plus petit),
   pas un paragraphe orange perdu dans la page. L'information est utile mais rare et secondaire. La couleur du texte reste celle de l'avertissement
   (posée en ligne par js/journal.js, partagé avec le téléphone). */
html.v5 #journal-body > .status-line.note-info{ margin: -4px 0 18px; padding: 0; border-radius: 0; background: none; font-size: var(--v5-t-12); line-height: 1.45; color: var(--v5-texte-3); }   /* 13/10 : une précision, pas une alerte — texte gris discret sous les chiffres (plus d’encadré orange) */

/* 12/10 — chiffres clés : la même carte que les tuiles d'Aujourd'hui (r16, filet fin, grand chiffre, libellé dessous) au lieu d'une bande grise
   d'un seul tenant. Deux composants qui jouent le même rôle (un chiffre et ce qu'il compte) n'ont qu'une forme. Pas de chevron : ici, on lit. */
html.v5 .vt-stats-bar.j-kpi{ gap: 10px; border-radius: 0; background: none; overflow: visible; }
/* Synthèse et Par article : la même carte (avant : une bande grise cloisonnée, et une rangée de colonnes sans cadre) */
html.v5 :is(.vt-stats-bar.vt-perf-kpi, #view-analytics .metrics-bar, #view-analytics #kpi-row){
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 0 0 16px; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; overflow: visible;
}
html.v5 :is(.vt-perf-kpi > .vt-stat, #view-analytics .metrics-bar > .metric-chip, #view-analytics #kpi-row > .kpi-card){
  display: flex; flex-direction: column; gap: 4px; min-width: 0; min-height: 84px; box-sizing: border-box; margin: 0; padding: 14px 14px 12px; border: 0;
  border-radius: var(--v5-r-groupe); background: var(--v5-fond); box-shadow: inset 0 0 0 var(--v5-trait-fort) var(--v5-separateur);
}
html.v5 :is(.vt-perf-kpi .vt-stat .num, #view-analytics .metric-value, #view-analytics .kpi-value){ font-size: var(--v5-t-26); font-weight: var(--v5-g-gras); line-height: var(--v5-i-26); letter-spacing: -.02em; color: var(--v5-texte); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.v5 :is(.vt-perf-kpi .vt-stat .lbl2, #view-analytics .metric-label, #view-analytics .kpi-label){ font-size: var(--v5-t-12); font-weight: var(--v5-g-normal); line-height: 16px; letter-spacing: normal; text-transform: none; color: var(--v5-texte-2); }
html.v5 .vt-perf-kpi .vt-stat-sub{ font-size: var(--v5-t-11); line-height: 14px; color: var(--v5-texte-3); font-variant-numeric: tabular-nums; }
html.v5 #view-analytics .metric-chip{ border-right: 0; }
html.v5 #view-analytics .metric-top{ order: 2; min-height: 0; margin: 0; }   /* le chiffre d'abord, son libellé dessous, comme les autres cartes */
html.v5 #view-analytics .metric-value{ order: 1; }
html.v5 #view-analytics .metric-delta{ order: 3; align-self: flex-start; margin: 2px 0 0; padding: 0 6px; height: 18px; border-radius: var(--v5-r-capsule); font-size: var(--v5-t-11); font-weight: var(--v5-g-moyen); }
html.v5 .j-kpi .vt-stat{ gap: 4px; min-height: 84px; padding: 14px 14px 12px; border-radius: var(--v5-r-groupe); background: var(--v5-fond); box-shadow: inset 0 0 0 var(--v5-trait-fort) var(--v5-separateur); }
html.v5 .j-kpi .vt-stat .num{ font-size: var(--v5-t-26); line-height: var(--v5-i-26); letter-spacing: -.02em; }
html.v5 .j-kpi .vt-stat .lbl2{ font-size: var(--v5-t-12); color: var(--v5-texte-2); }

/* 12/10 — Par article : achat → revente. La largeur du chiffre suit sa longueur (autosizePriceInput, js/analytics.js) ; le contour de champ
   (r8) est porté par le conteneur, sinon les marges intérieures du champ V5 mangeaient toute la place (« ( € » illisible). */
html.v5 #view-analytics .price-field-wrap{
  display: inline-flex; align-items: center; gap: 2px; box-sizing: border-box; height: var(--v5-ctrl-h); padding: 0 8px;
  border-radius: var(--v5-r-champ); background: var(--v5-fond); box-shadow: inset 0 0 0 var(--v5-trait-fort) var(--v5-separateur-fort);
}
html.v5 #view-analytics .price-field-wrap:focus-within{ outline: var(--v5-focus-l) solid var(--v5-focus); outline-offset: 0; }
html.v5 #view-analytics .price-field-wrap input{
  box-sizing: content-box; min-width: 2ch; height: auto; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; outline: none;
  text-align: right; font: var(--v5-g-moyen) var(--v5-t-13)/16px var(--v5-police); font-variant-numeric: tabular-nums; color: var(--v5-texte);
}
html.v5 #view-analytics .price-field-wrap .currency{ font-size: var(--v5-t-12); font-weight: var(--v5-g-normal); color: var(--v5-texte-3); }
html.v5 #view-analytics .price-arrow{ color: var(--v5-texte-3); }
html.v5 #view-analytics .kpi-value{ order: 1; }
html.v5 #view-analytics .kpi-label{ order: 2; }
html.v5 #view-analytics #kpi-row > .kpi-card{ min-height: 72px; }
/* Synthèse : un prix ne se coupe pas (« 14 / € ») */
html.v5 #vt-perf-body .vt-annonce-price{ white-space: nowrap; font-variant-numeric: tabular-nums; }
html.v5 #vt-perf-body .vt-row{ grid-template-columns: 36px minmax(0, 1fr) auto; }   /* vignette · titre · prix : la grille à cinq colonnes des listes d'annonces mettait le prix dans une colonne de 9 px */

/* Ventes annulées de la période (17/10, js/analytics.js) : une ligne sous les chiffres, point rouge + texte, sans fond */
#analytics-annulees{ display: flex; align-items: center; gap: 6px; margin: 8px 0 12px; font-size: var(--v5-t-12); color: var(--v5-texte-2); }
#analytics-annulees .point-annule{ width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--v5-rouge-plein); }

/* ================================================================== 26/10 : Statistiques › Aujourd'hui façon Notion (gamme choisie le 25/10,
   comme la page Aujourd'hui) — colonne centrée et aérée, chiffres en aplats doux sans contour, titres de groupe plus présents et soulignés,
   plus de boîtes autour du « plus aimé » ni du fil de la journée, tableau des 14 jours sans rayures (trait fin entre les lignes). */
html.v5 #journal-body{ max-width: none; margin: 0; padding-top: 12px; }   /* 01/11 : même colonne que Synthèse et Par article (réglage « Largeur des pages ») : le contenu sautait de 6 px de chaque côté d'un onglet à l'autre */
html.v5 #journal-body .j-kpi .vt-stat:not(#_){ min-height: 76px; border-radius: var(--v5-r-sel); background: var(--v5-rempli-3); box-shadow: none; }
html.v5 #journal-body .j-kpi .vt-stat .num{ font-size: 22px; line-height: 26px; }
html.v5 #journal-body > .lbl:not(#_){ margin: 30px 2px 4px; padding: 0 0 8px; font-size: var(--v5-t-15); line-height: 20px; box-shadow: inset 0 calc(-1 * var(--v5-trait-fort)) 0 var(--v5-separateur); }
html.v5 #journal-body > .empty:not(#_){ padding: 10px 2px; border: 0; border-radius: 0; background: none; box-shadow: none; text-align: left; color: var(--v5-texte-3); }
html.v5 #journal-body .j-fil:not(#_){ margin: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
html.v5 #journal-body .j-fil > .j-evt:not(#_){ padding-left: 2px; padding-right: 2px; border: 0; background: none; box-shadow: none; }
html.v5 #journal-body .j-ligne:not(.j-entete):nth-child(odd):not(#_){ background: none; }
html.v5 #journal-body .j-ligne:not(.j-entete):not(#_){ border-radius: 0; padding-left: 2px; padding-right: 2px; box-shadow: inset 0 calc(-1 * var(--v5-trait-fort)) 0 var(--v5-separateur); }
html.v5 #journal-body .j-ligne:not(.j-entete):last-child:not(#_){ box-shadow: none; }
html.v5 #journal-body .j-ligne.j-entete:not(#_){ padding-left: 2px; padding-right: 2px; }
html.v5 #journal-body > .status-line:not(.note-info):not(#_){ margin-left: 0; margin-right: 0; }   /* 01/11 : au nu des chiffres et des tableaux (2 px de retrait) */
/* 26/10 : Synthèse et Par article, même traitement — chiffres en aplats doux sans contour, graphiques et blocs posés sur la page
   (plus de cadre autour) */
html.v5 #view-analytics :is(.kpi-card, .metric-chip, .vt-perf-kpi .vt-stat):not(#_):not(#_):not(#_){ border-radius: var(--v5-r-sel); background: var(--v5-rempli-3); box-shadow: none; }
html.v5 #view-analytics .card.surface:not(.kpi-card):not(#_):not(#_):not(#_){ background: none; box-shadow: none; border: 0; padding-left: 0; padding-right: 0; }

/* 31/10 (audit de contraste) : la hausse en vert système tombait à 3,1:1 sur fond clair en 11 px ; un vert plus foncé, tiré du texte, la rend lisible */
html.v5 .j-delta.hausse{ color: color-mix(in srgb, var(--v5-vert) 72%, var(--v5-texte)); }
html.v5 .j-delta.baisse{ color: color-mix(in srgb, var(--v5-rouge, var(--danger)) 80%, var(--v5-texte)); }

/* 01/11 : cases de prix d'achat de « Par article » — l'input est dimensionné par sa valeur : « 5.00 » et « 10.00 » donnaient des cases
   de largeurs différentes, la colonne était en dents de scie. Largeur minimale commune, valeur calée à droite. */
html.v5 #view-analytics .price-field-wrap:not(#_){ min-width: 72px; justify-content: flex-end; }

/* 03/11 (audit, point 76) : graphique des 14 derniers jours (js/journal.js, vtJGraphe). Une seule donnée à la fois, en violet ;
   colonnes fines arrondies en haut et posées sur la ligne de base, 2 px d'écart ; la valeur seulement sur la plus haute. */
.j-graphe{ margin: 2px 0 14px; }
.j-graphe-choix{ display: flex; width: fit-content; gap: 2px; margin-bottom: 10px; padding: 2px; border-radius: var(--v5-r-presse); background: var(--v5-seg-piste); }
.j-graphe-choix button{ height: 26px; padding: 0 10px; border: 0; border-radius: 999px; background: none; font: inherit; font-size: var(--v5-t-12); color: var(--v5-texte-2); cursor: pointer; }
.j-graphe-choix button:hover{ color: var(--v5-texte); }
.j-graphe-choix button[aria-pressed="true"]{ background: var(--v5-seg-pilule); color: var(--v5-seg-pilule-texte); font-weight: var(--v5-g-fort); }
.j-graphe-zone{ position: relative; display: grid; grid-template-columns: repeat(14, 1fr); gap: 2px; height: 150px; padding-top: 20px; margin-bottom: 22px; box-shadow: inset 0 -1px 0 var(--v5-separateur); }
.j-col{ position: relative; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; min-width: 0; }
.j-barre{ width: min(72%, 26px); background: var(--v5-violet); border-radius: 4px 4px 0 0; }
.j-col:hover .j-barre{ filter: brightness(1.12); }
.j-val{ margin-bottom: 4px; font-size: var(--v5-t-12); font-weight: var(--v5-g-fort); color: var(--v5-texte); white-space: nowrap; }
.j-jour{ position: absolute; bottom: -19px; font-size: 11px; color: var(--v5-texte-3); }
.j-col[data-auj] .j-jour{ color: var(--v5-texte); font-weight: var(--v5-g-fort); }
.j-graphe-vide{ position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: var(--v5-t-13); color: var(--v5-texte-3); }
