/* ============================================
   Scorecard — Thème charcoal + or
   Bande et sidebar sombres, fond gris clair, accent violet
   ============================================ */

:root {
  --bg-page: #f4f5f7;
  --bg-main: #ffffff;
  --bg-sidebar: #282c34;
  --card-bg: #ffffff;
  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  --card-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.1);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --border-light: #e5e7eb;
  --text-primary: #282c34;
  --text-secondary: #666666;
  --text-sidebar: #ffffff;
  --text-sidebar-dim: #b0b0b0;
  --accent: #A684FF;
  --accent-hover: #8f6ae8;
  --accent-soft: rgba(166, 132, 255, 0.12);
  --positive: #059669;
  --negative: #dc2626;
  --warn: #A684FF;
  --score-green: #059669;
  --score-yellow: #eab308;
  --score-orange: #f59e0b;
  --score-red: #dc2626;
}

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

html { overflow: hidden; height: 100%; min-height: 100%; }

body {
  margin: 0;
  padding: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-page);
  min-height: 100%;
  height: 100vh;
  height: 100dvh; /* évite la bande blanche en bas sur mobile (barre d’adresse) */
  max-height: 100vh;
  max-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.tool-container {
  width: 100%;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-main);
  overflow: hidden;
}

.scorecard-top-band {
  flex-shrink: 0;
  display: flex;
  align-items: stretch;
  background: var(--bg-sidebar);
  color: #fff;
  padding: 28px 0 24px 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.scorecard-top-band-spacer {
  width: 260px;
  flex-shrink: 0;
}
.scorecard-top-band-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 32px;
}
.scorecard-top-title {
  font-family: "DM Serif Display", Georgia, serif;
  font-size: 1.75rem;
  font-weight: 400;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: #ffffff;
}
.scorecard-top-subtitle {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.9375rem;
  font-weight: 400;
  margin: 0;
  color: var(--text-sidebar-dim);
}

.app-layout { display: flex; flex: 1; min-height: 0; overflow: hidden; position: relative; }

/* ----- Sidebar (violet foncé type Pluralsight) ----- */
.sidebar-left {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 260px;
  background: var(--bg-sidebar);
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow: hidden;
  z-index: 1;
}
.sidebar-left .sidebar-title {
  color: var(--text-sidebar);
  font-size: 0.8125rem;
  font-weight: 600;
}
.sidebar-title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 16px; padding: 0 20px; }
.sidebar-title-row .sidebar-title { margin: 0; flex: 1; }
.sidebar-add-participant {
  width: 36px; height: 36px; padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-size: 1.25rem; font-weight: 300; line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, transform 0.15s;
}
.sidebar-add-participant:hover { background: var(--accent-hover); transform: scale(1.05); }
.sidebar-section { flex: 1; min-height: 0; padding: 0 16px; }
.sidebar-left .participant-tabs { flex: 1; overflow-y: auto; margin-bottom: 16px; }
.participant-tabs { display: flex; flex-direction: column; gap: 8px; }
.participant-tab-wrap {
  position: relative;
  display: flex; align-items: center;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  overflow: hidden;
  transition: background 0.2s, border-color 0.2s;
}
.participant-tab-wrap:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.2); }
.sidebar-left .participant-tab-wrap.active {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.participant-tab {
  flex: 1;
  padding: 14px 100px 14px 16px;
  font-size: 0.875rem; font-weight: 500;
  color: var(--text-sidebar);
  background: transparent; border: none;
  cursor: pointer; text-align: left;
}
.sidebar-left .participant-tab-wrap.active .participant-tab { color: #fff; }
.participant-tab-reset, .participant-tab-trash, .participant-tab-edit {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: none; border-radius: var(--radius-sm);
  cursor: pointer; color: var(--text-sidebar-dim);
  transition: color 0.2s, background 0.2s;
}
.participant-tab-edit { right: 68px; }
.participant-tab-reset { right: 36px; }
.participant-tab-trash { right: 4px; }
.participant-tab-reset:hover, .participant-tab-trash:hover, .participant-tab-edit:hover { color: var(--text-sidebar); background: rgba(255,255,255,0.08); }
.participant-tab-trash:hover { color: #f87171; }
.sidebar-left .participant-tab-wrap.active .participant-tab-edit { color: rgba(255,255,255,0.9); }
.sidebar-left .participant-tab-wrap.active .participant-tab-edit:hover { color: #fff; background: rgba(255,255,255,0.15); }

.app-main { flex: 1; min-width: 0; margin-left: 260px; display: flex; flex-direction: column; overflow: hidden; }

.btn-calculer {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 12px 24px;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 2px 8px rgba(201, 162, 39, 0.3);
  transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
  min-height: 44px;
}
.btn-calculer:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 14px rgba(201, 162, 39, 0.35);
}
.btn-calculer:active { transform: scale(0.98); }
.btn-calculer:disabled { cursor: wait; opacity: 0.85; }
.btn-text { flex: 1; }
.btn-icon {
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.25);
  border-radius: 6px;
}
.btn-icon path { stroke: #fff; }

/* ----- Contenu principal ----- */
#simulateur-scoring {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-page);
  padding: 24px 32px 32px;
  overflow: hidden;
}
.no-participant-overlay {
  display: none;
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg-page);
  align-items: flex-start;
  justify-content: center;
  padding: 40px 32px 24px;
  z-index: 10;
  pointer-events: none;
}
#simulateur-scoring.no-participant .no-participant-overlay { display: flex; pointer-events: auto; }
.no-participant-card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
  padding: 48px 56px 56px;
  max-width: 480px;
  width: 100%;
  text-align: center;
}
.no-participant-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 16px;
  letter-spacing: -0.02em;
  line-height: 1.3;
}
.no-participant-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  margin: 0 0 16px;
  line-height: 1.5;
}
.no-participant-add-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--accent);
  background: #fff;
  border: 2px dashed var(--accent);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.05s;
}
.no-participant-add-btn:hover {
  background: rgba(166, 132, 255, 0.08);
  color: var(--accent-hover);
  border-color: var(--accent-hover);
}
.no-participant-add-btn:active { transform: scale(0.98); }
#simulateur-scoring.no-participant { pointer-events: none; user-select: none; }

