/* dashboard-cu1.css — Styles dashboard CU1 (inline dans index.html) */
/* Note : les styles rcd-* sont injectés dynamiquement par generate_dashboard.js */
/* Ce fichier contient les styles de base du dashboard présents dans le HTML original */

.dash-badge {
  padding: 5px 14px;
  border: 1px solid var(--bd);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--tx2)
}

.dash-actions {
  display: flex;
  gap: 8px
}

.dash-pdf-btn {
  padding: 7px 16px;
  border: 1px solid var(--pri);
  border-radius: 8px;
  background: transparent;
  color: var(--pri);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: .15s
}

.dash-pdf-btn:hover {
  background: var(--pbg)
}

.dash-pdf-btn svg {
  width: 14px;
  height: 14px
}

.dash-metrics {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap
}

.dash-metric {
  flex: 1;
  min-width: 120px
}

.dash-metric-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--tx3);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 4px
}

.dash-metric-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--bd);
  overflow: hidden;
  margin-bottom: 4px
}

.dash-metric-bar span {
  display: block;
  height: 100%;
  border-radius: 3px
}

.dash-metric-val {
  font-size: 13px;
  font-weight: 600
}

.dash-section {
  margin-bottom: 24px
}

.dash-section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--tx3);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--bd)
}

/* Famille de risques (accordéon) */

.dash-fam {
  border: 1px solid var(--bd);
  border-radius: 10px;
  background: var(--wh);
  margin-bottom: 10px;
  overflow: hidden
}

.dash-fam-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  cursor: pointer;
  transition: .15s;
  user-select: none
}

.dash-fam-header:hover {
  background: var(--bg)
}

.dash-fam-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--tx);
  display: flex;
  align-items: center;
  gap: 8px
}

.dash-fam-arrow {
  width: 18px;
  height: 18px;
  transition: transform .2s;
  color: var(--tx3)
}

.dash-fam.open .dash-fam-arrow {
  transform: rotate(180deg)
}

.dash-fam-stats {
  display: flex;
  gap: 6px;
  align-items: center
}

.dash-fam-pill {
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 3px
}

.dash-fam-pill.p-sat { background: var(--gn2); color: var(--gn3) }
.dash-fam-pill.p-acc { background: var(--am2); color: var(--am3) }
.dash-fam-pill.p-ame { background: var(--or2); color: var(--or3) }
.dash-fam-pill.p-mep { background: var(--rd2); color: var(--rd3) }
.dash-fam-pill.p-nev { background: var(--gy2); color: var(--gy) }
.dash-fam-pill.p-nrq { background: var(--gy2); color: var(--tx3) }

.dash-fam-body {
  display: none;
  padding: 0 16px 16px;
  border-top: 1px solid var(--bd)
}

.dash-fam.open .dash-fam-body {
  display: block
}

.dash-fam-bar {
  height: 4px;
  border-radius: 2px;
  display: flex;
  overflow: hidden;
  margin-bottom: 12px;
  margin-top: 12px
}

.dash-fam-bar span {
  height: 100%
}

/* Items de point d'observation */

.dash-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--bd)
}

.dash-item:last-child {
  border-bottom: none
}

.dash-item-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 4px;
  flex-shrink: 0
}

.dash-item-ref {
  font-size: 11px;
  font-weight: 600;
  color: var(--sec);
  min-width: 32px
}

.dash-item-content {
  flex: 1;
  min-width: 0
}

.dash-item-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--tx)
}

.dash-item-just {
  font-size: 12px;
  color: var(--tx2);
  margin-top: 2px;
  line-height: 1.4
}

.dash-item-status {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
  flex-shrink: 0
}

/* Cards grille */

.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px
}

.dash-card {
  padding: 10px 12px;
  border: 1px solid var(--bd);
  border-radius: 8px;
  background: var(--wh);
  position: relative;
  cursor: pointer;
  transition: .15s
}

.dash-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, .06)
}

.dash-card-ref { font-size: 11px; font-weight: 600; color: var(--sec) }
.dash-card-title { font-size: 13px; font-weight: 500; color: var(--tx); margin: 2px 0 4px; line-height: 1.3 }
.dash-card-status { font-size: 11px; font-weight: 600; display: inline-block; padding: 2px 8px; border-radius: 10px }
.dash-card-dot { position: absolute; top: 10px; right: 10px; width: 8px; height: 8px; border-radius: 50% }

