/* ============================================================
   FF Panels — thème sombre, polices système (aucune requête externe)
   ============================================================ */
:root {
    --bg: #080b10;
    --bg-2: #0b1016;
    --card: #0f151d;
    --card-2: #141c26;
    --card-3: #19222e;
    --line: #1c2632;
    --line-2: #283444;
    --text: #e8eef6;
    --muted: #8e9bad;
    --faint: #5e6b7e;
    --green: #34d399;
    --green-2: #10b981;
    --green-bg: rgba(52, 211, 153, .12);
    --amber: #fbbf24;
    --amber-bg: rgba(251, 191, 36, .12);
    --red: #f87171;
    --red-bg: rgba(248, 113, 113, .12);
    --blue: #60a5fa;
    --blue-bg: rgba(96, 165, 250, .12);
    --violet: #a78bfa;
    --violet-bg: rgba(167, 139, 250, .13);
    --cyan: #22d3ee;
    --r: 16px;
    --r-sm: 10px;
    --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, "Roboto Mono", monospace;
    --nav-h: 64px;
    color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.01em; }
.mono, .num { font-family: var(--mono); 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; }
.ic.lg { width: 20px; height: 20px; }
.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(4px); } to { opacity: 1; transform: none; } }

/* ---------- marque / chargement ---------- */
.logo-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; flex: none;
    background: linear-gradient(135deg, var(--green), var(--cyan)); color: #04130c; font-weight: 800; font-family: var(--mono); letter-spacing: -.04em; }
.logo-mark.sm { width: 32px; height: 32px; border-radius: 9px; font-size: 13px; }
.boot { position: fixed; inset: 0; display: grid; place-content: center; justify-items: center; gap: 18px; background: var(--bg); z-index: 200; }
.boot-bar { width: 140px; height: 3px; border-radius: 3px; background: var(--card-2); overflow: hidden; }
.boot-bar span { display: block; width: 40%; height: 100%; background: var(--green); animation: boot 1s ease-in-out infinite; }
@keyframes boot { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }

/* ---------- boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px;
    border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--card-2); cursor: pointer;
    font-weight: 550; white-space: nowrap; transition: background .15s, border-color .15s, color .15s, transform .05s; }
.btn:hover { background: var(--card-3); border-color: #34435a; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn.lg { height: 44px; font-size: 15px; }
.btn.icon { width: 36px; padding: 0; }
.btn.icon.sm { width: 30px; }
.btn.block { width: 100%; }
.btn.primary { background: var(--green); border-color: var(--green); color: #03140c; }
.btn.primary:hover { background: #4ade9f; border-color: #4ade9f; }
.btn.danger { background: var(--red-bg); border-color: rgba(248, 113, 113, .35); color: var(--red); }
.btn.danger:hover { background: rgba(248, 113, 113, .2); }
.btn.soft-green { background: var(--green-bg); border-color: rgba(52, 211, 153, .3); color: var(--green); }
.btn.amber { background: var(--amber-bg); border-color: rgba(251, 191, 36, .35); color: var(--amber); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--card-2); color: var(--text); }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- formulaires ---------- */
input, select, textarea { background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 0 12px; height: 38px; width: 100%; outline: none; transition: border-color .15s, box-shadow .15s; }
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(--green); box-shadow: 0 0 0 3px rgba(52, 211, 153, .15); }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--green); padding: 0; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 500; }
label.check { flex-direction: row; align-items: center; gap: 10px; color: var(--text); cursor: pointer; }
.hint { font-size: 12px; color: var(--faint); font-weight: 400; }
.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: var(--bg-2); }
.fieldset legend { padding: 0 6px; font-weight: 650; font-size: 13px; 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(1000px 500px at 50% -10%, rgba(52, 211, 153, .12), transparent 60%), var(--bg); }
.login-card { width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 28px;
    display: flex; flex-direction: column; gap: 16px; box-shadow: 0 30px 80px rgba(0, 0, 0, .45); }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.login-brand b { display: block; font-size: 18px; }
.login-brand span { color: var(--muted); font-size: 13px; }

