:root {
  --bg: #0f131c; --panel: #171c28; --panel2: #1e2433; --line: #2a3142; --txt: #e3e6ee; --mut: #8b93a7;
  --blue: #2962ff; --green: #26a269; --red: #e5484d; --orange: #ff9800; --teal: #12b5cb; --purple: #ab47bc;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--txt); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
a { color: inherit; text-decoration: none; }
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px; background: #131722; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.brand img { width: 28px; height: 28px; border-radius: 7px; }
.acct { text-align: right; font-size: 12px; color: var(--mut); line-height: 1.3; }
.acct b { color: var(--txt); font-size: 14px; }
.pill { display: inline-block; padding: 1px 7px; border-radius: 99px; font-size: 11px; font-weight: 700; }
.pill.demo { background: #12b5cb22; color: var(--teal); }
.pill.reel { background: #e5484d22; color: var(--red); }
.pill.off { background: #ff980022; color: var(--orange); }
main { padding: 12px 12px 20px; max-width: 760px; margin: 0 auto; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--mut); margin: 18px 4px 8px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin-bottom: 10px; }
.card.click { cursor: pointer; }
.card.alert { border-color: #ff980066; box-shadow: 0 0 0 1px #ff980033 inset; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.title { font-weight: 700; font-size: 16px; }
.sub { color: var(--mut); font-size: 13px; }
.buy { color: var(--green); } .sell { color: var(--red); }
.thumb { width: 100%; border-radius: 10px; margin-top: 10px; display: block; background: #0b0e14; aspect-ratio: 14/7.5; object-fit: cover; }
.big { width: 100%; border-radius: 12px; display: block; background: #0b0e14; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.kv { background: var(--panel2); border-radius: 10px; padding: 8px; }
.kv span { display: block; font-size: 11px; color: var(--mut); text-transform: uppercase; letter-spacing: .04em; }
.kv b { font-size: 15px; font-variant-numeric: tabular-nums; }
.warn { margin-top: 10px; font-size: 13px; color: #f5c26b; }
.warn.ok { color: #6fd29a; }
.btns { display: flex; gap: 8px; margin-top: 12px; }
.btn { flex: 1; border: 0; border-radius: 12px; padding: 14px 10px; font-size: 16px; font-weight: 700; color: #fff; background: var(--panel2); cursor: pointer; }
.btn.green { background: var(--green); } .btn.red { background: var(--red); } .btn.blue { background: var(--blue); }
.btn.orange { background: var(--orange); color: #111; } .btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--txt); }
.btn:disabled { opacity: .45; }
.status { display: inline-block; padding: 2px 8px; border-radius: 8px; font-size: 12px; font-weight: 700; background: var(--panel2); color: var(--mut); }
.status.en_attente { background: #ff980022; color: var(--orange); }
.status.pris { background: #26a26922; color: var(--green); }
.status.refuse, .status.obsolete, .status.remplace { background: #8b93a722; color: var(--mut); }
.status.applique { background: #2962ff22; color: #7aa2ff; }
.empty { color: var(--mut); text-align: center; padding: 18px 8px; font-size: 14px; }
.live { margin-top: 10px; padding: 10px; border-radius: 10px; background: var(--panel2); font-size: 14px; }
.live.bad { background: #e5484d1a; color: #ff9a9d; }
.live.good { background: #26a2691a; }
.list .item { padding: 10px 2px; border-bottom: 1px solid var(--line); }
.list .item:last-child { border-bottom: 0; }
.banner { background: #2962ff22; border: 1px solid #2962ff55; color: #b9c8ff; border-radius: 12px; padding: 12px; margin-bottom: 10px; }
.tabs { position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: #131722; border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom); z-index: 6; }
.tabs a { flex: 1; text-align: center; padding: 12px 2px 13px; font-size: 12px; color: var(--mut); position: relative; }
.tabs a.on { color: #fff; font-weight: 700; }
.tabs a b { display: inline-block; vertical-align: 1px; margin-left: 4px; min-width: 16px; height: 16px; border-radius: 8px;
  background: var(--orange); color: #111; font-size: 10px; line-height: 16px; padding: 0 4px; }
.tabs a b:empty { display: none; }
.modal { position: fixed; inset: 0; background: #000a; z-index: 10; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--panel); width: 100%; max-width: 560px; border-radius: 18px 18px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
.sheet h3 { margin: 0 0 10px; }
.sheet input { width: 100%; font-size: 20px; padding: 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--txt); }
.hidden { display: none !important; }
.zoom { position: fixed; inset: 0; z-index: 11; background: #000; overflow: auto; display: flex; align-items: center; }
.zoom img { width: 220%; max-width: none; }
.toast { position: fixed; left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 12; padding: 12px 14px;
  border-radius: 12px; background: #2a3142; color: #fff; font-weight: 600; box-shadow: 0 6px 24px #0008; }
.toast.err { background: #8e2a2d; } .toast.ok { background: #1d6b45; }
.login { max-width: 380px; margin: 12vh auto 0; text-align: center; }
.login img { width: 84px; height: 84px; border-radius: 20px; }
.login input { width: 100%; font-size: 17px; padding: 14px; margin: 18px 0 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--txt); }
.loading { color: var(--mut); text-align: center; padding: 40px; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t td { padding: 7px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
small.mut { color: var(--mut); }

.pgroup summary { font-weight: 700; cursor: pointer; padding: 2px 0 6px; }
.prow { display: block; padding: 10px 0; border-top: 1px solid var(--line); }
.prow > span { display: block; font-size: 14px; margin-bottom: 6px; }
.prow input[type=text], .prow input[type=number], .prow input[type=password], .prow select, .prow textarea {
  width: 100%; font-size: 16px; padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--txt); }
.prow.chk { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.prow.chk > span { margin: 0; }
.prow.chk input { width: 24px; height: 24px; flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 99px; font-size: 14px; }

h2 em { font-style: normal; color: var(--txt); background: var(--panel2); border-radius: 8px; padding: 0 7px; margin-left: 4px; font-size: 12px; }
.hero { background: linear-gradient(160deg, #1b2335, #141924); border: 1px solid var(--line); border-radius: 16px; padding: 14px 14px 6px; margin-bottom: 10px; }
.hero-top { display: flex; justify-content: space-between; gap: 10px; }
.hero span, .kpi span { display: block; font-size: 11px; color: var(--mut); text-transform: uppercase; letter-spacing: .05em; }
.hero b { display: block; font-size: 26px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.hero small, .kpi small { display: block; font-size: 12px; color: var(--mut); }
.hero-pl { text-align: right; } .hero-pl b { font-size: 20px; }
.chart { width: 100%; height: auto; display: block; margin-top: 6px; }
.chart text { fill: var(--mut); font-size: 11px; font-family: system-ui, sans-serif; }
.chart .g { stroke: #2a3142; stroke-width: 1; } .chart .z { stroke: #5b6478; stroke-dasharray: 4 4; }
.chart-empty { color: var(--mut); font-size: 13px; text-align: center; padding: 26px 8px; }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 10px; }
.kpis.k2 { margin: 0; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.kpi b { display: block; font-size: 19px; font-variant-numeric: tabular-nums; margin: 2px 0 1px; }
.status-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 4px 0 6px; }
.st { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 4px; text-align: center; }
.st b { display: block; font-size: 20px; } .st span { font-size: 11px; color: var(--mut); }
.st.hot { border-color: #ff980088; } .st.hot b { color: var(--orange); }
.list .line, .line { display: flex; align-items: center; gap: 10px; padding: 11px 2px; border-bottom: 1px solid var(--line); }
.list .line:last-child { border-bottom: 0; }
.line .l { flex: 1; min-width: 0; } .line .l small { display: block; color: var(--mut); font-size: 12.5px; margin-top: 2px; }
.line .r { text-align: right; white-space: nowrap; } .line .r small { display: block; font-size: 11px; color: var(--mut); }
.chev { color: var(--mut); font-size: 20px; }
.tag { display: inline-block; padding: 3px 8px; border-radius: 8px; background: var(--panel2); color: var(--mut); font-size: 12px; font-weight: 700; }
.tag.live { background: #12b5cb22; color: var(--teal); } .tag.hot { background: #ff980022; color: var(--orange); }
.big-num { font-size: 24px; font-weight: 800; }
.btn.small { flex: none; padding: 7px 12px; font-size: 13px; border-radius: 9px; display: inline-block; }
a.btn { text-align: center; }
.seg { display: flex; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin: 4px 0 12px; }
.seg button { flex: 1; border: 0; background: transparent; color: var(--mut); padding: 10px; border-radius: 9px; font-weight: 700; font-size: 14px; }
.seg button.on { background: var(--blue); color: #fff; }
.tbl { padding: 4px 8px; overflow-x: auto; }
table.jt { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.jt th { text-align: left; font-size: 11px; color: var(--mut); text-transform: uppercase; letter-spacing: .04em; padding: 8px 4px; border-bottom: 1px solid var(--line); }
table.jt td { padding: 10px 4px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.jt td small { display: block; color: var(--mut); font-size: 11.5px; }
table.jt tr:last-child td { border-bottom: 0; }
table.jt td.res b { display: block; }
.timeline { position: relative; margin-left: 8px; border-left: 2px solid var(--line); padding-left: 14px; }
.tl { position: relative; margin-bottom: 14px; }
.tl .dot { position: absolute; left: -22px; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: var(--blue); border: 3px solid var(--bg); }
.tl .dot.sl, .tl .dot.suiveur { background: var(--orange); } .tl .dot.cloture { background: var(--green); }
.tl .dot.fin_strategie { background: var(--purple); } .tl .dot.entree { background: var(--teal); }
.tlc { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.donut { width: 112px; height: 112px; flex: none; }
.donut .dv { fill: #fff; font-size: 20px; font-weight: 800; } .donut .dl { fill: var(--mut); font-size: 10px; }

.seg.s4 button { padding: 9px 2px; font-size: 13px; }
.tl .dot.formation { background: var(--purple); } .tl .dot.a_confirmer { background: var(--teal); }
.tl .dot.avorte { background: var(--red); } .tl .dot.confirme { background: var(--green); } .tl .dot.maj { background: #8b93a7; }

.chartbox { height: 58vh; min-height: 320px; margin: 10px -12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.hint { color: var(--mut); font-size: 13px; text-align: center; margin-top: 8px; }
.hint b { color: #fff; }
.tl .dot.attente_pullback { background: var(--orange); }
