/* Affichage mural 1920×1080, lu à 3 m. Moteur Chrome 53 (webOS 4.1), processeur de TV : tout est peint une fois.
   1rem = 1 % de la largeur de l'écran (19 px sur une TV 1080p) : aucun texte sous 1rem.
   Style sobre et clair : fond uni, panneaux blancs, couleur réservée aux variations et aux alertes.
   Deux animations, le défilement continu du classement et du carrousel du bas (transform) ; ni flou, ni ombres.
   Flexbox sans « gap », pas de grille CSS. */
:root {
  --bg: #eef0f4;
  --panel: #ffffff;
  --line: rgba(15, 23, 42, 0.09);
  --text: #111827;
  --soft: #4b5563;
  --faint: #8b93a1;
  --up: #15925e;
  --down: #d6364a;
  --warn: #b7700a;
  --accent: #2f6fdf;
  --track: #e3e6eb;
  --chip: #e1e4ea;
}
/* Nuit (19 h → 7 h à Dubaï, posé par app.js) : mêmes jetons en sombre. */
html.night {
  --bg: #0d0f14;
  --panel: #161920;
  --line: rgba(255, 255, 255, 0.08);
  --text: #eef0f4;
  --soft: #a3a9b6;
  --faint: #6b7280;
  --up: #4cc38a;
  --down: #e5636f;
  --warn: #e2a93b;
  --accent: #7aa2f7;
  --track: #262a33;
  --chip: #252a35;
}
html.night .nt.signup .nt-kind { color: #b39cf0; }

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 1vw; }
html, body { width: 100%; height: 100%; overflow: hidden; color: var(--text); }
body {
  background: var(--bg);
  font-family: "SF Pro Display", "LG Smart UI", "Museo Sans", "Helvetica Neue", Arial, sans-serif;
  font-size: 1.3rem;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
b { font-variant-numeric: tabular-nums; }

#root { display: flex; flex-direction: column; height: 100vh; padding: 0.9rem 1.2rem 1rem; }

.panel, .kpi, .card { border-radius: 0.8rem; background: var(--panel); border: 1px solid var(--line); }
.panel { padding: 0.8rem 1rem; }
.vps { padding-left: 0.9rem; padding-right: 0.9rem; }
.panel h2 { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.6rem; font-size: 1.1rem; font-weight: 700; color: var(--soft); text-transform: uppercase; letter-spacing: 0.08em; white-space: nowrap; }
.badge { display: inline-block; padding: 0.15rem 0.6rem; border-radius: 1rem; font-size: 1.1rem; font-weight: 700; line-height: 1.2; letter-spacing: 0; text-transform: none; white-space: nowrap; }

/* ---- En-tête ---- */
.top { display: flex; align-items: center; height: 4.2rem; flex: none; margin-bottom: 0.8rem; }
.brand { flex: 1; font-size: 2.4rem; font-weight: 800; letter-spacing: 0.01em; }
.brand span { margin-left: 0.5rem; color: var(--faint); font-weight: 600; }
.brand em { font-style: normal; font-size: 1rem; vertical-align: middle; margin-left: 0.8rem; padding: 0.25rem 0.6rem; border-radius: 1rem; background: var(--warn); color: #1a1205; }
.period { margin-right: 1.6rem; }
.chips { display: flex; }
.chips span { margin-left: 0.4rem; padding: 0.45rem 1.1rem; border-radius: 0.6rem; font-size: 1.35rem; font-weight: 700; color: var(--faint); }
.chips span.on { color: var(--text); background: var(--chip); }
.progress { height: 0.2rem; margin: 0.4rem 0 0 0.4rem; border-radius: 0.2rem; background: var(--track); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--soft); }
.pill { display: flex; align-items: center; margin-right: 1.6rem; color: var(--soft); font-size: 1.15rem; font-weight: 700; white-space: nowrap; }
.pill .dot { margin-right: 0.5rem; }
.pill.offline { color: var(--warn); }
.clock { display: flex; align-items: baseline; white-space: nowrap; }
.clock span { margin-right: 0.9rem; color: var(--soft); font-size: 1.45rem; font-weight: 600; }
.clock b { font-size: 3.2rem; font-weight: 300; line-height: 1; }

.dot { display: inline-block; width: 0.75rem; height: 0.75rem; border-radius: 50%; background: var(--faint); flex: none; }
.dot.up { background: var(--up); }
.dot.degraded, .dot.warn { background: var(--warn); }
.dot.down, .dot.bad { background: var(--down); }

/* ---- Mise en page ---- */
.body { flex: 1; display: flex; min-height: 0; }
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; margin-right: 0.8rem; }
.middle { flex: 1; display: flex; min-height: 0; margin-bottom: 0.8rem; }
.side { width: 21.5rem; flex: none; display: flex; flex-direction: column; margin-left: 0.8rem; }

