/* ==========================================================================
 * TARMAC UI — Design System v1.0
 * Extrait du Hi-Fi Claude Design (2026-05-28).
 *
 * Usage :
 *   <link rel="stylesheet" href="{{ url_for('static', filename='tarmac-ui.css') }}">
 *   <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap" rel="stylesheet">
 *
 * Theming :
 *   <html data-theme="violet|indigo|forest|slate" data-density="compact|regular|cozy">
 *
 * Composants exportés :
 *   - .shell, .sidebar, .nav, .brand
 *   - .card, .card-head, .card-title
 *   - .hero, .hero-num, .hero-cta
 *   - .kpi-grid, .kpi
 *   - .pill, .chip, .ecart-badge, .type-badge, .rank-star, .rank-num
 *   - .tbl-wrap, table.tbl
 *   - .filter-group, .chips, .range-input
 *   - .btn-primary, .btn-ghost, .btn-secondary
 *   - utilities : .mono, .text-muted, .text-good, .text-bad
 * ========================================================================== */

/* ───────── TOKENS ───────── */
:root {
  /* Brand violet */
  --brand: #6e4dff;
  --brand-2: #8a7af0;
  --brand-50: #6e4dff0d;
  --brand-100: #6e4dff1a;
  --brand-200: #6e4dff33;
  --brand-deep: #4a2fd6;

  /* Surfaces */
  --bg: #f6ede0;
  --bg-2: #f1e6d3;
  --card: #ffffff;
  --card-2: #fbf6ec;
  --line: #ebe2cd;
  --line-soft: #f0e8d6;

  /* Ink */
  --ink: #1c1a16;
  --ink-2: #4a463d;
  --ink-3: #8a8270;
  --ink-4: #b8b0a0;

  /* Semantic */
  --good: #0ea968;
  --good-bg: #0ea96812;
  --bad:  #d83a4a;
  --bad-bg: #d83a4a12;
  --warn: #e89232;
  --warn-bg: #e8923214;

  /* Chart palette */
  --c1: var(--brand);
  --c2: #d83a4a;
  --c3: #0ea968;
  --c4: #e89232;
  --c5: #0ea5a5;
  --c6: #8b5cf6;

  /* Geometry */
  --r: 12px;
  --r-sm: 8px;
  --pad: 22px;
  --pad-sm: 14px;
}

[data-theme="indigo"] { --brand: #4f46e5; --brand-deep: #3b32c4; --brand-2: #7b73f0; --brand-50: #4f46e50d; --brand-100: #4f46e51a; --brand-200: #4f46e533; --c1: #4f46e5; }
[data-theme="forest"] { --brand: #1f8a5b; --brand-deep: #156b46; --brand-2: #4dac82; --brand-50: #1f8a5b0d; --brand-100: #1f8a5b1a; --brand-200: #1f8a5b33; --c1: #1f8a5b; }
[data-theme="slate"]  { --brand: #334155; --brand-deep: #1e293b; --brand-2: #64748b; --brand-50: #3341550d; --brand-100: #3341551a; --brand-200: #33415533; --c1: #334155; }

[data-density="compact"] { --pad: 16px; --pad-sm: 10px; --r: 10px; }
[data-density="cozy"]    { --pad: 28px; --pad-sm: 18px; --r: 14px; }

/* ───────── RESET / BASE ───────── */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font: 400 14px/1.45 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(ellipse 800px 400px at 80% -10%, #fbe2cf, transparent 70%),
    radial-gradient(ellipse 600px 300px at 10% -5%, #f3dec0, transparent 70%),
    var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-deep); text-decoration: none; }
a:hover { color: var(--brand); }

h1, h2, h3, h4, h5 { margin: 0; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); }
h1 { font-size: 32px; letter-spacing: -0.02em; }
h2 { font-size: 24px; }
h3 { font-size: 18px; }
h4 { font-size: 16px; }
p { margin: 0 0 12px; line-height: 1.55; color: var(--ink-2); }

button { font: inherit; cursor: pointer; }
input, textarea, select {
  font: inherit; color: var(--ink);
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--r-sm);
  padding: 9px 12px;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-100);
}