/* ----- Onglets + bouton Calculer ----- */
.form-tabs-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
  flex-shrink: 0;
  border-bottom: 2px solid var(--border-light);
  padding-bottom: 0;
}
.form-tabs {
  display: flex;
  gap: 0;
  flex: 0 0 auto;
  margin-bottom: 0;
  padding-bottom: 0;
}
.form-tabs-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: 4px;
}
.btn-calculer-in-tabs {
  flex-shrink: 0;
  margin-left: 0;
  align-self: center;
  min-height: 38px;
  padding: 10px 24px;
  font-size: 0.9375rem;
}
.btn-voir-rapport {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 10px 24px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.btn-voir-rapport:hover {
  background: var(--bg-page);
  border-color: var(--accent);
  color: var(--accent);
}
.form-tab {
  padding: 14px 24px 16px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: 0;
  cursor: pointer;
  position: relative;
  margin-bottom: -2px;
  transition: color 0.2s;
}
.form-tab:hover { color: var(--text-primary); }
.form-tab.active {
  color: var(--accent);
  font-weight: 600;
}
.form-tab.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--accent);
}
.form-tab-content { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.form-tab-panel { display: none; flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding-top: 28px; }
.form-tab-panel.active { display: block; }

/* ----- Grille formulaire (cartes légères) ----- */
.grid-simu {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
  width: 100%;
}
.bloc {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  padding: 16px;
  border-radius: var(--radius-md);
  box-shadow: var(--card-shadow);
  transition: box-shadow 0.2s, border-color 0.2s;
}
.bloc:hover {
  box-shadow: var(--card-shadow-hover);
  border-color: var(--accent-soft);
}
.bloc h4 {
  margin: 0 0 12px 0;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}
.bloc label {
  display: flex;
  flex-direction: column;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 10px;
}
.bloc label:last-child { margin-bottom: 0; }
.champ-participant-conditionnel { margin-top: 1rem; }
.champ-participant-conditionnel label { margin-bottom: 0; }
.bloc input, .bloc select {
  margin-top: 5px;
  padding: 8px 10px;
  font-size: 0.8125rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: #fff;
  color: var(--text-primary);
  transition: border-color 0.2s;
}
.bloc input:focus, .bloc select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

label { display: flex; flex-direction: column; font-size: 0.875rem; font-weight: 500; color: var(--text-secondary); margin-bottom: 14px; }
label:last-child { margin-bottom: 0; }
input, select {
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  font-size: 0.9375rem;
  font-family: inherit;
  background: #fff;
  color: var(--text-primary);
  width: 100%;
  box-sizing: border-box;
}
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.section-title-personnelles, .section-title-justificatifs {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light);
}
.section-justificatifs { margin-top: 32px; padding-top: 32px; border-top: 1px solid var(--border-light); }
.form-tab-justif .section-justificatifs { margin-top: 0; padding-top: 0; border-top: none; }