/* ---------- structure ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px; padding: 18px 14px;
    background: var(--bg-2); border-right: 1px solid var(--line); }
.side-brand { display: flex; align-items: center; gap: 11px; padding: 4px 6px 18px; }
.side-brand b { display: block; font-size: 15px; }
.side-brand span { display: block; font-size: 11.5px; color: var(--faint); font-family: var(--mono); }
.side-nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item { display: flex; align-items: center; gap: 11px; height: 40px; padding: 0 12px; border-radius: var(--r-sm); border: 0;
    background: none; color: var(--muted); cursor: pointer; font-weight: 550; text-align: left; position: relative; }
.nav-item:hover { background: var(--card); color: var(--text); }
.nav-item.active { background: var(--card-2); color: var(--text); }
.nav-item.active::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--green); }
.nav-item .count { margin-left: auto; font-family: var(--mono); font-size: 11.5px; 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; }
.me:hover { background: var(--card); }
.me span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.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: 64px; padding: 12px 28px;
    background: rgba(8, 11, 16, .82); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.topbar h1 { font-size: 20px; font-weight: 700; 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: 24px 28px 40px; width: 100%; max-width: 1600px; }
.view { animation: fade-in .18s ease-out; }
.view > * + * { margin-top: 18px; }
.mobile-only { display: none !important; }
.t-short { display: none; }
.bottom-nav { display: none; }

.live { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.live i { width: 8px; height: 8px; 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: 38px; height: 38px; border-radius: 12px; flex: none;
    background: hsl(var(--h, 160) 45% 20%); color: hsl(var(--h, 160) 80% 75%); font-weight: 700; font-size: 13px; letter-spacing: -.02em; }
.avatar.sm { width: 30px; height: 30px; border-radius: 9px; font-size: 12px; }
.avatar .sdot { position: absolute; right: -3px; bottom: -3px; width: 12px; height: 12px; border-radius: 50%; border: 2.5px solid var(--card-2); background: var(--faint); }

/* ---------- cartes & petits éléments ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.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: 24px; padding: 0 9px; border-radius: 99px; font-size: 12px;
    font-weight: 600; white-space: nowrap; background: var(--card-3); color: var(--muted); }
.pill i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.green { background: var(--green-bg); color: var(--green); }
.pill.amber { background: var(--amber-bg); color: var(--amber); }
.pill.red { background: var(--red-bg); color: var(--red); }
.pill.blue { background: var(--blue-bg); color: var(--blue); }
.pill.violet { background: var(--violet-bg); color: var(--violet); }
.pill.live-dot i { animation: pulse 1.4s infinite; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 8px; font-size: 12.5px;
    background: var(--card-2); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.chip b { color: var(--text); font-weight: 600; font-family: var(--mono); }
.chip .ic { width: 14px; height: 14px; }

.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--card); border: 1px solid var(--line); border-radius: 11px; overflow-x: auto; max-width: 100%; }
.seg button { height: 30px; padding: 0 12px; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; font-weight: 550; white-space: nowrap; font-size: 13px; }
.seg button:hover { color: var(--text); }
.seg button.active { background: var(--card-3); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .3); }
.seg button .n { font-family: var(--mono); font-size: 11.5px; color: var(--faint); margin-left: 4px; }

/* ---------- KPI ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.kpi { display: flex; gap: 14px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.kpi-ic { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; flex: none; }
.kpi-ic .ic { width: 20px; height: 20px; }
.kpi-ic.green { background: var(--green-bg); color: var(--green); } .kpi-ic.blue { background: var(--blue-bg); color: var(--blue); }
.kpi-ic.violet { background: var(--violet-bg); color: var(--violet); } .kpi-ic.amber { background: var(--amber-bg); color: var(--amber); }
.kpi-ic.red { background: var(--red-bg); color: var(--red); } .kpi-ic.cyan { background: rgba(34, 211, 238, .12); color: var(--cyan); }
.kpi .v { font-family: var(--mono); font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.2; }
.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: 6px; border-radius: 99px; overflow: hidden; background: var(--card-3); gap: 2px; }
.qbar span { display: block; height: 100%; border-radius: 99px; }
.qlegend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 8px; }
.qlegend span { display: inline-flex; align-items: center; gap: 6px; }
.qlegend i { width: 8px; height: 8px; border-radius: 3px; }
.qlegend b { font-family: var(--mono); color: var(--text); font-weight: 600; }
.q-pending { background: #4b5767; } .q-active { background: var(--green); } .q-completed { background: var(--blue); }
.q-failed { background: var(--red); } .q-stopped { background: var(--amber); } .q-disabled { background: #333d4a; }

/* ---------- cartes de panel ---------- */
.panel-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.panel-toolbar input { max-width: 260px; }
.panel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); gap: 18px; align-items: start; }
.pcard { background: var(--card); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; position: relative; transition: border-color .2s; }
.pcard::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--line-2); }
.pcard.st-running { border-color: rgba(52, 211, 153, .28); }
.pcard.st-running::before { background: linear-gradient(90deg, var(--green), var(--cyan)); }
.pcard.st-finished::before { background: var(--blue); }
.pcard-head { display: flex; align-items: center; gap: 10px; padding: 18px 18px 0; }
.pcard-title { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.pcard-title h3 { font-size: 16.5px; 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 18px 0; }
.pcard-metrics { display: grid; grid-template-columns: repeat(4, 1fr); margin: 14px 18px 0; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); }
.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: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard-metrics b { font-family: var(--mono); font-size: 16px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pcard-metrics b span { color: var(--faint); font-weight: 500; }
.pcard-queue { padding: 14px 18px 0; }
.pcard-body { padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 10px; }
.pcard-next { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--faint); }
.pcard.collapsed .pcard-queue, .pcard.collapsed .pcard-body { display: none; }
.pcard-body:has(.acc-list:empty):has(.pc-empty:empty):has(.pc-next:empty) { display: none; }
.pcard.collapsed .pcard-metrics { margin-bottom: 18px; }
.pcard .collapse-ic { transition: transform .2s; }
.pcard.collapsed .collapse-ic { transform: rotate(-90deg); }
.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; color: var(--faint); padding: 24px 12px;
    border: 1px dashed var(--line-2); border-radius: 14px; font-size: 13px; }