/* ───────── UTILITIES ───────── */
.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-variant-numeric: tabular-nums; }
.text-muted { color: var(--ink-3); }
.text-good { color: var(--good); }
.text-bad { color: var(--bad); }
.text-warn { color: var(--warn); }
.text-brand { color: var(--brand-deep); }
.hidden { display: none !important; }

/* ───────── LAYOUT SHELL ───────── */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.main { padding: 28px 36px 60px; max-width: 1480px; }

/* ───────── SIDEBAR ───────── */
.sidebar {
  background: rgba(255,255,255,0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-right: 1px solid var(--line);
  padding: 22px 14px 18px;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px 18px; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  display: grid; place-items: center; color: white;
  box-shadow: 0 4px 12px var(--brand-200);
}
.brand-mark svg { display: block; }
.brand-name { font: 800 19px/1 'Inter', sans-serif; letter-spacing: -0.02em; color: var(--ink); }

.role-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; margin: 0 4px 16px;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  color: white; font: 700 11px 'Inter'; letter-spacing: 0.1em; text-transform: uppercase;
  border-radius: 999px;
  box-shadow: 0 4px 10px var(--brand-200);
}
.role-badge::before { content: ''; width: 6px; height: 6px; background: white; border-radius: 50%; opacity: 0.9; }

.nav-group { font: 600 10px 'Inter'; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); padding: 14px 12px 6px; }
.nav { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; }
.nav a, .nav .nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px;
  color: var(--ink-2); text-decoration: none;
  font: 500 14px 'Inter';
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
}
.nav a:hover, .nav .nav-item:hover { background: rgba(0,0,0,0.04); color: var(--ink); }
.nav a.active, .nav .nav-item.active { background: linear-gradient(135deg, var(--brand), var(--brand-deep)); color: white; box-shadow: 0 4px 10px var(--brand-200); }
.nav a.active svg, .nav .nav-item.active svg { color: white; }
.nav svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--ink-3); }
.nav a.active svg, .nav .nav-item.active svg { color: white; }
.nav .badge {
  margin-left: auto;
  background: var(--brand-100); color: var(--brand-deep);
  padding: 2px 8px; border-radius: 999px;
  font: 700 11px 'Inter';
}
.nav a.active .badge, .nav .nav-item.active .badge { background: rgba(255,255,255,0.25); color: white; }

.sidebar-footer { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.user-tile { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 8px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--brand-2), var(--brand)); color: white; display: grid; place-items: center; font: 700 13px 'Inter'; }
.user-tile .name { font: 600 14px 'Inter'; color: var(--ink); }
.user-tile .sub { font: 500 11px 'Inter'; color: var(--ink-3); }
.logout { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: var(--ink-3); font: 500 13px 'Inter'; cursor: pointer; transition: background 0.15s, color 0.15s; }
.logout:hover { color: var(--ink); background: rgba(0,0,0,0.04); }

/* ───────── PAGEBAR / BREADCRUMB ───────── */
.pagebar { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.crumb { color: var(--ink-3); font: 500 12px 'Inter'; letter-spacing: 0.04em; text-transform: uppercase; }
.crumb strong { color: var(--ink); font-weight: 600; }
.pagebar .spacer { flex: 1; }

/* ───────── PILLS ───────── */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font: 500 12px 'Inter'; border: 1px solid transparent; }
.pill-soft { background: var(--card); border-color: var(--line); color: var(--ink-2); }
.pill-brand { background: var(--brand-50); color: var(--brand-deep); border-color: var(--brand-200); }
.pill-good { background: var(--good-bg); color: var(--good); }
.pill-bad { background: var(--bad-bg); color: var(--bad); }
.pill-dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--good); }

/* ───────── CARDS ───────── */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: var(--pad);
  box-shadow: 0 1px 0 rgba(28,26,22,0.02), 0 6px 20px -10px rgba(28,26,22,0.08);
}
.card.tint { background: linear-gradient(180deg, var(--card-2), var(--card)); }
.card.flush { padding: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 12px; }
.card-title { font: 600 11px 'Inter'; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }
.card-title .pip { display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: var(--c1); margin-right: 8px; vertical-align: 1px; }

