/* IMATEC — thèmes sombre (défaut) et clair */
/* IMATEC « Nuit du Sahel » : encre de nuit, safran (actions, montants), signal turquoise (en ligne).
   Thème sombre par défaut, variante claire « jour ». */
:root, [data-theme="dark"] {
  --bg: #0b1020;
  --bg-glow-1: rgba(245, 165, 36, .09);
  --bg-glow-2: rgba(45, 212, 191, .06);
  --panel: rgba(18, 26, 48, .86);
  --panel-solid: #121a30;
  --panel-2: #1a2440;
  --row: rgba(20, 28, 52, .92);
  --border: rgba(148, 163, 200, .12);
  --border-2: rgba(148, 163, 200, .22);
  --text: #eef1f8;
  --text-2: #b7bfd3;
  --muted: #7f89a6;
  --accent: #f5a524;
  --accent-2: #ffc35a;
  --accent-rgb: 245, 165, 36;
  --accent2-rgb: 45, 212, 191;
  --on-accent: #1d1302;
  --signal: #2dd4bf;
  --grad: linear-gradient(135deg, #f5a524 0%, #ffcf73 100%);
  --grad-soft: linear-gradient(135deg, rgba(245, 165, 36, .16), rgba(45, 212, 191, .07));
  --ok: #2dd4bf;   --ok-bg: rgba(45, 212, 191, .13);
  --bad: #fb7185;  --bad-bg: rgba(251, 113, 133, .13);
  --warn: #fbbf24; --warn-bg: rgba(251, 191, 36, .13);
  --wait: #9aa3bd; --wait-bg: rgba(154, 163, 189, .13);
  --purple: #ffcf73; --purple-bg: rgba(245, 165, 36, .18);
  --wa: #25d366;
  --code-bg: rgba(6, 9, 20, .7);
  --input-bg: #0e1528;
  --shadow: 0 12px 34px rgba(0, 0, 0, .38);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, .25);
  --switch-off: #2a3554;
  --radius: 18px;
  --font-display: "Bricolage Grotesque", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "Figtree", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f6f3ec;
  --bg-glow-1: rgba(201, 122, 0, .08);
  --bg-glow-2: rgba(15, 159, 140, .06);
  --panel: rgba(255, 255, 255, .94);
  --panel-solid: #ffffff;
  --panel-2: #f3eee3;
  --row: #ffffff;
  --border: rgba(40, 32, 10, .09);
  --border-2: rgba(40, 32, 10, .16);
  --text: #18160f;
  --text-2: #46412f;
  --muted: #7a7360;
  --accent: #c97a00;
  --accent-2: #a86400;
  --accent-rgb: 201, 122, 0;
  --accent2-rgb: 15, 159, 140;
  --on-accent: #fffaf0;
  --signal: #0f9f8c;
  --grad: linear-gradient(135deg, #d98500 0%, #f0a830 100%);
  --grad-soft: linear-gradient(135deg, rgba(201, 122, 0, .10), rgba(15, 159, 140, .06));
  --ok: #0f9f8c;   --ok-bg: rgba(15, 159, 140, .1);
  --bad: #d9465f;  --bad-bg: rgba(217, 70, 95, .09);
  --warn: #b7791f; --warn-bg: rgba(183, 121, 31, .1);
  --wait: #7a7360; --wait-bg: rgba(122, 115, 96, .1);
  --purple: #a86400; --purple-bg: rgba(201, 122, 0, .1);
  --code-bg: #f3eee3;
  --input-bg: #ffffff;
  --shadow: 0 12px 30px rgba(40, 32, 10, .09);
  --shadow-sm: 0 2px 8px rgba(40, 32, 10, .06);
  --switch-off: #d6cfbf;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: radial-gradient(1200px 600px at 85% -10%, var(--bg-glow-1), transparent 60%),
              radial-gradient(900px 500px at 10% 110%, var(--bg-glow-2), transparent 60%), var(--bg);
  background-attachment: fixed;
  color: var(--text); font: 15px/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-2); text-decoration: none; }
/* barres de défilement fines et discrètes (au lieu des barres grises de Windows) */
* { scrollbar-width: thin; scrollbar-color: var(--border-2) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }
a:hover { text-decoration: underline; }
h1 { font-size: 1.55rem; letter-spacing: -.02em; margin: .2rem 0 1.1rem; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
h2 { font-size: 1.12rem; letter-spacing: -.01em; margin: 0 0 .85rem; }
h3 { font-size: 1rem; margin: 0 0 .5rem; }
code, pre, .mono { font-family: var(--font-mono); }
h1, h2, .brand-name, .display { font-family: var(--font-display); }
.num, .mono, .stat span, .price strong { font-variant-numeric: tabular-nums; }
code { background: var(--code-bg); border: 1px solid var(--border); padding: .05rem .35rem; border-radius: 6px; font-size: .85em; }
pre { background: var(--code-bg); border: 1px solid var(--border); border-radius: 12px; padding: .9rem; overflow-x: auto; white-space: pre-wrap; word-break: break-all; font-size: .85rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ic { flex: none; display: inline-block; vertical-align: -0.2em; }
.when-light { display: none; }
[data-theme="light"] .when-light { display: inline-flex; }
[data-theme="light"] .when-dark { display: none; }

/* --- Structure : barre latérale, barre du haut, contenu --- */
body.app { display: grid; grid-template-columns: 272px minmax(0, 1fr); grid-template-rows: auto 1fr; grid-template-areas: "side top" "side main"; min-height: 100vh; }
.sidebar { grid-area: side; position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 20px 16px; display: flex; flex-direction: column; gap: 18px; border-right: 1px solid var(--border); background: var(--panel); backdrop-filter: blur(14px); }
.topbar { grid-area: top; position: sticky; top: 0; z-index: 25; display: flex; align-items: center; gap: .8rem; padding: 14px 32px; background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); }
.content { grid-area: main; padding: 26px 32px 56px; min-width: 0; max-width: 1640px; width: 100%; }
.brand { display: flex; align-items: center; gap: .7rem; font-weight: 800; font-size: 1.22rem; color: var(--text); letter-spacing: -.02em; padding: 4px 8px; }
.brand:hover { text-decoration: none; }
.brand-mark { display: grid; place-items: center; border-radius: 13px; background: var(--grad); color: var(--on-accent); box-shadow: 0 6px 18px rgba(var(--accent-rgb), .35); flex: none; }
.brand-logo { border-radius: 12px; object-fit: contain; background: #fff; padding: 3px; flex: none; }
.brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-brand { display: none; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: .6rem; }
.sidebar nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.nav-item { display: flex; align-items: center; gap: .8rem; padding: .55rem .7rem; border-radius: 14px; color: var(--text-2); font-size: .98rem; position: relative; transition: background .15s, color .15s; }
.nav-item:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.nav-item.active { background: var(--grad-soft); color: var(--text); font-weight: 600; box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .25); }
.nav-ic { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; color: var(--muted); transition: background .15s, color .15s; }
.nav-item.active .nav-ic { background: var(--grad); color: var(--on-accent); box-shadow: 0 6px 16px rgba(var(--accent-rgb), .35); }
.nav-badge { margin-left: auto; background: var(--bad); color: #fff; font-size: .74rem; font-weight: 700; border-radius: 999px; padding: .05rem .5rem; }
.nav-sep { margin: 14px 10px 4px; font-size: .7rem; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); opacity: .8; }
.upgrade-card { display: flex; flex-direction: column; gap: .3rem; padding: 1rem; border-radius: 16px; background: var(--grad); color: var(--on-accent); box-shadow: 0 12px 28px rgba(var(--accent-rgb), .3); position: relative; overflow: hidden; }
.upgrade-card::after { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: rgba(255, 255, 255, .12); }
.upgrade-card:hover { text-decoration: none; transform: translateY(-1px); }
.upgrade-card span:last-child { font-size: .84rem; opacity: .9; }
.upgrade-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: rgba(255, 255, 255, .18); margin-bottom: .2rem; }
.nav-toggle, .nav-backdrop { display: none; }
.topbar .menu-btn { display: none; }

/* barre du haut : formule, WhatsApp, thème, profil */
.plan-chip { display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .85rem; border-radius: 999px; background: var(--grad-soft); border: 1px solid rgba(var(--accent-rgb), .35); color: var(--text); font-weight: 700; }
.plan-chip:hover { text-decoration: none; border-color: var(--accent); }
.plan-chip .ic { color: #f5b301; }
.plan-chip small { font-weight: 600; font-size: .72rem; padding: .05rem .45rem; border-radius: 999px; background: var(--ok-bg); color: var(--ok); }
.plan-chip.trial small { background: var(--warn-bg); color: var(--warn); }
.plan-chip.suspended small { background: var(--bad-bg); color: var(--bad); }
.wa-btn { display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .9rem; border-radius: 999px; background: rgba(37, 211, 102, .12); color: var(--wa); border: 1px solid rgba(37, 211, 102, .35); font-weight: 600; }
.wa-btn:hover { text-decoration: none; background: rgba(37, 211, 102, .2); }
.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--border-2); background: var(--panel); color: var(--text); cursor: pointer; font: inherit; }
.icon-btn:hover { border-color: var(--accent); }
.icon-btn.floating { position: fixed; top: 16px; right: 16px; }
.avatar-btn { display: flex; align-items: center; gap: .6rem; padding: .25rem .6rem .25rem .25rem; border-radius: 999px; border: 1px solid var(--border-2); background: var(--panel); cursor: pointer; list-style: none; color: var(--text); }
.avatar-btn::-webkit-details-marker { display: none; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--grad); color: var(--on-accent); font-weight: 800; }
.avatar-text { display: flex; flex-direction: column; line-height: 1.15; max-width: 180px; }
.avatar-text strong, .avatar-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar-text small { color: var(--muted); font-size: .76rem; }
.menu-head { display: flex; flex-direction: column; padding: .5rem .75rem .7rem; border-bottom: 1px solid var(--border); margin-bottom: .3rem; }
.menu-head small { color: var(--muted); }
.menu-list a.danger-link { color: var(--bad); }

