/* Amazon Autobot : feuille de style unique du tableau de bord.
   Style sobre « A » (esprit Linear / Vercel) : sombre neutre, une seule couleur d'accent, séparateurs fins,
   aucune largeur maximale sur PC, barre latérale à gauche sur PC et onglets en bas sur téléphone. */

/* ---------- Couleurs et mesures ---------- */
:root {
  color-scheme: dark;
  --bg: #0e0f11;          /* fond */
  --line: #1d1f23;        /* séparateurs */
  --line-2: #16181b;      /* séparateurs des lignes de tableau */
  --hover: #1a1c20;       /* survol et sélection */
  --text: #d6d7da;        /* texte */
  --strong: #f2f2f3;      /* texte fort */
  --muted: #6c6e75;       /* texte secondaire */
  --soft: #9a9ca3;        /* entrées de navigation, libellés */
  --dim: #8a8c93;         /* pied de la barre latérale, libellés des jauges */
  --faint: #7c7e85;       /* légendes des chiffres clés, onglets inactifs */
  --heading: #c9cad0;     /* titres de blocs */
  --cell: #cfd0d4;        /* cellules de tableau */
  --accent: #d9924a;      /* liens, sélection, bouton principal */
  --deal: #e0a467;        /* remises */
  --amber: #d9a24a;       /* avertissement */
  --red: #a33a3e;         /* alerte */
  --alert-bg: #3b1517;    /* ligne d'alerte */
  --alert-text: #f1b4b4;
  --ok: #7fbf8e;          /* point « en marche » */
  --gauge: #6f7178;       /* jauges, courbes */
  --field: #141619;       /* champs de saisie */
  --btn-line: #2a2c31;    /* contour des boutons */
  --photo: #e9e9ec;       /* fond des photos */
  --alert-line: #5a1f22;  /* trait sous la ligne d'alerte rouge */
  --accent-hi: #e09d58;   /* bouton principal au survol */
  --ipdot: #3a3c42;       /* pastille d'adresse IP active */
  --btn-text: #e6e6e8;    /* texte des boutons et titres de cartes */
  --body-2: #b9bac0;      /* listes et journaux */
  --on-accent: #111;      /* texte sur fond d'accent */
  --radius: 8px;
  --radius-sm: 6px;
  --side: 208px;
  --gutter: 24px;
  --tabs-h: 46px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font: 13px/1.45 var(--font); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; color: var(--strong); font-weight: 600; }
h1 { font-size: 16px; }
h2 { font-size: 14px; margin: 22px 0 10px; }
h3 { font-size: 12.5px; }
img { max-width: 100%; }
s { color: var(--muted); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
           clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.r { text-align: right; }

/* ---------- Mise en page : barre latérale + contenu sur toute la largeur ---------- */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.content { display: flex; flex-direction: column; min-width: 0; }
.page { padding: 10px var(--gutter) 24px; }

/* ---------- Barre latérale (PC) ---------- */
.side {
  position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto;
  display: flex; flex-direction: column; padding: 16px 10px 14px; border-right: 1px solid var(--line);
}
.side .brand { padding: 0 10px 16px; font-weight: 650; color: var(--strong); }
.side a { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: var(--radius-sm); color: var(--soft); }
.side a:hover { color: var(--text); background: var(--hover); text-decoration: none; }
.side a.on { background: var(--hover); color: var(--strong); }
.side .count { margin-left: auto; color: var(--muted); }
.side .foot { margin-top: auto; padding: 10px 10px 0; border-top: 1px solid var(--line); font-size: 12px; color: var(--dim); }
.side .logout { width: 100%; margin-top: 10px; padding: 7px 10px; font-size: 12.5px; }

/* Point d'état du bot : un petit cercle, vert sobre en marche, ambre en pause, rouge en panne. */
.dot {
  display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%;
  background: var(--muted); vertical-align: 1px;
}
.dot.running { background: var(--ok); }
.dot.paused { background: var(--amber); }
.dot.down { background: var(--red); }

/* ---------- En-tête du contenu : ligne d'alerte, titre, « mis à jour il y a N s » ---------- */
.app-header { display: flex; flex-direction: column; }
.alertline { margin: 0; padding: 5px var(--gutter); font-size: 12px; line-height: 1.45; }
.alertline.red { background: var(--alert-bg); color: var(--alert-text); border-bottom: 1px solid var(--alert-line); }
.alertline.amber { background: rgba(217, 162, 74, .07); color: var(--amber); border-bottom: 1px solid rgba(217, 162, 74, .14); }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px var(--gutter) 6px; }
.top h1 { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-r { flex: none; font-size: 12px; color: var(--muted); white-space: nowrap; }
.top .state { display: none; }
.upd { font-size: 12px; color: var(--muted); }

/* ---------- Onglets du bas (téléphone) ---------- */
.tabs { display: none; }

/* ---------- Chiffres clés : une ligne encadrée, séparée par de fins traits ---------- */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); }
.kpi { min-width: 0; padding: 12px 16px; border-right: 1px solid var(--line); }
.kpi:last-child { border-right: 0; }
.kpi small { display: block; color: var(--faint); font-size: 11.5px; }
.kpi b { display: block; margin-top: 3px; font-size: 20px; font-weight: 600; color: var(--strong); white-space: nowrap; }
.kpi b.warn { color: var(--amber); }
.kpi b.bad { color: var(--alert-text); }
.kpi i { font-style: normal; font-size: 11.5px; color: var(--faint); }
@media (min-width: 720px) and (max-width: 1099px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi:nth-child(3n) { border-right: 0; }
  .kpi:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
}

