﻿/* ═══════════════════════════════════════════
   tablojs — Dashboard Gestion des Stocks
   Design System
═══════════════════════════════════════════ */

/* Inter — self-hosted (pas de CDN, pas de tracking) */
@import url('../vendors/fonts/inter/inter.css');

/* ── Tokens ─────────────────────────────── */
:root {
  --bg:        #0f1117;
  --bg2:       #181c27;
  --bg3:       #1e2336;
  --surface:   #252b3b;
  --surface2:  #2e3548;
  --border:    #323a52;
  --border2:   #404860;

  --text:      #e8eaf0;
  --text2:     #9ba3be;
  --text3:     #5e6880;

  --primary:   #4f80ff;
  --primary-d: #3a65e0;
  --primary-g: rgba(79,128,255,.12);

  --green:     #22c55e;
  --green-bg:  rgba(34,197,94,.12);
  --orange:    #f59e0b;
  --orange-bg: rgba(245,158,11,.12);
  --red:       #ef4444;
  --red-bg:    rgba(239,68,68,.12);
  --purple:    #a855f7;
  --purple-bg: rgba(168,85,247,.12);
  --teal:      #14b8a6;
  --teal-bg:   rgba(20,184,166,.12);

  --abc-a: #22c55e;
  --abc-b: #f59e0b;
  --abc-c: #64748b;
  --abc-t: #6366f1;

  --radius:  8px;
  --radius2: 12px;
  --radius3: 16px;
  --shadow:  0 4px 24px rgba(0,0,0,.4);
  --shadow2: 0 2px 8px rgba(0,0,0,.3);

  --header-h: 60px;
  --nav-w:    220px;
  --font:     'Inter', system-ui, sans-serif;
}

/* ── Reset ───────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select { font-family: inherit; }

/* ── Scrollbar ───────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* ── Layout ──────────────────────────────── */
.app-layout { display: flex; height: 100vh; overflow: hidden; }

/* ── Sidebar ─────────────────────────────── */
.sidebar {
  width: var(--nav-w);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 100;
}
.sidebar-logo {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
}
.logo-icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--primary), #7c5cfc);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.logo-text { font-weight: 700; font-size: 15px; letter-spacing: -.3px; }
.logo-sub { font-size: 10px; color: var(--text3); letter-spacing: .5px; text-transform: uppercase; }

.nav-section { padding: 16px 10px 4px; }
.nav-label { font-size: 10px; font-weight: 600; color: var(--text3); letter-spacing: 1px; text-transform: uppercase; padding: 0 8px 8px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all .15s;
  font-size: 13px;
  color: var(--text2);
  font-weight: 500;
  margin-bottom: 2px;
}
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item.active { background: var(--primary-g); color: var(--primary); }
.nav-item .icon { width: 18px; text-align: center; font-size: 15px; flex-shrink: 0; }
.nav-badge {
  margin-left: auto;
  background: var(--surface2);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 20px;
  color: var(--text3);
}
.nav-item.active .nav-badge { background: var(--primary-g); color: var(--primary); }

.sidebar-footer {
  margin-top: auto;
  padding: 12px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text3);
  text-align: center;
  line-height: 1.6;
}

/* ── Main Content ────────────────────────── */
.main-content {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* ── Top bar ─────────────────────────────── */
.topbar {
  height: var(--header-h);
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-title { font-size: 16px; font-weight: 700; flex: 1; }
.topbar-sub { font-size: 12px; color: var(--text3); margin-top: 1px; }

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  transition: all .15s;
  white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-d); }
.btn-ghost { background: var(--surface); color: var(--text2); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--surface2); color: var(--text); }
.btn-sm { padding: 5px 12px; font-size: 12px; }

.topbar-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 12px;
  width: 240px;
  transition: all .2s;
}
.topbar-search:focus-within { border-color: var(--primary); background: var(--surface2); }
.topbar-search input {
  background: none; border: none; outline: none;
  color: var(--text); font-size: 13px; width: 100%;
}
.topbar-search input::placeholder { color: var(--text3); }

/* ── Page content ────────────────────────── */
.page { display: none; padding: 24px; }
.page.active { display: block; animation: fadeIn .2s ease; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ── KPI Cards ───────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.kpi-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  transition: border-color .2s;
}
.kpi-card:hover { border-color: var(--border2); }
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: var(--radius2) var(--radius2) 0 0;
}
.kpi-card.blue::before { background: var(--primary); }
.kpi-card.green::before { background: var(--green); }
.kpi-card.orange::before { background: var(--orange); }
.kpi-card.purple::before { background: var(--purple); }
.kpi-card.teal::before { background: var(--teal); }

