:root {
  --navy: #0A2540;
  --navy-light: #0F3460;
  --blue: #1A73E8;
  --blue-light: #4285F4;
  --accent: #4FC3F7;
  --bg: #F4F7FA;
  --surface: #FFFFFF;
  --border: #E2E8F0;
  --text: #1E293B;
  --text-secondary: #64748B;
  --text-muted: #94A3B8;
  --sidebar-width: 260px;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --transition: 0.2s ease;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  margin: 0;
}

/* ===== SIDEBAR ===== */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-width);
  background: var(--navy);
  color: #fff;
  overflow-y: auto;
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition);
}
.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.logo-text { display: flex; flex-direction: column; line-height: 1.2; }
.logo-text strong { font-size: 1.05rem; }
.logo-text small { font-size: .75rem; color: var(--accent); opacity: .85; }

.nav-section { padding: 8px 0; }
.nav-section + .nav-section { border-top: 1px solid rgba(255,255,255,.07); }
.nav-section-label {
  padding: 10px 18px 4px;
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,.35);
  font-weight: 600;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  color: rgba(255,255,255,.7);
  text-decoration: none;
  font-size: .9rem;
  border-left: 3px solid transparent;
  transition: all var(--transition);
}
.nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-link.active {
  background: rgba(79, 195, 247, .1);
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 600;
}
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px; height: 24px;
  border-radius: 6px;
  background: rgba(255,255,255,.1);
  font-size: .75rem;
  font-weight: 700;
  flex-shrink: 0;
}
.nav-link.active .nav-badge { background: var(--accent); color: var(--navy); }

.nav-sector-group { display: block; }
.nav-link-sub {
  padding: 4px 18px 6px;
  font-size: .8rem;
  color: rgba(255,255,255,.45);
  border-left: 3px solid transparent;
}
.nav-link-sub:hover { color: rgba(255,255,255,.85); }
.nav-link-sub.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: rgba(79,195,247,.06);
}

/* Scénario global */
.nav-section-scenario { padding: 8px 0; border-top: 1px solid rgba(255,255,255,.08); }
.ui-scenario-toggle {
  display: flex;
  gap: .35rem;
  margin: .35rem 18px;
}
.ui-scenario-toggle button {
  flex: 1;
  background: rgba(0,0,0,.25);
  border: 1px solid rgba(255,255,255,.1);
  color: rgba(255,255,255,.7);
  padding: .5rem .3rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
  font-size: .82rem;
}
.ui-scenario-toggle button:hover { background: rgba(255,255,255,.08); color: #fff; }
.ui-scenario-toggle button.active {
  background: var(--accent);
  color: var(--navy);
  border-color: var(--accent);
}
.ui-sc-name {
  font-size: .68rem;
  color: rgba(255,255,255,.55);
  font-style: italic;
  margin: .25rem 18px 0;
  line-height: 1.3;
}

/* UI prefs (sidebar) */
.nav-section-ui { margin-top: auto; padding: 8px 0 1rem; border-top: 1px solid rgba(255,255,255,.08); }
.ui-toggle-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 18px .5rem;
}
.ui-toggle-label {
  font-size: .72rem;
  color: rgba(255,255,255,.5);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}
.ui-toggle {
  display: inline-flex;
  background: rgba(0,0,0,.25);
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}
.ui-toggle button {
  background: transparent;
  border: none;
  color: rgba(255,255,255,.55);
  font-size: .72rem;
  font-weight: 700;
  padding: .25rem .55rem;
  border-radius: 4px;
  cursor: pointer;
  letter-spacing: .3px;
}
.ui-toggle button:hover { color: #fff; }
.ui-toggle button.active {
  background: var(--accent);
  color: var(--navy);
}
.ui-rate {
  font-size: .68rem;
  color: rgba(255,255,255,.55);
  margin-top: .3rem;
  font-style: italic;
}
.ui-rate strong { color: var(--accent); font-style: normal; }

/* ===== SIDEBAR TOGGLE (mobile) ===== */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 14px; left: 14px;
  z-index: 200;
  width: 40px; height: 40px;
  background: var(--navy);
  border: none; border-radius: var(--radius);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  box-shadow: var(--shadow);
}
.sidebar-toggle span {
  display: block;
  width: 20px; height: 2px;
  background: #fff;
  border-radius: 2px;
}

/* ===== MAIN CONTENT ===== */
.container {
  margin-left: var(--sidebar-width);
  padding: 2rem 1.5rem;
  width: auto;
  max-width: none;
  box-sizing: border-box;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}
.card h2 { font-size: 1.1rem; color: var(--navy); margin-bottom: .6rem; }
.card .tagline {
  font-size: .95rem;
  color: var(--blue);
  font-weight: 500;
  margin-bottom: .8rem;
  font-style: italic;
}

