/* ============================================================
   FF Panels — thème sombre « Free Fire » : fond graphite neutre, un seul accent orange
   (boutons principaux, navigation / onglet actifs, liens, focus, progression de niveau).
   Pour changer l'accent : --accent-rgb + --gold / --gold-2 / --gold-ink.
   Polices système (aucune requête externe).
   ============================================================ */

:root {
    --bg: #121317;
    --bg-2: #16171c;
    --card: #1a1c21;
    --card-2: #202228;
    --card-3: #2a2d34;
    --line: rgba(236, 236, 239, .08);
    --line-2: rgba(236, 236, 239, .14);
    --text: #ececef;
    --muted: #a9adb8;
    --faint: #7c818d;
    --accent-rgb: 255 138 61;
    --gold: #ff8a3d;
    --gold-2: #ffa466;
    --gold-ink: #ffc29a;
    --gold-bg: rgb(var(--accent-rgb) / .12);
    --green: #4fd39a;
    --green-2: #36b981;
    --green-bg: rgba(79, 211, 154, .12);
    --amber: #e8c547;
    --amber-bg: rgba(232, 197, 71, .12);
    --red: #f2777a;
    --red-bg: rgba(242, 119, 122, .12);
    --blue: #6ea8f5;
    --blue-bg: rgba(110, 168, 245, .12);
    --violet: #a99cf5;
    --violet-bg: rgba(169, 156, 245, .13);
    --cyan: #5fcde0;
    --r: 10px;
    --r-sm: 7px;
    --serif: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
    --ease: cubic-bezier(.22, .7, .2, 1);
    /* relief : arête claire en haut + ombre diffuse, jamais de halo coloré */
    --edge: inset 0 1px 0 rgba(255, 255, 255, .045);
    --shadow-sm: var(--edge), 0 1px 3px rgba(0, 0, 0, .25);
    --shadow-md: var(--edge), 0 10px 28px rgba(0, 0, 0, .32);
    --shadow-lg: var(--edge), 0 24px 60px rgba(0, 0, 0, .5);
    --glow: 0 0 0 3px rgb(var(--accent-rgb) / .16);
    --nav-h: 64px;
    color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); font: 14px/1.55 var(--sans); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--gold-ink); text-decoration: none; text-underline-offset: 3px; }
