/* Telegram Marketiser — démo interactive */
:root {
  color-scheme: dark;
  --bg: #060a13; --panel: #0a1120; --panel-2: #0d1627; --line: #152238; --line-2: #1e3050;
  --text: #e9f1ff; --muted: #8492ab; --dim: #55637c;
  --accent: #3aa9f2; --accent-2: #62c4ff; --accent-ink: #04101d;
  --violet: #8b7cf6; --green: #3ddcb1; --orange: #f6b35a; --pink: #d971d9; --red: #f2647a;
  --sans: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
  --side: 232px; --pad: 28px; --gap: 14px; --radius: 14px;
}
body[data-accent="violet"] { --accent: #8b7cf6; --accent-2: #b0a5ff; }
body[data-accent="green"] { --accent: #2fcfa4; --accent-2: #6fe8c6; }
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; color: var(--text); font: 13px/1.45 var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p, dl, dd, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; text-align: inherit; }
button:disabled { opacity: .4; cursor: not-allowed; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--accent); color: var(--accent-ink); }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.dot { display: inline-block; width: 6px; height: 6px; flex: none; border-radius: 50%; background: var(--accent); }
.dot.green { background: var(--green); box-shadow: 0 0 8px var(--green); }
.dot.violet { background: var(--violet); }
.kicker { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.kicker.live { color: var(--accent-2); }
.sub { color: var(--muted); max-width: 72ch; }
.link { color: var(--accent-2); font-size: 12px; }
.link:hover { text-decoration: underline; }

/* ---------- Structure ---------- */
.app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; z-index: 30; display: flex; flex-direction: column; height: 100vh; padding: 20px 14px 14px; background: #070c17; border-right: 1px solid var(--line); overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 12px; padding: 2px 6px 22px; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(145deg, var(--accent-2), var(--accent)); color: #fff; box-shadow: 0 6px 22px color-mix(in srgb, var(--accent) 45%, transparent); }
.brand-mark .ic { width: 22px; height: 22px; }
.brand b { display: block; font-size: 15px; }
.brand small { display: block; color: var(--muted); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
#nav { display: flex; flex-direction: column; gap: 3px; }
#nav p { padding: 14px 10px 8px; color: var(--dim); font-size: 10px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
#nav a { display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 0 12px; border: 1px solid transparent; border-radius: 9px; color: var(--muted); font-size: 13.5px; transition: background .2s, color .2s, border-color .2s; }
#nav a:hover { color: var(--text); background: #0d1526; }
#nav a[aria-current] { color: var(--text); background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 16%, transparent), #0d1526); border-color: var(--line-2); }
#nav a[aria-current] .ic { color: var(--accent-2); }
#nav a span { flex: 1; }
#nav a small { color: var(--dim); font-size: 10px; }
.sidebar-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.status { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: #0b1322; }
.status > i { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px #3ddcb126; }
.status b { display: block; font-size: 11.5px; }
.status span { color: var(--muted); font-size: 10px; }
.status.syncing > i { animation: ping 1s ease-out; }
.user { display: flex; align-items: center; gap: 10px; padding: 14px 6px 2px; }
.user p { flex: 1; }
.user b { display: block; font-size: 12.5px; }
.user span { color: var(--muted); font-size: 10.5px; }
.avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: #14233b; border: 1px solid var(--line-2); font-size: 10.5px; font-weight: 700; }
.icon-btn { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 9px; color: var(--muted); transition: background .2s, color .2s; }
.icon-btn:hover { background: #111c30; color: var(--text); }
.scrim { display: none; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; min-height: 68px; padding: 10px var(--pad); background: #060a13e6; backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.topbar-title { margin-right: auto; min-width: 0; }
.topbar-title small { display: block; color: var(--muted); font-size: 9.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.topbar-title h1 { font-size: 17px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-btn { display: none; }
.demo-chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; border: 1px dashed color-mix(in srgb, var(--orange) 60%, transparent); border-radius: 100px; color: var(--orange); font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.demo-chip i { width: 6px; height: 6px; border-radius: 50%; background: var(--orange); }
.demo-chip:hover { background: #f6b35a14; }
.search { display: flex; align-items: center; gap: 10px; width: min(350px, 30vw); height: 40px; padding: 0 10px 0 12px; border: 1px solid var(--line-2); border-radius: 10px; background: #0a1120; color: var(--muted); transition: border-color .2s; }
.search:hover { border-color: var(--accent); }
.search span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
kbd { padding: 2px 6px; border: 1px solid var(--line-2); border-radius: 5px; background: #0f1a2e; color: var(--muted); font: 10.5px var(--mono); white-space: nowrap; }
.bell { position: relative; border: 1px solid var(--line-2); width: 40px; height: 40px; }
#bell-dot { position: absolute; top: 9px; right: 10px; width: 7px; height: 7px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px var(--bg); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 15px; border: 1px solid transparent; border-radius: 10px; font-size: 12.5px; font-weight: 650; white-space: nowrap; transition: background .2s, border-color .2s, transform .15s, box-shadow .2s; }
.btn:active { transform: scale(.97); }
.btn.primary { background: linear-gradient(180deg, var(--accent-2), var(--accent)); color: var(--accent-ink); box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn.primary:hover { box-shadow: 0 8px 28px color-mix(in srgb, var(--accent) 55%, transparent); }
.btn.ghost { border-color: var(--line-2); color: var(--accent-2); background: #0a1120; }
.btn.ghost:hover { border-color: var(--accent); background: #0e1a2e; }
.btn.wide { width: 100%; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; min-height: 34px; }
.btn.small { min-height: 30px; padding: 0 10px; font-size: 11.5px; }
#view { flex: 1; padding: 24px var(--pad) 8px; outline: 0; }
#view > * { animation: rise .45s cubic-bezier(.2, .7, .2, 1) backwards; }
#view > :nth-child(2) { animation-delay: .05s; }
#view > :nth-child(3) { animation-delay: .1s; }
.demo-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 20px; padding: 18px var(--pad) 26px; color: var(--muted); font-size: 11.5px; }
.demo-foot b { color: var(--orange); font-weight: 600; }
.demo-foot a { display: inline-flex; align-items: center; gap: 6px; color: var(--accent-2); }
.demo-foot a:hover { text-decoration: underline; }
.noscript { padding: 40px; text-align: center; }

/* ---------- Cartes ---------- */
.card { position: relative; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(180deg, var(--panel-2), var(--panel)); min-width: 0; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h3 { margin-top: 5px; font-size: 14.5px; font-weight: 650; }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); margin-top: var(--gap); }
.grid > * { grid-column: span 12; min-width: 0; }
.grid > .span-8 { grid-column: span 8; }
.grid > .span-4 { grid-column: span 4; }
.grid > div > .card { height: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h2 { margin: 6px 0; font-size: clamp(22px, 2.6vw, 30px); font-weight: 650; letter-spacing: -.02em; }
.delta { color: var(--green); font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 5px; background: #3ddcb11a; }
.delta.down { color: var(--accent-2); background: #3aa9f21f; }
.chip-btn { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--line-2); border-radius: 7px; color: var(--muted); font-size: 10.5px; white-space: nowrap; transition: border-color .2s, color .2s, background .2s; }
button.chip-btn:hover, .chip-btn[aria-pressed="true"], .chip-btn[aria-expanded="true"] { border-color: var(--accent); color: var(--text); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.seg { display: inline-flex; padding: 3px; border: 1px solid var(--line-2); border-radius: 8px; }
.seg button { padding: 4px 11px; border-radius: 5px; color: var(--muted); font-size: 10.5px; }
.seg button[aria-pressed="true"] { background: #17294a; color: var(--text); }
.select { position: relative; display: inline-flex; }
.select select { appearance: none; height: 34px; padding: 0 30px 0 11px; border: 1px solid var(--line-2); border-radius: 8px; background: #0a1120; font-size: 11.5px; cursor: pointer; max-width: 100%; }
.select select:hover { border-color: var(--accent); }
.select .ic { position: absolute; right: 9px; top: 9px; pointer-events: none; color: var(--muted); }
.switch { width: 38px; height: 22px; flex: none; padding: 2px; border-radius: 100px; background: #1b2942; transition: background .2s; }
.switch i { display: block; width: 18px; height: 18px; border-radius: 50%; background: #8492ab; transition: transform .2s, background .2s; }
.switch[aria-checked="true"] { background: color-mix(in srgb, var(--accent) 45%, #0a1120); }
.switch[aria-checked="true"] i { transform: translateX(16px); background: #fff; }
.range { display: grid; gap: 6px; color: var(--muted); font-size: 11px; }
.range b { color: var(--text); font-variant-numeric: tabular-nums; }
input[type="range"] { appearance: none; width: 100%; height: 4px; border-radius: 4px; background: #1b2942; accent-color: var(--accent); cursor: pointer; }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 15px; height: 15px; border-radius: 50%; background: var(--accent-2); border: 2px solid var(--bg); box-shadow: 0 0 0 1px var(--accent); }
input[type="range"]::-moz-range-thumb { width: 13px; height: 13px; border-radius: 50%; background: var(--accent-2); border: 2px solid var(--bg); }
textarea, input[type="text"], input[type="search"] { width: 100%; padding: 9px 11px; border: 1px solid var(--line-2); border-radius: 8px; background: #070d19; font-size: 12.5px; resize: vertical; }
textarea:focus, input[type="text"]:focus, input[type="search"]:focus { outline: 0; border-color: var(--accent); }
h4 { margin: 18px 0 9px; color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }

/* ---------- Overview ---------- */
.hero-card { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 30px 28px; border: 1px solid var(--line); border-radius: 18px; background: radial-gradient(900px 300px at 85% 50%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%), linear-gradient(120deg, #0b1424, #070d19); overflow: hidden; position: relative; }
.hero-card::after { content: ""; position: absolute; right: -60px; top: -120px; width: 420px; height: 420px; border: 1px solid #1c3558; border-radius: 50%; box-shadow: 0 0 0 60px #0f203a40, 0 0 0 61px #1c355880; pointer-events: none; }
.hero-card h2 { margin: 14px 0 12px; font-size: clamp(24px, 2.7vw, 32px); font-weight: 600; line-height: 1.12; letter-spacing: -.02em; }
.hero-card h2 em { display: inline; height: auto; background: none; overflow: visible; font-style: normal; color: var(--accent-2); }
.hero-stats { position: relative; z-index: 1; flex: none; width: min(400px, 100%); padding: 16px; border: 1px solid var(--line-2); border-radius: 13px; background: #070d19d9; }
.hero-stats dl { display: grid; grid-template-columns: repeat(3, auto); justify-content: space-between; margin-bottom: 14px; }
.hero-stats dl > div { padding: 2px 10px; }
.hero-stats dl > div + div { border-left: 1px solid var(--line); }
.hero-stats dt { color: var(--muted); font-size: 8.5px; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.hero-stats dd { margin-top: 8px; font-size: 13.5px; font-weight: 700; white-space: nowrap; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); margin-top: var(--gap); }
.kpi { position: relative; display: flex; flex-direction: column; align-items: flex-start; min-height: 150px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(180deg, var(--panel-2), var(--panel)); overflow: hidden; transition: border-color .25s, transform .25s; }
.kpi:hover { border-color: var(--accent); transform: translateY(-2px); }
.kpi.lead { border-color: var(--line-2); background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 14%, var(--panel-2)), var(--panel)); }
.kpi .delta { position: absolute; top: 20px; right: 18px; }
.kpi-icon { display: grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 8px; }
.kpi-icon.blue { background: #3aa9f224; color: #62c4ff; }
.kpi-icon.violet { background: #8b7cf626; color: #b0a5ff; }
.kpi-icon.green { background: #3ddcb11f; color: var(--green); }
.kpi-icon.orange { background: #f6b35a24; color: var(--orange); }
.kpi-label { margin-top: 16px; color: var(--muted); font-size: 11.5px; }
.kpi-value { margin-top: 4px; font-size: 27px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi-value b { font-weight: inherit; }
.kpi-value small { font-size: .62em; }
.kpi-note { margin-top: 8px; color: var(--dim); font-size: 10px; }
.kpi .spark { position: absolute; right: 12px; bottom: 12px; width: 34%; height: 40px; }
.spark { display: block; }
.chart-tools { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
.legend { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10.5px; }
.legend[aria-pressed="false"] { opacity: .35; text-decoration: line-through; }
.legend.violet .dot { background: var(--violet); }
.chart-stats { display: flex; flex-wrap: wrap; gap: 6px 0; margin: 4px 0 12px 34px; }
.chart-stats > div { padding-right: 24px; margin-right: 24px; border-right: 1px solid var(--line); }
.chart-stats > div:last-child { border: 0; }
.chart-stats dt { color: var(--muted); font-size: 10px; }
.chart-stats dd { display: flex; align-items: center; gap: 7px; margin-top: 3px; font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.chart { height: 250px; }
.chart svg { display: block; touch-action: pan-y; }
.chart .grid line { stroke: #14213a; }
.chart text { fill: var(--dim); font-size: 9.5px; }
.chart .line { fill: none; stroke: var(--accent-2); stroke-width: 2; stroke-linejoin: round; filter: drop-shadow(0 0 6px color-mix(in srgb, var(--accent) 70%, transparent)); }
.chart .line.dashed { stroke: var(--violet); stroke-width: 1.6; stroke-dasharray: 5 5; filter: none; }
.chart .line.draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.3s ease-out forwards; }
.chart .end { fill: var(--accent-2); }
.chart .cursor line { stroke: #2b4168; stroke-dasharray: 3 3; }
.chart .cv { fill: var(--accent-2); stroke: var(--bg); stroke-width: 2; }
.chart .ce { fill: var(--violet); stroke: var(--bg); stroke-width: 2; }
.donut { position: relative; width: 140px; margin: 6px auto 20px; }
.donut svg { display: block; transform: rotate(-90deg); }
.arc { fill: none; stroke-width: 11; stroke-linecap: round; transition: opacity .2s, stroke-width .2s; cursor: pointer; }
.arc.dim, .legend-bars li.dim { opacity: .3; }
.arc:hover { stroke-width: 13; }
#donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
#donut-center b { font-size: 19px; }
#donut-center span { color: var(--muted); font-size: 8.5px; letter-spacing: .12em; text-transform: uppercase; }
.legend-bars li { display: grid; grid-template-columns: auto 1fr auto 70px; align-items: center; gap: 8px; padding: 5px 0; color: var(--muted); font-size: 11px; transition: opacity .2s; }
.legend-bars li > i { width: 6px; height: 6px; border-radius: 50%; }
.legend-bars b { color: var(--text); font-size: 10.5px; }
em { font-style: normal; display: block; height: 4px; border-radius: 4px; background: #17233a; overflow: hidden; }
em u { display: block; height: 100%; border-radius: 4px; background: var(--accent); animation: grow .9s cubic-bezier(.2, .7, .2, 1) backwards; transform-origin: left; }
em u.bad { background: var(--pink); }
.map { display: block; width: 100%; max-height: 340px; }
.map polygon { fill: #101b2d; stroke: #1c2c47; stroke-width: 1; stroke-linejoin: round; }
.spot { cursor: pointer; outline: 0; }
.spot .core { fill: var(--accent-2); }
.spot .pulse { fill: color-mix(in srgb, var(--accent) 22%, transparent); transform-origin: center; transform-box: fill-box; animation: pulse 2.6s ease-in-out infinite; }
.spot .ring { fill: none; stroke: #1f3558; }
.spot.hot .core { fill: var(--violet); }
.spot.hot .pulse { fill: #8b7cf640; }
.spot:hover .ring, .spot:focus-visible .ring { stroke: var(--accent-2); }
.regions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; padding-top: 14px; margin-top: 4px; border-top: 1px solid var(--line); }
.region { display: flex; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; transition: border-color .2s, background .2s; }
.region:hover { border-color: var(--accent); background: #0e1a2e; }
.region > span { display: grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 7px; background: #14233b; font-size: 9px; font-weight: 700; }
.region b { display: block; font-size: 10.5px; }
.region small { display: block; color: var(--dim); font-size: 9px; }
.region em { height: auto; margin-top: 8px; background: none; color: var(--accent-2); font-size: 10.5px; font-weight: 700; }
.langs li > * { display: grid; grid-template-columns: 110px 1fr 46px; align-items: center; gap: 10px; width: 100%; padding: 9px 6px; border-radius: 8px; }
.langs button:hover { background: #0f1a2e; }
.langs b { display: block; font-size: 11.5px; font-weight: 600; }
.langs small { color: var(--dim); font-size: 9.5px; }
.langs i { font-style: normal; color: var(--muted); font-size: 10.5px; text-align: right; font-variant-numeric: tabular-nums; }
.langs .minor { animation: rise .3s backwards; }
.heat { display: grid; gap: 4px; }
.heat-row, .heat-axis { display: grid; grid-template-columns: 38px repeat(24, minmax(0, 1fr)); gap: 4px; align-items: center; }
.heat-row span { color: var(--dim); font-size: 9.5px; }
.heat-row i { height: 16px; border-radius: 3px; transition: transform .15s, box-shadow .15s; }
.heat-row i:hover { transform: scale(1.18); box-shadow: 0 0 0 1px #fff8; }
.heat-axis { display: flex; justify-content: space-between; padding: 6px 0 0 42px; color: var(--dim); font-size: 9px; }
.heat-axis span { display: none; }
.heat-axis b { font-weight: 400; }
.tz { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 28px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10.5px; }
.tz li { display: flex; align-items: center; gap: 7px; }
.tz b { color: var(--text); }

/* ---------- Tableaux ---------- */
.table-card { padding: 0; overflow: hidden; }
.table-card > .card-head { padding: 18px 18px 0; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.field { position: relative; display: flex; align-items: center; }
.search-field { flex: 1 1 220px; }
.search-field .ic { position: absolute; left: 10px; color: var(--muted); }
.search-field input { height: 34px; padding-left: 32px; }
.filters .range { min-width: 150px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { padding: 11px 14px; color: var(--muted); font-size: 9.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line); background: #0a111f; }
th button { display: inline-flex; align-items: center; gap: 4px; letter-spacing: inherit; text-transform: inherit; font-weight: inherit; }
th button .ic { width: 12px; height: 12px; opacity: .4; }
th button.on, th button:hover { color: var(--text); }
th button.on .ic { opacity: 1; color: var(--accent-2); }
td { padding: 11px 14px; border-bottom: 1px solid #101a2c; white-space: nowrap; vertical-align: middle; }
tbody tr { cursor: pointer; transition: background .15s; }
tbody tr:hover, tbody tr:focus-visible { background: #0e182a; outline: 0; }
tbody tr:last-child td { border-bottom: 0; }
td b { display: block; font-weight: 600; }
td small { color: var(--dim); font-size: 10px; }
td.num { font-variant-numeric: tabular-nums; }
td.pos { color: var(--green); }
td.neg { color: var(--red); }
tr.empty td { padding: 40px; text-align: center; color: var(--muted); cursor: default; }
.table-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.pager { display: flex; align-items: center; gap: 10px; }
.pager button { width: 30px; height: 30px; border: 1px solid var(--line-2); border-radius: 8px; text-align: center; font-size: 15px; }
.pager button:hover:not(:disabled) { border-color: var(--accent); }
.badge { display: inline-block; padding: 3px 8px; border-radius: 100px; font-size: 10px; font-weight: 600; background: #17233a; color: var(--muted); }
.badge.qualified, .badge.active { background: #3ddcb11f; color: var(--green); }
.badge.review, .badge.paused { background: #f6b35a1f; color: var(--orange); }
.badge.rejected, .badge.excluded { background: #f2647a1c; color: var(--red); }
.badge.completed { background: #3aa9f21f; color: var(--accent-2); }
.policy { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; }
.policy::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.policy.allowed::before { background: var(--green); }
.policy.contextual::before { background: var(--orange); }
.policy.restricted::before { background: var(--red); }
.score { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; font-variant-numeric: tabular-nums; }
.score i { width: 18px; height: 18px; border-radius: 50%; background: conic-gradient(currentColor calc(var(--v) * 1%), #1b2942 0); -webkit-mask: radial-gradient(circle, transparent 5px, #000 6px); mask: radial-gradient(circle, transparent 5px, #000 6px); }
.score.hi { color: var(--green); }
.score.mid { color: var(--orange); }
.score.lo { color: var(--muted); }
.mini { display: inline-block; width: 54px; height: 4px; margin-right: 7px; border-radius: 4px; background: #17233a; overflow: hidden; vertical-align: middle; }
.mini u { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.mini.bad u { background: var(--pink); }
.tabs { display: flex; gap: 4px; padding: 12px 14px 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { padding: 9px 14px; border-bottom: 2px solid transparent; color: var(--muted); font-size: 12px; white-space: nowrap; }
.tabs button span { margin-left: 4px; padding: 1px 6px; border-radius: 100px; background: #17233a; font-size: 10px; }
.tabs button[aria-selected="true"] { color: var(--text); border-color: var(--accent); }

/* ---------- AI scoring ---------- */
.histo { position: relative; display: flex; align-items: flex-end; gap: 4px; height: 210px; margin: 26px 0 22px; border-bottom: 1px solid var(--line-2); }
.histo i { flex: 1; min-height: 2px; border-radius: 4px 4px 0 0; background: #1b2c49; transition: height .5s cubic-bezier(.2, .7, .2, 1), background .25s; }
.histo i.on { background: linear-gradient(180deg, var(--accent-2), var(--accent)); }
.histo i:hover { filter: brightness(1.3); }
.histo > b { position: absolute; top: -20px; bottom: 0; width: 0; border-left: 1px dashed var(--orange); transition: left .2s; }
.histo > b span { position: absolute; top: 0; left: 5px; color: var(--orange); font-size: 10.5px; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.presets .chip-btn { white-space: normal; text-align: left; }
.weights { display: grid; gap: 14px; margin-bottom: 14px; }

/* ---------- Listes ---------- */
.bars li > button, .bars li:not(:has(button)) { display: grid; grid-template-columns: 118px 1fr 52px; align-items: center; gap: 10px; width: 100%; padding: 8px 4px; border-radius: 7px; color: var(--muted); font-size: 11.5px; }
.bars li > button:hover { background: #0f1a2e; color: var(--text); }
.bars b { color: var(--text); font-size: 11px; text-align: right; font-variant-numeric: tabular-nums; }
.report-list li, .flows li, .settings li { display: flex; align-items: center; gap: 14px; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.report-list li:last-child, .flows li:last-child, .settings li:last-child { border: 0; }
.report-list p, .flows li > div, .settings li > div:first-child { flex: 1; min-width: 0; }
.report-list b, .flows b, .settings b { display: block; font-size: 13px; font-weight: 600; }
.report-list small, .flows small, .settings small { color: var(--muted); font-size: 11px; }
.log { display: grid; gap: 2px; max-height: 420px; overflow: auto; font: 11px/1.5 var(--mono); color: var(--muted); }
.log li { padding: 6px 0; border-bottom: 1px dashed #14213a; animation: rise .3s backwards; }
.log time { margin-right: 8px; color: var(--accent-2); }
.swatches { display: flex; gap: 8px; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; }
.swatch.blue { background: #3aa9f2; }
.swatch.violet { background: #8b7cf6; }
.swatch.green { background: #2fcfa4; }
.swatch[aria-pressed="true"] { border-color: #fff; box-shadow: 0 0 0 3px #ffffff26; }

/* ---------- Calques ---------- */
#layer { display: none; }
#layer.open { display: block; position: fixed; inset: 0; z-index: 60; }
.backdrop { position: absolute; inset: 0; background: #03060ccc; backdrop-filter: blur(3px); animation: fade .2s; }
.backdrop.clear { background: transparent; backdrop-filter: none; }
.drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(430px, 100%); display: flex; flex-direction: column; padding: 22px; background: #0a1120; border-left: 1px solid var(--line-2); overflow-y: auto; animation: slide .3s cubic-bezier(.2, .7, .2, 1); }
.drawer > header, .modal > header, .popover > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.drawer h3, .modal h3 { margin-top: 6px; font-size: 19px; font-weight: 650; }
.drawer-score { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 16px 0; }
.drawer-score .score { font-size: 20px; }
.drawer-score .score i { width: 26px; height: 26px; -webkit-mask: radial-gradient(circle, transparent 8px, #000 9px); mask: radial-gradient(circle, transparent 8px, #000 9px); }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; background: var(--line); }
.facts > div { padding: 11px 12px; background: #0b1322; }
.facts dt { color: var(--muted); font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase; }
.facts dd { margin-top: 5px; font-size: 13px; font-weight: 650; }
.breakdown li { display: grid; grid-template-columns: 140px 1fr 26px; align-items: center; gap: 10px; padding: 6px 0; color: var(--muted); font-size: 11.5px; }
.breakdown b { color: var(--text); text-align: right; }
.drawer .spark { width: 100%; height: 64px; }
.note { margin-top: 14px; padding: 11px 12px; border-left: 2px solid var(--accent); border-radius: 0 8px 8px 0; background: #0d1729; color: var(--muted); font-size: 11.5px; }
.mini-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.mini-list b { display: block; font-size: 12px; }
.mini-list small { color: var(--dim); font-size: 10.5px; }
.drawer > footer, .modal > footer { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; padding-top: 20px; }
.modal { position: absolute; top: 50%; left: 50%; width: min(520px, calc(100% - 28px)); max-height: calc(100% - 28px); overflow: auto; translate: -50% -50%; padding: 22px; border: 1px solid var(--line-2); border-radius: 16px; background: #0a1120; box-shadow: 0 40px 100px #000c; animation: pop .25s cubic-bezier(.2, .7, .2, 1); }
.modal > footer { justify-content: flex-end; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; }
.form-grid .full { grid-column: 1 / -1; }
.field-col { display: grid; gap: 6px; color: var(--muted); font-size: 11px; }
.field-col .select, .field-col select { width: 100%; }
.scan-run { margin-top: 18px; }
.scan-run li { display: flex; align-items: center; gap: 10px; padding: 7px 0; color: var(--dim); transition: color .3s; }
.scan-run li .ic { padding: 2px; border: 1px solid var(--line-2); border-radius: 50%; color: transparent; }
.scan-run li.now { color: var(--text); }
.scan-run li.now .ic { border-color: var(--accent); border-top-color: transparent; animation: spin .8s linear infinite; }
.scan-run li.done { color: var(--muted); }
.scan-run li.done .ic { color: var(--accent-ink); background: var(--green); border-color: var(--green); }
.bar { height: 5px; margin: 14px 0 10px; border-radius: 5px; background: #17233a; overflow: hidden; }
.bar u { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
#scan-status { color: var(--muted); font-variant-numeric: tabular-nums; }
.palette { position: absolute; top: 12vh; left: 50%; width: min(560px, calc(100% - 28px)); translate: -50% 0; border: 1px solid var(--line-2); border-radius: 14px; background: #0a1120; box-shadow: 0 40px 100px #000c; overflow: hidden; animation: pop .2s cubic-bezier(.2, .7, .2, 1); }
.palette label { display: flex; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--line); color: var(--muted); }
.palette input { height: 50px; border: 0; background: none; padding: 0; font-size: 14px; }
.palette ul { max-height: 54vh; overflow: auto; padding: 6px; }
.palette li button { display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px; border-radius: 8px; color: var(--muted); }
.palette li button span { flex: 1; color: var(--text); }
.palette li button small { font-size: 10.5px; }
.palette li button.on, .palette li button:hover { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.palette .none { padding: 22px; text-align: center; color: var(--muted); }
.popover { position: absolute; top: 62px; right: var(--pad); width: min(360px, calc(100% - 24px)); padding: 14px; border: 1px solid var(--line-2); border-radius: 13px; background: #0a1120; box-shadow: 0 30px 80px #000c; animation: pop .2s cubic-bezier(.2, .7, .2, 1); }
.popover h3 { font-size: 13px; }
.popover li { display: flex; gap: 10px; padding: 10px 2px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.popover header + ul { margin-top: 10px; }
.popover li .dot { margin-top: 6px; background: transparent; }
.popover li.unread { color: var(--text); }
.popover li.unread .dot { background: var(--accent-2); }
.popover small { display: block; margin-top: 2px; color: var(--dim); font-size: 10.5px; }
.user-pop { top: auto; right: auto; bottom: 62px; left: 14px; width: 250px; padding: 6px; }
.user-pop li { padding: 0; border: 0; }
.user-pop li > * { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px; border-radius: 8px; color: var(--text); }
.user-pop li > *:hover { background: #111c30; }
.toasts { position: fixed; z-index: 80; right: 18px; bottom: 18px; display: grid; gap: 8px; justify-items: end; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; max-width: min(380px, calc(100vw - 36px)); padding: 11px 14px; border: 1px solid var(--line-2); border-radius: 11px; background: #0d1729; box-shadow: 0 16px 40px #000a; animation: rise .3s cubic-bezier(.2, .7, .2, 1); transition: opacity .35s, transform .35s; }
.toast .ic { color: var(--green); }
.toast.info .ic { color: var(--accent-2); }
.toast.out { opacity: 0; transform: translateY(8px); }
.tip { position: fixed; z-index: 90; display: grid; gap: 3px; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 8px; background: #0d1729f2; box-shadow: 0 10px 30px #000a; font-size: 11px; pointer-events: none; white-space: nowrap; }
.tip span { display: flex; align-items: center; gap: 6px; color: var(--muted); }

/* ---------- Animations ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
@keyframes pop { from { opacity: 0; scale: .96; } }
@keyframes grow { from { transform: scaleX(0); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pulse { 0%, 100% { transform: scale(.7); opacity: .9; } 50% { transform: scale(1.25); opacity: .35; } }
@keyframes ping { from { box-shadow: 0 0 0 0 #3ddcb1aa; } to { box-shadow: 0 0 0 12px #3ddcb100; } }
@keyframes spin { to { rotate: 360deg; } }
.kicker.live .dot { animation: ping 2s ease-out infinite; }
.no-motion *, .no-motion *::before, .no-motion *::after { animation: none !important; transition: none !important; }
.no-motion .chart .line.draw { stroke-dasharray: none; }

/* ---------- Densité compacte ---------- */
.compact { --gap: 10px; --pad: 20px; }
.compact .card, .compact .kpi { padding: 13px; }
.compact td, .compact th { padding-block: 7px; }
.compact .kpi { min-height: 128px; }
.compact .hero-card { padding: 20px; }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
  .search { width: 44px; padding: 0; justify-content: center; }
  .search span, .search kbd { display: none; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .grid > .span-8, .grid > .span-4 { grid-column: span 12; }
  .hero-card { flex-direction: column; align-items: stretch; }
  .hero-stats { width: 100%; }
  .hero-stats dl { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  :root { --pad: 16px; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(280px, 86vw); transform: translateX(-102%); transition: transform .3s cubic-bezier(.2, .7, .2, 1); }
  .nav-open .sidebar { transform: none; box-shadow: 30px 0 80px #000c; }
  .nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 25; background: #03060cb3; }
  .menu-btn { display: grid; border: 1px solid var(--line-2); width: 40px; height: 40px; }
  .btn.primary > span { display: none; }
  .topbar .btn.primary { width: 40px; padding: 0; }
  .demo-chip span { display: none; }
  .demo-chip { padding: 0; width: 28px; height: 28px; justify-content: center; }
  .regions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .user-pop { left: 14px; bottom: 14px; }
}
@media (max-width: 620px) {
  .topbar { gap: 8px; min-height: 60px; }
  .topbar-title small { display: none; }
  #view { padding-top: 16px; }
  .hero-card { padding: 20px 16px; }
  .hero-stats dl { grid-template-columns: 1fr; gap: 10px; }
  .hero-stats dl > div { display: flex; justify-content: space-between; align-items: center; padding: 0; }
  .hero-stats dl > div + div { border: 0; }
  .hero-stats dd { margin: 0; }
  .kpi { min-height: 132px; padding: 14px; }
  .kpi-value { font-size: 22px; }
  .kpi .spark { width: 40%; height: 30px; opacity: .8; }
  .kpi-note { max-width: 58%; }
  .chart-stats { margin-left: 0; }
  .chart-stats > div { padding-right: 14px; margin-right: 14px; }
  .chart-stats dd { font-size: 14px; }
  .chart { height: 210px; }
  .heat-row, .heat-axis { grid-template-columns: 26px repeat(24, minmax(0, 1fr)); gap: 2px; }
  .heat-row i { height: 14px; border-radius: 2px; }
  .heat-axis { padding-left: 28px; }
  .heat-axis b:nth-child(odd) { display: none; }
  .langs li > * { grid-template-columns: 96px 1fr 42px; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: 1fr; }
  .report-list li, .flows li { flex-wrap: wrap; }
  .report-list p, .flows li > div { flex-basis: 60%; }
  .filters .select, .filters .select select { flex: 1 1 46%; width: 100%; }
  .popover { right: 12px; top: 58px; }
  .toasts { left: 12px; right: 12px; bottom: 12px; justify-items: stretch; }
  .page-head .btn { width: 100%; }
}
@media (max-width: 400px) {
  .kpis { grid-template-columns: 1fr; }
  .regions { grid-template-columns: 1fr; }
}