.card.phase-y0 {
  border-left: 4px solid #F59E0B;
  background: linear-gradient(180deg, #FFFBEB 0%, var(--surface) 60%);
}
.phase-header {
  display: flex; align-items: center; gap: .8rem; margin-bottom: .6rem;
}
.phase-badge {
  background: #F59E0B;
  color: #fff;
  font-weight: 700;
  font-size: .8rem;
  padding: .25rem .7rem;
  border-radius: 4px;
  letter-spacing: .5px;
}
.phase-summary { margin-bottom: .9rem; }
.phase-h3 { font-size: .92rem; color: var(--navy); margin: 1rem 0 .5rem; text-transform: uppercase; letter-spacing: .5px; }
.phase-milestones ul { list-style: none; padding: 0; }
.phase-milestones li {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: .8rem;
  align-items: center;
  padding: .45rem 0;
  border-bottom: 1px dashed var(--border);
  font-size: .88rem;
}
.phase-milestones li:last-child { border-bottom: none; }
.ms-month {
  background: #FEF3C7;
  color: var(--navy);
  font-weight: 700;
  padding: .2rem .55rem;
  border-radius: 4px;
  font-size: .78rem;
  text-align: center;
}
.ms-event { color: var(--text); }
.phase-period {
  font-size: .9rem;
  color: var(--navy);
  background: #FEF3C7;
  display: inline-block;
  padding: .3rem .8rem;
  border-radius: 4px;
  margin-bottom: .8rem;
}
.phase-pillars { list-style: none; padding: 0; }
.phase-pillars li {
  padding: .4rem 0;
  border-bottom: 1px dashed var(--border);
  font-size: .92rem;
}
.phase-pillars li:last-child { border-bottom: none; }
.phase-pillars li strong { color: var(--navy); }

/* ===== AXES ===== */
.axes { display: grid; gap: 1.2rem; }
.axis {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--blue);
  border-radius: var(--radius);
  padding: 1.3rem 1.5rem;
  box-shadow: var(--shadow);
}
.axis h3 {
  font-size: 1.15rem;
  color: var(--navy);
  margin-bottom: .8rem;
  display: flex;
  align-items: center;
  gap: .6rem;
}
.axis h3 .num {
  background: var(--blue);
  color: #fff;
  width: 1.8rem; height: 1.8rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  font-weight: 700;
}
.axis .objective {
  background: #F8FAFC;
  border-left: 3px solid var(--accent);
  padding: .6rem .9rem;
  margin-bottom: .9rem;
  font-size: .9rem;
  color: var(--text-secondary);
  border-radius: 4px;
}
.axis .objective strong { color: var(--navy); }
.axis ul { list-style: none; padding-left: 0; }
.axis li {
  padding: .35rem 0;
  border-bottom: 1px dashed var(--border);
  font-size: .92rem;
}
.axis li:last-child { border-bottom: none; }
.axis li strong { color: var(--navy); }
.tag {
  display: inline-block;
  background: #E0F2FE;
  color: #0369A1;
  padding: .15rem .55rem;
  border-radius: 4px;
  font-size: .75rem;
  font-weight: 600;
  margin-left: .4rem;
}

/* ===== PRÉAMBULE STRUCTURE ===== */
.preambule-toc { background: #F8FAFC; }
.preambule-toc h2 { font-size: 1.05rem; margin-bottom: .6rem; }
.preambule-toc ol {
  padding-left: 1.2rem;
  margin: 0;
  display: grid;
  gap: .25rem;
}
.preambule-toc a { color: var(--blue); text-decoration: none; font-size: .9rem; }
.preambule-toc a:hover { text-decoration: underline; }
.preambule-section { scroll-margin-top: 16px; }
.preambule-section > h2,
.preambule-section .card > h2 {
  display: flex;
  align-items: center;
  gap: .6rem;
}
.psec-num {
  background: var(--navy);
  color: #fff;
  width: 1.7rem; height: 1.7rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  font-weight: 700;
  flex-shrink: 0;
}
.product-card { border-left: 4px solid var(--blue); }
.phase-label { font-weight: 700; color: var(--navy); }

/* ===== FOOTER ===== */
footer.app {
  text-align: center;
  color: var(--text-secondary);
  font-size: .8rem;
  padding: 1rem;
  margin-left: var(--sidebar-width);
}

[x-cloak] { display: none !important; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: 4px 0 12px rgba(0,0,0,.15);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-toggle { display: flex; }
  .container, footer.app { margin-left: 0; }
  .container { padding-top: 4rem; }
}