/* --- Éléments communs --- */
.card { min-width: 0; overflow-x: auto; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.35rem 1.45rem; margin-bottom: 1.1rem; box-shadow: var(--shadow-sm); backdrop-filter: blur(10px); }
.card.note { border-left: 3px solid var(--accent); }
.card.center { text-align: center; }
details.card summary { cursor: pointer; font-weight: 600; }
details.card[open] summary { margin-bottom: .8rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 1.1rem; margin-bottom: 1.1rem; }
.grid > .card { margin-bottom: 0; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 1rem; }
.head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: .6rem; }
.buttons { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.buttons form { margin: 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; font: inherit; font-weight: 600; padding: .62rem 1.1rem; border-radius: 999px; border: 1px solid var(--border-2); background: var(--panel-2); color: var(--text); cursor: pointer; white-space: nowrap; transition: transform .12s, box-shadow .15s, border-color .15s, background .15s; }
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--grad); border-color: transparent; color: var(--on-accent); box-shadow: 0 8px 22px rgba(var(--accent-rgb), .32); }
.btn.primary:hover { box-shadow: 0 10px 28px rgba(var(--accent-rgb), .45); transform: translateY(-1px); }
.btn.light { background: #fff; border-color: #fff; color: #0b1220; box-shadow: var(--shadow-sm); }
[data-theme="light"] .btn.light { background: var(--text); border-color: var(--text); color: #fff; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); background: transparent; }
.btn.sm { padding: .36rem .72rem; font-size: .85rem; font-weight: 500; border-radius: 10px; }
.btn.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.btn.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }
.btn .count { background: var(--bad); color: #fff; border-radius: 999px; font-size: .72rem; padding: 0 .45rem; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--accent-2); cursor: pointer; }
.link.danger { color: var(--bad); }
form.inline, td.actions form { display: inline; }
form.danger { margin-top: 2rem; }

input, select, textarea { font: inherit; color: var(--text); background: var(--input-bg); border: 1px solid var(--border-2); border-radius: 12px; padding: .62rem .8rem; width: 100%; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .2); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--accent); }
input[type=file] { padding: .45rem; }
.form label { display: block; margin-bottom: .9rem; font-weight: 500; color: var(--text-2); }
.form label input, .form label textarea, .form label select { margin-top: .3rem; font-weight: 400; }
fieldset { border: 1px solid var(--border); border-radius: 14px; margin: 0 0 .9rem; padding: .7rem 1rem; }
legend { color: var(--text-2); padding: 0 .3rem; }
label.radio { font-weight: 400; display: flex; gap: .55rem; align-items: center; margin: .35rem 0; }
.toolbar { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; align-items: center; }
.toolbar input { flex: 1 1 240px; width: auto; }
.toolbar select { width: auto; }

.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 1.1rem; box-shadow: var(--shadow-sm); }
.table-wrap.flat { border: 0; background: transparent; border-radius: 0; margin: 0; box-shadow: none; }
table { border-collapse: collapse; width: 100%; }
th, td { padding: .72rem .9rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: .72rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 600; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: color-mix(in srgb, var(--panel-2) 50%, transparent); }
table.compact th, table.compact td { padding: .45rem .55rem; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.actions { white-space: nowrap; }
td.actions a { margin-right: .7rem; }
td.empty { text-align: center; padding: 2rem; color: var(--muted); }

.badge { display: inline-block; font-size: .75rem; font-weight: 600; padding: .16rem .62rem; border-radius: 999px; white-space: nowrap; }
.badge.online { color: var(--ok); background: var(--ok-bg); }
.badge.offline { color: var(--bad); background: var(--bad-bg); }
.badge.tunnel { color: var(--warn); background: var(--warn-bg); }
.badge.pending { color: var(--wait); background: var(--wait-bg); }
.badge.accent { color: var(--on-accent); background: var(--grad); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--wait); }
.dot.online { background: var(--ok); } .dot.offline { background: var(--bad); } .dot.tunnel { background: var(--warn); }
.pill { display: inline-flex; align-items: center; gap: .4rem; padding: .55rem 1rem; border-radius: 999px; border: 1px solid var(--border-2); font-weight: 600; font-size: .9rem; }
.pill.accent { border-color: rgba(var(--accent-rgb), .45); color: var(--accent-2); background: rgba(var(--accent-rgb), .08); }
.chip { display: inline-block; font-size: .76rem; padding: .12rem .55rem; margin: .1rem .2rem .1rem 0; border-radius: 999px; }
.chip.error { color: var(--bad); background: var(--bad-bg); }
.chip.warn { color: var(--warn); background: var(--warn-bg); }
.chip-link { white-space: nowrap; font-size: .85rem; }

.flash { display: flex; gap: .6rem; align-items: flex-start; padding: .85rem 1.05rem; border-radius: 14px; margin-bottom: 1rem; background: var(--ok-bg); color: var(--ok); border: 1px solid color-mix(in srgb, var(--ok) 30%, transparent); }
.flash.error { background: var(--bad-bg); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .9rem; margin-bottom: 1.2rem; }
.stat { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.05rem 1.2rem; color: var(--muted); box-shadow: var(--shadow-sm); }
.stat span { display: block; font-size: 1.9rem; font-weight: 700; letter-spacing: -.02em; color: var(--text); font-variant-numeric: tabular-nums; }
.stat.ok span { color: var(--ok); } .stat.bad span { color: var(--bad); } .stat.wait span { color: var(--wait); }
a.stat:hover { text-decoration: none; border-color: var(--accent); }

