:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-2: #334155;
  --border: #475569;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --accent: #06b6d4;
  --accent-2: #3b82f6;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --critique: #dc2626;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  font-size: 14px;
}

/* TOPBAR */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 28px;
  background: linear-gradient(135deg, #1e3a8a 0%, #0f172a 100%);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { display: flex; align-items: center; gap: 16px; }
.logo {
  width: 48px; height: 48px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px;
  color: #fff;
}
h1 { font-size: 18px; font-weight: 600; }
.subtitle { color: var(--text-muted); font-size: 12px; }
.meta { display: flex; align-items: center; gap: 16px; font-size: 12px; color: var(--text-muted); }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
}
.btn-ghost:hover { background: var(--surface-2); }

/* TABS */
.tabs {
  display: flex;
  gap: 4px;
  padding: 0 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 12px 18px;
  cursor: pointer;
  font-size: 13px;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

/* MAIN */
main { padding: 24px 28px; max-width: 1400px; margin: 0 auto; }
.tab-content { display: none; }
.tab-content.active { display: block; }

h2 {
  font-size: 15px;
  font-weight: 600;
  margin: 24px 0 12px;
  color: var(--text);
}

/* SCORE CARD */
.score-card {
  background: linear-gradient(135deg, #1e3a8a 0%, #0c4a6e 100%);
  padding: 20px 24px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
}
.score-badge {
  font-size: 42px;
  font-weight: 800;
  padding: 8px 20px;
  background: rgba(0,0,0,.25);
  border-radius: 10px;
  color: var(--warning);
}

/* KPI GRID */
.grid.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.kpi {
  background: var(--surface);
  padding: 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
}
.kpi-label { color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; }
.kpi-value { font-size: 22px; font-weight: 700; margin-top: 6px; }
.kpi-hint { color: var(--text-muted); font-size: 11px; margin-top: 4px; }
.kpi.critique { border-left-color: var(--critique); }
.kpi.warning { border-left-color: var(--warning); }
.kpi.ok { border-left-color: var(--success); }

/* ALERTS */
.alerts { display: flex; flex-direction: column; gap: 10px; }
.alert {
  background: var(--surface);
  padding: 14px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--warning);
}
.alert.CRITIQUE { border-left-color: var(--critique); }
.alert.ÉLEVÉ { border-left-color: var(--warning); }
.alert-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}
.alert-title { font-weight: 600; font-size: 14px; }
.alert-level {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  font-weight: 700;
}
.alert.CRITIQUE .alert-level { background: var(--critique); color: #fff; }
.alert.ÉLEVÉ .alert-level { background: var(--warning); color: #000; }
.alert-body { color: var(--text-muted); font-size: 13px; }
.alert-meta { color: var(--text-muted); font-size: 11px; margin-top: 6px; }
.alert-action { margin-top: 8px; font-size: 13px; }

/* HEALTH */
.health {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}
.health-item {
  background: var(--surface);
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 13px;
}
.health-label { color: var(--text-muted); font-size: 11px; margin-bottom: 4px; }

/* CARD LIST */
.card-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.card {
  background: var(--surface);
  padding: 18px;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.card h3 {
  font-size: 15px;
  margin-bottom: 10px;
  color: var(--accent);
}
.card .row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 13px; border-bottom: 1px dashed var(--border); }
.card .row:last-child { border-bottom: none; }
.card .row .label { color: var(--text-muted); }
.card .row .value { font-weight: 500; text-align: right; max-width: 60%; }

/* TABLE */
.search {
  width: 100%;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  margin-bottom: 12px;
  font-size: 13px;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: 10px;
  overflow: hidden;
  font-size: 12px;
}
.data-table th, .data-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.data-table th {
  background: var(--surface-2);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.data-table tr:hover td { background: rgba(6,182,212,.05); }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}
.badge.critique { background: var(--critique); color: #fff; }
.badge.haute { background: var(--warning); color: #000; }
.badge.moyenne { background: var(--accent-2); color: #fff; }
.badge.basse { background: var(--surface-2); color: var(--text-muted); }

/* ACTIONS LIST */
.actions-list {
  list-style: none;
  counter-reset: step;
}
.actions-list li {
  background: var(--surface);
  padding: 14px 16px 14px 50px;
  border-radius: 8px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  position: relative;
  counter-increment: step;
  font-size: 13px;
}
.actions-list li::before {
  content: counter(step);
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
}

.hint { color: var(--text-muted); font-size: 12px; margin-bottom: 12px; }

.levier {
  background: var(--surface);
  border-radius: 10px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
}
.levier-pri {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 700;
  margin-bottom: 8px;
}
.levier-titre { font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.levier-desc { color: var(--text-muted); font-size: 13px; margin-bottom: 8px; line-height: 1.5; }
.levier-gain {
  font-size: 12px;
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
  padding: 6px 10px;
  border-radius: 6px;
  display: inline-block;
}