.empty .ic { width: 22px; height: 22px; opacity: .7; }

/* ---------- compte actif ---------- */
.arow { background: var(--card-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px; transition: border-color .2s; }
.acc-list { display: flex; flex-direction: column; gap: 10px; }
.acc-list:empty, .pc-empty:empty, .pc-next:empty { display: none; }
.arow-top { display: flex; align-items: center; gap: 11px; }
.arow-id { min-width: 0; flex: 1; }
.arow-id b { display: block; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arow-sub { display: flex; align-items: center; flex-wrap: wrap; gap: 3px 8px; margin-top: 3px; min-width: 0; }
.arow-sub > span { font-family: var(--mono); font-size: 11.5px; 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: 8px; margin-top: 12px; }
.arow-grid > div { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; min-width: 0; }
.arow-grid small { display: block; font-size: 10.5px; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; }
.arow-grid b { font-family: var(--mono); font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.arow-grid .mcount b { font-size: 19px; }
.arow-grid .mcount b span { color: var(--faint); font-weight: 500; font-size: 14px; }
.pbar { height: 5px; border-radius: 99px; background: var(--bg-2); overflow: hidden; margin-top: 10px; }
.pbar span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--green-2), var(--green)); transition: width .6s ease; }
.pbar.small { height: 4px; margin-top: 6px; background: var(--card-3); }
.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; }
.icon-actions { display: flex; gap: 4px; margin-left: auto; }
.arow.st-STALLED, .arow.st-RECONNECTING { border-color: rgba(251, 191, 36, .3); }
.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: 10px; }
.prow { display: grid; grid-template-columns: auto minmax(180px, 1.3fr) minmax(0, 2fr) auto; gap: 16px; align-items: center;
    background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.prow-order { display: flex; flex-direction: column; gap: 2px; }
.prow-main b { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.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(--bg-2); overflow: hidden; }
.stepper button { width: 36px; height: 36px; border: 0; background: none; cursor: pointer; color: var(--muted); display: grid; place-items: center; }
.stepper button:hover { background: var(--card-2); color: var(--text); }
.stepper input { width: 56px; height: 36px; border: 0; border-radius: 0; text-align: center; background: transparent; font-family: var(--mono); 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: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
th { font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); font-weight: 600; background: var(--bg-2); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(255, 255, 255, .018); }
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; }
.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: 22px; padding: 0 7px; border-radius: 6px; border: 1px solid var(--line-2);
    background: var(--bg-2); font-family: var(--mono); font-size: 11.5px; font-weight: 500; color: var(--muted); cursor: pointer; white-space: nowrap;
    max-width: 100%; flex: none; transition: color .15s, border-color .15s, background .15s; }