/* Size toggle */
.size-toggle { display: inline-flex; padding: 3px; background: var(--bg-2); border-radius: 8px; gap: 2px; }
.size-toggle button { border: none; background: transparent; padding: 5px 11px; border-radius: 6px; font: 600 11px 'Inter'; color: var(--ink-3); cursor: pointer; transition: all 0.15s; }
.size-toggle button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,0.06); }

/* ───────── HERO ───────── */
.hero {
  background:
    radial-gradient(circle at 90% 20%, var(--brand-100), transparent 60%),
    linear-gradient(180deg, #fffaf0, #ffffff);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 32px 36px;
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
}
.hero-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 36px; align-items: center; }
.hero-eyebrow { font: 600 11px 'Inter'; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-3); }
.hero-num {
  font: 800 88px/0.95 'Inter', system-ui;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin: 8px 0 6px;
  font-variant-numeric: tabular-nums;
}
.hero-meta { color: var(--ink-2); font-size: 14px; }
.hero-meta strong { color: var(--ink); font-weight: 600; }
.hero-chips { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.hero-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 6px;
  background: var(--brand-50); color: var(--brand-deep);
  font: 600 11px 'Inter'; letter-spacing: 0.04em;
  border: 1px solid var(--brand-200);
}

/* ───────── BUTTONS ───────── */
.btn-primary, .hero-cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 22px;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  color: white; border: none;
  border-radius: 12px;
  font: 600 15px 'Inter'; letter-spacing: 0.01em;
  box-shadow: 0 10px 30px -10px var(--brand);
  transition: transform 0.12s, box-shadow 0.12s, filter 0.12s;
  cursor: pointer;
  text-decoration: none;
}
.btn-primary:hover, .hero-cta:hover { transform: translateY(-1px); box-shadow: 0 14px 36px -10px var(--brand); color: white; }
.btn-primary:active, .hero-cta:active { transform: translateY(0); }

.hero-cta { width: 100%; padding: 16px 24px; }

.btn-ghost, .hero-secondary .btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 14px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: 500 13px 'Inter'; color: var(--ink-2);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  text-decoration: none;
}
.btn-ghost:hover { border-color: var(--brand); color: var(--brand-deep); }

.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  font: 600 13px 'Inter'; color: var(--ink);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  text-decoration: none;
}
.btn-secondary:hover { background: var(--card); border-color: var(--brand-200); color: var(--ink); }

.btn-danger {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px;
  background: var(--bad);
  color: white;
  border: none;
  border-radius: 10px;
  font: 600 13px 'Inter';
  cursor: pointer;
  transition: filter 0.15s;
}
.btn-danger:hover { filter: brightness(1.05); color: white; }

.btn-xs { padding: 5px 11px; font-size: 11px; border-radius: 6px; }
.btn-sm { padding: 7px 14px; font-size: 12px; border-radius: 8px; }

.hero-secondary { display: flex; gap: 10px; margin-top: 10px; }
.hero-secondary .btn-ghost { flex: 1; }

/* ───────── POSITION BAR / SCALE ───────── */
.position-bar { margin-top: 24px; padding-top: 22px; border-top: 1px dashed var(--line); }
.position-bar-label { display: flex; justify-content: space-between; font: 600 10px 'Inter'; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 10px; }
.scale {
  position: relative; height: 8px;
  background: linear-gradient(90deg, var(--good) 0%, #c5b500 50%, var(--bad) 100%);
  border-radius: 4px;
}
.scale .tick { position: absolute; top: -4px; width: 1px; height: 16px; background: var(--ink-3); opacity: 0.4; }
.scale .here { position: absolute; top: -8px; width: 24px; height: 24px; border: 3px solid var(--card); background: var(--brand); border-radius: 50%; transform: translateX(-50%); box-shadow: 0 4px 12px var(--brand-200); }
.scale-labels { display: flex; justify-content: space-between; margin-top: 26px; font: 500 11px 'Inter'; color: var(--ink-3); }
.scale-labels span strong { display: block; color: var(--ink); font-weight: 600; font-family: 'JetBrains Mono'; font-size: 12px; }

/* ───────── KPI GRID ───────── */
.kpi-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 22px; }
.kpi-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.kpi-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.kpi-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.kpi {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
}
.kpi-label { font: 600 10px 'Inter'; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }
.kpi-value { font: 700 26px/1 'Inter'; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi-unit { font-size: 16px; color: var(--ink-3); margin-left: 2px; font-weight: 500; }
.kpi-trend { display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; font: 600 11px 'Inter'; }
.kpi-trend.up { color: var(--good); }
.kpi-trend.down { color: var(--bad); }
.kpi.brand .kpi-value { color: var(--brand); }
.kpi.bad .kpi-value { color: var(--bad); }
.kpi.good .kpi-value { color: var(--good); }
.kpi.muted .kpi-value { color: var(--ink-2); }
.kpi-accent { position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--ink-3); opacity: 0.6; }
.kpi.brand .kpi-accent { background: var(--brand); }
.kpi.bad .kpi-accent   { background: var(--bad); }
.kpi.good .kpi-accent  { background: var(--good); }

