/* ==========================================================================
   Back-office Triaaathlon
   ========================================================================== */
:root {
  --bo-bleu: #05213F;
  --bo-rouge: #E62426;
  --bo-fond: #f4f6f9;
  --bo-sidebar: 250px;
}
body.bo {
  background: var(--bo-fond);
  font-size: 14px;
  min-height: 100vh;
}
.bo-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--bo-sidebar);
  background: var(--bo-bleu);
  color: #fff;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 100;
  transition: transform .25s;
}
.bo-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px;
  color: #fff;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.bo-brand img { height: 32px; background: #fff; border-radius: 4px; padding: 3px; }
.bo-brand span { font-weight: 600; letter-spacing: .3px; }
.bo-menu { list-style: none; margin: 0; padding: 10px 0; flex: 1; }
.bo-menu-titre {
  padding: 16px 20px 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: rgba(255,255,255,.45);
}
.bo-menu a {
  display: block;
  padding: 9px 20px;
  color: rgba(255,255,255,.85);
  text-decoration: none;
  border-left: 3px solid transparent;
}
.bo-menu a:hover { background: rgba(255,255,255,.06); color: #fff; }
.bo-menu a.active { background: rgba(255,255,255,.1); color: #fff; border-left-color: var(--bo-rouge); }
.bo-sidebar-pied { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,.1); }
.bo-sidebar-pied a { color: rgba(255,255,255,.7); text-decoration: none; }
.bo-sidebar-pied a:hover { color: #fff; }

.bo-contenu { margin-left: var(--bo-sidebar); min-height: 100vh; display: flex; flex-direction: column; }
.bo-entete {
  background: #fff;
  border-bottom: 1px solid #e3e6ea;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.bo-titre { font-size: 20px; font-weight: 600; margin: 0; color: var(--bo-bleu); flex: 1; }
.bo-utilisateur { display: flex; align-items: center; gap: 12px; color: #555; }
.bo-burger { background: none; border: 1px solid #ccc; border-radius: 4px; font-size: 18px; line-height: 1; padding: 4px 8px; }
.bo-main { padding: 28px; flex: 1; }

@media (max-width: 991px) {
  .bo-sidebar { transform: translateX(-100%); }
  body.bo-menu-ouvert .bo-sidebar { transform: translateX(0); }
  .bo-contenu { margin-left: 0; }
  .bo-main, .bo-entete { padding-left: 16px; padding-right: 16px; }
}

/* Cartes et tableaux */
.bo-carte {
  background: #fff;
  border: 1px solid #e3e6ea;
  border-radius: 6px;
  padding: 22px 24px;
  margin-bottom: 24px;
}
.bo-carte h2 { font-size: 16px; font-weight: 600; color: var(--bo-bleu); margin: 0 0 16px; }
.bo-table { background: #fff; border: 1px solid #e3e6ea; border-radius: 6px; overflow: hidden; }
.bo-table table { margin: 0; }
.bo-table th { background: #f8f9fb; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: #555; border-bottom: 1px solid #e3e6ea; white-space: nowrap; }
.bo-table td { vertical-align: middle; }
.bo-table tr.non-lu td { font-weight: 600; }
.bo-actions { white-space: nowrap; text-align: right; }
.bo-actions form { display: inline; }
.bo-aide { color: #666; margin-bottom: 16px; }
.bo-barre { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }

.btn-bleu { background: var(--bo-bleu); color: #fff; border-color: var(--bo-bleu); }
.btn-bleu:hover { background: #0a3563; color: #fff; }
.badge-oui { background: #198754; }
.badge-non { background: #adb5bd; }

/* Formulaires */
.bo-form label.form-label { font-weight: 600; color: #333; }
.bo-form .form-text { color: #6c757d; }
.bo-form .apercu { margin-bottom: 8px; }
.bo-form .apercu img { max-height: 120px; max-width: 240px; border: 1px solid #ddd; border-radius: 4px; padding: 3px; background: #fff; }
.bo-form .bloc { border-left: 4px solid var(--bo-rouge); padding-left: 18px; margin-bottom: 32px; }
.bo-form .bloc h3 { font-size: 15px; font-weight: 600; color: var(--bo-bleu); margin-bottom: 12px; }
.bo-form .galerie { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 8px; }
.bo-form .galerie figure { margin: 0; text-align: center; font-size: 12px; }
.bo-form .galerie img { height: 90px; border: 1px solid #ddd; border-radius: 4px; }
.tox-tinymce { border-radius: 4px !important; }

/* Tableau de bord */
.bo-tuiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.bo-tuile { background: #fff; border: 1px solid #e3e6ea; border-radius: 6px; padding: 18px 20px; text-decoration: none; color: inherit; display: block; }
.bo-tuile:hover { border-color: var(--bo-bleu); color: inherit; }
.bo-tuile .chiffre { font-size: 30px; font-weight: 700; color: var(--bo-bleu); line-height: 1; }
.bo-tuile .libelle { color: #666; margin-top: 6px; }
.bo-tuile.alerte .chiffre { color: var(--bo-rouge); }

/* Page de connexion */
.bo-connexion { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bo-bleu); padding: 20px; }
.bo-connexion .boite { background: #fff; border-radius: 8px; padding: 36px; width: 100%; max-width: 400px; }
.bo-connexion .boite img { height: 48px; display: block; margin: 0 auto 24px; }

/* Fiche détail */
.bo-fiche dt { font-weight: 600; color: #555; }
.bo-fiche dd { margin-bottom: 12px; white-space: pre-wrap; }
