/* =====================================================================
   hubahub — Vitrine de savoir-faire
   Design system autonome (aucune dépendance externe), thème clair/sombre.
   ===================================================================== */

/* ------------------------------- Tokens ------------------------------- */
:root {
  --brand-1: #6d5efc;   /* indigo hubahub */
  --brand-2: #a855f7;   /* violet         */
  --brand-3: #ec4899;   /* rose           */
  --brand-grad: linear-gradient(120deg, var(--brand-1), var(--brand-2) 55%, var(--brand-3));

  /* Light */
  --bg:        #f5f6fb;
  --bg-soft:   #eceeffa8;
  --surface:   #ffffff;
  --surface-2: #f8f9fe;
  --surface-3: #f1f2f9;
  --ink:       #10152b;
  --ink-2:     #3c4463;
  --ink-3:     #6b7291;
  --line:      #e5e7f2;
  --line-2:    #d9dcec;
  --accent:    var(--brand-1);
  --ok:        #16a34a;
  --warn:      #d97706;
  --bad:       #dc2626;
  --info:      #2563eb;

  --shadow-sm: 0 1px 2px rgba(16,21,43,.06), 0 1px 3px rgba(16,21,43,.05);
  --shadow:    0 6px 24px -8px rgba(16,21,43,.18), 0 2px 8px -4px rgba(16,21,43,.10);
  --shadow-lg: 0 24px 60px -20px rgba(16,21,43,.35);

  --r-sm: 8px; --r: 14px; --r-lg: 22px; --r-xl: 30px;
  --sp: 4px;
  --maxw: 1220px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

:root[data-theme="dark"], .dark {
  --bg:        #080b18;
  --bg-soft:   #0c1024;
  --surface:   #121732;
  --surface-2: #171d3d;
  --surface-3: #1d2450;
  --ink:       #eef1ff;
  --ink-2:     #b7bee2;
  --ink-3:     #7d86b4;
  --line:      #232a4f;
  --line-2:    #2c3564;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --shadow:    0 10px 34px -12px rgba(0,0,0,.6);
  --shadow-lg: 0 30px 80px -24px rgba(0,0,0,.7);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:#080b18; --bg-soft:#0c1024; --surface:#121732; --surface-2:#171d3d; --surface-3:#1d2450;
    --ink:#eef1ff; --ink-2:#b7bee2; --ink-3:#7d86b4; --line:#232a4f; --line-2:#2c3564;
    --shadow-sm:0 1px 2px rgba(0,0,0,.3); --shadow:0 10px 34px -12px rgba(0,0,0,.6); --shadow-lg:0 30px 80px -24px rgba(0,0,0,.7);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  line-height: 1.55;
}
body::before {
  content:""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 50% at 85% -5%, rgba(168,85,247,.16), transparent 60%),
    radial-gradient(50% 40% at 5% 0%, rgba(109,94,252,.16), transparent 55%);
}
a { color: inherit; text-decoration: none; }
h1,h2,h3,h4 { margin: 0; line-height: 1.12; letter-spacing: -.02em; font-weight: 800; }
p { margin: 0; }
img { max-width: 100%; }
::selection { background: rgba(109,94,252,.25); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.muted { color: var(--ink-3); }
.grad-text {
  background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ------------------------------- Header ------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: saturate(1.4) blur(14px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 20px; height: 66px; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 800; font-size: 19px; letter-spacing: -.03em; }
.brand .logo {
  width: 34px; height: 34px; border-radius: 10px; background: var(--brand-grad);
  display: grid; place-items: center; color: #fff; font-weight: 900; box-shadow: var(--shadow-sm);
  position: relative;
}
.brand .logo::after{ content:""; position:absolute; inset:0; border-radius:10px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.25);}
.brand small { color: var(--ink-3); font-weight: 600; font-size: 12px; letter-spacing: 0; }
.header-spacer { flex: 1; }
.header-nav { display: flex; gap: 4px; }
.header-nav a { padding: 8px 12px; border-radius: 10px; font-weight: 600; font-size: 14px; color: var(--ink-2); }
.header-nav a:hover { background: var(--surface-3); color: var(--ink); }
.icon-btn {
  width: 40px; height: 40px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface);
  display: grid; place-items: center; cursor: pointer; color: var(--ink-2); transition: .15s;
}
.icon-btn:hover { color: var(--ink); border-color: var(--line-2); transform: translateY(-1px); }
@media (max-width: 720px){ .header-nav{ display:none; } }

/* ------------------------------- Hero -------------------------------- */
.hero { padding: 68px 0 30px; position: relative; }
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px;
  color: var(--ink-2); background: var(--surface); border: 1px solid var(--line);
  padding: 6px 13px; border-radius: 999px; box-shadow: var(--shadow-sm);
}
.hero .eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); }
.hero h1 { font-size: clamp(34px, 6vw, 62px); margin: 22px 0 0; max-width: 16ch; }
.hero p.lead { font-size: clamp(16px, 2.1vw, 21px); color: var(--ink-2); margin-top: 20px; max-width: 60ch; }
.hero .cta { display: flex; gap: 12px; margin-top: 30px; flex-wrap: wrap; }