dl { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1.2rem; margin: 0; }
dt { color: var(--muted); }
dd { margin: 0; }
ul.events, ul.files { list-style: none; padding: 0; margin: 0; }
ul.events li, ul.files li { padding: .4rem 0; border-bottom: 1px solid var(--border); }
ul.events li:last-child, ul.files li:last-child { border-bottom: 0; }
.pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .35rem 1rem; margin: .5rem 0 1rem; max-height: 380px; overflow-y: auto; }
.pick label { display: flex; gap: .45rem; align-items: center; font-weight: 400; margin: 0; }
.qr svg { width: 240px; height: 240px; background: #fff; padding: 8px; border-radius: 12px; }

/* --- Tableau de bord --- */
.dash { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1.5rem; align-items: start; }
.hero { position: relative; overflow: hidden; padding: 1.6rem 1.8rem; border-color: rgba(var(--accent-rgb), .22); background: linear-gradient(160deg, color-mix(in srgb, var(--panel-solid) 92%, #2f6bff) 0%, var(--panel) 55%); }
.hero::before { content: ""; position: absolute; width: 380px; height: 380px; right: -120px; top: -200px; border-radius: 50%; background: radial-gradient(circle, rgba(var(--accent2-rgb), .28), transparent 65%); pointer-events: none; }
.hero > * { position: relative; }
.hero-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1.5rem; }
.hero-left { min-width: 0; }
.who-chip { display: inline-flex; align-items: center; gap: .5rem; color: var(--text); flex-wrap: wrap; }
.who-chip .ic { width: 30px; height: 30px; padding: 6px; border-radius: 50%; border: 1px solid var(--border-2); }
.eyebrow { margin-top: 1.1rem; font-size: .76rem; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.balance { display: flex; align-items: center; gap: .9rem; margin: .4rem 0 .3rem; }
.balance .coin { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffe3a3, #c8891f); color: #4a3006; box-shadow: 0 0 0 4px rgba(246, 212, 138, .14), 0 8px 22px rgba(200, 137, 31, .35); }
.balance .amount { font-size: 3rem; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.balance .unit { color: var(--muted); font-size: 1.1rem; align-self: flex-end; margin-bottom: .65rem; }
.plan-line { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-top: .55rem; color: var(--text-2); font-size: .92rem; }
.plan-line .plan-name { display: inline-flex; align-items: center; gap: .35rem; font-weight: 700; color: var(--text); }
.plan-line .plan-name .ic { color: #f5b301; }
.usage { width: 160px; height: 6px; border-radius: 999px; background: var(--panel-2); overflow: hidden; display: inline-block; vertical-align: middle; }
.usage i { display: block; height: 100%; background: var(--grad); border-radius: inherit; }
.usage.full i { background: var(--bad); }
.hero-right { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 1.2rem; }
.hero-actions { display: flex; gap: .6rem; flex-wrap: wrap; justify-content: flex-end; }
.counters { display: flex; gap: 1.3rem; flex-wrap: wrap; justify-content: flex-end; font-size: .78rem; letter-spacing: .13em; color: var(--muted); font-weight: 700; }
.counters a { color: var(--muted); display: inline-flex; align-items: baseline; }
.counters a:hover { text-decoration: none; color: var(--text); }
.counters b { color: var(--text); font-size: 1.2rem; letter-spacing: 0; margin-left: .4rem; }
.counters .ok b { color: var(--ok); } .counters .warn b { color: var(--warn); } .counters .bad b { color: var(--bad); }
.hero-alert { display: flex; gap: 1rem; align-items: center; margin-top: 1.3rem; padding-top: 1.2rem; border-top: 1px solid var(--border); }
.hero-alert strong { font-size: 1.08rem; }
.hero-alert.bad { color: var(--bad); }
.hero-alert.info { color: var(--text-2); }
.alert-ic { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; border: 1px solid currentColor; flex: none; }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 1.7rem 0 1rem; flex-wrap: wrap; }
.section-head h2 { display: flex; align-items: center; gap: .6rem; margin: 0; font-size: 1.18rem; }
.section-head h2 .ic { color: var(--accent-2); }
.searchbar { position: relative; max-width: 440px; margin-bottom: 1rem; display: flex; gap: .6rem; align-items: center; }
.searchbar input { padding-left: 2.6rem; border-radius: 14px; background: var(--panel); }
.search-ic { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--muted); display: flex; }

.router-list { display: flex; flex-direction: column; gap: .65rem; }
/* colonnes fixes : les lignes restent alignées entre elles */
.router-row { display: grid; grid-template-columns: 32px minmax(120px, 1fr) 56px 76px 54px 118px 30px 92px 48px 88px; align-items: center; gap: .7rem; padding: .72rem 1rem; background: var(--row); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-sm); transition: border-color .15s, transform .15s, box-shadow .15s; }
.router-row:hover { border-color: rgba(var(--accent-rgb), .35); box-shadow: var(--shadow); }
.row-title { display: flex; align-items: center; gap: .1rem .4rem; flex-wrap: wrap; min-width: 0; }
.router-row .ping { width: 92px; }
.router-row details.menu summary { width: 88px; }
.row-ic { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; color: var(--warn); background: var(--warn-bg); }
.row-ic.ok { color: var(--ok); background: var(--ok-bg); }
.row-name { color: var(--text); font-weight: 600; font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; max-width: calc(100% - 30px); }
.row-name:hover { color: var(--accent-2); text-decoration: none; }
.row-owner { flex-basis: 100%; font-size: .78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag-r { display: inline-grid; place-items: center; width: 22px; height: 22px; flex: none; border-radius: 6px; border: 1px solid var(--warn); color: var(--warn); font-size: .75rem; font-weight: 800; }
.tag-vpn { background: var(--purple-bg); color: var(--purple); font-weight: 700; font-size: .76rem; padding: .3rem .5rem; border-radius: 8px; letter-spacing: .04em; text-align: center; }
.row-cpu { color: var(--muted); font-size: .76rem; letter-spacing: .08em; white-space: nowrap; }
.row-cpu b { color: var(--ok); letter-spacing: 0; font-size: .9rem; }
.score { display: inline-flex; align-items: center; justify-content: center; gap: .3rem; font-size: .84rem; font-weight: 700; padding: .2rem .45rem; border-radius: 8px; border: 1px solid var(--border-2); color: var(--muted); }
.score:hover { text-decoration: none; }
.score.good { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, transparent); background: var(--ok-bg); }
.score.mid { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, transparent); background: var(--warn-bg); }
.score.low { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, transparent); background: var(--bad-bg); }
.row-status { display: inline-flex; align-items: center; gap: .45rem; white-space: nowrap; color: var(--muted); overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.row-status::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent); flex: none; }
.row-status.online { color: var(--ok); }
.row-status.offline, .row-status.tunnel { color: var(--warn); }
.row-status.pending, .row-status.disabled { color: var(--wait); }
.row-status.suspended { color: var(--bad); }
.row-ver { color: var(--muted); font-size: .85rem; }

.switch { position: relative; width: 48px; height: 26px; display: inline-block; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; inset: 0; border-radius: 999px; background: var(--switch-off); transition: background .15s; cursor: pointer; }
.slider::before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.switch input:checked + .slider { background: var(--ok); }
.switch input:checked + .slider::before { transform: translateX(22px); }
.switch input:disabled + .slider { opacity: .45; cursor: not-allowed; }
.switch input:focus-visible + .slider { outline: 2px solid var(--accent-2); outline-offset: 2px; }

details.menu { position: relative; }
details.menu summary { list-style: none; }
details.menu summary::-webkit-details-marker { display: none; }
.menu-list { position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; min-width: 230px; background: var(--panel-solid); border: 1px solid var(--border-2); border-radius: 14px; padding: .4rem; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.menu-list a { display: flex; align-items: center; gap: .55rem; padding: .55rem .75rem; border-radius: 10px; color: var(--text); }
.menu-list a:hover { background: var(--panel-2); text-decoration: none; }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: .6rem; padding: 2.5rem; color: var(--muted); text-align: center; }

.dash-side { display: flex; flex-direction: column; gap: 1.1rem; }
.side-card { margin: 0; }
.side-card p { color: var(--text-2); margin: .55rem 0 0; }
.side-head { display: flex; align-items: center; gap: .9rem; }
.side-head.between { justify-content: space-between; align-items: flex-start; }
.side-head h3 { font-size: 1.1rem; margin: 0; }
.round-ic { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; border: 1px solid rgba(var(--accent-rgb), .35); color: var(--accent-2); background: rgba(var(--accent-rgb), .08); flex: none; }
.round-ic.sm { width: 38px; height: 38px; border-radius: 12px; border-color: var(--border-2); color: var(--muted); background: var(--panel-2); }
.round-ic.wa { border-color: rgba(37, 211, 102, .4); color: var(--wa); background: rgba(37, 211, 102, .1); }
.big { font-size: 1.6rem; color: var(--text); }
.activity { padding-bottom: .4rem; }
.feed { list-style: none; padding: 0; margin: 1rem -1.45rem 0; max-height: 560px; overflow-y: auto; }
.feed li { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: .85rem; align-items: center; padding: .8rem 1.45rem; border-top: 1px solid var(--border); }
.feed .amt { font-weight: 700; font-variant-numeric: tabular-nums; }
.amt.pos { color: var(--ok); } .amt.neg { color: var(--bad); }

/* --- Formules --- */
.pricing-head { text-align: center; max-width: 720px; margin: .5rem auto 2rem; }
.pricing-head h1 { justify-content: center; font-size: 2rem; }
.pricing-head p { color: var(--muted); font-size: 1.05rem; margin: 0; }
.pricing { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 1.3rem; align-items: stretch; margin-bottom: 1.5rem; }
.price-card { position: relative; display: flex; flex-direction: column; gap: 1rem; padding: 1.7rem 1.6rem; border-radius: 22px; background: var(--panel); border: 1px solid var(--border); box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s; }
.price-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.price-card.featured { border: 1px solid transparent; background: linear-gradient(var(--panel-solid), var(--panel-solid)) padding-box, var(--grad) border-box; box-shadow: 0 18px 44px rgba(var(--accent-rgb), .25); }
.price-card.current { box-shadow: 0 0 0 2px var(--ok), var(--shadow); }
.ribbon { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); padding: .3rem .9rem; border-radius: 999px; background: var(--grad); color: var(--on-accent); font-size: .78rem; font-weight: 700; letter-spacing: .04em; white-space: nowrap; box-shadow: 0 6px 16px rgba(var(--accent-rgb), .35); }
.ribbon.ok { background: var(--ok); box-shadow: none; }
.price-card h3 { font-size: 1.3rem; margin: 0; }
.price-card .tagline { color: var(--muted); margin: -.6rem 0 0; }
.price { display: flex; align-items: baseline; gap: .35rem; }
.price strong { font-size: 2.4rem; letter-spacing: -.03em; }
.price span { color: var(--muted); }
.limit { display: inline-flex; align-items: center; gap: .45rem; font-weight: 600; padding: .45rem .75rem; border-radius: 12px; background: var(--grad-soft); color: var(--text); }
.features { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .55rem; flex: 1; }
.features li { display: flex; gap: .55rem; align-items: flex-start; color: var(--text-2); }
.features .ic { color: var(--ok); margin-top: .15rem; }
.price-card form { margin: 0; }

