/* Charte lyplee.fr — tokens repris de https://lyplee.fr/assets/site.css (Plus Jakarta Sans / Inter / JetBrains Mono,
   canvas clair, encre marine, dégradé de marque teal → emerald → royal → indigo réservé aux accents). */
:root {
  --canvas: #FCFCFD;
  --surface: #FFFFFF;
  --tint: #F7F8FB;
  --tint-2: #EFF1F7;
  --ink: #0E1330;
  --ink-2: #383F66;
  --ink-3: #545B82;
  --ink-4: #767D9F;
  --ink-5: #9AA0BC;
  --line: rgba(20, 30, 70, 0.08);
  --line-2: rgba(20, 30, 70, 0.14);
  --glass: rgba(255, 255, 255, 0.78);
  --teal: #15929E;    --teal-soft: #DCF2F4;
  --emerald: #19AF90; --emerald-soft: #D8F2EB;
  --royal: #2158C4;   --royal-soft: #DCE7FA;
  --indigo: #6F57DD;  --indigo-soft: #E6E1FB;
  --alert: #C8423B;   --alert-soft: #FBE4E2;
  --todo: #B8780E;    --todo-bg: #FBEFD3;
  --grad: linear-gradient(135deg, #15929E 0%, #19AF90 28%, #2158C4 70%, #6F57DD 100%);
  --grad-soft: linear-gradient(135deg, #DCF2F4 0%, #D8F2EB 50%, #E6E1FB 100%);
  --shadow-sm: 0 1px 2px rgba(20, 30, 70, 0.04), 0 1px 3px rgba(20, 30, 70, 0.04);
  --shadow-md: 0 8px 24px -8px rgba(33, 88, 196, 0.18), 0 2px 4px rgba(20, 30, 70, 0.04);
  --display: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-pill: 9999px;
  /* compatibilité avec l'ancien thème */
  --rule: var(--line-2);
  --accent: var(--royal);
  --sans: var(--body);
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body {
  margin: 0; background: var(--canvas); color: var(--ink);
  font-family: var(--body); font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3 { font-family: var(--display); color: var(--ink); margin: 0; letter-spacing: -0.02em; text-wrap: balance; }
h1 { font-weight: 800; font-size: clamp(32px, 4vw, 46px); line-height: 1.08; letter-spacing: -0.025em; }
h2 { font-weight: 700; font-size: 28px; line-height: 1.15; }
h3 { font-weight: 700; font-size: 18px; line-height: 1.3; margin-bottom: 12px; letter-spacing: -0.01em; }
p { color: var(--ink-2); margin: 0 0 12px; }
h1 em, h2 em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
a { color: var(--royal); text-decoration: none; cursor: pointer; transition: color 200ms var(--ease); }
a:hover { color: var(--indigo); }
:focus-visible { outline: 2px solid var(--royal); outline-offset: 3px; border-radius: 4px; }

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100vh; }
nav.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  border-right: 1px solid var(--line); padding: 22px 20px; background: var(--glass);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); margin-bottom: 4px; }
.brand img { width: 36px; height: 36px; border-radius: 10px; }
.brand span { font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: -0.01em; }
.brand-sub { margin: 2px 0 24px 46px; }
nav.side a.nav {
  display: block; padding: 9px 12px; margin-bottom: 4px; border-radius: var(--r-sm);
  font-family: var(--display); font-weight: 500; font-size: 14px; color: var(--ink-2);
}
nav.side a.nav:hover { color: var(--royal); background: var(--royal-soft); }
.nav-block { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
main { padding: 40px 56px 96px; max-width: 1320px; min-width: 0; }

.meta, label.meta {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-4);
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 14px;
  font-family: var(--display); font-size: 12px; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--teal); background: var(--teal-soft);
  padding: 6px 12px; border-radius: var(--r-pill);
}
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--teal); display: inline-block; }
.num {
  display: inline-grid; place-items: center; width: 40px; height: 40px; margin-right: 6px;
  border-radius: var(--r-md); background: var(--grad); color: #fff;
  font-family: var(--display); font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums;
}

section.block {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm); padding: 32px 36px 36px; margin-top: 28px;
}
section.block.tinted { background: var(--tint); }
.lede { font-size: 16px; color: var(--ink-3); max-width: 760px; margin-top: 10px; }