.btn {
  --b: var(--brand-1);
  display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: 15px;
  padding: 12px 20px; border-radius: 12px; cursor: pointer; border: 1px solid transparent; transition: .16s;
  white-space: nowrap;
}
.btn-primary { background: var(--brand-grad); color: #fff; box-shadow: 0 10px 24px -10px rgba(109,94,252,.7); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -12px rgba(109,94,252,.75); }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { border-color: var(--line-2); transform: translateY(-2px); }

/* Hero stats */
.hero-stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-top: 46px; }
.hero-stats .stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; box-shadow: var(--shadow-sm); }
.hero-stats .stat .n { font-size: 34px; font-weight: 900; letter-spacing: -.03em; }
.hero-stats .stat .l { color: var(--ink-3); font-size: 13.5px; font-weight: 600; margin-top: 2px; }
@media (max-width: 760px){ .hero-stats{ grid-template-columns: repeat(2,1fr);} }

/* ---------------------------- Domain rail ---------------------------- */
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 8px 0 20px; }
.section-head h2 { font-size: clamp(24px, 3.4vw, 34px); }
.section-head .sub { color: var(--ink-3); margin-top: 8px; font-size: 15px; }

.toolbar { position: sticky; top: 66px; z-index: 30; padding: 14px 0; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.toolbar .wrap { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.search {
  flex: 1; min-width: 220px; display: flex; align-items: center; gap: 9px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; box-shadow: var(--shadow-sm);
}
.search input { border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 15px; width: 100%; font-family: inherit; }
.search svg { color: var(--ink-3); flex: none; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: 13.5px; cursor: pointer;
  padding: 8px 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  transition: .14s; white-space: nowrap;
}
.chip .cdot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--brand-1)); }
.chip:hover { border-color: var(--line-2); color: var(--ink); }
.chip.active { color: #fff; background: var(--c, var(--brand-1)); border-color: transparent; box-shadow: 0 8px 18px -8px color-mix(in srgb, var(--c, var(--brand-1)) 80%, transparent); }
.chip.active .cdot { background: rgba(255,255,255,.9); }
.chip .count { font-size: 12px; opacity: .7; }

/* ---------------------- Layout : menu latéral ------------------------ */
#menuBtn { display: none; }
.layout { display: grid; grid-template-columns: 258px minmax(0, 1fr); gap: 30px; align-items: start; padding-top: 28px; scroll-margin-top: 84px; }
.sidebar { position: sticky; top: 84px; align-self: start; max-height: calc(100vh - 104px); overflow-y: auto; }
.side-inner { display: flex; flex-direction: column; gap: 14px; }
.side-head { display: none; align-items: center; justify-content: space-between; }
.side-title { font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.sidebar .search { padding: 9px 12px; }
.sidebar .search input { font-size: 14px; }
.side-nav { display: flex; flex-direction: column; gap: 3px; }
.side-link {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 12px; cursor: pointer;
  font-weight: 600; font-size: 14px; color: var(--ink-2); border: 1px solid transparent; transition: .14s; text-align: left; width: 100%; background: transparent; font-family: inherit;
}
.side-link:hover { background: var(--surface); color: var(--ink); }
.side-link.active { background: var(--surface); border-color: var(--line); color: var(--ink); box-shadow: var(--shadow-sm); }
.side-link.dim { opacity: .38; }
.side-link .sic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: #fff; background: var(--c, var(--brand-1)); flex: none; }
.side-link .slabel { flex: 1; line-height: 1.15; }
.side-link .scount { font-size: 12px; font-weight: 800; color: var(--ink-3); background: var(--surface-3); border-radius: 999px; padding: 1px 8px; }
.side-link.active .scount { color: #fff; background: var(--c, var(--brand-1)); }
.side-link.all { font-weight: 800; }
.side-link.all .sic { background: var(--brand-grad); }
.side-note { font-size: 12px; padding: 4px 6px; line-height: 1.4; }
.side-backdrop { display: none; }

@media (max-width: 960px) {
  #menuBtn { display: grid; }
  .layout { grid-template-columns: 1fr; padding-top: 18px; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: 286px; z-index: 70; background: var(--bg);
    border-right: 1px solid var(--line); padding: 18px; max-height: none; transform: translateX(-104%);
    transition: transform .26s cubic-bezier(.2,.8,.2,1); box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: none; }
  .side-head { display: flex; }
  .side-backdrop { position: fixed; inset: 0; background: rgba(8,11,24,.55); backdrop-filter: blur(3px); z-index: 65; }
  .side-backdrop.open { display: block; }
}

/* ------------------------------ Catalog ------------------------------ */
.catalog { padding: 4px 0 60px; }
.domain-block { margin-bottom: 40px; scroll-margin-top: 140px; }
.domain-title { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.domain-title .badge-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: #fff; box-shadow: var(--shadow-sm); }
.domain-title h3 { font-size: 20px; }
.domain-title .cnt { margin-left: auto; color: var(--ink-3); font-weight: 600; font-size: 13px; background: var(--surface); border: 1px solid var(--line); padding: 4px 10px; border-radius: 999px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 16px; }

.card {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 20px; box-shadow: var(--shadow-sm); cursor: pointer; overflow: hidden;
  transition: transform .18s cubic-bezier(.2,.7,.3,1), box-shadow .18s, border-color .18s;
  display: flex; flex-direction: column; gap: 12px; min-height: 186px;
}
.card::before { content:""; position:absolute; inset:0 0 auto 0; height:3px; background: var(--c, var(--brand-1)); opacity: .0; transition:.18s; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--line-2); }
.card:hover::before { opacity: 1; }
.card .ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: var(--c, var(--brand-1)); box-shadow: var(--shadow-sm); flex: none; }
.card h4 { font-size: 16.5px; letter-spacing: -.02em; }
.card .pitch { color: var(--ink-2); font-size: 14px; line-height: 1.5; flex: 1; }
.card .foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 2px; }
.card .tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 11.5px; font-weight: 600; color: var(--ink-3); background: var(--surface-3); border-radius: 6px; padding: 3px 8px; }
.flag-pill { font-size: 11px; font-weight: 800; letter-spacing: .04em; color: #fff; background: var(--brand-grad); padding: 4px 9px; border-radius: 999px; text-transform: uppercase; }
.card .deploy { display:flex; align-items:center; gap:6px; font-size:12.5px; color: var(--ink-3); font-weight:600; }
.card .demo-link { font-weight: 700; font-size: 13.5px; color: var(--c, var(--brand-1)); display: inline-flex; align-items: center; gap: 5px; }

.empty { text-align:center; padding: 70px 20px; color: var(--ink-3); }

/* ------------------------------ Detail ------------------------------- */
.overlay {
  position: fixed; inset: 0; z-index: 90; background: rgba(8,11,24,.55); backdrop-filter: blur(4px);
  display: none; align-items: stretch; justify-content: flex-end;
}
.overlay.open { display: flex; }
.panel {
  width: min(920px, 100%); background: var(--bg); border-left: 1px solid var(--line);
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slideIn .28s cubic-bezier(.2,.8,.2,1);
  overflow: hidden;
}
@keyframes slideIn { from { transform: translateX(40px); opacity: .3; } to { transform: none; opacity: 1; } }
.panel-head { padding: 22px 26px; border-bottom: 1px solid var(--line); display: flex; gap: 16px; align-items: flex-start; background: var(--surface); }
.panel-head .ic { width: 48px; height: 48px; border-radius: 13px; display: grid; place-items: center; color: #fff; background: var(--c, var(--brand-1)); flex: none; box-shadow: var(--shadow-sm); }
.panel-head h2 { font-size: 22px; }
.panel-head .dm { color: var(--ink-3); font-weight: 700; font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
.panel-body { overflow-y: auto; padding: 24px 26px 60px; }
.panel-body .detail-text { color: var(--ink-2); font-size: 15.5px; line-height: 1.6; max-width: 68ch; }
.panel-body .tags { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0 4px; }
.panel-body .tag { font-size: 12.5px; padding: 5px 10px; }
.demo-frame {
  margin-top: 22px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface-2);
  overflow: hidden; box-shadow: var(--shadow-sm);
}
.demo-frame .demo-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface); }
.demo-frame .demo-bar .dots { display: flex; gap: 6px; }
.demo-frame .demo-bar .dots i { width: 11px; height: 11px; border-radius: 50%; background: var(--line-2); display: inline-block; }
.demo-frame .demo-bar .lbl { font-size: 12.5px; color: var(--ink-3); font-weight: 600; margin-left: 6px; }
.demo-frame .demo-bar .fic { margin-left: auto; font-size: 11px; font-weight: 700; color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); padding: 3px 9px; border-radius: 999px; }
.demo-hint { display: flex; align-items: center; gap: 9px; padding: 10px 16px; font-size: 13px; font-weight: 600; color: var(--brand-1); background: color-mix(in srgb, var(--brand-1) 9%, transparent); border-bottom: 1px solid var(--line); }
.demo-hint svg { flex: none; }
:root[data-theme="dark"] .demo-hint { color: #b7b0ff; }
.demo-canvas { padding: 18px; }
.deploy-strip { display:flex; flex-wrap:wrap; gap:8px; margin-top: 20px; align-items:center; }
.deploy-strip .lbl { font-size:12.5px; color:var(--ink-3); font-weight:700; }
.sector { font-size:12.5px; font-weight:600; color: var(--ink-2); background: var(--surface); border:1px solid var(--line); padding:5px 11px; border-radius:999px; }

.close-x { margin-left: auto; }

/* ============================ UI primitives =========================== */
/* Everything a demo renderer may use. Keep the vocabulary small & consistent. */

.ui-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px,1fr)); gap: 10px; }
.ui-kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 13px 15px; }
.ui-kpi .n { font-size: 23px; font-weight: 900; letter-spacing: -.02em; }
.ui-kpi .l { font-size: 12px; color: var(--ink-3); font-weight: 600; margin-top: 2px; }
.ui-kpi .d { font-size: 11.5px; font-weight: 700; margin-top: 5px; }
.ui-kpi .d.up { color: var(--ok); } .ui-kpi .d.down { color: var(--bad); }