/* ───────── RANGE CARD (recommandation prix) ───────── */
.range-card {
  background: linear-gradient(135deg, #fcfaf5, #fff);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 24px 26px;
}
.range-num { display: flex; align-items: baseline; gap: 12px; margin: 10px 0 6px; }
.range-num .from { font: 700 36px 'Inter'; color: var(--ink); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.range-num .to   { font: 700 36px 'Inter'; color: var(--brand); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.range-num .arrow { color: var(--ink-3); font-size: 22px; }
.range-meta { color: var(--ink-3); font-size: 13px; }
.range-bands { margin-top: 18px; display: flex; gap: 6px; height: 36px; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); }
.range-bands .band { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 0 4px; font: 600 10px 'Inter'; letter-spacing: 0.1em; color: white; text-transform: uppercase; }
.range-bands .band.lo { background: var(--good); flex: 1; }
.range-bands .band.mid { background: var(--brand); flex: 1.8; }
.range-bands .band.hi { background: var(--ink-3); flex: 1; }
.range-bands .band span { opacity: 0.85; font-size: 9px; }

/* ───────── FILTERS / CHIPS ───────── */
.filters-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 12px; flex-wrap: wrap; }
.filters-head .title { display: flex; align-items: center; gap: 10px; font: 600 14px 'Inter'; color: var(--ink); }
.filters-head .title svg { color: var(--brand); }
.filters-head .reset { font: 600 12px 'Inter'; color: var(--ink-3); background: none; border: none; padding: 4px 8px; border-radius: 6px; cursor: pointer; }
.filters-head .reset:hover { color: var(--brand); background: var(--brand-50); }
.filter-group { margin-bottom: 14px; }
.filter-group:last-child { margin-bottom: 0; }
.filter-label { font: 600 10px 'Inter'; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 11px; border-radius: 999px;
  background: var(--card-2); border: 1px solid var(--line);
  font: 500 12px 'Inter'; color: var(--ink-2);
  cursor: pointer; transition: all 0.12s;
}
.chip:hover { border-color: var(--brand); color: var(--brand-deep); }
.chip.on { background: var(--brand); color: white; border-color: var(--brand); }
.chip .count { color: var(--ink-3); font-size: 11px; }
.chip.on .count { color: rgba(255,255,255,0.75); }
.filter-rows { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.range-input { display: flex; align-items: center; gap: 6px; }
.range-input input {
  flex: 1; padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px;
  font: 500 12px 'JetBrains Mono'; color: var(--ink); background: var(--card);
}
.range-input input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); }
.range-input .sep { color: var(--ink-3); }

/* ───────── CHARTS ───────── */
.charts-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 22px; margin-bottom: 22px; }
.chart-card { padding: 22px 22px 18px; }
.chart-card.dense { padding: 20px; }
.chart-svg { width: 100%; display: block; overflow: visible; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; font: 500 12px 'Inter'; color: var(--ink-2); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-swatch { width: 10px; height: 10px; border-radius: 2px; }
.legend-dash { width: 16px; height: 2px; }

/* ───────── BOTTOM GRID (finitions + vendeurs) ───────── */
.bottom-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 22px; margin-bottom: 22px; }
.finition-row {
  display: grid; grid-template-columns: 90px 1fr 60px 90px; gap: 14px; align-items: center;
  padding: 10px 0; border-bottom: 1px dashed var(--line-soft);
}
.finition-row:last-child { border-bottom: none; }
.finition-name { font: 600 14px 'Inter'; color: var(--ink); }
.finition-bar { height: 8px; background: var(--bg-2); border-radius: 999px; overflow: hidden; position: relative; }
.finition-bar .fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); }
.finition-count { font: 600 13px 'JetBrains Mono'; color: var(--ink-2); text-align: right; }
.finition-price { font: 700 13px 'JetBrains Mono'; color: var(--bad); text-align: right; }