.idchip small { font-family: var(--sans); font-size: 10px; font-weight: 700; color: var(--faint); letter-spacing: .03em; }
.idchip span { overflow: hidden; text-overflow: ellipsis; }
.idchip .ic { width: 12px; height: 12px; opacity: .6; }
.idchip:hover { color: var(--text); border-color: #3b4a5f; }
.idchip:hover .ic { opacity: 1; }
.idchip.copied { color: var(--green); border-color: rgba(52, 211, 153, .45); background: var(--green-bg); }
.idchip.empty-id { cursor: default; opacity: .6; }
.idchip.lg { height: 28px; font-size: 13px; padding: 0 9px; margin-top: 3px; }
.bar-col { width: 22%; min-width: 60px; }
/* espace (administrateur) / accès (client) */
.scopebar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; padding: 10px 14px;
    background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.scopebar select { width: auto; min-width: 220px; height: 34px; }
.banner { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 16px; border-radius: 14px;
    background: linear-gradient(135deg, rgba(52, 211, 153, .12), rgba(34, 211, 238, .06)); border: 1px solid rgba(52, 211, 153, .28); }
.banner > .ic { color: var(--green); }
.banner b { display: block; font-size: 15px; }
.banner span { color: var(--muted); font-size: 13px; }
.banner span b { display: inline; color: var(--text); font-family: var(--mono); font-size: 13px; }
.notice { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--amber-bg);
    border: 1px solid rgba(251, 191, 36, .35); 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); font-weight: 500; }
[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 rgba(52, 211, 153, .35);
    background: rgba(16, 40, 30, .92); border-radius: 14px; position: sticky; top: 76px; z-index: 5; backdrop-filter: blur(8px); }
.bulkbar select { width: auto; height: 30px; }

/* ---------- import ---------- */
.import-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 18px; align-items: start; }
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 8px; border: 1.5px dashed var(--line-2); border-radius: var(--r);
    padding: 22px; text-align: center; color: var(--muted); cursor: pointer; transition: all .15s; }
.dropzone:hover { border-color: #3b4a5f; color: var(--text); }
.dropzone.over { border-color: var(--green); background: var(--green-bg); color: var(--text); }
.dropzone .ic { width: 26px; height: 26px; color: var(--green); }
.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(--bg-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: #b8c4d4; }
.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: 12.5px; height: 62vh; overflow-y: auto; background: #06090d; border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px; }
.log-line { display: flex; gap: 10px; padding: 3px 0; border-bottom: 1px solid rgba(255, 255, 255, .025); }
.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: #b3c0d0; } .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(2, 4, 8, .7); backdrop-filter: blur(3px); z-index: 50; display: flex;
    justify-content: center; align-items: flex-start; padding: 6vh 16px; overflow-y: auto; animation: fade-in .15s; }
.modal { background: var(--card); border: 1px solid var(--line-2); border-radius: 20px; width: 100%; max-width: 760px; padding: 22px; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }
.modal.wide { max-width: 1120px; }
.modal-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.modal-head h2 { font-size: 18px; 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: 18px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { background: none; border: 0; height: 38px; padding: 0 12px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 550; }
.tabs button.active { color: var(--text); border-bottom-color: var(--green); }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.kv div { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; min-width: 0; }
.kv small { display: block; color: var(--faint); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.kv span { font-family: var(--mono); font-weight: 600; overflow-wrap: anywhere; }

/* ---------- toasts ---------- */
#toasts { position: fixed; right: 18px; bottom: 18px; 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-3); border: 1px solid var(--line-2); padding: 11px 14px; border-radius: 12px;
    max-width: 420px; pointer-events: auto; box-shadow: 0 12px 30px rgba(0, 0, 0, .45); animation: fade-in .2s; }
.toast .ic { color: var(--green); }
.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 { padding: 10px 16px; min-height: 56px; gap: 10px; }
    .topbar .logo-mark { display: grid; }
    .topbar h1 { font-size: 17px; }
    .t-long { display: none; }
    .t-short { display: inline; }
    main { padding: 16px 14px 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(11, 16, 22, .94); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); 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-size: 10.5px; font-weight: 600; cursor: pointer; border-radius: 12px; min-width: 0; }
    .bottom-nav button .ic { width: 21px; height: 21px; }
    .bottom-nav button.active { color: var(--green); background: var(--green-bg); }
    #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: 20px 20px 0 0; max-height: 92vh; overflow-y: auto; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
    .bulkbar { top: 66px; }
}
@media (max-width: 640px) {
    .kpis { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .kpi { padding: 12px; gap: 10px; }
    .kpi-ic { width: 34px; height: 34px; border-radius: 10px; }
    .kpi-ic .ic { width: 17px; height: 17px; }
    .kpi .v { font-size: 18px; }
    .pcard-head { padding: 16px 14px 0; }
    .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: 12px 14px 14px; }
    .pcard-actions .label { display: none; }
    .arow-grid { grid-template-columns: repeat(2, 1fr); }
    .report-kpis { grid-template-columns: repeat(2, 1fr); }
    .top-actions .label { display: none; }
    .topbar .logo-mark { display: none; }
    .topbar { gap: 8px; padding: 10px 12px; }
    .top-actions { gap: 6px; }
    /* tableau -> cartes */
    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; }
}