.ui-table { width: 100%; border-collapse: collapse; font-size: 13.5px; overflow: hidden; }
.ui-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.ui-table th { text-align: left; font-weight: 700; color: var(--ink-3); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ui-table td { padding: 11px 14px; border-bottom: 1px solid var(--line); color: var(--ink-2); white-space: nowrap; }
.ui-table tr:last-child td { border-bottom: 0; }
.ui-table tbody tr:hover { background: var(--surface-3); }
.ui-table td.num, .ui-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.ui-table td.strong { color: var(--ink); font-weight: 700; }

.ui-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--surface-3); color: var(--ink-2); }
.ui-badge.ok   { background: color-mix(in srgb, var(--ok) 16%, transparent);   color: var(--ok); }
.ui-badge.warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.ui-badge.bad  { background: color-mix(in srgb, var(--bad) 15%, transparent);  color: var(--bad); }
.ui-badge.info { background: color-mix(in srgb, var(--info) 14%, transparent); color: var(--info); }
.ui-badge .pt { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.ui-badges { display: flex; gap: 8px; flex-wrap: wrap; }

.ui-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 12px 20px; }
.ui-field .k { font-size: 11.5px; color: var(--ink-3); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.ui-field .v { font-size: 14.5px; color: var(--ink); font-weight: 600; margin-top: 2px; }

.ui-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.ui-panel + .ui-panel { margin-top: 12px; }
.ui-h { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); margin-bottom: 12px; }
.ui-row { display: flex; gap: 12px; align-items: center; }
.ui-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ui-grid3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
@media (max-width: 620px){ .ui-grid2,.ui-grid3{ grid-template-columns: 1fr; } }