/* Statuts couleurs */
.st-sat .dash-card-status, .st-sat .dash-item-status { color: var(--gn3); background: var(--gn2) }
.st-sat .dash-card-dot, .st-sat .dash-item-dot { background: var(--gn) }
.st-acc .dash-card-status, .st-acc .dash-item-status { color: var(--am3); background: var(--am2) }
.st-acc .dash-card-dot, .st-acc .dash-item-dot { background: var(--am) }
.st-ame .dash-card-status, .st-ame .dash-item-status { color: var(--or3); background: var(--or2) }
.st-ame .dash-card-dot, .st-ame .dash-item-dot { background: var(--or) }
.st-mep .dash-card-status, .st-mep .dash-item-status { color: var(--rd3); background: var(--rd2) }
.st-mep .dash-card-dot, .st-mep .dash-item-dot { background: var(--rd) }
.st-nev .dash-card-status, .st-nev .dash-item-status { color: var(--gy); background: var(--gy2) }
.st-nev .dash-card-dot, .st-nev .dash-item-dot { background: var(--gy); opacity: .5 }
.st-nrq .dash-card-status, .st-nrq .dash-item-status { color: var(--tx3); background: var(--gy2) }
.st-nrq .dash-card-dot, .st-nrq .dash-item-dot { background: var(--tx3); opacity: .3 }
.st-abs .dash-card-status, .st-abs .dash-item-status { color: var(--gn3); background: var(--gn2) }
.st-abs .dash-card-dot, .st-abs .dash-item-dot { background: var(--gn); opacity: .4 }

.dash-card-just {
  display: none;
  font-size: 12px;
  color: var(--tx2);
  margin-top: 6px;
  line-height: 1.5;
  border-top: 1px solid var(--bd);
  padding-top: 6px
}

.dash-card.open .dash-card-just { display: block }
.dash-card.open { grid-column: 1/-1 }

/* Scénarios */

.dash-scenario {
  padding: 16px;
  border: 1px solid var(--bd);
  border-radius: 10px;
  background: var(--wh);
  margin-bottom: 10px
}

.dash-scenario-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 8px
}

.dash-scenario-title { font-size: 15px; font-weight: 600; color: var(--tx) }
.dash-scenario-badges { display: flex; gap: 6px; flex-wrap: wrap }

.dash-gravity {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .3px
}

.grav-1 { background: var(--gn2); color: var(--gn3) }
.grav-2 { background: var(--am2); color: var(--am3) }
.grav-3 { background: var(--or2); color: var(--or3) }
.grav-4 { background: var(--rd2); color: var(--rd3) }

.grav-dots { display: flex; gap: 3px }
.grav-dots span { width: 8px; height: 8px; border-radius: 50% }

.dash-scenario-text {
  font-size: 13px;
  line-height: 1.6;
  color: var(--tx);
  padding: 12px;
  background: var(--bg);
  border-radius: 8px;
  margin-top: 10px
}

.dash-scenario-amounts { display: flex; gap: 12px; margin-top: 10px; flex-wrap: wrap }
.dash-scenario-amount { padding: 8px 14px; background: var(--bg); border-radius: 8px; flex: 1; min-width: 150px }
.dash-scenario-amount-label { font-size: 10px; font-weight: 600; color: var(--tx3); text-transform: uppercase; letter-spacing: .5px }
.dash-scenario-amount-val { font-size: 15px; font-weight: 600; color: var(--tx); margin-top: 2px }

/* Matrice risque */

.dash-matrix {
  display: inline-grid;
  grid-template-columns: 24px repeat(4, 40px);
  grid-template-rows: auto repeat(4, 40px);
  gap: 2px;
  margin: 12px auto;
  font-size: 10px;
  font-weight: 600
}

.dash-matrix-cell { display: flex; align-items: center; justify-content: center; border-radius: 4px; font-size: 10px }
.dash-matrix-label { display: flex; align-items: center; justify-content: center; color: var(--tx3); font-size: 10px; font-weight: 600 }
.dash-matrix-dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--wh); box-shadow: 0 0 0 1px var(--tx3) }

/* Recommandations */

.dash-reco {
  padding: 12px 16px;
  border: 1px solid var(--bd);
  border-radius: 10px;
  background: var(--wh);
  margin-bottom: 8px;
  display: flex;
  align-items: flex-start;
  gap: 12px
}

.dash-reco-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center
}

.dash-reco-icon svg { width: 18px; height: 18px }
.dash-reco-body { flex: 1; min-width: 0 }
.dash-reco-title { font-size: 14px; font-weight: 600; color: var(--tx) }
.dash-reco-desc { font-size: 12px; color: var(--tx2); margin-top: 2px; line-height: 1.4 }

.dash-reco-impact {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 3px 10px;
  border-radius: 10px;
  white-space: nowrap;
  align-self: center
}

.imp-fort { background: var(--rd2); color: var(--rd3) }
.imp-moyen { background: var(--am2); color: var(--am3) }
.imp-faible { background: var(--gy2); color: var(--gy) }
.imp-aucun { background: var(--gy2); color: var(--tx3) }

/* Toggle vue */

.dash-toggle { display: flex; gap: 4px; margin-bottom: 12px }
.dash-toggle button {
  padding: 5px 12px;
  border: 1px solid var(--bd);
  background: var(--wh);
  border-radius: 6px;
  font-size: 12px;
  color: var(--tx2);
  cursor: pointer;
  transition: .15s
}
.dash-toggle button.on {
  background: var(--pri);
  color: white;
  border-color: var(--pri)
}

.dash-raw {
  display: none;
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.7;
  max-height: 600px;
  overflow-y: auto;
  padding: 12px;
  background: var(--bg);
  border-radius: 8px;
  border: 1px solid var(--bd)
}