/* ----- Alerte fraude ----- */
.alerte-fraude-container { margin-top: 24px; margin-bottom: 20px; }
.alerte-fraude-content {
  padding: 18px 24px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--card-shadow);
}
.alerte-fraude-icon { font-size: 1.5rem; flex-shrink: 0; }
.alerte-fraude-text { color: #b91c1c; font-size: 0.9375rem; font-weight: 700; }

/* ----- Résultat global ----- */
.result-global {
  margin-top: 0;
  padding-top: 0;
  padding: 24px 32px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.result-global .score-container { width: 100%; max-width: 100%; display: flex; flex-direction: column; gap: 24px; }
.form-tab-result .result-global { padding: 24px 32px; }

/* ----- Grille résultat 2×2 ----- */
.result-frames-wrapper { display: flex; flex-direction: column; gap: 20px; align-items: flex-start; }
.result-participant-banner {
  font-size: 0.875rem;
  color: var(--text-light);
  margin-bottom: 4px;
}
.result-participant-banner #result-participant-name { font-weight: 600; color: var(--text-primary); }
.result-participant-banner .result-participant-score-dossier { color: var(--text-light); font-weight: 400; }
.result-dashboard-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto 1fr;
  gap: 20px;
  width: 100%;
  max-width: 900px;
  min-height: 480px;
}
.result-dashboard-layout .result-frame { min-height: 0; min-width: 0; }
/* Score et Indicateurs financiers : même hauteur (celle du plus grand des deux) */
.result-dashboard-layout .result-frame-score,
.result-dashboard-layout .result-frame-finances {
  min-height: 0;
}
.result-dashboard-layout .result-frame-score .result-frame-content,
.result-dashboard-layout .result-frame-finances .result-frame-content {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.result-frame {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.result-frame-content { padding: 20px; flex: 1; min-height: 0; overflow: auto; }
.result-frame-full { width: 100%; grid-column: 1 / -1; }

/* ----- Score (cercle + valeur + label + sublabel) ----- */
.result-frame-content-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
/* Cercle + valeur : commun Score et Finances (même taille, même police) */
.result-frame-score .dashboard-kpi { gap: 8px; }
.result-frame-score .score-circle-wrap,
.result-frame-finances .score-circle-wrap {
  position: relative;
  width: 120px;
  height: 120px;
  flex-shrink: 0;
}
.result-frame-score .score-circle-svg,
.result-frame-finances .score-circle-svg {
  width: 100%;
  height: 100%;
}
.result-frame-score .score-circle-svg { transform: rotate(-90deg); }
.result-frame-score .score-circle-bg {
  fill: none;
  stroke: var(--border-light);
  stroke-width: 8;
}
.result-frame-finances .score-circle-bg {
  fill: none;
  stroke: var(--border-light);
  stroke-width: 8;
}
.result-frame-finances .score-circle-svg.financial-gauge-svg { transform: rotate(-90deg); }
.result-frame-finances .score-circle-progress.financial-gauge-progress {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 565.49;
  stroke-dashoffset: 565.49;
  stroke: var(--positive);
  transition: stroke-dashoffset 0.5s ease, stroke 0.2s;
}
.result-frame-finances .financial-kpi-wrap.warn .financial-gauge-progress { stroke: var(--warn); }
.result-frame-finances .financial-kpi-wrap.danger .financial-gauge-progress { stroke: var(--negative); }
.result-frame-score .score-circle-progress {
  fill: none;
  stroke: var(--accent);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 565.49;
  stroke-dashoffset: 565.49;
  transition: stroke-dashoffset 0.5s ease, stroke 0.2s;
}
.result-frame-score .score-circle-progress.score-ring-solvable { stroke: var(--score-green); }
.result-frame-score .score-circle-progress.score-ring-risque-bas { stroke: var(--score-yellow); }
.result-frame-score .score-circle-progress.score-ring-risque-eleve { stroke: var(--score-orange); }
.result-frame-score .score-circle-progress.score-ring-insolvable { stroke: var(--score-red); }
.result-frame-score .score-circle-value,
.result-frame-finances .score-circle-value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}
#simulateur-scoring.score-solvable .result-frame-score .score-circle-value { color: var(--score-green); }
#simulateur-scoring.score-risque-bas .result-frame-score .score-circle-value { color: var(--score-yellow); }
#simulateur-scoring.score-risque-eleve .result-frame-score .score-circle-value { color: var(--score-orange); }
#simulateur-scoring.score-insolvable .result-frame-score .score-circle-value { color: var(--score-red); }
#simulateur-scoring.score-solvable .result-frame-score .dashboard-kpi-sublabel { color: var(--score-green); }
#simulateur-scoring.score-risque-bas .result-frame-score .dashboard-kpi-sublabel { color: var(--score-yellow); }
#simulateur-scoring.score-risque-eleve .result-frame-score .dashboard-kpi-sublabel { color: var(--score-orange); }
#simulateur-scoring.score-insolvable .result-frame-score .dashboard-kpi-sublabel { color: var(--score-red); }
.result-frame-finances .financial-kpi-wrap .score-circle-value { color: var(--positive); }
.result-frame-finances .financial-kpi-wrap.warn .score-circle-value { color: var(--warn); }
.result-frame-finances .financial-kpi-wrap.danger .score-circle-value { color: var(--negative); }
.result-frame-score .dashboard-kpi-label,
.result-frame-finances .dashboard-kpi-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.result-frame-score .dashboard-kpi-sublabel {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 400;
  margin-top: 4px;
}

/* ----- Carte ----- */
.mini-map-wrapper {
  margin-top: 0;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-page);
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.mini-map-france { width: 100%; height: 200px; min-height: 180px; flex: 1; }
.result-frame-map .result-frame-content { display: flex; flex-direction: column; padding: 12px; overflow: hidden; min-height: 0; }
.result-frame-map .mini-map-wrapper { margin-top: 0; }
.result-frame-map .mini-map-france { flex: 1; min-height: 220px; }
.mini-map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  padding: 10px 14px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-light);
  background: #fff;
}
.mini-map-legend-item { display: inline-flex; align-items: center; gap: 8px; }
.mini-map-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.mini-map-dot-domicile { background: var(--positive); }
.mini-map-dot-bien { background: var(--accent); }
.mini-map-dot-travail { background: #f59e0b; }

/* ----- Placeholders ----- */
.result-placeholder, .rapport-placeholder {
  font-size: 1rem;
  color: var(--text-secondary);
  text-align: center;
  margin: 0;
  padding: 32px 24px;
}
.result-placeholder strong, .rapport-placeholder strong { color: var(--text-primary); }
.rapport-panel-inner { padding: 24px 32px; }

/* ----- Rapport ----- */
.rapport-container {
  margin-top: 0;
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--card-shadow);
}
.result-frame-title {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-page);
}
.rapport-content, .rapport-content p { font-size: 0.9375rem; line-height: 1.7; color: var(--text-secondary); }
.rapport-content p { margin-bottom: 12px; }
.rapport-content .rapport-section { font-weight: 600; color: var(--text-primary); margin-top: 16px; margin-bottom: 6px; font-size: 0.9375rem; }
.rapport-content .rapport-vigilance, .rapport-content .rapport-vigilance .rapport-section, .rapport-content .rapport-vigilance ul li { color: #b91c1c; }
.rapport-content ul { margin: 8px 0 14px 20px; padding: 0; }
.result-frame-full.rapport-container .result-frame-content { padding: 20px 24px; }
.rapport-actions { padding: 16px 24px 24px; border-top: 1px solid var(--border-light); background: var(--bg-page); }
.btn-ouvrir-rapport {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--card-bg);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.btn-ouvrir-rapport:hover {
  background: var(--accent-soft);
  color: var(--accent);
}
.result-frame-full.alerte-fraude-container .alerte-fraude-content { border-radius: 0; border-left: none; border-right: none; border-bottom: none; }
.result-frame-title-alert { background: #fef2f2; color: #b91c1c; }

/* ----- Finances (même visuel que Score : valeur + label) ----- */
.result-frame-content-finances {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  padding: 24px;
}
.result-frame-finances .financial-section {
  background: var(--card-bg);
  padding: 0.75rem 1.25rem 1.25rem;
  border-radius: 20px;
  box-shadow: 0 4px 20px var(--card-shadow);
  margin-bottom: 0;
}
.result-frame-finances .financial-viz {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
.result-frame-finances .financial-kpi-wrap {
  text-align: center;
}
.result-frame-finances .financial-kpi-wrap .dashboard-kpi {
  gap: 8px;
  align-items: center;
}
.dashboard-bar-distance { background: var(--accent); }
.dashboard-bar-distance.warn { background: var(--warn); }
.dashboard-bar-distance.danger { background: var(--negative); }

/* ----- Alertes KPI ----- */
.result-frame-content-alertes { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; }
.result-frame-alertes .dashboard-kpi { gap: 8px; }
.dashboard-kpi { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.dashboard-kpi-value { font-size: 2.25rem; font-weight: 800; line-height: 1; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.dashboard-kpi-value.alert-ok { color: var(--positive); }
.dashboard-kpi-value.alert-warn { color: var(--score-orange); }
.dashboard-kpi-value.alert-danger { color: var(--score-orange); }
.dashboard-kpi-label { font-size: 0.75rem; color: var(--text-secondary); font-weight: 500; }
.result-frame-alertes .dashboard-kpi-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.dashboard-kpi-sublabel { font-size: 0.75rem; color: var(--text-secondary); font-weight: 400; margin-top: 4px; }
#dashboard-kpi-alertes { cursor: pointer; }
#dashboard-kpi-alertes:hover { opacity: 0.85; }

/* ----- Popup ----- */
.popup-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.4); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.popup-content { background: #fff; border-radius: var(--radius-md); padding: 0; max-width: 440px; width: 90%; max-height: 85vh; overflow-y: auto; border: 1px solid var(--border-light); box-shadow: 0 24px 48px rgba(0,0,0,0.12); }
.popup-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--border-light); }
.popup-header h4 { margin: 0; font-size: 1.125rem; font-weight: 700; color: var(--text-primary); }
.popup-close { background: var(--bg-page); border: 1px solid var(--border-light); font-size: 1.25rem; color: var(--text-secondary); cursor: pointer; padding: 0; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); transition: all 0.2s; }
.popup-close:hover { background: var(--border-light); color: var(--text-primary); }
.popup-body { padding: 24px; }
.popup-body p { margin: 0 0 14px 0; color: var(--text-secondary); font-size: 0.9375rem; }
.popup-body ul { margin: 0; padding-left: 22px; color: var(--text-primary); }
.popup-body li { margin-bottom: 8px; font-size: 0.9375rem; }
.popup-nom-label { display: block; margin-bottom: 10px; font-size: 1rem; font-weight: 600; color: var(--text-primary); }
.popup-nom-input { width: 100%; padding: 12px 14px; font-size: 1rem; border: 1px solid var(--border-light); border-radius: var(--radius-sm); margin-bottom: 8px; box-sizing: border-box; }
.popup-nom-input.invalid { border-color: var(--negative); }
.popup-nom-error { margin: 0 0 12px 0; font-size: 0.875rem; color: var(--negative); display: none; }
.popup-nom-error[style*="block"] { display: block; }
.popup-nom-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.popup-conjoint-text { margin-bottom: 20px !important; font-size: 1rem; color: var(--text-primary) !important; }
.popup-conjoint-buttons { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.btn-popup-conjoint { padding: 12px 24px; border-radius: var(--radius-sm); font-size: 0.9375rem; font-weight: 600; cursor: pointer; border: none; transition: all 0.2s; position: relative; z-index: 1; pointer-events: auto; width: 100%; }
.btn-popup-non { background: var(--bg-page); color: var(--text-primary); border: 1px solid var(--border-light); }
.btn-popup-non:hover { background: var(--border-light); }
.btn-popup-oui { background: var(--accent); color: #fff; }
.btn-popup-oui:hover { background: var(--accent-hover); }
#popup-conjoint .popup-content { pointer-events: auto; }

/* ----- Responsive ----- */
@media (max-width: 1200px) { .grid-simu { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 900px) {
  .sidebar-left { position: relative; width: 100%; flex-direction: row; flex-wrap: wrap; padding: 16px 20px; border-bottom: 1px solid rgba(255,255,255,0.12); }
  .app-main { margin-left: 0; }
  .scorecard-top-band-spacer { width: 0; min-width: 0; overflow: hidden; }
  .sidebar-section { flex-direction: row; flex-wrap: wrap; align-items: center; padding: 0; }
  .sidebar-left .participant-tabs { flex-direction: row; flex-wrap: wrap; margin-bottom: 0; gap: 8px; }
  .sidebar-left .participant-tab-wrap { width: auto; }
  .result-dashboard-layout { grid-template-columns: 1fr; grid-template-rows: repeat(4, minmax(200px, 1fr)); }
}
@media (max-width: 600px) {
  .grid-simu { grid-template-columns: 1fr; }
  #simulateur-scoring { padding-left: 20px; padding-right: 20px; }
  .score-circle { width: 180px; height: 180px; }
  .result-frame-score .score-value { font-size: 2.5rem; }
  .result-frame-finances .financial-viz { grid-template-columns: 1fr; }
}