.kpi-label { font-size: 11px; font-weight: 600; color: var(--text3); letter-spacing: .5px; text-transform: uppercase; margin-bottom: 8px; }
.kpi-value { font-size: 26px; font-weight: 800; letter-spacing: -1px; line-height: 1; }
.kpi-value.blue { color: var(--primary); }
.kpi-value.green { color: var(--green); }
.kpi-value.orange { color: var(--orange); }
.kpi-value.purple { color: var(--purple); }
.kpi-value.teal { color: var(--teal); }
.kpi-sub { font-size: 11px; color: var(--text3); margin-top: 6px; }
.kpi-icon { position: absolute; top: 16px; right: 16px; font-size: 24px; opacity: .2; }

/* ── Section headers ─────────────────────── */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap; gap: 12px;
}
.section-title {
  font-size: 15px; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.section-title .icon { font-size: 17px; }
.section-controls { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Toggle pills ────────────────────────── */
.pill-group { display: flex; background: var(--surface); border-radius: var(--radius); padding: 3px; gap: 2px; }
.pill {
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px; font-weight: 500;
  color: var(--text3);
  cursor: pointer; transition: all .15s;
}
.pill.active { background: var(--bg2); color: var(--text); box-shadow: var(--shadow2); }

/* ── Chart containers ────────────────────── */
.chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}
.chart-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  padding: 20px;
}
.chart-card-full {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  padding: 20px;
  margin-bottom: 24px;
}
.chart-title { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.chart-sub { font-size: 11px; color: var(--text3); margin-bottom: 16px; }
.chart-wrap { position: relative; }

/* ── MAIN TABLE (style screenshot) ──────── */
.stock-table-wrap {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  overflow: hidden;
  margin-bottom: 24px;
}
.table-toolbar {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.table-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 12px;
  width: 280px;
}
.table-search:focus-within { border-color: var(--primary); }
.table-search input { background: none; border: none; outline: none; color: var(--text); font-size: 13px; width: 100%; }
.table-search input::placeholder { color: var(--text3); }

.filter-select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 10px;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  outline: none;
}
.filter-select:focus { border-color: var(--primary); }

.table-count { margin-left: auto; font-size: 12px; color: var(--text3); }

/* The scrollable table container */
.table-scroll { overflow-x: auto; overflow-y: auto; max-height: 65vh; }

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
table.data-table thead {
  position: sticky; top: 0; z-index: 10;
}
table.data-table thead tr { background: var(--surface); }
table.data-table th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text3);
  letter-spacing: .4px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
table.data-table th:hover { color: var(--text); }
table.data-table th.sorted { color: var(--primary); }
table.data-table th .sort-icon { margin-left: 4px; opacity: .5; }
table.data-table th.sorted .sort-icon { opacity: 1; }

table.data-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background .1s;
}
table.data-table tbody tr:hover { background: var(--surface); }
table.data-table tbody tr:last-child { border-bottom: none; }
table.data-table td { padding: 10px 14px; vertical-align: middle; }

/* Monthly cells — vue annuelle N + N-1 */
.month-col { text-align: right; min-width: 80px; }
.month-cell {
  display: flex; flex-direction: column; align-items: flex-end;
  gap: 1px; padding: 2px 0;
}
.month-amount {
  font-weight: 700;
  font-size: 11px;
  line-height: 1.2;
}
.month-amount.has-value { color: var(--text); }
.month-amount.zero { color: var(--text3); }
.month-bar-wrap { width: 52px; height: 3px; background: var(--surface2); border-radius: 2px; }
.month-bar { height: 100%; border-radius: 2px; background: var(--primary); transition: width .3s; }

/* ABC badge */
.abc-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  border-radius: 6px;
  font-size: 11px; font-weight: 700;
  flex-shrink: 0;
}
.abc-badge.A { background: var(--green-bg); color: var(--green); }
.abc-badge.B { background: var(--orange-bg); color: var(--orange); }
.abc-badge.C { background: var(--surface2); color: var(--text3); }
.abc-badge.T { background: var(--purple-bg); color: var(--purple); }