/* ---------- boutons & champs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--display); font-weight: 600; font-size: 14px; line-height: 1;
  padding: 12px 20px; border-radius: var(--r-pill); border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink); cursor: pointer;
  transition: all 200ms var(--ease);
}
.btn:hover { color: var(--royal); border-color: var(--royal); transform: translateY(-1px); }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 8px 24px -8px rgba(33, 88, 196, 0.3); }
.btn.primary:hover { color: #fff; box-shadow: var(--shadow-md); }
.btn.small { padding: 8px 14px; font-size: 13px; }
.btn:active { transform: translateY(0) scale(0.99); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
input[type=text], input[type=number], select {
  font-family: var(--body); font-size: 14px; padding: 9px 12px; border: 1px solid var(--line-2);
  border-radius: var(--r-sm); background: var(--surface); color: var(--ink); width: 100%;
  transition: border-color 200ms var(--ease);
}
input:focus, select:focus { outline: none; border-color: var(--royal); box-shadow: 0 0 0 3px var(--royal-soft); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.gap-s { gap: 8px; }
.stack > * + * { margin-top: 10px; }

.drop {
  border: 1.5px dashed var(--line-2); border-radius: var(--r-md); padding: 26px; text-align: center;
  color: var(--ink-3); background: var(--tint); cursor: pointer; transition: all 200ms var(--ease);
}
.drop:hover, .drop.over { border-color: var(--royal); background: var(--royal-soft); color: var(--royal); }

.report { margin-top: 14px; font-size: 13px; }
.report .err { color: var(--alert); }
.report .warn { color: var(--ink-2); }
.report li { margin-bottom: 2px; }
.report ul { padding-left: 18px; margin: 6px 0; max-height: 180px; overflow: auto; }

/* ---------- onglets (chips) ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 26px 0 14px; }
.tab {
  font-family: var(--display); font-size: 13px; font-weight: 500;
  padding: 7px 14px; cursor: pointer; color: var(--ink-2); background: var(--surface);
  border: 1px solid var(--line-2); border-radius: var(--r-pill); transition: all 200ms var(--ease);
}
.tab:hover { color: var(--royal); border-color: var(--royal); }
.tab.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.hint { font-size: 13px; color: var(--ink-4); margin: 0 0 10px; }

.banner {
  border: 1px solid var(--todo); color: var(--todo); background: var(--todo-bg);
  padding: 10px 14px; border-radius: var(--r-md); margin-bottom: 16px; font-size: 14px; font-weight: 500;
}
.hidden { display: none !important; }

/* ---------- KPI & graphiques ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin: 18px 0 28px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; box-shadow: var(--shadow-sm); }
.kpi .n {
  font-family: var(--display); font-weight: 800; font-size: 30px; letter-spacing: -0.02em; line-height: 1.1;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.kpi .n.alert { background: none; color: var(--alert); }
.kpi .l { margin-top: 6px; }
.chart { width: 100%; height: 340px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.charts-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 20px; }
@media (max-width: 1100px) { .charts-2 { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  nav.side { position: static; height: auto; }
  main { padding: 24px 16px 60px; }
  section.block { padding: 24px 18px; }
}
.status-ok { color: var(--emerald); font-weight: 500; }
.status-ko { color: var(--alert); font-weight: 600; }
.status-nq { color: var(--ink-4); font-style: italic; }

/* ---------- Tabulator ---------- */
.tabulator { font-family: var(--body); font-size: 13px; border: 1px solid var(--line-2); border-radius: var(--r-md); background: var(--surface); overflow: hidden; }
.tabulator .tabulator-header { background: var(--tint); border-bottom: 1px solid var(--line-2); color: var(--ink-3); }
.tabulator .tabulator-header .tabulator-col { background: var(--tint); border-right: 1px solid var(--line); }
.tabulator .tabulator-header .tabulator-col .tabulator-col-content { padding: 9px 10px; }
.tabulator .tabulator-header .tabulator-col-title {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; font-weight: 500;
}
.tabulator .tabulator-tableholder { background: var(--surface); }
.tabulator-row { border-bottom: 1px solid var(--line); min-height: 30px; background: var(--surface); }
.tabulator-row.tabulator-row-even { background: var(--surface); }
.tabulator-row .tabulator-cell { border-right: 1px solid var(--line); padding: 6px 10px; }
.tabulator-row:hover { background: var(--royal-soft) !important; }
.tabulator-row .tabulator-cell.ro { background: var(--tint); color: var(--ink-3); }
.tabulator-row .tabulator-cell.ovr { box-shadow: inset 3px 0 0 var(--royal); }
.tabulator-row .tabulator-cell.nq { background: var(--tint-2); color: var(--ink-5); }
.tabulator-row .tabulator-cell.inh { color: var(--ink-4); font-style: italic; }
.tabulator-row .tabulator-cell.num-r { text-align: right; font-variant-numeric: tabular-nums; }