.vendors-split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.vendor-tile { padding: 16px; border-radius: var(--r-sm); border: 1px solid var(--line); }
.vendor-tile.pro { background: var(--brand-50); border-color: var(--brand-200); }
.vendor-tile.part { background: var(--bg-2); }
.vendor-num { font: 700 32px 'Inter'; line-height: 1; }
.vendor-tile.pro .vendor-num { color: var(--brand-deep); }
.vendor-meta { font: 600 11px 'Inter'; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); margin-top: 6px; }
.dept-row { display: grid; grid-template-columns: 1fr 60px 50px; gap: 10px; align-items: center; padding: 8px 0; font: 500 13px 'Inter'; }
.dept-row + .dept-row { border-top: 1px solid var(--line-soft); }
.dept-row .name { color: var(--ink); }
.dept-row .count { color: var(--ink-2); text-align: right; font-family: 'JetBrains Mono'; }
.dept-row .pct { color: var(--ink-3); text-align: right; font-family: 'JetBrains Mono'; font-size: 12px; }

/* ───────── TABLES ───────── */
.tbl-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 12px; flex-wrap: wrap; }
.tbl-head h3 { margin: 0; font: 700 18px 'Inter'; letter-spacing: -0.01em; color: var(--ink); }
.tbl-head .sub { color: var(--ink-3); font-size: 13px; font-weight: 500; margin-left: 8px; }
.tbl-wrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
table.tbl { width: 100%; border-collapse: collapse; }
table.tbl th { text-align: left; font: 600 10px 'Inter'; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); padding: 14px 16px; border-bottom: 1px solid var(--line); background: var(--card-2); }
table.tbl td { padding: 14px 16px; border-bottom: 1px solid var(--line-soft); font: 500 13px 'Inter'; color: var(--ink); }
table.tbl tr:last-child td { border-bottom: none; }
table.tbl tr:hover td { background: var(--brand-50); }
table.tbl .num { font-family: 'JetBrains Mono'; font-variant-numeric: tabular-nums; }
.rank-star { display: inline-flex; align-items: center; justify-content: center; gap: 4px; width: 36px; height: 28px; border-radius: 6px; background: var(--good-bg); color: var(--good); font: 700 12px 'Inter'; }
.rank-num { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 28px; color: var(--ink-3); font: 600 12px 'JetBrains Mono'; }
.title-cell { line-height: 1.3; }
.title-cell .meta { color: var(--ink-3); font-size: 12px; margin-top: 2px; }
.price-cell { color: var(--brand-deep); font-weight: 700; }
.ecart-badge { display: inline-block; padding: 4px 9px; border-radius: 6px; background: var(--good-bg); color: var(--good); font: 700 12px 'JetBrains Mono'; }
.ecart-badge.neg { background: var(--bad-bg); color: var(--bad); }
.type-badge { display: inline-block; padding: 3px 8px; border-radius: 4px; background: var(--brand-100); color: var(--brand-deep); font: 700 11px 'Inter'; letter-spacing: 0.04em; }
.lbc-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; background: var(--card); border: 1px solid var(--brand-200); border-radius: 6px; color: var(--brand-deep); font: 600 12px 'Inter'; text-decoration: none; }
.lbc-btn:hover { background: var(--brand); color: white; border-color: var(--brand); }