/* Stock indicator */
.stock-indicator {
  display: flex; align-items: center; gap: 6px;
  font-weight: 600;
}
.stock-dot {
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0;
}
.stock-dot.ok     { background: var(--green); box-shadow: 0 0 6px var(--green); }
.stock-dot.warn   { background: var(--orange); box-shadow: 0 0 6px var(--orange); }
.stock-dot.excess { background: var(--primary); }
.stock-dot.none   { background: var(--text3); }

/* Mois de stock chip */
.mois-chip {
  display: inline-flex; align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px; font-weight: 600;
}
.mois-chip.ok     { background: var(--green-bg);  color: var(--green); }
.mois-chip.warn   { background: var(--orange-bg); color: var(--orange); }
.mois-chip.excess { background: var(--primary-g); color: var(--primary); }
.mois-chip.none   { background: var(--surface2);  color: var(--text3); }

/* Wilson chip */
.wilson-cell { font-size: 11.5px; }
.wilson-q { font-weight: 600; color: var(--teal); }
.wilson-d { color: var(--text3); font-size: 11px; }

/* Ref cell */
.ref-cell { display: flex; flex-direction: column; gap: 2px; }
.ref-code { font-weight: 600; font-family: monospace; font-size: 12px; color: var(--primary); }
.ref-des  { color: var(--text2); font-size: 11.5px; max-width: 240px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Montant cells */
.amount-cell { font-weight: 600; text-align: right; white-space: nowrap; }
.amount-vente { color: var(--green); }
.amount-achat { color: var(--orange); }
.amount-zero  { color: var(--text3); }

/* ── ABC Donut Page ──────────────────────── */
.abc-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 16px;
  margin-bottom: 24px;
}
.abc-legend { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.abc-legend-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border-radius: var(--radius);
  border-left: 3px solid;
}
.abc-legend-item.A { border-color: var(--abc-a); }
.abc-legend-item.B { border-color: var(--abc-b); }
.abc-legend-item.C { border-color: var(--abc-c); }
.abc-legend-label { font-weight: 700; font-size: 15px; width: 20px; }
.abc-legend-desc  { flex: 1; }
.abc-legend-title { font-size: 12px; font-weight: 600; }
.abc-legend-val   { font-size: 11px; color: var(--text3); }
.abc-legend-pct   { font-size: 20px; font-weight: 800; }

/* ── Wilson Page ─────────────────────────── */
.wilson-params {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.param-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  padding: 16px 20px;
}
.param-label { font-size: 11px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 10px; }
.param-input-wrap { display: flex; align-items: center; gap: 8px; }
.param-input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  width: 100%;
  outline: none;
}
.param-input:focus { border-color: var(--primary); }
.param-unit { color: var(--text3); font-size: 12px; white-space: nowrap; }
.param-desc { font-size: 11px; color: var(--text3); margin-top: 6px; }

/* ── Trend chart ─────────────────────────── */
.trend-legend {
  display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 12px;
}
.trend-legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text2); }
.trend-legend-dot  { width: 10px; height: 3px; border-radius: 2px; }

/* ── Pareto chart layout ──────────────────── */
.pareto-wrap { position: relative; }
.pareto-wrap canvas { max-height: 340px; }

/* ── Tags / chips ────────────────────────── */
.tag {
  display: inline-flex; align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px; font-weight: 500;
}
.tag-transport { background: var(--purple-bg); color: var(--purple); }
.tag-produit   { background: var(--green-bg);  color: var(--green); }

/* ── Rank number ─────────────────────────── */
.rank {
  width: 26px; height: 26px;
  border-radius: 8px;
  background: var(--surface2);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  color: var(--text3);
  flex-shrink: 0;
}
.rank.top3 { background: var(--primary-g); color: var(--primary); }

/* ── Empty state ─────────────────────────── */
.empty-state {
  padding: 60px 0;
  text-align: center;
  color: var(--text3);
}
.empty-state .icon { font-size: 40px; margin-bottom: 12px; opacity: .4; }
.empty-state p { font-size: 14px; }

/* ── Loading ─────────────────────────────── */
.loading-overlay {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  z-index: 9999;
  gap: 16px;
}
.loading-spinner {
  width: 48px; height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: 14px; color: var(--text3); }