/* ---- Chiffres clés ---- */
.kpis { display: flex; margin: 0 -0.4rem 0.8rem; flex: none; }
.kpi { flex: 1; min-width: 0; margin: 0 0.4rem; padding: 0.8rem 1.1rem 0.9rem; }
.kpi h3 { font-size: 1.15rem; font-weight: 700; color: var(--soft); text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap; }
.kpi .big { display: block; margin: 0.25rem 0 0.4rem; font-size: 3.4rem; font-weight: 800; line-height: 1.05; white-space: nowrap; }
.kpi .sub { display: flex; align-items: center; font-size: 1.2rem; color: var(--soft); white-space: nowrap; }
.kpi .sub .delta { margin-right: 0.6rem; }
.pos { color: var(--up) !important; }
.neg { color: var(--down) !important; }

/* Variations : texte coloré, sans fond. */
.delta { display: inline-block; font-size: 1.2rem; font-weight: 800; white-space: nowrap; }
.delta.up { color: var(--up); }
.delta.down { color: var(--down); }
.delta.flat { color: var(--faint); }
.delta.new { color: var(--accent); }

/* ---- Classement des sites ---- */
.board { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 0.3rem 1.1rem 0.4rem; }
#sites { flex: 1; position: relative; min-height: 0; overflow: hidden; }
.vbelt { position: absolute; top: 0; left: 0; right: 0; will-change: transform; -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.vbelt.scroll { -webkit-animation: vbelt 60s linear infinite; animation: vbelt 60s linear infinite; }
@-webkit-keyframes vbelt { from { -webkit-transform: translate3d(0, 0, 0); } to { -webkit-transform: translate3d(0, -50%, 0); } }
@keyframes vbelt { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(0, -50%, 0); } }
.row { display: flex; align-items: center; }
.row.head { height: 2.6rem; flex: none; color: var(--faint); font-size: 1.05rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 1px solid var(--line); }
#sites .row { border-bottom: 1px solid var(--line); }
.c-rank { width: 1.8rem; flex: none; font-size: 1.6rem; font-weight: 700; color: var(--faint); }
.c-name { flex: 1; min-width: 0; display: flex; align-items: center; }
.row.head .c-name { color: var(--soft); }
.c-name b { font-size: 1.5rem; font-weight: 700; line-height: 1.1; }
.logo { width: 3.2rem; height: 3.2rem; flex: none; margin-right: 0.8rem; border-radius: 0.6rem; overflow: hidden; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; font-weight: 800; color: #fff; }
.logo img { width: 100%; height: 100%; object-fit: contain; }
.c-chart { width: 7rem; flex: none; height: 72%; padding: 0 0.8rem; }
.row.head .c-chart { height: auto; }
.c-chart svg { display: block; width: 100%; height: 100%; }
/* Colonnes de chiffres séparées par un filet : deux nombres voisins ne se lisent jamais comme un seul. */
.c-num, .c-money { flex: none; align-self: stretch; display: flex; flex-direction: column; justify-content: center; box-sizing: border-box; padding: 0 0.6rem; border-left: 1px solid var(--line); text-align: right; white-space: nowrap; }
.c-num { width: 6.2rem; }
.c-num.narrow { width: 5.6rem; }
.c-num.sales { width: 4.4rem; }
.c-money { width: 6.8rem; }
.c-money.result { width: 7.6rem; }
.row.head .c-num, .row.head .c-money, .row.head .c-chart { font-size: 0.9rem; letter-spacing: 0; }
#sites .c-num b.long, #sites .c-money b.long { font-size: 1.3rem; }
#sites .c-name .logo { width: 2.8rem; height: 2.8rem; margin-right: 0.6rem; }
#sites .c-num b, #sites .c-money b { display: block; font-size: 1.7rem; font-weight: 800; line-height: 1.1; white-space: nowrap; }
#sites .c-num .delta { display: block; font-size: 1.1rem; }
#sites .none, #sites .c-money b.none { color: var(--faint); font-weight: 600; }

/* ---- Abonnements IA ---- */
.ai { flex: none; margin-bottom: 0.8rem; }
.sub-ai + .sub-ai { margin-top: 0.6rem; padding-top: 0.6rem; border-top: 1px solid var(--line); }
.sub-head { display: flex; align-items: baseline; justify-content: space-between; font-size: 1.4rem; font-weight: 700; white-space: nowrap; }
.sub-head span { color: var(--soft); font-size: 1.2rem; font-weight: 600; }
.limits { display: flex; margin-top: 0.3rem; }
.limit { flex: 1; min-width: 0; }
.limit + .limit { margin-left: 0.9rem; }
.limit .lr { display: flex; justify-content: space-between; align-items: baseline; font-size: 1.05rem; color: var(--soft); white-space: nowrap; }
.limit .lr b { font-size: 1.6rem; font-weight: 800; color: var(--text); }
.limit .lr b.warn { color: var(--warn); }
.limit .lr b.bad { color: var(--down); }
.limit .track { height: 0.4rem; margin-top: 0.2rem; }
.sub-ai.total .sub-head { color: var(--soft); }
.sub-ai.total .sub-head span { color: var(--text); font-weight: 800; }
.renew { margin-top: 0.1rem; color: var(--faint); font-size: 1.05rem; white-space: nowrap; }
.renew b { color: var(--soft); font-weight: 700; }
.renew b.warn { color: var(--warn, #d08a1e); }
.waiting { margin-top: 0.2rem; color: var(--faint); font-size: 1.05rem; }

.track { border-radius: 0.3rem; background: var(--track); overflow: hidden; }
.fill { height: 100%; border-radius: 0.3rem; background: var(--up); }
.fill.warn { background: var(--warn); }
.fill.bad { background: var(--down); }

/* ---- VPS : tableau, une jauge circulaire par mesure ---- */
.vps { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.badge.ok { background: rgba(76, 195, 138, 0.15); color: var(--up); }
.badge.bad { background: rgba(229, 99, 111, 0.18); color: var(--down); }
.vps-cols { display: flex; flex: none; padding-bottom: 0.3rem; border-bottom: 1px solid var(--line); color: var(--faint); font-size: 1rem; font-weight: 700; text-transform: uppercase; }
.vps-cols span, .srv .ring { width: 3.6rem; flex: none; margin-left: 0.4rem; text-align: center; }
.vps-cols span:first-child { flex: 1; width: auto; margin-left: 0; text-align: left; }
#vps-list { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.srv { flex: 1; min-height: 0; display: flex; align-items: center; border-bottom: 1px solid var(--line); }
.srv:last-child { border-bottom: 0; }
.srv-name { flex: 1; min-width: 0; padding-right: 0.3rem; display: flex; align-items: center; font-size: 1.2rem; font-weight: 700; line-height: 1.15; }
.srv-name .dot { margin-right: 0.5rem; }
.srv .error { width: 11.6rem; flex: none; color: var(--down); font-size: 1.05rem; font-weight: 700; text-align: right; }
.ring { position: relative; height: 3.6rem; }
.ring svg { display: block; width: 100%; height: 100%; -webkit-transform: rotate(-90deg); transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 3.4; }
.ring .bg { stroke: var(--track); }
.ring .val { stroke: var(--up); }
.ring.warn .val { stroke: var(--warn); }
.ring.bad .val { stroke: var(--down); }
.ring b { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; font-weight: 800; letter-spacing: -0.02em; }
.ring b small { font-size: 0.75em; font-weight: 700; }
.ring.warn b { color: var(--warn); }
.ring.bad b { color: var(--down); }

/* ---- Notifications (colonne de droite) ---- */
.rail { width: 20rem; flex: none; display: flex; flex-direction: column; min-height: 0; }
.notifs { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.notifs h2 .badge { background: var(--down); color: #fff; }
.notifs h2 .badge:empty { display: none; }
.list { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.nt { display: flex; align-items: flex-start; padding: 0.35rem 0; border-bottom: 1px solid var(--line); }
.nt .logo { width: 2.8rem; height: 2.8rem; margin-right: 0.7rem; }
.nt-body { flex: 1; min-width: 0; }
.nt-top { display: flex; justify-content: space-between; align-items: baseline; }
.nt-top b { flex: 1; min-width: 0; font-size: 1.25rem; font-weight: 700; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nt-top time { margin-left: 0.4rem; flex: none; color: var(--faint); font-size: 0.95rem; white-space: nowrap; }
.nt-kind { display: flex; align-items: baseline; justify-content: space-between; margin-top: 0.05rem; font-size: 1.1rem; font-weight: 700; }
.nt-kind em { font-style: normal; font-size: 1.25rem; }
.nt p { margin-top: 0.05rem; color: var(--soft); font-size: 1rem; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nt.sale .nt-kind { color: var(--up); }
.nt.refund .nt-kind, .nt.cancel .nt-kind { color: var(--down); }
.nt.signup .nt-kind { color: #7c4dd6; }
.nt.contact .nt-kind, .nt.ticket .nt-kind { color: var(--accent); }
.nt.fresh .nt-top b:before { content: ""; display: inline-block; width: 0.55rem; height: 0.55rem; margin-right: 0.45rem; border-radius: 50%; background: var(--accent); vertical-align: 0.2rem; }
.empty { padding: 1rem 0; color: var(--faint); font-size: 1.2rem; }

/* ---- Carrousel : défilement lent et continu (deux copies des cartes, on glisse d'une copie) ---- */
.carousel { position: relative; height: 6.2rem; flex: none; overflow: hidden; }
.belt { position: absolute; top: 0; left: 0; height: 100%; display: flex; white-space: nowrap; will-change: transform; -webkit-backface-visibility: hidden; backface-visibility: hidden;
  -webkit-animation: belt 60s linear infinite; animation: belt 60s linear infinite; }
@-webkit-keyframes belt { from { -webkit-transform: translate3d(0, 0, 0); } to { -webkit-transform: translate3d(-50%, 0, 0); } }
@keyframes belt { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-50%, 0, 0); } }
.card { width: 21rem; height: 100%; flex: none; margin-right: 0.8rem; padding: 0.55rem 0.9rem; display: flex; align-items: center; }
.card .logo { width: 3.4rem; height: 3.4rem; }
.card-body { flex: 1; min-width: 0; }
.card-body > b { display: block; font-size: 1.4rem; font-weight: 700; white-space: nowrap; overflow: hidden; }
.card-line { display: flex; align-items: center; justify-content: space-between; margin-top: 0.2rem; font-size: 1.1rem; color: var(--soft); }
.card-line span { display: flex; align-items: baseline; }
.card-line b { margin-right: 0.6rem; color: var(--text); font-size: 1.45rem; font-weight: 800; }
.card-line .delta { width: 5.4rem; font-size: 1.15rem; text-align: right; }

/* ---- Écran de réglage ---- */
.setup { position: absolute; top: 0; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--bg); }
.setup h1 { font-size: 4rem; margin-bottom: 1rem; }
.setup p { font-size: 1.6rem; color: var(--soft); }
.setup code { color: var(--accent); }

#awake { position: fixed; right: 0; bottom: 0; width: 2px; height: 2px; opacity: 0.01; pointer-events: none; }