/* ───────── LANDING / MARKETING (pages publiques) ───────── */
.landing-hero {
  padding: 80px 24px 60px;
  text-align: center;
  background: radial-gradient(circle at 50% 0%, var(--brand-100), transparent 60%);
}
.landing-hero h1 {
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 18px;
  background: linear-gradient(135deg, var(--ink), var(--brand-deep) 80%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.landing-hero p {
  font-size: 18px; color: var(--ink-2);
  max-width: 640px; margin: 0 auto 32px;
}

.section { padding: 60px 24px; max-width: 1200px; margin: 0 auto; }
.section-eyebrow { font: 600 11px 'Inter'; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-3); text-align: center; margin-bottom: 8px; }
.section-title { font-size: 32px; text-align: center; margin-bottom: 12px; }
.section-lead { text-align: center; max-width: 600px; margin: 0 auto 40px; color: var(--ink-2); font-size: 16px; }

.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 28px;
  transition: transform 0.15s, box-shadow 0.15s;
}
.feature-card:hover { transform: translateY(-2px); box-shadow: 0 10px 28px -10px rgba(28,26,22,0.12); }
.feature-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(135deg, var(--brand-50), var(--brand-100));
  color: var(--brand);
  display: grid; place-items: center; margin-bottom: 14px;
}
.feature-card h3 { margin-bottom: 8px; font-size: 18px; }
.feature-card p { color: var(--ink-2); font-size: 14px; line-height: 1.55; margin: 0; }

.cta-band {
  background: linear-gradient(135deg, var(--brand-deep), var(--brand));
  color: white;
  padding: 60px 24px;
  text-align: center;
  border-radius: 20px;
  margin: 60px auto;
  max-width: 1100px;
}
.cta-band h2 { color: white; font-size: 32px; margin-bottom: 12px; }
.cta-band p { color: rgba(255,255,255,0.85); margin-bottom: 24px; max-width: 500px; margin-left: auto; margin-right: auto; }
.cta-band .btn-primary { background: white; color: var(--brand-deep); box-shadow: 0 10px 30px -10px rgba(0,0,0,0.3); }
.cta-band .btn-primary:hover { color: var(--brand-deep); transform: translateY(-1px); }

/* ───────── FOOTER ───────── */
.footer {
  border-top: 1px solid var(--line);
  padding: 40px 24px 28px;
  background: rgba(255,255,255,0.4);
  margin-top: 60px;
}
.footer-grid { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 28px; }
.footer h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-3); margin-bottom: 12px; font-weight: 600; }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin-bottom: 6px; }
.footer a { color: var(--ink-2); font-size: 13px; }
.footer a:hover { color: var(--brand); }
.footer-bottom { max-width: 1100px; margin: 0 auto; padding-top: 20px; border-top: 1px solid var(--line); text-align: center; font-size: 12px; color: var(--ink-3); }

/* ───────── FORMS ───────── */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font: 600 11px 'Inter'; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%;
}
.form-help { font-size: 12px; color: var(--ink-3); margin-top: 4px; }

/* ───────── MODAL ───────── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(28, 26, 22, 0.5);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.modal {
  background: var(--card);
  border-radius: var(--r);
  padding: 28px;
  max-width: 520px;
  width: 100%;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.3);
}
.modal-title { font-size: 20px; margin-bottom: 8px; }
.modal-close {
  position: absolute; top: 16px; right: 16px;
  background: transparent; border: none; padding: 8px;
  color: var(--ink-3); cursor: pointer;
  border-radius: 6px;
}
.modal-close:hover { background: var(--bg-2); color: var(--ink); }

/* ───────── ALERTS / FLASH MESSAGES ───────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--r-sm);
  border-left: 3px solid;
  margin-bottom: 14px;
  font-size: 13px;
  display: flex; align-items: flex-start; gap: 10px;
}
.alert-info { background: var(--brand-50); border-color: var(--brand); color: var(--brand-deep); }
.alert-success { background: var(--good-bg); border-color: var(--good); color: var(--good); }
.alert-warn { background: var(--warn-bg); border-color: var(--warn); color: var(--warn); }
.alert-error { background: var(--bad-bg); border-color: var(--bad); color: var(--bad); }

/* ───────── RESPONSIVE ───────── */
@media (max-width: 1240px) {
  .hero-grid, .charts-grid, .bottom-grid, .features-grid { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 880px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .main { padding: 20px 18px 40px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero { padding: 22px 18px; }
  .hero-num { font-size: 60px; }
  .landing-hero { padding: 50px 18px 40px; }
}