a:hover { color: var(--text); text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-family: var(--sans); font-weight: 650; letter-spacing: -.01em; line-height: 1.25; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
::selection { background: rgb(var(--accent-rgb) / .35); }
.mono { font-family: var(--mono); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.pos { color: var(--green); }
.neg { color: var(--red); }
.ic { width: 16px; height: 16px; flex: none; stroke-width: 1.6; }
.ic.lg { width: 19px; height: 19px; }
.spin { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- marque / chargement ---------- */
.logo-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; flex: none;
    border: 1px solid rgb(var(--accent-rgb) / .55); color: var(--gold-ink); background: linear-gradient(160deg, rgb(var(--accent-rgb) / .28), rgb(var(--accent-rgb) / .06)); box-shadow: var(--edge);
    font: 800 14px/1 var(--sans); letter-spacing: -.03em; }
.logo-mark.sm { width: 32px; height: 32px; border-radius: 9px; font-size: 12.5px; }
.boot { position: fixed; inset: 0; display: grid; place-content: center; justify-items: center; gap: 20px; background: var(--bg); z-index: 200; }
.boot-bar { width: 140px; height: 1px; background: var(--line-2); overflow: hidden; }
.boot-bar span { display: block; width: 40%; height: 100%; background: var(--gold); animation: boot 1.2s var(--ease) infinite; }
@keyframes boot { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }

/* ---------- boutons (contours, jamais remplis) ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 15px;
    border-radius: var(--r-sm); border: 1px solid var(--line-2); background: transparent; cursor: pointer;
    font: 600 13.5px/1 var(--sans); white-space: nowrap; color: var(--text);
    transition: background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease), transform .1s; }
.btn:hover { background: var(--card-2); border-color: rgba(236, 236, 239, .28); }
.btn:active { transform: translateY(1px); background: var(--card-3); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.sm { height: 31px; padding: 0 11px; font-size: 12.5px; }
.btn.lg { height: 44px; font-size: 15px; }
.btn.icon { width: 36px; padding: 0; }
.btn.icon.sm { width: 31px; }
.btn.block { width: 100%; }
.btn.primary { border-color: var(--gold); color: var(--gold-ink); }
.btn.primary:hover { background: var(--gold-bg); border-color: var(--gold-2); box-shadow: var(--glow); }
.btn.primary:active { background: rgb(var(--accent-rgb) / .24); }
.btn.danger { border-color: rgba(242, 119, 122, .45); color: var(--red); }
.btn.danger:hover { background: var(--red-bg); border-color: var(--red); }
.btn.soft-green { border-color: rgba(79, 211, 154, .45); color: var(--green); }
.btn.soft-green:hover { background: var(--green-bg); border-color: var(--green); }
.btn.amber { border-color: var(--gold); color: var(--gold-ink); }
.btn.amber:hover { background: var(--gold-bg); }
.btn.ghost { border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--card-3); color: var(--text); }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- formulaires ---------- */
input, select, textarea { background: var(--card); border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 0 12px; height: 38px; width: 100%; outline: none; transition: border-color .2s, box-shadow .2s; }
textarea { padding: 10px 12px; height: auto; min-height: 220px; resize: vertical; font-family: var(--mono); font-size: 12.5px; line-height: 1.55; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgb(var(--accent-rgb) / .2); }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--gold); padding: 0; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
label.check { flex-direction: row; align-items: center; gap: 10px; color: var(--text); cursor: pointer; }
.hint { font-size: 12px; color: var(--faint); }
.form-error { color: var(--red); min-height: 1.2em; margin: 0; font-size: 13px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.fieldset { border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin: 0 0 14px; background: transparent; }
.fieldset legend { padding: 0 8px; font: 650 13px var(--sans); color: var(--text); display: flex; align-items: center; gap: 6px; }

/* ---------- connexion ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: radial-gradient(900px 500px at 50% -10%, rgb(var(--accent-rgb) / .18), transparent 60%), var(--bg); }
.login-card { width: 100%; max-width: 390px; background: var(--card); border: 1px solid var(--line); border-top: 2px solid var(--gold); border-radius: var(--r); padding: 34px 30px;
    display: flex; flex-direction: column; gap: 16px; box-shadow: var(--shadow-md); animation: rise .5s var(--ease); }
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.login-brand b { display: block; font: 700 18px/1.2 var(--sans); }
.login-brand span { color: var(--faint); font-size: 12.5px; }

/* ---------- structure ---------- */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px; padding: 22px 16px 16px;
    background: var(--bg-2); border-right: 1px solid var(--line); }
.side-brand { display: flex; align-items: center; gap: 12px; padding: 2px 6px 20px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.side-brand b { display: block; font: 700 15px/1.2 var(--sans); }
.side-brand span { display: block; font-size: 11.5px; color: var(--faint); }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px; border-radius: var(--r-sm); border: 0;
    background: none; color: var(--muted); cursor: pointer; font: 550 14px/1 var(--sans); text-align: left; position: relative;
    transition: background .2s var(--ease), color .2s var(--ease); }
.nav-item:hover { background: var(--card-2); color: var(--text); }
.nav-item.active { color: var(--text); background: linear-gradient(90deg, rgb(var(--accent-rgb) / .16), rgb(var(--accent-rgb) / .03)); box-shadow: inset 0 0 0 1px rgb(var(--accent-rgb) / .2); }
.nav-item.active::before { content: ""; position: absolute; left: -16px; top: 10px; bottom: 10px; width: 2px; background: var(--gold); }
.nav-item.active .ic { color: var(--gold); }
.nav-item .count { margin-left: auto; font: 12px var(--sans); color: var(--faint); }
.side-foot { margin-top: auto; display: flex; align-items: center; gap: 6px; padding-top: 12px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.side-foot .live { width: 100%; padding: 4px 6px 8px; }
.me { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; background: none; border: 0; padding: 6px; border-radius: var(--r-sm); cursor: pointer; text-align: left; transition: background .2s; }
.me:hover { background: var(--card-2); }
.me span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.main-col { 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: 72px; padding: 14px clamp(16px, 3vw, 40px);
    background: rgba(18, 19, 23, .8); backdrop-filter: blur(14px) saturate(1.1); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.topbar h1 { font-size: clamp(18px, 1.6vw, 21px); font-weight: 650; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .logo-mark { display: none; }
.top-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
main { padding: clamp(16px, 2.4vw, 32px) clamp(16px, 3vw, 40px) 48px; width: 100%; max-width: 1560px; }
.view { animation: fade-in .35s var(--ease); }
.view > * + * { margin-top: 22px; }
.mobile-only { display: none !important; }
.t-short { display: none; }
.bottom-nav { display: none; }

.live { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: none; }
.live.on i { background: var(--green); box-shadow: 0 0 0 3px var(--green-bg); }
.live.off i { background: var(--red); animation: pulse 1.2s infinite; }

.avatar { position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; flex: none;
    background: hsl(var(--h, 250) 35% 22%); color: hsl(var(--h, 250) 75% 82%); border: 1px solid hsl(var(--h, 250) 35% 34%);
    font: 700 13px/1 var(--sans); letter-spacing: -.02em; }
.avatar.sm { width: 30px; height: 30px; font-size: 11.5px; }
.avatar .sdot { position: absolute; right: -2px; bottom: -2px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--card); background: var(--faint); }

/* ---------- cartes & petits éléments ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.card-head h3 { font-size: 15px; }
.spacer { flex: 1; }
.section-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.section-head h2 { font-size: 16px; }

.pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 99px; font-size: 11.5px;
    white-space: nowrap; border: 1px solid var(--line-2); color: var(--muted); background: transparent; }
.pill i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.green { color: var(--green); border-color: rgba(79, 211, 154, .35); background: var(--green-bg); }
.pill.amber { color: var(--amber); border-color: rgba(232, 197, 71, .4); background: var(--amber-bg); }
.pill.red { color: var(--red); border-color: rgba(242, 119, 122, .35); background: var(--red-bg); }
.pill.blue { color: var(--blue); border-color: rgba(110, 168, 245, .35); background: var(--blue-bg); }
.pill.violet { color: var(--violet); border-color: rgba(169, 156, 245, .35); background: var(--violet-bg); }
.pill.live-dot i { animation: pulse 1.6s infinite; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: var(--r-sm); font-size: 12.5px;
    background: transparent; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; transition: border-color .2s, color .2s; }
a.chip:hover { border-color: var(--gold); color: var(--text); text-decoration: none; }
.chip b { color: var(--text); font-weight: 600; }
.chip .ic { width: 14px; height: 14px; color: var(--faint); }

.seg { display: inline-flex; padding: 3px; gap: 2px; background: transparent; border: 1px solid var(--line-2); border-radius: var(--r); overflow-x: auto; max-width: 100%; }
.seg button { height: 30px; padding: 0 13px; border: 0; border-radius: var(--r-sm); background: none; color: var(--muted); cursor: pointer; font: 550 13px/1 var(--sans); white-space: nowrap; transition: background .2s, color .2s; }
.seg button:hover { color: var(--text); }
.seg button.active { background: var(--gold-bg); color: var(--text); box-shadow: inset 0 0 0 1px rgb(var(--accent-rgb) / .5); }
.seg button .n { font: 11.5px var(--sans); color: var(--faint); margin-left: 5px; }

/* ---------- KPI ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); }
.kpi { display: flex; gap: 14px; align-items: center; padding: 18px 20px; border-right: 1px solid var(--line); }
.kpi-ic { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; flex: none; border: 1px solid currentColor; }
.kpi-ic .ic { width: 18px; height: 18px; }
.kpi-ic.green { color: var(--green); } .kpi-ic.blue { color: var(--blue); } .kpi-ic.violet { color: var(--violet); }
.kpi-ic.amber { color: var(--amber); } .kpi-ic.red { color: var(--red); } .kpi-ic.cyan { color: var(--cyan); }
.kpi .v { font: 650 22px/1.2 var(--sans); font-variant-numeric: tabular-nums; }
.kpi .l { font-size: 12.5px; color: var(--muted); }
.kpi .s { font-size: 11.5px; color: var(--faint); }

/* ---------- barre de file ---------- */
.qbar { display: flex; height: 4px; border-radius: 99px; overflow: hidden; background: var(--card-3); gap: 2px; }
.qbar span { display: block; height: 100%; transition: flex .6s var(--ease); }
.qlegend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 9px; }
.qlegend span { display: inline-flex; align-items: center; gap: 6px; }
.qlegend i { width: 8px; height: 8px; border-radius: 50%; }
.qlegend b { color: var(--text); font-weight: 600; }
.q-pending { background: #5b5f69; } .q-active { background: var(--green); } .q-completed { background: var(--blue); }
.q-failed { background: var(--red); } .q-stopped { background: var(--amber); } .q-disabled { background: #3a3d44; }
.q-banned { background: #c0514f; }

/* ---------- cartes de panel ---------- */
.panel-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.panel-toolbar input { max-width: 260px; }
.panel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: 20px; align-items: start; }
.pcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; position: relative;
    box-shadow: var(--shadow-sm); transition: border-color .3s var(--ease), box-shadow .3s var(--ease), transform .3s var(--ease); animation: rise .45s var(--ease) both; }
.pcard:nth-child(2) { animation-delay: .05s; } .pcard:nth-child(3) { animation-delay: .1s; } .pcard:nth-child(4) { animation-delay: .15s; }
.pcard:nth-child(5) { animation-delay: .2s; } .pcard:nth-child(n+6) { animation-delay: .25s; }
.pcard:hover { box-shadow: var(--shadow-md); border-color: var(--line-2); }
.pcard::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: var(--line-2); transition: background .3s; }
.pcard.st-running { border-color: rgb(var(--accent-rgb) / .22); }
.pcard.st-running::before { background: var(--gold); }
.pcard.st-finished::before { background: var(--blue); }
.pcard-head { display: flex; align-items: center; gap: 10px; padding: 20px 20px 0; }
.pcard-title { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.pcard-title h3 { font-size: 17px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard-actions { display: flex; gap: 6px; align-items: center; }
.pcard-meta { display: flex; gap: 6px; flex-wrap: wrap; padding: 12px 20px 0; }
.pcard-metrics { display: grid; grid-template-columns: repeat(4, 1fr); margin: 16px 20px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.pcard-metrics > div { padding: 10px 12px; min-width: 0; }
.pcard-metrics > div + div { border-left: 1px solid var(--line); }
.pcard-metrics small { display: block; font-size: 10.5px; color: var(--faint); text-transform: uppercase; letter-spacing: .08em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard-metrics b { font: 650 16px var(--sans); white-space: nowrap; }
.pcard-metrics b span { color: var(--faint); }
.pcard-queue { padding: 14px 20px 0; }
.pcard-body { padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 12px; }
.pcard-body:has(.acc-list:empty):has(.pc-empty:empty) { display: none; }
/* détail d'un panel : réglages en cours + comptes suivants */
.pm-summary { display: flex; flex-direction: column; gap: 10px; margin: -4px 0 16px; }
.pm-summary:empty { display: none; }
.pm-meta, .pm-next { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pm-next small { font-size: 10.5px; color: var(--faint); text-transform: uppercase; letter-spacing: .08em; margin-right: 4px; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; color: var(--faint); padding: 26px 12px;
    border: 1px dashed var(--line-2); border-radius: var(--r); font-size: 13px; }
.empty .ic { width: 22px; height: 22px; opacity: .7; }

/* ---------- compte en cours de level ---------- */
.arow { background: linear-gradient(180deg, var(--card-2), var(--bg-2)); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; transition: border-color .3s var(--ease), background .3s; animation: fade-in .35s var(--ease); }
.arow:hover { border-color: var(--line-2); }
.acc-list { display: flex; flex-direction: column; gap: 12px; }
.acc-list:empty, .pc-empty:empty { display: none; }
.arow-top { display: flex; align-items: center; gap: 12px; }
.arow-id { min-width: 0; flex: 1; }
.arow-id b { display: block; font: 650 15px/1.3 var(--sans); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arow-sub { display: flex; align-items: center; flex-wrap: wrap; gap: 3px 9px; margin-top: 4px; min-width: 0; }
.arow-sub > span { font-size: 12px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.arow-grid { display: grid; grid-template-columns: 1.25fr 1fr 1fr 1fr; gap: 0; margin-top: 14px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.arow-grid > div { padding: 9px 12px; min-width: 0; }
.arow-grid > div + div { border-left: 1px solid var(--line); }
.arow-grid small { display: block; font-size: 10.5px; color: var(--faint); text-transform: uppercase; letter-spacing: .08em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.arow-grid b { display: block; font: 650 16px/1.35 var(--sans); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.arow { container-type: inline-size; }
@container (max-width: 560px) {
    .arow-grid { grid-template-columns: repeat(2, 1fr); }
    .arow-grid > div:nth-child(odd) { border-left: 0; }
    .arow-grid > div:nth-child(n+3) { border-top: 1px solid var(--line); }
}
.arow-grid .mcount b { font-size: 19px; }
.arow-grid .mcount b span { color: var(--faint); font-size: 14px; font-weight: 500; }
.pbar { height: 3px; border-radius: 99px; background: var(--card-3); overflow: hidden; margin-top: 12px; }
.pbar span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--gold), var(--gold-2)); transition: width .8s var(--ease); }
.pbar.small { height: 3px; margin-top: 6px; }
.arow-foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.arow-foot .err { flex: 1; min-width: 0; font-size: 12px; color: var(--red); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arow-foot .ok { flex: 1; min-width: 0; font-size: 12px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arow-foot .ok.speed { flex: 0 1 auto; display: inline-flex; align-items: center; gap: 6px; color: var(--gold-ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.arow-foot .ok.speed .ic { width: 14px; height: 14px; color: var(--gold); }
.arow-foot .ok.live { display: inline-flex; align-items: center; gap: 6px; margin-left: 6px; font-weight: 600; font-variant-numeric: tabular-nums; }
.arow-foot .ok.live .ic { width: 14px; height: 14px; flex: none; }
.arow-foot .ok.live.on { color: var(--cyan); }
.icon-actions { display: flex; gap: 2px; margin-left: auto; }
.arow.st-STALLED, .arow.st-RECONNECTING { border-color: rgba(232, 197, 71, .4); background: rgba(232, 197, 71, .05); }
/* carte de profil : largeur fluide (s'adapte à la largeur du panel / de l'écran), proportions conservées */
.gcard { width: 100%; max-width: 100%; aspect-ratio: 320 / 70; border-radius: var(--r-sm); overflow: hidden;
    background: var(--card-3); border: 1px solid var(--line); }
.gcard img { display: block; width: 100%; height: 100%; animation: card-in .4s var(--ease); }
@keyframes card-in { from { opacity: 0; } }
.gcard-skel { width: 100%; height: 100%; background: linear-gradient(90deg, var(--card-3) 20%, var(--card-2) 50%, var(--card-3) 80%);
    background-size: 200% 100%; animation: card-shimmer 1.4s linear infinite; }
@keyframes card-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.gcard-msg { display: flex; align-items: center; gap: 8px; height: 100%; padding: 0 4px 0 12px; color: var(--faint); font-size: 12px; line-height: 1.35; }
.gcard-msg span { flex: 1; min-width: 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.arow-card { margin-bottom: 12px; cursor: pointer; }
.arow-card:empty { display: none; }
.acc-card { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; margin-bottom: 14px; }
.acc-card > :first-child { flex: 1 1 280px; max-width: 460px; }
.acc-card .gcard { max-width: 460px; }
.acc-card-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
a.btn { color: var(--text); text-decoration: none; }
.btn.ghost[aria-pressed="true"] { background: var(--card); border-color: var(--gold); color: var(--gold-ink); }
@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }
.arow-sub .timer { display: inline-flex; align-items: center; gap: 4px; color: var(--gold-ink); }
.arow-sub .timer .ic { width: 12px; height: 12px; flex: none; }
.arow-tags { display: flex; align-items: center; gap: 6px; flex: none; }
.mode-tag { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: var(--r-sm); border: 1px solid;
    font: 600 10.5px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; vertical-align: middle; background: transparent; }
.mode-tag small { font-weight: 400; letter-spacing: 0; text-transform: none; opacity: .85; }
.mode-tag.m-br { color: var(--amber); border-color: rgba(232, 197, 71, .45); }
.mode-tag.m-lone_wolf { color: var(--violet); border-color: rgba(169, 156, 245, .45); }
.mode-tag.m-clash_squad { color: var(--blue); border-color: rgba(110, 168, 245, .45); }
/* progression vers le niveau suivant */
.lvl { margin-top: 12px; padding: 0; }
.lvl-head, .lvl-foot { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.lvl-head small { font-size: 10.5px; color: var(--faint); text-transform: uppercase; letter-spacing: .08em; white-space: nowrap; }
.lvl-head small b { color: var(--gold-ink); font: 700 12px var(--sans); letter-spacing: 0; }
.lvl-head > span { font: 650 12.5px var(--sans); color: var(--gold-ink); white-space: nowrap; }
.lvl-bar { display: flex; height: 6px; border-radius: 99px; background: var(--card-3); overflow: hidden; margin: 8px 0 6px; }
.lvl-bar span { height: 100%; transition: width .8s var(--ease); }
.lvl-bar .lb-before { background: var(--gold); opacity: .35; }
.lvl-bar .lb-gain { background: linear-gradient(90deg, var(--gold), var(--gold-2)); }
.lvl-foot { font-size: 11.5px; color: var(--faint); }
.lvl-foot b { color: var(--gold-ink); font-size: 12.5px; }
.s-green { background: var(--green) !important; } .s-violet { background: var(--violet) !important; } .s-blue { background: var(--blue) !important; }
.s-amber { background: var(--amber) !important; } .s-red { background: var(--red) !important; }

/* ---------- liste de gestion des panels ---------- */
.plist { display: flex; flex-direction: column; gap: 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); }
.prow { display: grid; grid-template-columns: auto minmax(180px, 1.3fr) minmax(0, 2fr) auto; gap: 16px; align-items: center;
    padding: 14px 16px; border-bottom: 1px solid var(--line); transition: background .2s; }
.prow:last-child { border-bottom: 0; }
.prow:hover { background: var(--card-2); }
.prow-order { display: flex; flex-direction: column; gap: 2px; }
.prow-main b { display: flex; align-items: center; gap: 8px; font: 650 15px var(--sans); }
.prow-main span { display: block; font-size: 12.5px; color: var(--faint); margin-top: 3px; }
.prow-stats { display: flex; gap: 6px; flex-wrap: wrap; }
.prow-actions { display: flex; gap: 6px; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--card); overflow: hidden; }
.stepper button { width: 36px; height: 36px; border: 0; background: none; cursor: pointer; color: var(--muted); display: grid; place-items: center; transition: background .2s; }
.stepper button:hover { background: var(--card-3); color: var(--text); }
.stepper input { width: 56px; height: 36px; border: 0; border-radius: 0; text-align: center; background: transparent; font-weight: 600; box-shadow: none; }

/* ---------- tableaux ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
th { font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--faint); font-weight: 500; background: transparent; border-bottom: 1px solid var(--line-2); }
tbody tr { transition: background .15s; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--card-2); }
td.num, th.num { text-align: right; }
td.wrap { white-space: normal; min-width: 200px; }
.cell-acc { display: flex; align-items: center; gap: 10px; }
.cell-acc b { display: block; font-weight: 650; }
.cell-acc .sub { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 3px; font-size: 12px; }

/* identifiant copiable */
.idchip { display: inline-flex; align-items: center; gap: 5px; height: 21px; padding: 0 7px; border-radius: var(--r-sm); border: 1px solid var(--line);
    background: transparent; font-family: var(--mono); font-size: 11px; color: var(--muted); cursor: pointer; white-space: nowrap;
    max-width: 100%; flex: none; transition: color .2s, border-color .2s, background .2s; }
.idchip small { font-family: var(--sans); font-size: 9.5px; font-weight: 600; color: var(--faint); letter-spacing: .06em; }
.idchip span { overflow: hidden; text-overflow: ellipsis; }
.idchip .ic { width: 12px; height: 12px; opacity: .55; }
.idchip:hover { color: var(--text); border-color: var(--gold); }
.idchip:hover .ic { opacity: 1; }
.idchip.copied { color: var(--green); border-color: rgba(79, 211, 154, .5); background: var(--green-bg); }
.idchip.empty-id { cursor: default; opacity: .6; }
.idchip.lg { height: 27px; font-size: 12.5px; padding: 0 9px; margin-top: 3px; }
.bar-col { width: 22%; min-width: 60px; }
.scopebar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; padding: 10px 14px;
    background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.scopebar select { width: auto; min-width: 220px; height: 34px; }
.banner { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 16px 18px; border-radius: var(--r);
    background: var(--card); border: 1px solid var(--line); border-left: 0; box-shadow: inset 2px 0 0 var(--gold); }
.banner > .ic { color: var(--gold); }
.banner b { display: block; font: 650 15px var(--sans); }
.banner span { color: var(--muted); font-size: 13px; }
.banner span b { display: inline; color: var(--text); font: 600 13px var(--sans); }
.notice { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--r); background: var(--amber-bg);
    border: 1px solid rgba(232, 197, 71, .4); color: var(--amber); }
.notice b { color: var(--text); }
.input-btn { display: flex; gap: 6px; }
.input-btn input { font-family: var(--mono); }
.dur-pick { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.dur-pick .flabel { font-size: 13px; color: var(--muted); }
[data-left].neg { color: var(--red); }
#acc-tabs button { display: inline-flex; align-items: center; gap: 6px; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; }
.filters > * { flex: 1 1 180px; width: auto; }
.search { position: relative; }
.search .ic { position: absolute; left: 11px; top: 11px; color: var(--faint); }
.search input { padding-left: 34px; }
.bulkbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 14px; border: 1px solid var(--gold);
    background: rgba(32, 34, 40, .94); border-radius: var(--r); position: sticky; top: 84px; z-index: 5; backdrop-filter: blur(8px); box-shadow: var(--shadow-md); }
.bulkbar select { width: auto; height: 30px; }

/* ---------- import ---------- */
.import-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 20px; align-items: start; }
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 8px; border: 1px dashed var(--line-2); border-radius: var(--r);
    padding: 26px; text-align: center; color: var(--muted); cursor: pointer; transition: all .2s var(--ease); }
.dropzone:hover { border-color: var(--gold); color: var(--text); }
.dropzone.over { border-color: var(--gold); background: var(--gold-bg); color: var(--text); }
.dropzone .ic { width: 26px; height: 26px; color: var(--gold); }
.files { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.files .chip button { background: none; border: 0; color: var(--faint); cursor: pointer; padding: 0; display: grid; }
pre.example { background: var(--card-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; font-size: 12px; overflow-x: auto; margin: 8px 0 0; font-family: var(--mono); color: var(--muted); }
.format-list { display: flex; flex-direction: column; gap: 12px; }
.format-list h4 { font-size: 13px; display: flex; align-items: center; gap: 8px; }
.report-kpis { grid-template-columns: repeat(4, 1fr); }

/* ---------- journal ---------- */
.log { font-family: var(--mono); font-size: 12px; height: 62vh; overflow-y: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 16px; }
.log-line { display: flex; gap: 12px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.log-line time { color: var(--faint); flex: none; }
.log-line .who { color: var(--violet); flex: none; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-line .msg { min-width: 0; overflow-wrap: anywhere; }
.lv-info { color: var(--text); } .lv-success { color: var(--green); } .lv-warning { color: var(--amber); } .lv-error { color: var(--red); } .lv-debug { color: var(--faint); }

/* ---------- modales ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(6, 6, 8, .7); backdrop-filter: blur(4px); z-index: 50; display: flex;
    justify-content: center; align-items: flex-start; padding: 6vh 16px; overflow-y: auto; animation: fade-in .2s var(--ease); }
.modal { background: var(--card); border: 1px solid var(--line); border-top: 2px solid var(--gold); border-radius: var(--r); width: 100%; max-width: 760px; padding: 26px; box-shadow: var(--shadow-lg); animation: rise .35s var(--ease); }
.modal.wide { max-width: 1120px; }
.modal-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 18px; font-weight: 650; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; overflow-y: hidden; }
.tabs button { background: none; border: 0; height: 40px; padding: 0 12px; color: var(--muted); cursor: pointer; border-bottom: 1px solid transparent; margin-bottom: -1px; white-space: nowrap; font: 550 13.5px var(--sans); transition: color .2s, border-color .2s; }
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--text); border-bottom-color: var(--gold); }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0; border-top: 1px solid var(--line); }
.kv div { border-bottom: 1px solid var(--line); padding: 10px 12px 10px 0; min-width: 0; }
.kv small { display: block; color: var(--faint); font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; }
.kv span { font-weight: 600; overflow-wrap: anywhere; }

/* ---------- toasts ---------- */
#toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; z-index: 300; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-left: 2px solid var(--green); padding: 12px 16px; border-radius: var(--r);
    max-width: 420px; pointer-events: auto; box-shadow: var(--shadow-lg); animation: rise .3s var(--ease); }
.toast .ic { color: var(--green); }
.toast.error { border-left-color: var(--red); }
.toast.error .ic { color: var(--red); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
    .prow { grid-template-columns: auto 1fr auto; }
    .prow-stats { grid-column: 2 / -1; grid-row: 2; }
    .import-grid { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
    .shell { grid-template-columns: 1fr; }
    .sidebar { display: none; }
    .mobile-only { display: inline-flex !important; }
    .topbar { min-height: 60px; gap: 10px; }
    .topbar .logo-mark { display: grid; }
    .t-long { display: none; }
    .t-short { display: inline; }
    main { padding-bottom: calc(var(--nav-h) + 28px + env(safe-area-inset-bottom)); }
    .bottom-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; height: calc(var(--nav-h) + env(safe-area-inset-bottom));
        padding: 6px 6px env(safe-area-inset-bottom); background: rgba(18, 19, 23, .94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
    .bottom-nav button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; background: none;
        color: var(--faint); font: 600 10.5px var(--sans); cursor: pointer; border-radius: var(--r); min-width: 0; transition: color .2s; position: relative; }
    .bottom-nav button .ic { width: 21px; height: 21px; }
    .bottom-nav button.active { color: var(--gold-ink); }
    .bottom-nav button.active::before { content: ""; position: absolute; top: -6px; left: 30%; right: 30%; height: 2px; background: var(--gold); }
    #toasts { left: 14px; right: 14px; bottom: calc(var(--nav-h) + 14px + env(safe-area-inset-bottom)); align-items: stretch; }
    .modal-backdrop { padding: 0; align-items: flex-end; }
    .modal, .modal.wide { border-radius: var(--r) var(--r) 0 0; max-height: 92vh; overflow-y: auto; padding: 20px 16px calc(18px + env(safe-area-inset-bottom)); }
    .bulkbar { top: 70px; }
}
@media (max-width: 640px) {
    .kpis { grid-template-columns: repeat(2, 1fr); }
    .kpi { padding: 12px; gap: 10px; }
    .kpi-ic { width: 32px; height: 32px; }
    .kpi .v { font-size: 22px; }
    .pcard-head { padding: 18px 14px 0; }
    .pcard-title h3 { font-size: 20px; }
    .pcard-meta { padding: 10px 14px 0; }
    .pcard-metrics { grid-template-columns: repeat(2, 1fr); margin: 12px 14px 0; }
    .pcard-metrics > div:nth-child(3) { border-left: 0; }
    .pcard-metrics > div:nth-child(n+3) { border-top: 1px solid var(--line); }
    .pcard-queue { padding: 12px 14px 0; }
    .pcard-body { padding: 14px 14px 16px; }
    .pcard-actions .label { display: none; }
    .arow { padding: 12px; }
    .arow-grid { grid-template-columns: repeat(2, 1fr); }
    .mode-tag small { display: none; }
    .report-kpis { grid-template-columns: repeat(2, 1fr); }
    .top-actions .label { display: none; }
    .topbar .logo-mark { display: none; }
    .topbar { gap: 8px; }
    .top-actions { gap: 6px; }
    table.rtable thead { display: none; }
    table.rtable, table.rtable tbody, table.rtable tr, table.rtable td { display: block; width: 100%; }
    table.rtable tr { padding: 10px 12px; border-bottom: 1px solid var(--line); }
    table.rtable td { border: 0; padding: 3px 0; white-space: normal; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
    table.rtable td::before { content: attr(data-label); color: var(--faint); font-size: 12px; text-align: left; }
    table.rtable td.num { text-align: right; }
    table.rtable td[data-label=""]::before { content: none; }
    table.rtable td.cell-main { justify-content: flex-start; text-align: left; }
    .log .who { max-width: 90px; }
    .bar-col { display: none; }
}