/* ---------- Blocs et titres de blocs ---------- */
.panel h3 {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  margin: 0 0 8px; font-size: 12.5px; font-weight: 600; color: var(--heading);
}
.panel h3 span, .panel h3 a { color: var(--muted); font-weight: 400; }
.panel h3 a:hover { color: var(--text); text-decoration: none; }

/* ---------- Accueil : tableau à gauche, colonne d'état de 320 px à droite ---------- */
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; padding-top: 18px; }
.aside { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.meter { display: flex; align-items: center; gap: 10px; margin: 8px 0; font-size: 12.5px; }
.meter .k { flex: none; width: 84px; color: var(--dim); }
.meter .v { flex: none; width: 44px; text-align: right; }
.note { margin-top: 8px; font-size: 12px; }
.ipdots + .note { margin-top: 8px; }
.activity { display: block; width: 100%; height: 50px; overflow: visible; }
.activity polyline { fill: none; stroke: var(--gauge); stroke-width: 1.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
table.rows td.ph, table.deals-table td.ph { width: 1%; padding-right: 0; }
table.rows tr, table.deals-table tr { position: relative; }
a.row-link { color: inherit; }
a.row-link::after { content: ""; position: absolute; inset: 0; }  /* toute la ligne est cliquable */
table.rows .acts, table.deals-table .acts { position: relative; z-index: 1; }  /* au-dessus du lien de la ligne */
table.rows .mprice { display: none; }
@media (max-width: 1099px) { .cols { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Tableau dense ---------- */
table.grid { width: 100%; border-collapse: collapse; }
table.grid th {
  padding: 7px 8px; border-bottom: 1px solid var(--line); color: var(--muted);
  font-size: 11.5px; font-weight: 500; text-align: left; white-space: nowrap;
}
table.grid th.r, table.grid td.r { text-align: right; }
table.grid th a { color: inherit; }
table.grid th a:hover { color: var(--text); text-decoration: none; }
table.grid th a.on { color: var(--soft); }
table.grid td { padding: 7px 8px; border-bottom: 1px solid var(--line-2); color: var(--cell); white-space: nowrap; vertical-align: middle; }
table.grid td.t { white-space: normal; min-width: 160px; overflow-wrap: anywhere; }
table.grid tr:hover td { background: var(--hover); }
table.grid tr.on td { background: var(--hover); }
table.grid tr.on td:first-child { box-shadow: inset 2px 0 0 var(--accent); }
table.grid tr.ended td { color: var(--muted); }
.pct { color: var(--deal); font-weight: 600; }
.lnk { color: var(--accent); }
.lnk + .lnk { margin-left: 10px; }

/* ---------- Groupe segmenté ---------- */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.seg > * { padding: 6px 10px; border: 0; border-right: 1px solid var(--line); background: none; color: var(--soft); font-size: 12.5px; white-space: nowrap; }
.seg > :last-child { border-right: 0; }
.seg > a:hover, .seg > button:hover { color: var(--text); text-decoration: none; cursor: pointer; }
.seg > .on { background: var(--hover); color: var(--strong); }

/* ---------- Boutons : secondaires par défaut (contour fin) ; .primary pour l'unique action principale ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border: 1px solid var(--btn-line); border-radius: var(--radius-sm);
  background: transparent; color: var(--btn-text); font: inherit; font-weight: 500; line-height: 1.2;
  text-align: center; white-space: nowrap; cursor: pointer;
}
.btn:hover { background: var(--hover); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn.primary:hover { background: var(--accent-hi); }
.btn.light { background: #f2f2f3; border-color: #f2f2f3; color: #0e0f11; font-weight: 600; }  /* « Ajouter au panier » */
.btn.light:hover { background: #fff; }
.btn.sm { padding: 4px 9px; font-size: 12px; }
.acts { display: inline-flex; gap: 6px; }
.btn:disabled { opacity: .4; cursor: not-allowed; background: transparent; }
.block { display: flex; width: 100%; }

/* ---------- Vignettes, jauges, pastilles d'adresses IP ---------- */
.thumb {
  display: inline-block; flex: none; width: 32px; height: 32px; max-width: none; border-radius: 4px;
  background: var(--photo); object-fit: contain; vertical-align: middle;
}
img.thumb { background: var(--photo); }
.bar { display: block; flex: 1; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.bar > i { display: block; width: 0; height: 100%; border-radius: 2px; background: var(--gauge); }
.bar > i.warn { background: var(--amber); }
.bar > i.bad { background: var(--red); }
.ipdots { display: grid; grid-template-columns: repeat(auto-fill, minmax(12px, 1fr)); gap: 3px; }
.ipdots i { height: 10px; border-radius: 2px; background: var(--ipdot); }
.ipdots i.warn { background: var(--amber); }
.ipdots i.bad { background: var(--red); }

/* ---------- Deals : barre d'outils, tableau trié par en-têtes, panneau de détail sur la moitié droite ---------- */
.deals { display: flex; align-items: flex-start; }
.deals-list { flex: 1 1 0; min-width: 0; overflow-x: auto; container-type: inline-size; }
.deals-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 4px 0 12px; }
.deals-search { flex: 1 1 200px; min-width: 200px; }
.deals-search label { display: block; }
.deals-search input { margin: 0; }
.msort { display: none; }
.msort select { width: auto; margin: 0; padding: 5px 8px; }
table.deals-table a.row-link {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;  /* titre sur 2 lignes */
}
/* Liste resserrée (panneau ouvert, écran moyen) : la référence et les liens passent dans le panneau. */
@container (max-width: 820px) {
  table.deals-table .c-ref, table.deals-table .c-lnk { display: none; }
  table.deals-table td.t { min-width: 120px; }
}
table.grid td.bad, .mmeta .bad, .facts b.bad { color: var(--alert-text); }  /* vendeur suspect : vraie alerte */
.deals-more { margin-top: 14px; }
.deals-empty { margin: 0; padding: 28px 0; color: var(--muted); text-align: center; }
.detail {
  flex: 0 0 50%; min-width: 0; position: sticky; top: 0; max-height: 100vh; max-height: 100dvh;
  overflow-x: hidden; overflow-y: auto;
  margin-left: 20px; padding: 6px 0 24px 22px; border-left: 1px solid var(--line);
}
.dh { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.dh h2 { margin: 0; font-size: 16px; line-height: 1.35; overflow-wrap: anywhere; }
.dh .x { flex: none; display: flex; padding: 5px; margin-top: -2px; border-radius: var(--radius-sm); color: var(--muted); }
.dh .x:hover { color: var(--text); background: var(--hover); }
.dh .x svg { stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.photo {
  display: flex; align-items: center; justify-content: center; height: 240px; margin: 14px 0;
  border-radius: var(--radius); background: var(--photo); overflow: hidden;
}
.photo img { width: 100%; height: 100%; padding: 14px; object-fit: contain; mix-blend-mode: multiply; }
.prices { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.prices b { font-size: 26px; font-weight: 600; color: var(--strong); }
.prices .pct { font-size: 16px; }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 16px 0; border: 1px solid var(--line); border-radius: var(--radius); }
.facts > div { min-width: 0; padding: 10px 12px; border-right: 1px solid var(--line); }
.facts > div:last-child { border-right: 0; }
.facts small { display: block; color: var(--muted); font-size: 11.5px; }
.facts b { font-weight: 600; color: var(--strong); }
.sec { margin: 16px 0 8px; font-size: 12.5px; color: var(--heading); }
.curve { display: block; width: 100%; height: 110px; overflow: visible; }
.curve line { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.curve polyline { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.reasons { margin: 0; padding-left: 18px; color: var(--body-2); line-height: 1.7; }
.reasons li { overflow-wrap: anywhere; }
.btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.btns .btn { padding: 9px 16px; }

/* Cartes sobres du téléphone (à la place du tableau) */
.mcards { display: none; }
.mcard { margin: 0 0 10px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.mph { display: flex; align-items: center; justify-content: center; height: 130px; background: var(--photo); }
.mph img { width: 100%; height: 100%; padding: 8px; object-fit: contain; mix-blend-mode: multiply; }
.mbd { padding: 10px 12px; }
.mtt {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden;
  color: var(--btn-text); line-height: 1.3; overflow-wrap: anywhere;
}
.mpr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; margin-top: 6px; }
.mpr b { font-size: 18px; font-weight: 600; color: var(--strong); }
.mmeta { margin-top: 4px; color: var(--muted); font-size: 12px; }
.mln { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.mln a.dim { margin-left: auto; color: var(--soft); }
.mcard.ended .mtt, .mcard.ended .mpr b, .mcard.ended .mpr span { color: var(--muted); }

/* ---------- Formulaires ---------- */
label { color: var(--soft); font-size: 12.5px; }
input, select, textarea {
  width: 100%; padding: 7px 10px; margin-top: 4px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--field); color: var(--text); font: inherit;
}
input[type="checkbox"], input[type="radio"] { width: auto; margin: 0; accent-color: var(--accent); }
textarea { resize: vertical; line-height: 1.4; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
::placeholder { color: var(--muted); }

/* ---------- Page de connexion : petit formulaire centré ---------- */
.login { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px 16px; }
.login-form { display: grid; gap: 12px; width: 100%; max-width: 320px; }
.login-form p { margin: 0; }
.login-form .muted { margin-bottom: 6px; font-size: 12.5px; }
.login-form .alertline { padding: 7px 10px; border: 0; border-radius: var(--radius-sm); }
.login-form input { margin: 0; padding: 9px 12px; }
.login-form .btn { padding: 9px 14px; }

/* ---------- Téléphone : pas de barre latérale, quatre onglets fixes en bas ---------- */
@media (max-width: 719px) {
  :root { --gutter: 16px; }
  .shell { display: block; }
  .side { display: none; }
  .content { padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom)); }
  .tabs {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    padding-bottom: env(safe-area-inset-bottom); border-top: 1px solid var(--line); background: var(--bg);
  }
  .tabs a { flex: 1; padding: 11px 0 13px; color: var(--faint); font-size: 12px; text-align: center; }
  .tabs a:hover { text-decoration: none; color: var(--text); }
  .tabs a.on { color: var(--strong); box-shadow: inset 0 2px 0 var(--accent); }
  .top { order: -1; padding: 14px var(--gutter) 6px; }
  .top h1 { font-size: 15px; }
  .top .state { display: inline; }
  .upd-l { display: none; }
  .alertline { padding: 5px 14px; font-size: 11.5px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  /* Ordre de la maquette : Deals, Pages, Blocage, Produits, Processeur, Mémoire */
  .kpi:nth-child(1) { order: 1; }
  .kpi:nth-child(3) { order: 2; }
  .kpi:nth-child(4) { order: 3; }
  .kpi:nth-child(2) { order: 4; }
  .kpi:nth-child(5) { order: 5; }
  .kpi:nth-child(6) { order: 6; }
  .kpi:nth-child(1), .kpi:nth-child(4), .kpi:nth-child(5) { border-right: 1px solid var(--line); }
  .kpi:nth-child(5), .kpi:nth-child(6) { border-bottom: 0; }
  .kpi b { font-size: 16px; }
  .kpi i { display: none; }
  .cols { padding-top: 14px; }
  .aside { display: none; }  /* Machine, adresses IP et activité : onglet Machine */
  table.rows thead { display: none; }
  table.rows, table.rows tbody { display: block; }
  table.rows tr { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; column-gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
  table.rows tr:last-child { border-bottom: 0; }
  table.rows td { padding: 0; border: 0; background: none; }
  table.rows tr:hover td, table.rows tr.on td { background: none; }
  table.rows td.hm { display: none; }
  /* Accueil : boutons compacts sous le titre (comme sur les cartes des Deals), retour à la ligne si besoin. */
  table.rows td.lk { display: block; grid-column: 2 / -1; margin-top: 6px; }
  table.rows td.lk:empty { display: none; }
  table.rows td.lk .acts { display: flex; flex-wrap: wrap; gap: 6px; }
  table.rows td.ph { width: auto; }
  table.rows .thumb { width: 44px; height: 44px; }
  table.rows .mprice { display: block; margin-top: 2px; }
  table.rows .mprice b { color: var(--strong); font-weight: 600; }
  /* Deals : « N en cours » à la place de l'état du bot ; cartes à la place du tableau ; panneau au-dessus. */
  .top .counts .ended-n, .top .counts + .state { display: none; }
  .deals { flex-direction: column; align-items: stretch; }
  .deals-list { flex: none; overflow: visible; }
  .deals-search { flex-basis: 100%; min-width: 0; }
  .seg .u { display: none; }
  .msort { display: block; }
  table.deals-table { display: none; }
  .mcards { display: block; }
  .detail {
    order: -1; position: static; max-height: none; overflow: visible;
    margin: 0 0 14px; padding: 0 0 16px; border-left: 0; border-bottom: 1px solid var(--line);
  }
  .photo { height: 200px; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts > div:nth-child(2n) { border-right: 0; }
  .facts > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  input, select, textarea { font-size: 16px; }  /* pas de zoom automatique à la saisie sur iPhone */
}

/* ---------- Machine : deux grandes courbes de 24 h, activité du scan, disque, tableau des adresses IP ---------- */
.mach { padding-top: 14px; }
.mach .panel { min-width: 0; }
.mcharts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
.mrow { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 28px; margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); }
.mach .ips { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); }
.big-now { font-size: 28px; font-weight: 600; line-height: 1.15; color: var(--strong); }
.big-now.warn { color: var(--amber); }
.big-now.bad { color: var(--alert-text); }
.mach .note { margin-top: 3px; }
.big-chart { display: block; width: 100%; height: 150px; margin-top: 14px; overflow: visible; }
.big-chart line { stroke: var(--line-2); stroke-width: 1; vector-effect: non-scaling-stroke; }
.big-chart polyline { fill: none; stroke: var(--gauge); stroke-width: 1.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.big-chart polygon { fill: rgba(111, 113, 120, .16); stroke: none; }
.big-chart.warn polyline { stroke: var(--amber); }
.big-chart.warn polygon { fill: rgba(217, 162, 74, .14); }
.big-chart.bad polyline { stroke: var(--red); }
.big-chart.bad polygon { fill: rgba(163, 58, 62, .2); }
.big-act { height: 90px; margin-top: 4px; }

/* Une teinte douce par mesure, réservée à la page Machine : processeur, mémoire, activité du scan, disque.
   L'ambre (warn) et le rouge (bad) l'emportent quand un seuil est dépassé : ils redéfinissent la teinte. */
.m-cpu { --tint: #7aa2d6; }
.m-mem { --tint: #a593d8; }
.m-scan { --tint: #8cc49b; }
.m-disk { --tint: #c9b38a; }
.m-cpu.warn, .m-mem.warn, .m-scan.warn, .m-disk.warn { --tint: var(--amber); }
.m-cpu.bad, .m-mem.bad, .m-scan.bad, .m-disk.bad { --tint: var(--red); }
.big-now.m-cpu, .big-now.m-mem { color: var(--tint); }
.big-now.m-cpu.bad, .big-now.m-mem.bad { color: var(--alert-text); }
.big-chart.m-cpu polyline, .big-chart.m-mem polyline, .big-chart.m-scan polyline { stroke: var(--tint); }
.big-chart.m-cpu polygon { fill: var(--tint); fill-opacity: .14; }
.m-disk .bar > i { background: var(--tint); }
.m-disk .bar > i.warn { background: var(--amber); }
.m-disk .bar > i.bad { background: var(--red); }
.m-disk > h3 span { color: var(--tint); }

/* Bloc « en direct » : remplacé chaque seconde, donc de hauteur fixe et sans transition (aucun clignotement) */
.mlive { min-height: 292px; }
.live-figs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px 16px; margin: 4px 0 0; }
.live-figs > div { min-width: 0; }
.live-figs dt { color: var(--faint); font-size: 11.5px; }
.live-figs dd { margin: 3px 0 0; font-size: 24px; font-weight: 600; line-height: 1.15; color: var(--tint); font-variant-numeric: tabular-nums; }
.live-figs > div.bad dd { color: var(--alert-text); }
.live-chart { display: block; width: 100%; height: 120px; margin-top: 14px; overflow: visible; }
.live-chart line { stroke: var(--line-2); stroke-width: 1; vector-effect: non-scaling-stroke; }
.live-chart polyline { fill: none; stroke: var(--tint); stroke-width: 1.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.live-legend span { margin-right: 12px; }
.live-legend span::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 2px; background: var(--tint); }
.mrest { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); }
.axis { display: flex; justify-content: space-between; margin-top: 6px; color: var(--muted); font-size: 11.5px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 16px; margin: 16px 0 0; }
.stats.one { grid-template-columns: minmax(0, 1fr); gap: 0; margin-top: 12px; }
#m-scan-stats { grid-template-columns: repeat(6, minmax(0, 1fr)); }  /* compteurs du scan sur une ligne */
.stats > div { min-width: 0; }
.stats .m-steal.warn dd { color: var(--amber); }
.stats .m-steal.bad dd { color: var(--alert-text); }
.stats.one > div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line-2); }
.stats.one > div:last-child { border-bottom: 0; }
.stats dt { color: var(--faint); font-size: 11.5px; }
.stats dd { margin: 3px 0 0; font-size: 16px; font-weight: 600; color: var(--strong); overflow-wrap: anywhere; }
.stats.one dt { font-size: 12.5px; }
.stats.one dd { margin: 0; font-size: 13px; text-align: right; }
.tscroll { overflow-x: auto; }
#ip-table code { color: var(--text); font: 12px var(--mono); }
#ip-table td.st { color: var(--cell); }
#ip-table td.st.warn { color: var(--amber); }
#ip-table td.st.bad { color: var(--alert-text); }
@media (max-width: 719px) {
  .mcharts, .mrow { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .mlive { min-height: 0; }
  .live-figs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .live-figs dd { font-size: 22px; }
  .mrest { margin-top: 22px; padding-top: 16px; }
  .mrow { margin-top: 22px; padding-top: 16px; }
  .mach .ips { margin-top: 22px; padding-top: 16px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #m-scan-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .big-chart { height: 120px; }
  .tscroll { border: 1px solid var(--line); border-radius: var(--radius); }  /* seul défilement horizontal permis */
  #ip-table { min-width: 560px; }
}

/* ---------- Fiche produit : le panneau de détail en pleine page, puis la fiche Amazon et les deals ---------- */
.detail.full {
  display: block; flex: none; position: static; max-height: none; overflow: visible;
  margin: 0; padding: 8px 0 0; border-left: 0; border-bottom: 0;
}
.detail.full .asin { margin: 4px 0 0; font-size: 12px; }
.detail.full .curve { height: 140px; }
@media (min-width: 1000px) {
  /* Photo à gauche sur toute la hauteur, texte, grille, courbe et boutons à droite. */
  .detail.full { display: grid; grid-template-columns: 340px minmax(0, 1fr); column-gap: 32px; align-content: start; }
  .detail.full > * { grid-column: 2; min-width: 0; }
  .detail.full > .photo { grid-column: 1; grid-row: 1 / span 20; align-self: start; height: 340px; margin: 6px 0 0; }
}
.fiche-sec { margin-top: 26px; padding-top: 4px; border-top: 1px solid var(--line); }
.fiche-sec > .sec:first-child { margin-top: 14px; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px 24px; }
.kv small { display: block; color: var(--muted); font-size: 11.5px; }
.kv b { font-weight: 600; color: var(--strong); overflow-wrap: anywhere; }

/* ---------- Réglages : sections à titre et fin trait, deux colonnes sur PC ---------- */
.notice { margin: 0 0 14px; padding: 7px 12px; border-radius: var(--radius-sm); font-size: 12.5px; }
.notice.error { background: var(--alert-bg); color: var(--alert-text); }
.notice.success { background: var(--hover); color: var(--text); }
.set { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 56px; align-items: start; }
.set-col { min-width: 0; margin: 0; }
.set-sec { padding: 18px 0 22px; border-top: 1px solid var(--line); }
.set-col > .set-sec:first-child { border-top: 0; padding-top: 8px; }
.set-sec h2 {
  display: flex; align-items: baseline; gap: 10px; margin: 0 0 12px; font-size: 13px; color: var(--heading);
}
.set-sec h2 span { color: var(--muted); font-size: 11.5px; font-weight: 400; }
.set-sec h2 span.warn { color: var(--amber); }
.set-sec h2 span.ok { color: var(--soft); }
.set-sec p { margin: 0 0 12px; }
.set-sec form { margin: 0; }
.field { display: block; margin: 0 0 14px; }
.field label { display: block; }
.field-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 10px; }
.field-row label { color: var(--text); font-size: 13px; }
.field-row input { width: 96px; margin: 0; text-align: right; }
.hook-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line-2); }
.hook-row:first-of-type { border-top: 0; padding-top: 0; }
@media (max-width: 999px) {
  .set { grid-template-columns: minmax(0, 1fr); }
  .set > .set-col + .set-col > .set-sec:first-child { border-top: 1px solid var(--line); padding-top: 18px; }
}
@media (min-width: 720px) { .phone-only { display: none; } }  /* sur PC, la barre latérale propose la déconnexion */
/* Catégories exclues : liste déroulante (details) avec recherche et cases groupées par rayon */
.pick { margin: 0 0 16px; }
.pick > summary { list-style: none; }
.pick > summary::-webkit-details-marker { display: none; }
.pick > summary::after {
  content: ""; width: 5px; height: 5px; margin: 0 0 3px 4px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg);
}
.pick[open] > summary::after { margin: 3px 0 0 4px; transform: rotate(-135deg); }
.pick-panel { margin-top: 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--field); }
.pick-panel input[type="search"] { margin: 0; border: 0; border-bottom: 1px solid var(--line); border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.pick-list { max-height: 340px; overflow-y: auto; padding: 6px 0; overscroll-behavior: contain; }
.pick-group { padding: 2px 12px; }
.pick [hidden] { display: none !important; }
.pick-dep, .pick-sub { display: flex; align-items: center; gap: 8px; padding: 4px 0; cursor: pointer; }
.pick-dep { color: var(--text); font-size: 13px; }
.pick-sub { color: var(--soft); font-size: 12.5px; }
.pick-subs { min-width: 0; margin: 0; padding: 0 0 4px 22px; border: 0; }
.pick-subs:disabled { opacity: .45; }
.pick-subs:disabled .pick-sub { cursor: default; }
.pick-head { padding: 6px 0 2px; color: var(--muted); font-size: 11.5px; }
.pick-note { margin: 0; padding: 8px 12px; font-size: 12.5px; }
@media (max-width: 719px) { .pick-dep, .pick-sub { padding: 7px 0; } }  /* cibles plus grandes au doigt */
/* Mots-clés exclus : pastilles avec une croix sous le champ */
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pills:empty { display: none; }
.pill {
  display: inline-flex; align-items: center; gap: 2px; max-width: 100%; padding: 2px 2px 2px 10px;
  border: 1px solid var(--btn-line); border-radius: 999px; color: var(--text); font-size: 12.5px; overflow-wrap: anywhere;
}
.pill-x {
  padding: 2px 7px; border: 0; border-radius: 999px; background: transparent; color: var(--muted);
  font: inherit; font-size: 14px; line-height: 1; cursor: pointer;
}
.pill-x:hover { background: var(--hover); color: var(--strong); }

/* ---------- Journaux : chasse fixe, retours à la ligne, aucun débordement ---------- */
.log-sec > .muted { margin: 6px 0 12px; }
pre.logs {
  margin: 0; padding-top: 12px; border-top: 1px solid var(--line); color: var(--body-2);
  font: 12px/1.5 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word;
}

/* ---------- Fenêtre de confirmation de la déconnexion ---------- */
#logout-dialog { padding: 0; border: 1px solid var(--btn-line); border-radius: var(--radius); background: var(--bg); color: var(--text); width: min(340px, calc(100vw - 32px)); }
#logout-dialog::backdrop { background: rgba(0, 0, 0, .6); }
.dlg { padding: 20px; }
.dlg h2 { font-size: 15px; }
.dlg p { margin: 6px 0 0; }
.dlg-btns { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