/* --- Pages publiques (connexion, inscription) --- */
body.public { min-height: 100vh; }
body.public .content { max-width: none; padding: 0; }
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-hero { position: relative; overflow: hidden; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 2rem; background: radial-gradient(110% 80% at 0% 100%, rgba(245, 165, 36, .32), transparent 60%), radial-gradient(80% 60% at 100% 0%, rgba(45, 212, 191, .12), transparent 60%), #0b1020; color: #eef1f8; }
.auth-hero::before { content: none; }
.auth-hero::after { content: none; }
.auth-hero > * { position: relative; }
.auth-hero .brand { color: #fff; padding: 0; }
.auth-hero h2 { font-size: 2.4rem; line-height: 1.15; letter-spacing: -.03em; margin: 0 0 1rem; max-width: 520px; }
.auth-hero p { color: rgba(255, 255, 255, .78); font-size: 1.06rem; max-width: 480px; margin: 0; }
.hero-features { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: .9rem; }
.hero-features li { display: flex; gap: .8rem; align-items: center; color: rgba(255, 255, 255, .9); }
.hero-features .ic { width: 38px; height: 38px; padding: 9px; border-radius: 12px; background: rgba(255, 255, 255, .12); }
.auth-hero small { color: rgba(255, 255, 255, .55); }
.auth-side { display: grid; place-items: center; padding: 40px 24px; }
.auth { width: 100%; max-width: 440px; padding: 2.2rem; border-radius: 24px; box-shadow: var(--shadow); }
.auth h1 { margin-bottom: .2rem; }
.auth label { display: block; margin: .85rem 0; color: var(--text-2); font-weight: 500; }
.auth label input { margin-top: .3rem; }
.auth .btn { width: 100%; margin-top: .5rem; padding: .8rem; }
.auth .alt { margin-top: 1.2rem; text-align: center; color: var(--muted); }
.mini-plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin: 1rem 0 .4rem; }
.mini-plans div { padding: .6rem; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--border); text-align: center; font-size: .82rem; color: var(--muted); }
.mini-plans strong { display: block; color: var(--text); font-size: .95rem; }

