/* ════════════════════════════════════════════════════════
   bcr.css — styles spécifiques à la page « BCR & Isorisque — Sélection des actions de maintenance »
   (extraits de l'ancien <style> en ligne de bcr.html)
════════════════════════════════════════════════════════ */

/* ════════════════════════════════════════════════════════
   STYLES SPÉCIFIQUES PAGE BCR
   Ces variables CSS (.var) viennent du style.css global.
   On les réutilise pour garder la cohérence visuelle.
════════════════════════════════════════════════════════ */

/* ── Grille principale : 2 colonnes côte à côte ── */
.bcr-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 32px;
}

/* Sur petit écran (mobile), on empile les colonnes */
@media (max-width: 800px) {
  .bcr-grid { grid-template-columns: 1fr; }
}

/* ── Carte générique (bloc avec bordure) ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 24px;
}

/* ── Label de champ formulaire ── */
.field-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
  display: block;
}

/* ── Champ texte / nombre ── */
.field-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px 10px;
  color: var(--text);
  font-size: 0.85rem;
  font-family: 'Inter', sans-serif;
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.field-input:focus {
  outline: none;
  border-color: var(--accent);
}

/* ── Groupe de champ (label + input) ── */
.field-group {
  margin-bottom: 14px;
}

/* ── Ligne d'aide sous un champ (texte gris) ── */
.field-hint {
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: 3px;
}

/* ── Carte résultat BCR ── */
.bcr-result-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 16px;
  margin-bottom: 12px;
  transition: border-color 0.2s;
  position: relative;
}

/* Couleur de bordure selon le verdict BCR */
.bcr-result-card.verdict-excellent { border-color: #4ade80; }
.bcr-result-card.verdict-bon       { border-color: #86efac; }
.bcr-result-card.verdict-limite    { border-color: #fde047; }
.bcr-result-card.verdict-mauvais   { border-color: #f87171; }

/* ── En-tête de la carte résultat ── */
.bcr-result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

/* ── Nom de l'action ── */
.bcr-result-name {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
}

/* ── Badge BCR (affiché en haut à droite) ── */
.bcr-badge {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  padding: 4px 12px;
  border-radius: 4px;
}
.bcr-badge.excellent { background: rgba(74,222,128,0.15); color: #4ade80; }
.bcr-badge.bon       { background: rgba(134,239,172,0.15); color: #86efac; }
.bcr-badge.limite    { background: rgba(253,224,71,0.15);  color: #fde047; }
.bcr-badge.mauvais   { background: rgba(248,113,113,0.15); color: #f87171; }

/* ── Petit badge secondaire (BCR actualisé) ── */
.bcr-badge-small {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.78rem;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--muted);
}

/* ── Ligne de détail dans la carte résultat ── */
.bcr-detail-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  padding: 3px 0;
  border-bottom: 1px dashed var(--border);
}
.bcr-detail-row:last-child { border-bottom: none; }
.bcr-detail-label { color: var(--muted); }
.bcr-detail-value { font-weight: 600; font-family: 'Syne', sans-serif; }

/* ── Badge de rang (classement) ── */
.rank-badge {
  position: absolute;
  top: -10px;
  left: 12px;
  background: var(--accent);
  color: #000;
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 3px;
}

/* ── Conteneur du graphique isorisque ── */
.isorisk-container {
  width: 100%;
  position: relative;
}

/* ── Canvas pour le graphique (Chart.js dessinera dedans) ── */
#isoriskChart {
  width: 100% !important;
  max-height: 380px;
}

/* ── Légende du graphique isorisque ── */
.isorisk-legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
  font-size: 0.7rem;
}

/* ── Tableau de classement final ── */
.ranking-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  margin-top: 16px;
}
.ranking-table th {
  text-align: left;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}
.ranking-table td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.ranking-table tr:last-child td { border-bottom: none; }
.ranking-table tr:hover td { background: rgba(255,255,255,0.02); }

/* ── Barre de progression (visualise le BCR) ── */
.bcr-bar-wrap {
  background: var(--border);
  border-radius: 3px;
  height: 6px;
  width: 120px;
  overflow: hidden;
}
.bcr-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s;
}

/* ── Message vide (aucune action saisie) ── */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.8;
}
.empty-state-icon { font-size: 2rem; margin-bottom: 12px; }

/* ── Bloc d'info (formule mathématique expliquée) ── */
.math-info {
  background: rgba(250,204,21,0.06);
  border: 1px solid rgba(250,204,21,0.2);
  border-radius: 6px;
  padding: 12px 16px;
  font-size: 0.75rem;
  line-height: 1.7;
  margin-bottom: 20px;
}
.math-info strong { color: var(--accent); font-family: 'Syne', sans-serif; }
.math-formula {
  font-family: monospace;
  background: var(--bg);
  padding: 6px 10px;
  border-radius: 4px;
  margin: 6px 0;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
}

/* ── Séparateur entre actions ── */
.action-separator {
  border: none;
  border-top: 1px dashed var(--border);
  margin: 16px 0;
}

/* ── Bouton supprimer (×) ── */
.btn-remove {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 2px 6px;
  border-radius: 3px;
  transition: color 0.15s;
  float: right;
}
.btn-remove:hover { color: #f87171; }

/* ── Compteur d'actions ── */
.action-count {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

/* ── Toggle coût ponctuel ── */
.ponctuel-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 6px 10px;
  background: var(--bg);
  border-radius: 4px;
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 0.75rem;
  color: var(--muted);
  user-select: none;
}
.ponctuel-toggle input[type="checkbox"] {
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
  cursor: pointer;
}
.ponctuel-toggle.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(250,204,21,0.06);
}

/* ── Bloc coût ponctuel (affiché si toggle actif) ── */
.ponctuel-bloc {
  background: rgba(250,204,21,0.04);
  border: 1px solid rgba(250,204,21,0.15);
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 10px;
  display: none;  /* caché par défaut, affiché par JS */
}
.ponctuel-bloc.visible { display: block; }

/* ── Grille 2 colonnes pour les champs ponctuel/durée ── */
.field-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ════════════════════════════════════════════════════════
   COURBE €/RU — styles spécifiques
════════════════════════════════════════════════════════ */

.eru-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
}
.eru-table th {
  text-align: left;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
}
.eru-table td {
  padding: 8px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.eru-table tr:last-child td { border-bottom: none; }

/* ── Bloc seuil d'arbitrage ── */
.arbitrage-bloc {
  background: rgba(250,204,21,0.06);
  border: 1px solid rgba(250,204,21,0.25);
  border-radius: 6px;
  padding: 12px 14px;
  font-size: 0.75rem;
  line-height: 1.7;
  margin-top: 16px;
}
.arbitrage-bloc strong { color: var(--accent); }

/* ── Bloc d'info sur les deux méthodes ── */
.methode-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.methode-tab {
  font-size: 0.7rem;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted);
}
.methode-tab.actif {
  background: rgba(250,204,21,0.12);
  border-color: var(--accent);
  color: var(--accent);
}