/* ── Responsive ──────────────────────────── */
@media (max-width: 1200px) {
  .chart-grid { grid-template-columns: 1fr; }
  .abc-grid   { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  :root { --nav-w: 0px; }
  .sidebar { display: none; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Tooltip ─────────────────────────────── */
[title] { cursor: default; }

/* ── Number formatting helper ────────────── */
.num-positive { color: var(--green); }
.num-negative { color: var(--red); }
.num-neutral  { color: var(--text2); }

/* highlight current month column */
th.current-month, td.current-month { background: rgba(79,128,255,.05); }
th.current-month { color: var(--primary) !important; }

/* ═══════════════════════════════════════════
   PAGE : Taux de Rotation des Stocks
═══════════════════════════════════════════ */

/* Formule */
.formula-block {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--surface); border-radius: var(--radius);
  padding: 16px 20px; font-size: 13px;
  border: 1px solid var(--border);
}
.formula-row {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
}
.formula-label {
  font-weight: 700; color: var(--text); width: 160px; flex-shrink: 0;
}
.formula-eq {
  color: var(--primary); font-family: monospace; font-size: 13px; font-weight: 600;
}
.formula-note {
  color: var(--text3); font-size: 11px; font-style: italic;
}

/* Légende interprétation */
.rot-legend-item {
  padding: 8px 14px; border-radius: var(--radius);
  font-size: 12px; font-weight: 500; border-left: 3px solid;
}
.rot-fast     { background: rgba(239,68,68,.10);  border-color: var(--red);    color: #fca5a5; }
.rot-normal   { background: var(--green-bg);       border-color: var(--green);  color: #86efac; }
.rot-slow     { background: var(--orange-bg);      border-color: var(--orange); color: #fcd34d; }
.rot-immobile { background: rgba(99,102,241,.12);  border-color: #6366f1;       color: #a5b4fc; }

/* Badges de vitesse dans le tableau */
.tr-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 20px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.tr-badge.fast     { background: rgba(239,68,68,.15);  color: #f87171; }
.tr-badge.normal   { background: var(--green-bg);       color: var(--green); }
.tr-badge.slow     { background: var(--orange-bg);      color: var(--orange); }
.tr-badge.immobile { background: rgba(99,102,241,.15);  color: #818cf8; }

/* Cellule TR valeur */
.tr-value {
  font-size: 15px; font-weight: 800; letter-spacing: -0.5px;
}
.tr-value.fast     { color: #f87171; }
.tr-value.normal   { color: var(--green); }
.tr-value.slow     { color: var(--orange); }
.tr-value.immobile { color: #818cf8; }

/* Cellule par année */
.rot-year-cell {
  text-align: right; min-width: 80px;
}
.rot-year-val {
  font-weight: 700; font-size: 12.5px;
}
.rot-year-duree {
  font-size: 10px; color: var(--text3);
}

/* ═══════════════════════════════════════════
   PAGE : Propositions d'Achats (Appro)
═══════════════════════════════════════════ */

/* Badge méthode */
.methode-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 700; white-space: nowrap;
  letter-spacing: .3px;
}
.methode-sm   { background: rgba(239,68,68,.15);  color: #f87171; border: 1px solid rgba(239,68,68,.3); }
.methode-per  { background: rgba(79,128,255,.15); color: #93c5fd; border: 1px solid rgba(79,128,255,.3); }
.methode-amp  { background: rgba(168,85,247,.15); color: #c4b5fd; border: 1px solid rgba(168,85,247,.3); }

/* Badge urgence */
.urg-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 700;
}
.urg-critique { background: rgba(239,68,68,.2);  color: #f87171;  animation: pulse-red 1.8s infinite; }
.urg-haute    { background: rgba(245,158,11,.2); color: #fbbf24; }
.urg-normale  { background: rgba(34,197,94,.15); color: #86efac; }

@keyframes pulse-red {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,.4); }
  50%       { box-shadow: 0 0 0 5px rgba(239,68,68,0); }
}

/* Panel de configuration méthodes */
.appro-config {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius2); margin-bottom: 24px; overflow: hidden;
}
.appro-config-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; cursor: pointer;
  border-bottom: 1px solid transparent;
  transition: background .15s;
}
.appro-config-header:hover { background: var(--surface); }
.appro-config-header.open  { border-bottom-color: var(--border); }
.appro-config-title { font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.appro-config-body  { padding: 16px 20px; display: none; }
.appro-config-body.open { display: block; }

.config-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.config-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
}
.config-card-title {
  font-size: 12px; font-weight: 700; margin-bottom: 8px;
  display: flex; align-items: center; gap: 6px;
}
.config-label { font-size: 11px; color: var(--text3); margin-bottom: 4px; }
.config-select {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 6px 10px;
  color: var(--text); font-size: 12px; width: 100%;
  outline: none; cursor: pointer;
}
.config-select:focus { border-color: var(--primary); }

/* Stock mini-bar dans tableau appro */
.stock-mini {
  display: flex; flex-direction: column; gap: 3px; min-width: 100px;
}
.stock-mini-bar {
  height: 4px; border-radius: 2px; background: var(--surface2);
  position: relative; overflow: hidden;
}
.stock-mini-bar-fill {
  height: 100%; border-radius: 2px; transition: width .4s;
}
.stock-mini-bar-alert {
  position: absolute; top: 0; height: 100%; width: 2px;
  background: var(--red); opacity: .7;
}
.stock-mini-nums {
  display: flex; justify-content: space-between;
  font-size: 10px; color: var(--text3);
}

/* Qté commander cell */
.qte-cell {
  text-align: right; white-space: nowrap;
}
.qte-value {
  font-size: 15px; font-weight: 800; color: var(--text);
}
.qte-valeur {
  font-size: 10px; color: var(--text3); margin-top: 2px;
}

/* Motif cell */
.motif-cell {
  font-size: 11px; color: var(--text2); max-width: 220px;
  line-height: 1.5;
}

/* KPI appro */
.kpi-card.red::before { background: var(--red); }
.kpi-value.red        { color: var(--red); }

/* ══════════════════════════════════════════
   CONSOLE DE DÉBOGAGE — panneau terminal
══════════════════════════════════════════ */
.dev-console {
  position: fixed;
  bottom: 0; right: 24px;
  width: 520px;
  background: #0d0f1a;
  border: 1px solid #2a2f45;
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  font-family: 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  font-size: 12px;
  z-index: 9999;
  box-shadow: 0 -4px 32px rgba(0,0,0,.6);
  transition: height .25s ease;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 240px;
}
.dev-console.collapsed { height: 36px; }
.dev-console-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px; height: 36px;
  background: #12152a; border-bottom: 1px solid #2a2f45;
  cursor: pointer; flex-shrink: 0; user-select: none;
}
.dev-console-title {
  display: flex; align-items: center; gap: 8px;
  color: #a0aec0; font-size: 11px; font-weight: 700; letter-spacing: .08em;
}
.dev-console-caret { color: #4fd1c5; font-weight: 900; font-size: 13px; }
.console-unread {
  background: #e53e3e; color: #fff; border-radius: 10px;
  font-size: 9px; font-weight: 800; padding: 1px 6px;
}
.dev-console-actions { display: flex; align-items: center; gap: 6px; }
.dev-console-actions button {
  background: none; border: none; color: #718096; font-size: 11px;
  cursor: pointer; padding: 2px 4px; border-radius: 4px;
  font-family: inherit; transition: color .15s;
}
.dev-console-actions button:hover { color: #e2e8f0; }
.dev-console-sep { color: #2d3748; font-size: 11px; }
.dev-console-body {
  flex: 1; overflow-y: auto; padding: 8px 0 4px;
  scrollbar-width: thin; scrollbar-color: #2a2f45 transparent;
}
.dev-console-body::-webkit-scrollbar { width: 4px; }
.dev-console-body::-webkit-scrollbar-thumb { background: #2a2f45; border-radius: 2px; }
.con-line {
  display: flex; align-items: baseline; padding: 1px 14px; line-height: 1.75;
  transition: background .1s;
}
.con-line:hover { background: rgba(255,255,255,.03); }
.con-ts { color: #4a5568; flex-shrink: 0; margin-right: 8px; font-size: 10px; }
.con-prefix { color: #4fd1c5; flex-shrink: 0; margin-right: 6px; font-size: 11px; }
.con-msg { flex: 1; word-break: break-all; font-size: 11px; }
.con-info    .con-msg { color: #a0aec0; }
.con-success .con-msg { color: #68d391; }
.con-warn    .con-msg { color: #f6ad55; }
.con-error   .con-msg { color: #fc8181; }
.con-api     .con-msg { color: #76e4f7; }
.con-search  .con-msg { color: #b794f4; }
.con-data    .con-msg { color: #f6e05e; }
.con-nav     .con-msg { color: #63b3ed; }
.con-divider { border-top: 1px solid #1a2035; margin: 4px 14px; }