/* --- Ventes --- */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1.1rem; }
.filters label { display: flex; gap: .35rem; align-items: center; color: var(--muted); }
.filters input, .filters select { width: auto; }
.segmented { display: inline-flex; border: 1px solid var(--border-2); border-radius: 12px; overflow: hidden; flex-wrap: wrap; background: var(--panel); }
.segmented a { padding: .55rem .85rem; color: var(--text-2); border-right: 1px solid var(--border-2); }
.segmented a:last-child { border-right: 0; }
.segmented a.active { background: var(--grad); color: var(--on-accent); }
.segmented a:hover { text-decoration: none; }
.chart { position: relative; display: grid; grid-template-columns: auto 1fr; gap: .5rem; }
.chart-y { display: flex; flex-direction: column; justify-content: space-between; height: 200px; font-size: .75rem; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.chart-plot { position: relative; min-width: 0; }
.chart-grid { position: absolute; inset: 0 0 auto 0; height: 200px; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.chart-grid i { border-top: 1px solid var(--border); }
.chart-bars { position: relative; height: 200px; display: flex; align-items: flex-end; gap: 2px; }
.bar-slot { flex: 1 1 0; height: 100%; display: flex; align-items: flex-end; min-width: 2px; outline: none; }
.bar { width: 100%; background: var(--accent); border-radius: 4px 4px 0 0; }
.bar-slot.hover .bar, .bar-slot:focus .bar { background: var(--accent-2); }
.chart-x { display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted); margin-top: .3rem; }
.tooltip { position: absolute; top: -.4rem; left: 50%; transform: translate(-50%, -100%); background: var(--text); color: var(--bg); font-size: .8rem; padding: .3rem .6rem; border-radius: 6px; white-space: nowrap; pointer-events: none; }
.table-wrap + h2 { margin-top: 1.6rem; }
.inline-form { display: inline-flex; gap: .4rem; align-items: center; margin-right: .4rem; }
.inline-form input { width: 7rem; padding: .35rem .5rem; }
.logo-preview { display: flex; align-items: center; gap: 1rem; margin-bottom: .8rem; }
.logo-preview img { width: 64px; height: 64px; border-radius: 16px; object-fit: contain; background: #fff; padding: 4px; border: 1px solid var(--border); }
.plan-admin { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; margin-bottom: 1.1rem; }
.plan-admin .price-card { padding: 1.2rem; }
.plan-admin .price strong { font-size: 1.8rem; }

/* --- Adaptation aux écrans --- */
@media (max-width: 1599px) {
  .dash { grid-template-columns: 1fr; }
}
/* écrans peu hauts : menu plus compact, encart « formule » masqué */
@media (max-height: 1000px) and (min-width: 901px) {
  .sidebar { gap: 12px; padding: 16px 14px; }
  .nav-item { padding: .38rem .6rem; font-size: .94rem; }
  .nav-ic { width: 32px; height: 32px; border-radius: 10px; }
  .nav-sep { margin-top: 8px; }
  .upgrade-card { display: none; }
}
@media (max-width: 1100px) {
  .router-row { grid-template-columns: 32px minmax(0, 1fr) 56px 120px 92px 48px 88px; }
  .row-cpu, .row-ver, .score { display: none; }
  .avatar-text { display: none; }
}
@media (max-width: 900px) {
  body.app { display: block; }
  .topbar { padding: 10px 14px; }
  .topbar .menu-btn { display: grid; }
  .topbar-brand { display: flex; }
  .topbar-brand .brand-name { max-width: 120px; }
  .wa-btn span, .plan-chip small { display: none; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 50; width: 280px; transform: translateX(-100%); transition: transform .2s; background: var(--panel-solid); }
  .nav-toggle:checked ~ .sidebar { transform: none; }
  .nav-toggle:checked ~ .nav-backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 40; }
  .content { padding: 18px 16px 40px; }
  .hero { padding: 1.25rem; }
  .hero-top { grid-template-columns: 1fr; }
  .hero-right { align-items: flex-start; }
  .hero-actions, .counters { justify-content: flex-start; }
  .balance .amount { font-size: 2.3rem; }
  .router-row { grid-template-columns: 30px minmax(0, 1fr) auto; row-gap: .5rem; }
  .router-row .tag-vpn, .router-row .ping { display: none; }
  .router-row .row-status { grid-column: 2; grid-row: 2; }
  .router-row .switch { grid-column: 3; grid-row: 1; }
  .router-row details.menu { grid-column: 3; grid-row: 2; }
  .feed { margin: 1rem -1.25rem 0; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-hero { padding: 32px 22px; }
  .auth-hero h2 { font-size: 1.7rem; }
  .hero-features { display: none; }
  .pricing-head h1 { font-size: 1.5rem; }
}
@media (max-width: 1250px) {
  .hero-top { grid-template-columns: 1fr; }
  .hero-right { align-items: flex-start; }
  .hero-actions, .counters { justify-content: flex-start; }
}
@media (max-width: 520px) {
  .plan-chip span, .topbar-brand .brand-name, .avatar-btn > .ic { display: none; }
  .topbar-right { gap: .35rem; }
  .plan-chip, .wa-btn { padding: .45rem .6rem; }
  .avatar-btn { padding: .2rem; }
}
.wa-card { display: block; color: inherit; } .wa-card:hover { text-decoration: none; border-color: rgba(37, 211, 102, .45); }

/* --- Disponibilité et graphiques --- */
.meter { display: block; height: 10px; border-radius: 999px; background: var(--panel-2); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: inherit; background: var(--ok); }
.meter.mid i { background: var(--warn); }
.meter.low i { background: var(--bad); }
.period { display: inline-flex; border: 1px solid var(--border-2); border-radius: 10px; overflow: hidden; }
.period button { font: inherit; padding: .4rem .8rem; border: 0; background: transparent; color: var(--text-2); cursor: pointer; }
.period button.active { background: var(--grad); color: var(--on-accent); }
.avail-strip { display: flex; gap: 1px; height: 26px; margin: .6rem 0 .3rem; }
.avail-strip i { flex: 1; border-radius: 2px; background: var(--ok); min-width: 1px; }
.avail-strip i.mid { background: var(--warn); }
.avail-strip i.low { background: var(--bad); }
.avail-strip i.none { background: var(--panel-2); }
.mini-chart { position: relative; }
.mini-chart svg { display: block; width: 100%; height: 150px; overflow: visible; }
.mini-chart .axis { fill: var(--muted); font-size: 11px; }
.mini-chart .grid-line { stroke: var(--border); }
.mini-chart .line { fill: none; stroke: var(--accent); stroke-width: 2; }
.mini-chart .area { fill: url(#mc-grad); opacity: .35; }
.mini-chart .cursor { stroke: var(--muted); stroke-dasharray: 3 3; }
.mini-chart .dot-hover { fill: var(--accent); stroke: var(--panel-solid); stroke-width: 2; }
.chart-tip { position: absolute; top: 0; transform: translate(-50%, -110%); background: var(--text); color: var(--bg); font-size: .78rem; padding: .25rem .55rem; border-radius: 6px; white-space: nowrap; pointer-events: none; }
.kpis { display: flex; gap: 1.5rem; flex-wrap: wrap; margin: .3rem 0 .8rem; }
.kpis div { display: flex; flex-direction: column; }
.kpis strong { font-size: 1.5rem; letter-spacing: -.02em; }
.kpis span { color: var(--muted); font-size: .82rem; }

/* --- Modes de paiement --- */
.pay-methods { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(190px, 100%), 1fr)); gap: .6rem; margin: .4rem 0 1rem; }
.pay-method { display: flex; align-items: center; gap: .7rem; padding: .7rem .8rem; border-radius: 14px; border: 1px solid var(--border-2); background: var(--panel-2); cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.pay-method input { position: absolute; opacity: 0; pointer-events: none; }
.pay-method small { display: block; color: var(--muted); font-size: .76rem; }
.pay-method.selected { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .18); }
.pay-method:focus-within { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.pay-logo { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; font-weight: 800; font-size: .8rem; color: var(--on-accent); background: var(--grad); flex: none; }
.pay-logo.pm-airtel { background: #e40000; }
.pay-logo.pm-moov { background: #0066b3; }
.pay-logo.pm-mynita { background: #0a8f4a; }
.pay-logo.pm-amanata { background: #f29400; }
.pay-logo.pm-zamani { background: #ff7900; }
.pay-logo.pm-wave { background: #1dc8f2; }
.pay-logo.pm-cinetpay { background: linear-gradient(135deg, #00b14f, #0a7cff); }
.pm-table input[type=text], .pm-table input:not([type]) { padding: .4rem .55rem; }

/* --- Anomalies --- */
.anomaly-banner { display: flex; align-items: center; gap: .7rem; padding: .8rem 1rem; margin-bottom: 1rem; border-radius: 14px;
  color: var(--text); text-decoration: none; background: rgba(245, 158, 11, .12); border: 1px solid rgba(245, 158, 11, .45); }
.anomaly-banner svg { color: #f59e0b; flex: none; }
.anomaly-banner .go { margin-left: auto; white-space: nowrap; color: var(--accent-2); font-weight: 600; display: inline-flex; align-items: center; gap: .2rem; }
.anomalies { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.anomaly { display: grid; grid-template-columns: auto 1fr auto; gap: .8rem; align-items: center; padding: .8rem; border-radius: 14px;
  background: var(--panel-2); border: 1px solid var(--border-2); border-left: 4px solid #f59e0b; }
.anomaly.cpu { border-left-color: #ef4444; }
.anomaly.sales { border-left-color: #a855f7; }
.anomaly-ic { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: rgba(245, 158, 11, .15); color: #f59e0b; }
.anomaly.cpu .anomaly-ic { background: rgba(239, 68, 68, .15); color: #ef4444; }
.anomaly.sales .anomaly-ic { background: rgba(168, 85, 247, .15); color: #a855f7; }
@media (max-width: 560px) { .anomaly { grid-template-columns: auto 1fr; } .anomaly form { grid-column: 1 / -1; } }
.anomaly-banner .go svg { transform: rotate(-90deg); color: inherit; }

/* --- Winbox à distance --- */
.winbox-addr { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin: .4rem 0 .8rem; }
.winbox-addr code { font-size: 1.25rem; font-weight: 700; padding: .55rem .9rem; border-radius: 12px; background: var(--panel-2);
  border: 1px dashed var(--accent); color: var(--text); word-break: break-all; }
.winbox-form { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; gap: .8rem; align-items: end; }
@media (max-width: 760px) { .winbox-form { grid-template-columns: 1fr; } }

/* --- Sauvegardes --- */
table.backups td.actions { display: flex; gap: .4rem; justify-content: flex-end; flex-wrap: wrap; }
table.backups code { word-break: break-all; }
.btn.danger-fill { background: var(--bad); border-color: var(--bad); color: #fff; }

/* --- Diagnostic réseau --- */
ul.diag { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
ul.diag li { display: flex; gap: .6rem; align-items: flex-start; padding: .7rem .8rem; border-radius: 12px; background: var(--panel-2); border-left: 4px solid var(--ok, #22c55e); overflow-wrap: anywhere; }
ul.diag li.warn { border-left-color: #f59e0b; }
ul.diag li.bad { border-left-color: var(--bad); }
ul.diag li svg { flex: none; margin-top: .1rem; }

/* --- Double authentification --- */
.mfa-qr { background: #fff; border-radius: 14px; padding: .6rem; width: min(240px, 100%); }
.mfa-qr svg { width: 100%; height: auto; display: block; }
.mfa-key { font-size: 1rem; letter-spacing: .05em; word-break: break-all; }
.mfa-codes { columns: 2; font-size: 1.1rem; line-height: 1.9; background: var(--panel-2); padding: 1rem 1.2rem; border-radius: 12px; }

/* --- Revendeurs --- */
fieldset.checks { border: 1px solid var(--border-2); border-radius: 12px; padding: .6rem .9rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: .2rem .8rem; }
fieldset.checks legend { padding: 0 .3rem; font-weight: 600; }
tr.muted td { opacity: .6; }

/* --- Accès Winbox par VPN --- */
.device-list { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .5rem; }
.device-list li { display: grid; grid-template-columns: auto 1fr auto auto; gap: .6rem; align-items: center; padding: .6rem .7rem; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--border-2); }
.device-ic { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: rgba(var(--accent-rgb), .15); color: var(--accent-2); }
ol.steps { padding-left: 1.2rem; display: grid; gap: .45rem; }

/* --- Migration --- */
pre.cmd { white-space: pre-wrap; word-break: break-all; background: var(--panel-2); border: 1px solid var(--border-2); border-radius: 12px; padding: .8rem 1rem; font-size: .82rem; }
.features li.opt svg { color: #f59e0b; }

/* --- Modèles de page hotspot --- */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(190px, 100%), 1fr)); gap: .8rem; margin: .6rem 0; }
.tpl { display: grid; gap: .35rem; padding: .6rem; border-radius: 14px; border: 1px solid var(--border-2); background: var(--panel-2); }
.tpl.current { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .18); }
.tpl-frame { position: relative; width: 100%; aspect-ratio: 9 / 14; overflow: hidden; border-radius: 10px; background: #fff; }
.tpl-frame iframe { position: absolute; top: 0; left: 0; width: 360px; height: 560px; border: 0; transform-origin: 0 0; pointer-events: none; }
.tpl .buttons { display: flex; gap: .4rem; flex-wrap: wrap; }

/* --- Prix mensuel / annuel en bas des formules --- */
.cycle-prices { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-top: auto; padding-top: .9rem; border-top: 1px dashed var(--border-2); }
.cycle-prices .cycle { display: grid; gap: .1rem; padding: .55rem .65rem; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--border-2); }
.cycle-prices .cycle span { font-size: .78rem; color: var(--text-2); display: flex; gap: .35rem; align-items: center; flex-wrap: wrap; }
.cycle-prices .cycle strong { font-size: 1.02rem; }
.cycle-prices .cycle small { color: var(--muted); font-size: .74rem; }
.cycle-prices .cycle.annual { border-color: rgba(34, 197, 94, .45); background: rgba(34, 197, 94, .08); }
.cycle-prices .saving { font-style: normal; font-weight: 700; font-size: .72rem; color: #fff; background: #16a34a; padding: .05rem .4rem; border-radius: 999px; }
.cycle-prices:only-child, .cycle-prices .cycle:only-child { grid-column: 1 / -1; }
.cycle-buttons { display: grid; gap: .45rem; }
.wa-preview { white-space: pre-wrap; font: inherit; font-size: .88rem; background: var(--panel-2); border: 1px solid var(--border-2); border-radius: 12px; padding: .7rem .8rem; margin: .3rem 0 .6rem; }
.inline-test .buttons input { flex: 1; min-width: 200px; }

/* --- Barre du haut : support et alertes --- */
.support-menu summary.wa-btn { cursor: pointer; }
.bell-btn { position: relative; cursor: pointer; }
.bell-btn .dot-count { position: absolute; top: -6px; right: -6px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: var(--bad); color: #fff; font-size: .7rem; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--bg); }
.alerts-list { min-width: 300px; max-width: min(360px, calc(100vw - 24px)); }
.menu-list .alert-item { align-items: flex-start; font-size: .9rem; }
.alert-item .alert-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; margin-top: .4rem; background: var(--warn, #f59e0b); }
.alert-item.bad .alert-dot { background: var(--bad); }
.alert-item.billing .alert-dot { background: var(--accent); }
.menu-note { display: flex; gap: .5rem; align-items: center; padding: .55rem .75rem; color: var(--muted); font-size: .9rem; }
.menu-list .menu-foot { border-top: 1px solid var(--border); margin-top: .3rem; padding-top: .65rem; color: var(--text-2); font-size: .88rem; }
@media (max-width: 520px) { .support-menu .menu-list, .alerts-menu .menu-list { position: fixed; left: 12px; right: 12px; top: 64px; min-width: 0; max-width: none; } }

/* --- Vérification d'un ticket --- */
.ticket-search input[name=code] { flex: 1; min-width: 200px; font-family: ui-monospace, monospace; }
.ticket-card .ticket-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .8rem; flex-wrap: wrap; }
.ticket-card h2 code { font-size: 1.5rem; }
.badge.big { font-size: .9rem; padding: .35rem .8rem; }
.ticket-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(210px, 100%), 1fr)); gap: .7rem; margin: .8rem 0; }
.ticket-grid .tk { display: grid; gap: .15rem; padding: .7rem .8rem; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--border-2); }
.ticket-grid .tk span { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.ticket-grid .tk small { color: var(--text-2); }
.ticket-grid .tk.reason { grid-column: 1 / -1; border-color: rgba(239, 68, 68, .45); background: rgba(239, 68, 68, .08); }
.empty-card { text-align: center; }

/* --- Reconfiguration à distance --- */
.mode-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 1rem; margin: 1rem 0; }
.mode-card { position: relative; }
.mode-card .btn { justify-self: start; }
.mode-tag { justify-self: start; font-size: .75rem; font-weight: 700; padding: .2rem .6rem; border-radius: 999px; background: rgba(34, 197, 94, .15); color: #16a34a; }
.mode-tag.warn { background: rgba(245, 158, 11, .15); color: #d97706; }
.mode-tag.bad { background: rgba(239, 68, 68, .15); color: var(--bad); }
.danger-zone { border-color: rgba(239, 68, 68, .45); margin-bottom: 1rem; }
ul.diag li.error { border-left-color: var(--bad); }
.bad-text { color: var(--bad); font-weight: 600; }
.check-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: .25rem .8rem; }
.menu-list form { margin: 0; }
.menu-list .menu-btn-item { display: flex; width: 100%; align-items: center; gap: .55rem; padding: .55rem .75rem; border: 0; border-radius: 10px; background: none; font: inherit; color: var(--bad); cursor: pointer; text-align: left; }
.menu-list .menu-btn-item:hover { background: rgba(239, 68, 68, .1); }
.menu-list .menu-btn-item.neutral { color: var(--text); }
.menu-list .menu-btn-item.neutral:hover { background: var(--panel-2); }

/* --- Administrateurs en ligne --- */
ul.presence { list-style: none; margin: .4rem 0 0; padding: 0; display: grid; gap: .55rem; }
ul.presence li { display: flex; gap: .6rem; align-items: flex-start; }
ul.presence .dot { flex: none; width: 10px; height: 10px; border-radius: 50%; margin-top: .4rem; background: var(--muted); }
ul.presence li.on .dot { background: var(--ok, #22c55e); box-shadow: 0 0 0 3px rgba(34, 197, 94, .2); }
.auth .forgot { margin: -.4rem 0 0; text-align: right; font-size: .88rem; }

/* --- Mode maintenance --- */
.maint-wrap { min-height: 80vh; display: grid; place-items: center; padding: 1rem; }
.maint { max-width: 560px; text-align: center; display: grid; gap: .8rem; justify-items: center; padding: 2.2rem 1.6rem; }
.maint-ic { width: 72px; height: 72px; border-radius: 22px; display: grid; place-items: center; background: var(--grad-soft); color: var(--accent); }
.maint-until { font-size: 1.05rem; }
.maint-ok { list-style: none; padding: 0; margin: .4rem 0; display: grid; gap: .4rem; text-align: left; color: var(--text-2); }
.maint-ok li { display: flex; gap: .5rem; align-items: center; }
.maint-ok svg { color: var(--ok, #22c55e); }
.buttons.center { justify-content: center; }
.maint-banner { display: flex; gap: .6rem; align-items: center; padding: .6rem 1rem; margin-bottom: 1rem; border-radius: 12px; background: rgba(245, 158, 11, .12); border: 1px solid rgba(245, 158, 11, .4); color: #d97706; font-weight: 600; }
.maint-banner a { margin-left: auto; }

/* --- Boutique --- */
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .8rem 0 1rem; }
.chip { padding: .35rem .8rem; border-radius: 999px; border: 1px solid var(--border-2); color: var(--text-2); background: var(--panel); font-size: .9rem; }
.chip.active, .chip:hover { border-color: var(--accent); color: var(--text); text-decoration: none; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 1rem; margin-bottom: 1.2rem; }
.shop-card { display: flex; flex-direction: column; border-radius: 18px; overflow: hidden; background: var(--panel); border: 1px solid var(--border); color: var(--text); transition: transform .15s, box-shadow .15s; }
.shop-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); text-decoration: none; }
.shop-img { position: relative; aspect-ratio: 16 / 10; background: var(--panel-2); overflow: hidden; }
.shop-img img, .shop-img svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.shop-img .ribbon { position: absolute; top: 10px; left: 10px; right: auto; transform: none; }
.shop-body { display: grid; gap: .3rem; padding: .9rem 1rem 1rem; flex: 1; align-content: start; }
.shop-body h3 { margin: 0; font-size: 1.05rem; }
.shop-body p { margin: 0; color: var(--text-2); font-size: .9rem; }
.shop-foot { display: flex; align-items: center; gap: .5rem; margin-top: .5rem; flex-wrap: wrap; }
.shop-foot .btn { margin-left: auto; }
.shop-detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.2rem; align-items: start; }
.shop-img.big { border-radius: 20px; }
.shop-info { display: grid; gap: .6rem; }
.shop-info h1 { margin: 0; }
td.thumb { width: 72px; }
td.thumb img, td.thumb svg { width: 64px; height: 40px; object-fit: cover; border-radius: 8px; display: block; }
.order-status { display: flex; gap: .35rem; flex-wrap: wrap; }
.order-status input { min-width: 140px; }
@media (max-width: 860px) { .shop-detail { grid-template-columns: 1fr; } }

/* --- Support & assistance --- */
.support-hero { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 1.2rem; align-items: center; background: linear-gradient(135deg, rgba(var(--accent-rgb), .14), rgba(139, 92, 246, .1)), var(--panel); }
.support-hero h1 { margin: 0 0 .3rem; }
.support-search { display: flex; align-items: center; gap: .5rem; margin-top: .8rem; padding: 0 .9rem; border-radius: 14px; border: 1px solid var(--border-2); background: var(--panel-solid); }
.support-search input { border: 0; background: none; flex: 1; padding: .8rem 0; }
.support-search input:focus { outline: none; box-shadow: none; }
.support-contacts { display: grid; gap: .5rem; }
.contact { display: flex; gap: .7rem; align-items: center; padding: .65rem .8rem; border-radius: 14px; background: var(--panel-solid); border: 1px solid var(--border-2); color: var(--text); }
.contact:hover { border-color: var(--accent); text-decoration: none; }
.contact span { display: grid; }
.contact small { color: var(--muted); }
.contact.wa svg { color: var(--wa); }
.help-cat { margin: 1.4rem 0 .6rem; font-size: 1.1rem; }
.help-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: .7rem; }
.help-card { display: flex; gap: .7rem; align-items: flex-start; padding: .9rem; border-radius: 14px; background: var(--panel); border: 1px solid var(--border); color: var(--text); }
.help-card:hover { border-color: var(--accent); text-decoration: none; }
.help-card span:last-child { display: grid; gap: .2rem; }
.help-card small { color: var(--text-2); }
.help-ic { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--grad-soft); color: var(--accent); }
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 1rem; align-items: start; }
.article-layout aside { display: grid; gap: 1rem; }
.help-article { line-height: 1.65; }
.help-article h1 { margin-top: 0; }
.help-article h2 { margin: 1.4rem 0 .5rem; font-size: 1.2rem; }
.help-article h3 { margin: 1.1rem 0 .4rem; }
.help-article figure { margin: 1rem 0; }
.help-article figure img { max-width: 100%; border-radius: 12px; border: 1px solid var(--border-2); box-shadow: var(--shadow-sm); }
.help-article figcaption { font-size: .82rem; color: var(--muted); margin-top: .3rem; }
.help-article li { margin: .25rem 0; }
.tip { padding: .7rem .9rem; border-radius: 12px; background: rgba(var(--accent-rgb), .1); border-left: 4px solid var(--accent); margin: .8rem 0; }
ul.related { padding-left: 1.1rem; margin: .3rem 0 0; display: grid; gap: .35rem; }
.request { padding: .7rem 0; border-bottom: 1px solid var(--border); }
.request:last-child { border-bottom: 0; }
.between { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; }
textarea.mono { font-family: ui-monospace, monospace; font-size: .88rem; }
.help-article.preview { max-height: 600px; overflow: auto; }
@media (max-width: 900px) { .support-hero, .article-layout { grid-template-columns: 1fr; } }

/* --- Services à la carte --- */
.svc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: .9rem; margin: .8rem 0 1rem; }
.svc { display: grid; gap: .5rem; align-content: start; }
.svc-head { display: flex; align-items: center; gap: .6rem; }
.svc-head .badge { margin-left: auto; white-space: nowrap; }
.svc p { margin: 0; }
.svc label { display: grid; gap: .25rem; font-size: .9rem; }
.svc .btn { justify-self: start; }

/* Listes déroulantes : options lisibles partout (Windows affiche sinon du texte clair sur fond blanc) */
:root, [data-theme="dark"] { color-scheme: dark; }
[data-theme="light"] { color-scheme: light; }
select option, select optgroup { background-color: var(--panel-solid); color: var(--text); }
select option:disabled { color: var(--muted); }
.thread { display: grid; gap: .4rem; margin: .5rem 0; }
.msg { padding: .5rem .7rem; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--border-2); max-width: 92%; }
.msg p { margin: .15rem 0 0; white-space: pre-wrap; }
.msg small { color: var(--muted); }
.msg.staff { justify-self: end; background: rgba(var(--accent-rgb), .12); border-color: rgba(var(--accent-rgb), .35); }
.request.unseen { box-shadow: inset 3px 0 0 var(--accent); padding-left: .7rem; }
.new-tag { color: var(--accent); }
.inline-reply { display: flex; gap: .4rem; margin-top: .3rem; }
.inline-label { display: flex; align-items: center; gap: .4rem; }
.inline-label select { width: auto; }
.currency-pick select { width: auto; }
.cur-table input { min-width: 90px; }
.rank { display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 .4rem; border-radius: 9px; background: var(--grad-soft); font-weight: 700; font-size: .85rem; }

/* --- Fidélité & parrainage --- */
.level-hero { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1.4rem; align-items: center; background: linear-gradient(135deg, color-mix(in srgb, var(--lvl) 22%, transparent), transparent 70%), var(--panel); border-color: color-mix(in srgb, var(--lvl) 45%, var(--border)); }
.level-badge { display: flex; gap: .9rem; align-items: center; }
.level-badge .medal { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--lvl); color: #1f1300; box-shadow: 0 10px 30px color-mix(in srgb, var(--lvl) 45%, transparent); }
.level-badge small { display: block; color: var(--muted); }
.level-badge strong { font-size: 1.7rem; }
.level-progress .bar { height: 12px; border-radius: 999px; background: var(--panel-2); overflow: hidden; margin: .5rem 0; }
.level-progress .bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--lvl), var(--accent)); border-radius: 999px; }
.levels-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr)); gap: .8rem; margin: 1rem 0; }
.lvl { border-top: 4px solid var(--lvl); }
.lvl.current { box-shadow: 0 0 0 2px var(--lvl), var(--shadow); }
.lvl-name { color: var(--lvl); font-size: 1.1rem; }
.tiers { display: flex; gap: .5rem; flex-wrap: wrap; }
.tier { display: grid; padding: .5rem .8rem; border-radius: 12px; border: 1px dashed var(--border-2); color: var(--muted); }
.tier.reached { border-style: solid; border-color: var(--ok, #22c55e); color: var(--text); background: rgba(34, 197, 94, .1); }
.copy-row { display: flex; gap: .4rem; margin-top: .3rem; }
.stats.mini { margin-top: 1rem; }
.lvl-chip { display: inline-flex; align-items: center; gap: .3rem; padding: .1rem .5rem; border-radius: 999px; font-size: .75rem; font-weight: 700; color: #1f1300; background: var(--lvl); }
@media (max-width: 640px) { .level-hero { grid-template-columns: 1fr; } }
.level-side { color: var(--text); display: grid; gap: .5rem; border-color: color-mix(in srgb, var(--lvl) 45%, var(--border)); }
.level-side:hover { text-decoration: none; border-color: var(--lvl); }
.level-side .link { color: var(--accent); }

/* --- Application mobile --- */
.app-hero { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1.3rem; align-items: center; margin-bottom: 1rem; background: linear-gradient(135deg, rgba(var(--accent-rgb), .16), rgba(139, 92, 246, .12)), var(--panel); }
.app-hero h1 { margin: 0 0 .3rem; }
.app-icon { border-radius: 24px; box-shadow: 0 14px 34px rgba(var(--accent-rgb), .35); }
.install-steps { display: grid; gap: .8rem; }
.install-steps ol { margin: .3rem 0 0; padding-left: 1.2rem; }
@media (max-width: 600px) { .app-hero { grid-template-columns: 1fr; justify-items: start; } }
.app-promo { display: flex; align-items: center; gap: .8rem; color: var(--text); margin-bottom: 1rem; }
.app-promo:hover { text-decoration: none; border-color: var(--accent); }
.app-promo img { border-radius: 12px; }
.app-promo span:nth-child(2) { display: grid; flex: 1; }
.app-promo small { color: var(--muted); }
[hidden] { display: none !important; }

/* --- Menu regroupé en familles repliables --- */
.nav-group { display: grid; gap: 2px; }
.nav-group > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; padding: 10px 10px 4px; font: 700 .68rem var(--font-body); text-transform: uppercase; letter-spacing: .14em; color: var(--muted); user-select: none; }
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary::after { content: ""; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); margin-right: 4px; transition: transform .15s; }
.nav-group:not([open]) > summary::after { transform: rotate(-45deg); }
.nav-group > summary:hover { color: var(--text-2); }
.sidebar nav { display: grid; gap: 4px; }
.sidebar .nav-item { padding: .45rem .65rem; font-size: .93rem; border-radius: 12px; }
.sidebar .nav-ic { width: 30px; height: 30px; }

/* =====================  Tableau de bord « Nuit du Sahel »  ===================== */
.dash2 { display: grid; gap: 1.1rem; max-width: 1400px; }
.dash-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.dash-top p { margin: .2rem 0 0; }
h1.greet { font-size: clamp(1.6rem, 2.6vw, 2.15rem); font-weight: 800; letter-spacing: -.02em; margin: 0; }
.dash-top-actions { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; }
.chip-gold { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .85rem; border-radius: 999px; border: 1px solid rgba(var(--accent-rgb), .45); color: var(--accent-2); font-weight: 600; font-size: .88rem; background: rgba(var(--accent-rgb), .08); }
.chip-gold:hover { text-decoration: none; background: rgba(var(--accent-rgb), .14); }
.chip-team { display: inline-flex; gap: .3rem; padding: .3rem .4rem; border-radius: 999px; border: 1px solid var(--border-2); background: var(--panel); }
.chip-team:hover { text-decoration: none; border-color: var(--accent); }
.chip-team span { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .55rem; border-radius: 999px; font-size: .8rem; color: var(--text-2); }
.chip-team span::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.chip-team span.on::before { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); }

.queue { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; }
.todo { display: grid; gap: .1rem; padding: .95rem 1rem; border-radius: 16px; border: 1px solid var(--border); background: var(--panel); color: var(--text); min-width: 0; transition: transform .15s, border-color .15s; }
.todo:hover { text-decoration: none; transform: translateY(-2px); border-color: var(--border-2); }
.todo small { font-size: .68rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; color: var(--muted); }
.todo b { font: 700 1.18rem var(--font-display); }
.todo span { color: var(--text-2); font-size: .84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo em { font-style: normal; font-weight: 700; font-size: .84rem; color: var(--muted); margin-top: .25rem; }
.todo.hot { border-color: rgba(var(--accent-rgb), .5); background: linear-gradient(140deg, rgba(var(--accent-rgb), .12), transparent 70%), var(--panel); }
.todo.hot em { color: var(--accent-2); }
.todo.bad { border-color: color-mix(in srgb, var(--bad) 50%, transparent); background: linear-gradient(140deg, var(--bad-bg), transparent 70%), var(--panel); }
.todo.bad em { color: var(--bad); }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; }
.kpi { position: relative; display: grid; gap: .25rem; padding: 1rem 1.05rem; border-radius: 16px; border: 1px solid var(--border); background: var(--panel); color: var(--text); min-width: 0; overflow: hidden; }
a.kpi:hover { text-decoration: none; border-color: var(--border-2); }
.kpi small { color: var(--muted); font-size: .8rem; }
.kpi b { font: 800 1.75rem/1.05 var(--font-display); letter-spacing: -.01em; }
.kpi b em { font: 500 .8rem var(--font-body); color: var(--muted); font-style: normal; margin-left: .3rem; }
.kpi .trend { font: 700 .76rem var(--font-mono); color: var(--ok); }
.kpi .trend.down { color: var(--bad); }
.kpi .trend.neutral { color: var(--muted); font-weight: 500; font-family: var(--font-body); }
.kpi .spark { width: 100%; height: 34px; margin-top: .2rem; }
.kpi .kpi-link { font-size: .8rem; font-weight: 700; color: var(--accent-2); display: inline-flex; align-items: center; gap: .3rem; margin-top: .2rem; }
.hero-kpi { border-color: rgba(var(--accent-rgb), .42); background: radial-gradient(120% 100% at 0% 0%, rgba(var(--accent-rgb), .2), transparent 60%), var(--panel); }
.hero-kpi b { color: var(--accent-2); }

.split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: .8rem; align-items: stretch; }
.split > .card { margin: 0; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; margin-bottom: .6rem; flex-wrap: wrap; }
.panel-head h2 { margin: 0; font-size: 1.08rem; }
.bar-chart { width: 100%; height: auto; display: block; }
.bar-chart .grid path { stroke: var(--border); stroke-width: 1; }
.bar-chart text { font: 500 10px var(--font-mono); fill: var(--muted); }
.bar-chart rect { fill: color-mix(in srgb, var(--accent) 45%, var(--panel-2)); }
.bar-chart rect.last { fill: var(--accent); }
.bar-chart rect:hover { fill: var(--accent-2); }
.bar-chart .peak { fill: var(--accent-2); font-weight: 700; }
.bar-chart .lbl { font-family: var(--font-body); }
.donut-row { display: grid; grid-template-columns: 116px 1fr; gap: 1rem; align-items: center; }
.donut { width: 116px; height: 116px; }
.legend { display: grid; gap: .5rem; font-size: .92rem; color: var(--text-2); }
.legend div { display: grid; grid-template-columns: 10px 1fr auto; gap: .6rem; align-items: center; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.legend b { color: var(--text); }
.mini-feed { list-style: none; margin: .9rem 0 0; padding: .7rem 0 0; border-top: 1px solid var(--border); display: grid; gap: .45rem; }
.mini-feed li { display: flex; justify-content: space-between; gap: .6rem; flex-wrap: wrap; font-size: .9rem; }
.level-side { display: grid; gap: .7rem; align-content: start; color: var(--text); border-color: color-mix(in srgb, var(--lvl) 45%, var(--border)); background: radial-gradient(120% 100% at 100% 0%, color-mix(in srgb, var(--lvl) 18%, transparent), transparent 60%), var(--panel); }
.level-side:hover { text-decoration: none; }
.level-side h2 { margin: 0; font-size: 1.1rem; }
.level-side .link { color: var(--accent-2); font-weight: 700; font-size: .88rem; }
.medal-sm { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--lvl); color: #1f1300; font: 800 1.2rem var(--font-display); flex: none; }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; margin-top: .4rem; }
.section-head h2 { margin: 0; display: flex; align-items: center; gap: .5rem; }
.section-head .filters { display: flex; gap: .4rem; flex-wrap: wrap; }
.section-head .chip.warn { border-color: color-mix(in srgb, var(--bad) 50%, transparent); color: var(--bad); }

.router-row { grid-template-columns: 40px minmax(140px, 1fr) 62px 58px 128px 96px 92px 48px 88px; }
.router-row.is-problem { box-shadow: inset 3px 0 0 var(--warn); }
.ring { width: 40px; height: 40px; }
.ring circle { fill: none; stroke-width: 4; }
.ring .ring-bg { stroke: var(--panel-2); }
.ring .ring-fg { stroke-linecap: round; transition: stroke-dasharray .4s; }
.ring.on .ring-fg { stroke: var(--ok); }
.ring.warn .ring-fg { stroke: var(--warn); }
.ring.bad .ring-fg { stroke: var(--bad); }
.ring.off .ring-fg { stroke: var(--wait); }
.ring text { font: 700 10px var(--font-mono); fill: var(--text); }
.row-sales { text-align: right; font-weight: 700; font-size: .9rem; color: var(--text); white-space: nowrap; }

.split.bottom { align-items: start; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; max-height: 420px; overflow-y: auto; }
.timeline li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: .7rem; align-items: baseline; padding: .55rem .2rem; border-bottom: 1px solid var(--border); }
.timeline li:last-child { border-bottom: 0; }
.timeline li i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.timeline li.bad i, .timeline li.neg i { background: var(--bad); }
.timeline li.pos i { background: var(--accent); }
.timeline li div { display: grid; min-width: 0; }
.timeline li div span { overflow-wrap: anywhere; }
.timeline .amt { font-weight: 700; }
.side-stack { display: grid; gap: .8rem; }
.side-stack .card { margin: 0; }

@media (max-width: 1250px) {
  .router-row { grid-template-columns: 40px minmax(0, 1fr) 128px 96px 92px 48px 88px; }
  .router-row .row-cpu, .router-row .score { display: none; }
}
@media (max-width: 1100px) {
  .queue, .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .router-row { grid-template-columns: 40px minmax(0, 1fr) auto; row-gap: .45rem; }
  .router-row .ping, .router-row .row-sales { display: none; }
  .router-row .row-status { grid-column: 2; grid-row: 2; }
  .router-row .switch { grid-column: 3; grid-row: 1; }
  .router-row details.menu { grid-column: 3; grid-row: 2; }
  .router-row .ring { grid-row: span 2; }
}
@media (max-width: 520px) {
  .queue, .kpis { grid-template-columns: 1fr 1fr; gap: .55rem; }
  .kpi b { font-size: 1.35rem; }
  .todo b { font-size: 1rem; }
  .donut-row { grid-template-columns: 90px 1fr; }
  .donut { width: 90px; height: 90px; }
  .dash-top-actions .btn { padding: .5rem .8rem; }
}

/* --- Page de connexion « vitrine » --- */
.net-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.auth-hero .brand { display: flex; align-items: center; gap: .7rem; font: 800 1.3rem var(--font-display); color: #eef1f8; }
.auth-hero .brand-mark { background: linear-gradient(135deg, #f5a524, #ffcf73); color: #1d1302; }
.auth-hero h2 { font: 800 clamp(1.9rem, 3.4vw, 2.9rem)/1.08 var(--font-display); letter-spacing: -.025em; margin: 0 0 1rem; max-width: 16ch; color: #fff; }
.auth-hero p { color: rgba(238, 241, 248, .8); }
.auth-stats { display: flex; gap: 1.8rem; flex-wrap: wrap; margin-top: 1.8rem; }
.auth-stats div { display: grid; }
.auth-stats b { font: 800 1.9rem/1.1 var(--font-display); color: #ffcf73; font-variant-numeric: tabular-nums; }
.auth-stats small { color: rgba(238, 241, 248, .72); font-size: .85rem; }
.hero-features li { color: rgba(238, 241, 248, .88); }
.hero-features .ic { background: rgba(255, 255, 255, .08); color: #ffcf73; }
.auth-foot { display: grid; gap: .7rem; }
.auth-foot .momo { display: flex; gap: .4rem; flex-wrap: wrap; }
.auth-foot .momo span { font-size: .75rem; font-weight: 700; padding: .3rem .6rem; border-radius: 8px; background: rgba(255, 255, 255, .08); color: rgba(238, 241, 248, .85); }
.auth-side .card.auth { border-color: var(--border-2); }
.auth .btn.primary { width: 100%; justify-content: center; }
@media (max-width: 900px) { .auth-stats { gap: 1.1rem; } .auth-stats b { font-size: 1.4rem; } .auth-hero { padding: 28px 22px; } }

/* --- Barre d'onglets en bas (téléphone) --- */
.tabbar { display: none; }
@media (max-width: 900px) {
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    padding: 6px max(6px, env(safe-area-inset-left, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) max(6px, env(safe-area-inset-right, 0px));
    background: color-mix(in srgb, var(--panel-solid) 92%, transparent); backdrop-filter: blur(14px); border-top: 1px solid var(--border); }
  .tab { display: grid; justify-items: center; gap: 2px; padding: 4px 0; font-size: .68rem; font-weight: 600; color: var(--muted); }
  .tab:hover { text-decoration: none; color: var(--text); }
  .tab.on { color: var(--accent-2); }
  .tab.fab .ic { width: 46px; height: 46px; padding: 12px; margin-top: -22px; border-radius: 16px; background: var(--grad); color: var(--on-accent); box-shadow: 0 10px 24px rgba(var(--accent-rgb), .45); }
  .tab.fab { color: var(--accent-2); }
  body.app .content { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
}
.dash2 > .hero-alert { margin: 0; padding: .85rem 1.1rem; border: 1px solid var(--border); border-radius: 16px; background: var(--panel); }
.dash2 > .hero-alert.bad { border-color: color-mix(in srgb, var(--bad) 45%, transparent); background: linear-gradient(140deg, var(--bad-bg), transparent 70%), var(--panel); }
.dash2 > .searchbar { margin: -.4rem 0 0; }
.dash2 > .anomaly-banner { margin: 0; }

.inline-forms{display:flex;flex-wrap:wrap;gap:.2rem .9rem;align-items:center;font-size:.82rem;margin-top:.2rem}
.inline-forms .link{text-align:left;padding:0}
#acces dd{min-width:0}
#acces code{word-break:break-all}
.inline-forms form{display:inline}
#mk-link{word-break:break-all}

.router-actions{gap:.4rem}
.router-actions .btn,.router-actions form .btn{padding:.38rem .85rem;font-size:.86rem}
.flash.warn{background:rgba(var(--accent-rgb),.1);color:var(--accent);border-color:rgba(var(--accent-rgb),.45)}

.menu-list form { margin: 0; }
.menu-list .menu-link { display: flex; width: 100%; text-align: left; padding: .55rem .75rem; border-radius: 10px; color: var(--text); background: none; border: 0; font: inherit; cursor: pointer; }
.menu-list .menu-link:hover { background: var(--panel-2); }

.row-sales.muted { font-weight: 500; color: var(--muted); font-family: inherit; }

.pay-qr { display: grid; grid-template-columns: 180px 1fr; gap: 1rem; align-items: start; padding: .8rem; border: 1px solid var(--border-2); border-radius: 14px; background: var(--panel-2); margin-bottom: .8rem; }
.pay-qr img { width: 180px; height: 180px; object-fit: contain; background: #fff; border-radius: 12px; padding: 6px; }
@media (max-width: 560px) { .pay-qr { grid-template-columns: 1fr; justify-items: center; text-align: left; } }
.qr-thumb { width: 54px; height: 54px; object-fit: contain; background: #fff; border-radius: 8px; display: block; margin-bottom: .3rem; }
.pay-logo.pm-fedapay { background: #1f9d55; }

.svc-cats { display: flex; flex-wrap: wrap; gap: .4rem; margin: .4rem 0 1rem; }
.chip-link { display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .75rem; border-radius: 999px; border: 1px solid var(--border-2); background: var(--panel-2); color: var(--text); font-size: .85rem; font-weight: 600; }
.chip-link small { color: var(--muted); font-weight: 500; }
.chip-link:hover { border-color: var(--accent); }
.svc-cat { display: flex; align-items: center; gap: .45rem; margin: 1.3rem 0 .6rem; scroll-margin-top: 80px; }
.svc-cat-row { background: var(--panel-2); }