/* Kanban */
.ui-kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(190px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.ui-col { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 10px; min-height: 60px; }
.ui-col .ch { display: flex; align-items: center; justify-content: space-between; font-weight: 800; font-size: 12.5px; margin-bottom: 10px; color: var(--ink-2); }
.ui-col .ch .n { background: var(--surface-3); border-radius: 999px; padding: 1px 8px; font-size: 11px; color: var(--ink-3); }
.ui-kcard { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 11px; box-shadow: var(--shadow-sm); margin-bottom: 8px; cursor: grab; transition: .12s; }
.ui-kcard:hover { transform: translateY(-2px); border-color: var(--line-2); }
.ui-kcard .t { font-weight: 700; font-size: 13.5px; }
.ui-kcard .m { font-size: 12px; color: var(--ink-3); margin-top: 5px; display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.ui-kcard .bar { height: 4px; border-radius: 999px; background: var(--surface-3); margin-top: 8px; overflow:hidden; }
.ui-kcard .bar i { display:block; height:100%; background: var(--c, var(--brand-1)); }

/* List / timeline */
.ui-list { display: flex; flex-direction: column; }
.ui-li { display: flex; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--line); }
.ui-li:last-child { border-bottom: 0; }
.ui-li .av { width: 34px; height: 34px; border-radius: 9px; background: var(--brand-grad); color:#fff; display:grid; place-items:center; font-weight:800; font-size:13px; flex:none; }
.ui-li .bd { flex: 1; min-width: 0; }
.ui-li .bd .t { font-weight: 700; font-size: 14px; }
.ui-li .bd .s { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.ui-li .rt { font-size: 12px; color: var(--ink-3); white-space: nowrap; }

.ui-timeline { position: relative; padding-left: 22px; }
.ui-timeline::before { content:""; position:absolute; left: 7px; top: 4px; bottom: 4px; width: 2px; background: var(--line); }
.ui-tl { position: relative; padding: 6px 0 16px; }
.ui-tl::before { content:""; position:absolute; left: -19px; top: 9px; width: 12px; height: 12px; border-radius: 50%; background: var(--c, var(--brand-1)); box-shadow: 0 0 0 3px var(--surface-2); }
.ui-tl .t { font-weight: 700; font-size: 14px; }
.ui-tl .s { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }

/* Stepper */
.ui-stepper { display: flex; align-items: center; gap: 0; }
.ui-step { display: flex; align-items: center; gap: 10px; flex: 1; }
.ui-step .b { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; border: 2px solid var(--line-2); color: var(--ink-3); background: var(--surface); flex: none; }
.ui-step.done .b { background: var(--brand-grad); color: #fff; border-color: transparent; }
.ui-step.active .b { border-color: var(--brand-1); color: var(--brand-1); }
.ui-step .lb { font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.ui-step .line { flex: 1; height: 2px; background: var(--line-2); margin: 0 6px; }
.ui-step.done .line { background: var(--brand-1); }

/* Document / PDF preview */
.ui-doc { background: #fff; color: #1e2338; border-radius: 8px; padding: 22px; box-shadow: var(--shadow); font-size: 12.5px; }
.ui-doc .dh { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid #eef; padding-bottom: 12px; margin-bottom: 14px; }
.ui-doc .dh .co { font-weight: 900; font-size: 17px; letter-spacing: -.02em; }
.ui-doc .dt-title { text-align: right; }
.ui-doc .dt-title .big { font-size: 19px; font-weight: 800; color: var(--brand-1); }
.ui-doc table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.ui-doc th { text-align: left; font-size: 10.5px; text-transform: uppercase; color: #8a90ad; padding: 6px 4px; border-bottom: 1px solid #e6e8f5; }
.ui-doc td { padding: 7px 4px; border-bottom: 1px solid #f0f1fa; }
.ui-doc .tot { display: flex; justify-content: flex-end; margin-top: 10px; }
.ui-doc .tot table { width: auto; min-width: 220px; }
.ui-doc .tot td { border: 0; padding: 3px 4px; }
.ui-doc .tot .g td { font-weight: 900; font-size: 15px; color: var(--brand-1); border-top: 2px solid #eef; padding-top: 8px; }

/* Phone frame */
.ui-phone { width: 268px; margin: 0 auto; background: #0b0f22; border-radius: 34px; padding: 12px; box-shadow: var(--shadow-lg); }
.ui-phone .scr { background: var(--surface); border-radius: 24px; overflow: hidden; height: 500px; display: flex; flex-direction: column; }
.ui-phone .pbar { background: var(--brand-grad); color: #fff; padding: 16px 16px 14px; }
.ui-phone .pbar .t { font-weight: 800; font-size: 15px; }
.ui-phone .pbar .s { font-size: 12px; opacity: .85; }
.ui-phone .pbody { padding: 12px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 9px; }
.ui-phone .pnav { display: flex; border-top: 1px solid var(--line); }
.ui-phone .pnav a { flex: 1; text-align: center; padding: 10px 0 12px; font-size: 10px; color: var(--ink-3); font-weight: 700; }
.ui-phone .pnav a.on { color: var(--brand-1); }

/* Controls (interactive demos) */
.ui-toggle { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-weight: 600; font-size: 13.5px; }
.ui-toggle .tk { width: 40px; height: 23px; border-radius: 999px; background: var(--line-2); position: relative; transition: .18s; flex:none; }
.ui-toggle .tk::after { content:""; position: absolute; top: 2px; left: 2px; width: 19px; height: 19px; border-radius: 50%; background: #fff; transition: .18s; box-shadow: var(--shadow-sm); }
.ui-toggle.on .tk { background: var(--brand-1); }
.ui-toggle.on .tk::after { transform: translateX(17px); }
.ui-range { width: 100%; accent-color: var(--brand-1); }
.ui-seg { display: inline-flex; background: var(--surface-3); border-radius: 10px; padding: 3px; gap: 3px; }
.ui-seg button { border: 0; background: transparent; padding: 6px 13px; border-radius: 8px; font-weight: 700; font-size: 13px; cursor: pointer; color: var(--ink-3); font-family: inherit; }
.ui-seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.ui-btn-sm { border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 700; font-size: 13px; padding: 8px 14px; border-radius: 10px; cursor: pointer; font-family: inherit; transition:.14s; }
.ui-btn-sm:hover { border-color: var(--line-2); transform: translateY(-1px); }
.ui-btn-sm.primary { background: var(--brand-grad); color: #fff; border-color: transparent; }
.ui-input { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 9px 12px; font-family: inherit; font-size: 14px; color: var(--ink); width: 100%; }
.ui-input:focus { outline: 2px solid color-mix(in srgb, var(--brand-1) 40%, transparent); border-color: var(--brand-1); }

/* Gantt */
.ui-gantt { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.ui-gantt .g-head { display: grid; grid-template-columns: 130px repeat(var(--cols,5), 1fr); background: var(--surface-2); border-bottom: 1px solid var(--line); }
.ui-gantt .g-head > div { padding: 8px 10px; font-size: 11.5px; font-weight: 700; color: var(--ink-3); text-align: center; border-left: 1px solid var(--line); }
.ui-gantt .g-head > div:first-child { text-align: left; border-left: 0; }
.ui-gantt .g-row { display: grid; grid-template-columns: 130px 1fr; border-bottom: 1px solid var(--line); }
.ui-gantt .g-row:last-child { border-bottom: 0; }
.ui-gantt .g-res { padding: 10px; font-weight: 700; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.ui-gantt .g-track { position: relative; height: 46px; background-image: repeating-linear-gradient(90deg, transparent, transparent calc(20% - 1px), var(--line) 20%); }
.ui-gbar { position: absolute; top: 8px; height: 30px; border-radius: 8px; color: #fff; font-size: 11.5px; font-weight: 700; display: flex; align-items: center; padding: 0 10px; cursor: grab; box-shadow: var(--shadow-sm); overflow: hidden; }
.ui-gbar:active { cursor: grabbing; }

/* Charts (SVG) */
.ui-chart { width: 100%; }
.ui-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; }
.ui-legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.ui-legend span i { width: 10px; height: 10px; border-radius: 3px; }

/* Signature pad */
.ui-sign { border: 2px dashed var(--line-2); border-radius: var(--r); background: var(--surface); height: 130px; position: relative; cursor: crosshair; overflow: hidden; }
.ui-sign .hint { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-3); font-size: 13px; pointer-events: none; }

/* Progress / meter */
.ui-meter { height: 9px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.ui-meter i { display: block; height: 100%; background: var(--brand-grad); border-radius: 999px; }
.ui-note { font-size: 12.5px; color: var(--ink-3); margin-top: 10px; }
.ui-callout { display:flex; gap:10px; align-items:flex-start; background: color-mix(in srgb, var(--brand-1) 8%, transparent); border: 1px solid color-mix(in srgb, var(--brand-1) 22%, transparent); border-radius: var(--r); padding: 12px 14px; font-size: 13px; color: var(--ink-2); }

/* App-shell mock (toolbar for module screenshots) */
.ui-app { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.ui-app .ab { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.ui-app .ab .t { font-weight: 800; font-size: 14px; }
.ui-app .ab .sp { flex: 1; }
.ui-app .abody { padding: 14px; }

/* master-detail (ex: appels d'offres) */
.md-split { display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1.28fr); gap: 14px; align-items: start; }
.md-item { display: block; width: 100%; text-align: left; background: transparent; border: 1px solid transparent; border-radius: 11px; padding: 10px 11px; cursor: pointer; font-family: inherit; margin-bottom: 6px; transition: .14s; color: inherit; }
.md-item:hover { background: var(--surface-3); }
.md-item.on { background: var(--surface-3); border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.md-item.off { opacity: .5; }
.md-item .mi-t { font-weight: 700; font-size: 13.5px; line-height: 1.25; }
.md-item .mi-s { font-size: 12px; color: var(--ink-3); margin-top: 3px; }

/* ============ Démo Plan de charge (Gantt plan de charge composite) ============ */
.gantt-demo .pdc-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.gantt-demo .pdc-title { font-weight: 800; font-size: 15px; margin-right: auto; }
.gantt-demo .pdc-help { font-size: 12px; margin: 0 0 12px; }
.gantt-demo .pdc-wrap { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-sm); background: var(--surface); }
.gantt-demo .pdc-grid { display: grid; grid-template-columns: 160px repeat(7, 1fr); }
.gantt-demo .pdc-headrow { background: var(--surface-2); border-bottom: 1px solid var(--line); }
.gantt-demo .pdc-jour { text-align: center; font-size: 11px; color: var(--ink-3); padding: 6px 0; border-left: 1px solid var(--line); line-height: 1.3; }
.gantt-demo .pdc-jour.today { background: rgba(99,102,241,.12); color: var(--brand-1); }
.gantt-demo .pdc-jour strong { font-size: 13px; color: var(--ink); }
.gantt-demo .pdc-jour.today strong { color: var(--brand-1); }
.gantt-demo .pdc-row { display: grid; grid-template-columns: 160px 1fr; border-top: 1px solid var(--line); }
.gantt-demo .pdc-label { padding: 8px 12px; font-weight: 600; font-size: 13px; display: flex; align-items: center; background: var(--surface-2); border-right: 1px solid var(--line); }
.gantt-demo .pdc-track { position: relative; display: grid; grid-template-columns: repeat(7, 1fr); min-height: 54px; }
.gantt-demo .pdc-cell { border-left: 1px solid var(--line); font-size: 10px; color: var(--ink-3); text-align: center; padding-top: 3px; }
.gantt-demo .pdc-cell.today { background: rgba(99,102,241,.05); }
.gantt-demo .pdc-bars { position: absolute; inset: 0; pointer-events: none; }
.gantt-demo .pdc-bar { position: absolute; top: 7px; height: 40px; border-radius: 8px; color: #fff; font-size: 11px; font-weight: 700; padding: 5px 12px 5px 9px; display: flex; align-items: center; overflow: hidden; cursor: grab; box-shadow: var(--shadow-sm); pointer-events: auto; }
.gantt-demo .pdc-bar:hover { box-shadow: var(--shadow); }
.gantt-demo .pdc-bar-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gantt-demo .pdc-grip { position: absolute; right: 0; top: 0; height: 100%; width: 12px; cursor: ew-resize; display: flex; align-items: center; justify-content: center; }
.gantt-demo .pdc-grip::after { content: ''; width: 3px; height: 55%; border-radius: 3px; background: rgba(255,255,255,.6); }
.gantt-demo .pdc-charge { display: grid; grid-template-columns: 160px repeat(7, 1fr); border-top: 2px solid var(--line-2); background: var(--surface-2); }
.gantt-demo .pdc-charge .lab { padding: 9px 12px; font-weight: 800; font-size: 12px; border-right: 1px solid var(--line); }
.gantt-demo .pdc-charge .c { text-align: center; font-size: 11px; font-weight: 700; padding: 9px 0; border-left: 1px solid var(--line); color: var(--ink-2); }
.gantt-demo .pdc-charge .c.today { background: rgba(99,102,241,.10); color: var(--brand-1); }
.gantt-demo .pdc-bin { margin-top: 14px; }
.gantt-demo .pdc-pill { display: inline-flex; align-items: center; margin: 0 8px 8px 0; padding: 7px 13px; border-radius: 999px; border: 1px dashed var(--line-2); background: var(--surface-2); font: inherit; font-size: 12.5px; font-weight: 600; color: var(--ink); cursor: pointer; }
.gantt-demo .pdc-pill:hover { border-color: var(--brand-1); color: var(--brand-1); }
.gantt-demo .pdc-toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 60; background: var(--ink); color: var(--surface); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 10px 16px; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.gantt-demo .pdc-toast[hidden] { display: none; }

/* ============ Démo Dispatch — reproduction fidèle du planning Gantt GESTRANS ============ */
.dispatch-demo .dispatch-legende { display: flex; flex-wrap: wrap; gap: 14px; margin: 0 0 12px; font-size: 12px; color: var(--ink-3); }
.dispatch-demo .dispatch-legende span { display: inline-flex; align-items: center; gap: 6px; }
.dispatch-demo .dispatch-legende i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }

.dispatch-demo .dispatch-daynav { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; box-shadow: var(--shadow-sm); }
.dispatch-demo .datenav-input { border: 1px solid var(--line-2); border-radius: 8px; padding: 7px 12px; background: var(--surface-2); font: inherit; font-weight: 700; color: var(--ink); width: 150px; text-align: center; cursor: pointer; }
.dispatch-demo .dispatch-daynav .line2 { color: var(--ink-3); font-size: 12.5px; margin-left: auto; }

.dispatch-demo .dispatch-pool { display: flex; align-items: center; gap: 12px; width: 100%; box-sizing: border-box; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; box-shadow: var(--shadow-sm); margin-bottom: 14px; }
.dispatch-demo .dispatch-pool .col-head { flex: none; padding: 0; white-space: nowrap; font-weight: 700; font-size: 13px; }
.dispatch-demo .pool-cards { display: flex; gap: 8px; overflow-x: auto; flex: 1; min-width: 0; padding: 2px; }
.dispatch-demo .pool-cards .tour-card { flex: 0 0 auto; width: 190px; }
.dispatch-demo .pool-cards .line2 { white-space: nowrap; color: var(--ink-3); padding: 8px; font-size: 12.5px; }

.dispatch-demo .dispatch-tools { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-3); }
.dispatch-demo .pause-chip { background: #fff7ed; border: 1px solid #fdba74; color: #9a3412; border-radius: 999px; padding: 5px 12px; font-size: 12.5px; font-weight: 600; cursor: grab; white-space: nowrap; }

.dispatch-demo .gantt-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-sm); background: var(--surface); max-height: 520px; }
.dispatch-demo .gantt { min-width: max-content; }
.dispatch-demo .gantt-head, .dispatch-demo .gantt-row { display: grid; }
.dispatch-demo .gantt-head { background: var(--surface-2); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.dispatch-demo .gantt-cellhead { padding: 8px 2px; font-size: 11px; color: var(--ink-3); grid-row: 1; text-align: center; }
.dispatch-demo .gantt-cellhead.pleine { font-weight: 700; color: var(--ink-2); border-left: 1px solid var(--line); }
.dispatch-demo .gantt-rowhead { padding: 8px 12px; font-size: 14px; font-weight: 600; border-left: 1px solid var(--line); grid-column: 1; position: sticky; left: 0; z-index: 4; display: flex; align-items: center; justify-content: space-between; gap: 6px; background: var(--surface-2); cursor: grab; }
.dispatch-demo .gantt-head .gantt-rowhead { z-index: 6; }
.dispatch-demo .gantt-row { border-top: 1px solid var(--line); min-height: 72px; position: relative; }
.dispatch-demo .gantt-row:hover { background: rgba(99,102,241,.03); }
.dispatch-demo .rh-name { display: flex; align-items: flex-start; gap: 6px; min-width: 0; }
.dispatch-demo .rh-grip { color: var(--ink-3); line-height: 1.3; }
.dispatch-demo .rh-ident { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.dispatch-demo .rh-ident > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dispatch-demo .rh-prenom { font-weight: 600; }
.dispatch-demo .rh-nom { font-weight: 600; text-transform: uppercase; }
.dispatch-demo .rh-transporteur { font-size: 11px; font-weight: 500; color: var(--ink-3); }
.dispatch-demo .rh-hide { border: none; background: transparent; color: var(--ink-3); cursor: pointer; font-size: 12px; padding: 2px 5px; border-radius: 6px; line-height: 1; }
.dispatch-demo .rh-hide:hover { color: #ef4444; background: rgba(239,68,68,.12); }
.dispatch-demo .gantt-cell { border-left: 1px solid var(--line); min-height: 72px; grid-row: 1; }
.dispatch-demo .gantt-cell.pleine { border-left: 1px solid var(--line-2); }
.dispatch-demo .gantt-cell.drop-hover { background: rgba(99,102,241,.12); outline: 2px dashed var(--brand-1); outline-offset: -2px; }
.dispatch-demo .gantt-cell.preview { background: rgba(99,102,241,.18); box-shadow: inset 0 0 0 1px var(--brand-1); }

.dispatch-demo .tour-card { border-radius: 8px; padding: 6px 8px; font-size: 12px; box-shadow: var(--shadow-sm); transition: box-shadow .14s; }
.dispatch-demo .tour-card:hover { box-shadow: var(--shadow); }
.dispatch-demo .tour-card.placed { margin: 4px 2px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; align-self: stretch; display: flex; align-items: center; font-size: 10px; cursor: grab; position: relative; padding: 4px 14px 4px 8px; border: 1px solid rgba(0,0,0,.15); }
.dispatch-demo .tour-card.placed .tc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 1px; overflow: hidden; }
.dispatch-demo .tour-card.placed .tc-body > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.15; }
.dispatch-demo .tour-card.placed .tc-main { font-weight: 700; }
.dispatch-demo .tour-card.placed .tc-line { font-size: 9px; font-weight: 500; opacity: .85; }
.dispatch-demo .tour-card.dragging { opacity: .45; }
.dispatch-demo .pool-cards .tour-card { background: var(--surface-2); border: 1px solid var(--line-2); border-left: 3px solid var(--brand-1); cursor: grab; }
.dispatch-demo .pool-cards .tour-card:hover { border-color: var(--brand-1); box-shadow: var(--shadow-sm); }
.dispatch-demo .tour-card a { color: var(--ink); font-weight: 700; text-decoration: none; }
.dispatch-demo .tour-card .tc-sub { color: var(--ink-3); font-weight: 500; margin-top: 2px; font-size: 11px; }
.dispatch-demo .resize-handle { position: absolute; top: 0; right: 0; width: 12px; height: 100%; cursor: ew-resize; display: flex; align-items: center; justify-content: center; }
.dispatch-demo .resize-handle::after { content: ''; width: 3px; height: 60%; border-radius: 3px; background: rgba(15,23,41,.28); }
.dispatch-demo .resize-handle:hover::after { background: var(--brand-1); }
.dispatch-demo .tour-coupure { position: absolute; top: 0; bottom: 0; background: #fff; border-left: 1px dashed rgba(15,23,41,.35); border-right: 1px dashed rgba(15,23,41,.35); opacity: .95; pointer-events: none; z-index: 1; display: flex; align-items: center; justify-content: center; font-size: 8px; font-weight: 700; letter-spacing: .3px; color: rgba(15,23,41,.7); white-space: nowrap; }
.dispatch-demo .gantt-addrow { border-top: 1px solid var(--line); padding: 12px 14px; background: var(--surface-2); position: sticky; left: 0; }
.dispatch-demo .gantt-addrow form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.dispatch-demo .gantt-addrow span { font-weight: 600; color: var(--ink-2); }
.dispatch-demo .gantt-addrow select { padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); font: inherit; color: var(--ink); }
.dispatch-demo .disp-tip { position: fixed; z-index: 50; max-width: 320px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 10px 12px; font-size: 12px; pointer-events: none; display: none; }
.dispatch-demo .disp-tip .tip-h { font-weight: 800; font-size: 13px; margin-bottom: 6px; padding-bottom: 5px; border-bottom: 1px solid var(--line); }
.dispatch-demo .disp-tip .tip-r { display: flex; gap: 8px; line-height: 1.45; }
.dispatch-demo .disp-tip .tip-l { color: var(--ink-3); min-width: 84px; font-weight: 600; }
.dispatch-demo .disp-tip .tip-v { flex: 1; }
.dispatch-demo .disp-toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 60; background: var(--ink); color: var(--surface); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 10px 16px; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.dispatch-demo .disp-toast[hidden] { display: none; }
@media (max-width: 720px) { .md-split { grid-template-columns: 1fr; } }

.mono { font-family: var(--mono); font-size: 12.5px; }
.code { font-family: var(--mono); font-size: 12.5px; background: #0b0f22; color: #d6ddff; border-radius: var(--r); padding: 14px 16px; overflow-x: auto; line-height: 1.6; }
.code .k { color: #a5b4ff; } .code .s { color: #86efac; } .code .c { color: #6b7291; } .code .n2 { color: #fbbf24; }

/* ------------------------------ Footer ------------------------------- */
.site-footer { border-top: 1px solid var(--line); padding: 40px 0; color: var(--ink-3); font-size: 14px; margin-top: 40px; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: center; }

/* scrollbars */
.panel-body::-webkit-scrollbar, .ui-kanban::-webkit-scrollbar, .ui-table-wrap::-webkit-scrollbar { height: 9px; width: 9px; }
.panel-body::-webkit-scrollbar-thumb, .ui-kanban::-webkit-scrollbar-thumb, .ui-table-wrap::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 999px; }

.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s, transform .5s; }
.reveal.in { opacity: 1; transform: none; }
