:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #eef2f6;
  --text: #17202a;
  --muted: #667085;
  --line: #d6dde6;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --module: #2563eb;
  --pec: #b45309;
  --objectif: #6d28d9;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: 100vh;
}

a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

.sidebar {
  background: #14213d;
  color: white;
  padding: 22px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: #e0fbfc;
  color: #14213d;
  font-weight: 800;
  border-radius: 8px;
}

.brand span {
  display: block;
  color: #cbd5e1;
  font-size: 13px;
  margin-top: 2px;
}

nav { display: grid; gap: 5px; }
nav a {
  color: #e5e7eb;
  padding: 10px 12px;
  border-radius: 6px;
  font-weight: 600;
}
nav a.active, nav a:hover {
  background: rgba(255, 255, 255, .12);
  color: white;
  text-decoration: none;
}

.main { min-width: 0; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 24px;
  padding: 28px 34px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

h1 { font-size: 30px; margin: 0; letter-spacing: 0; }
h2 { font-size: 18px; margin: 0 0 14px; letter-spacing: 0; }
p { line-height: 1.5; }
.muted { color: var(--muted); margin: 6px 0 0; }

.quick-search, .filters {
  display: flex;
  gap: 8px;
  align-items: center;
}

.filters {
  padding: 18px 34px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

input, select, button, .button {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 11px;
  font: inherit;
  background: white;
}

input[type="search"] { min-width: 260px; }

button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  font-weight: 700;
  cursor: pointer;
}

.button.secondary {
  background: white;
  color: var(--accent-dark);
}

.panel, .module-hero, .kpi-grid, .two-columns {
  margin: 22px 34px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  overflow: auto;
}

.module-hero, .two-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, .7fr);
  gap: 18px;
}

.module-hero > div, .two-columns > .panel {
  margin: 0;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 14px;
}

.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}
.kpi span { color: var(--muted); font-size: 13px; }
.kpi strong { display: block; font-size: 30px; margin-top: 6px; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th, td {
  padding: 10px 9px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
}
th {
  color: #475467;
  font-size: 12px;
  text-transform: uppercase;
  background: #f8fafc;
}

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.module-code {
  font-weight: 800;
  color: var(--module);
}

.version {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.badges {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  font-weight: 700;
  font-size: 12px;
}

.badge.neutral {
  color: #344054;
  background: #f2f4f7;
  border-color: #d0d5dd;
}

.large .badge, .large-badge {
  min-height: 30px;
  font-size: 14px;
}

.summary-list {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 16px;
  margin: 0;
}
.summary-list dt { color: var(--muted); }
.summary-list dd { margin: 0; font-weight: 700; }

.bars { display: grid; gap: 10px; }
.bar-row {
  display: grid;
  grid-template-columns: minmax(160px, 240px) 1fr 40px;
  gap: 10px;
  align-items: center;
}
.bar {
  height: 10px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
}
.bar i {
  display: block;
  height: 100%;
  background: var(--accent);
}

.objective {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 10px 0;
  padding: 8px 12px;
}
.objective summary {
  cursor: pointer;
  display: grid;
  grid-template-columns: 80px 1fr minmax(120px, auto);
  gap: 10px;
  align-items: start;
}

.matrix-table td { min-width: 180px; }
.matrix-table td:first-child { min-width: 60px; font-weight: 800; }
.matrix-table p { margin: 7px 0 0; color: var(--muted); }

.graph-panel { min-height: 660px; }
.graph {
  width: 100%;
  min-height: 600px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  overflow: hidden;
}
.legend {
  display: flex;
  gap: 18px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
}
.legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-right: 6px;
}
.legend-module { background: var(--module); }
.legend-pec { background: var(--pec); }
.legend-objectif { background: var(--objectif); }

.graph text {
  font-size: 12px;
  fill: #182230;
  pointer-events: none;
}
.graph line { stroke: #cbd5e1; stroke-width: 1; }
.graph circle { stroke: white; stroke-width: 2; }

@media (max-width: 900px) {
  body { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
  }
  nav { grid-template-columns: repeat(2, 1fr); }
  .topbar, .filters { padding-left: 18px; padding-right: 18px; }
  .topbar { flex-direction: column; }
  .panel, .module-hero, .kpi-grid, .two-columns { margin-left: 18px; margin-right: 18px; }
  .kpi-grid, .module-hero, .two-columns { grid-template-columns: 1fr; }
  input[type="search"] { min-width: 0; width: 100%; }
  .quick-search { width: 100%; }
}

.subheading { margin-top: 20px; }
.compact-list { display: grid; gap: 7px; margin-top: 8px; }
.compact-list a { color: var(--text); border-left: 3px solid #f59e0b; padding-left: 8px; }
.status { display: inline-flex; align-items: center; min-height: 24px; padding: 2px 8px; border-radius: 999px; font-weight: 700; font-size: 12px; }
.status.warning { color: #92400e; background: #fffbeb; border: 1px solid #fbbf24; }

.note { margin: 18px 34px 0; padding: 12px 14px; border: 1px solid #bae6fd; background: #f0f9ff; color: #164e63; border-radius: 8px; line-height: 1.45; }
.note code { background: rgba(255,255,255,.75); padding: 1px 5px; border-radius: 4px; }
.terminology-note { font-size: 14px; }
@media (max-width: 900px) { .note { margin-left: 18px; margin-right: 18px; } }
