/* ==========================================================================
   BetaOne Support — couche de thème maison, par-dessus Bootstrap 5 core.
   On ne dépend que de Bootstrap *core* (framework, pas un template tiers).
   Ce fichier nous appartient : theming via CSS custom properties (--bs-*),
   aucun build/toolchain requis — reste valable même si Bootstrap stagne.
   ========================================================================== */

/* --- Marque : bleu BetaOne (#4a6bff) -------------------------------------- */
:root {
  --bo-primary:        #4a6bff;
  --bo-primary-rgb:    74, 107, 255;
  --bo-primary-hover:  #3a5beb;
  --bo-primary-active: #3454e0;

  --bs-primary:           var(--bo-primary);
  --bs-primary-rgb:       var(--bo-primary-rgb);
  --bs-link-color:        var(--bo-primary);
  --bs-link-color-rgb:    var(--bo-primary-rgb);
  --bs-link-hover-color:  var(--bo-primary-hover);
  --bs-focus-ring-color:  rgba(var(--bo-primary-rgb), .4);
}

/* Bootstrap 5.3 fige les couleurs des boutons par variante au build :
   on surcharge les variables au niveau du composant. */
.btn-primary {
  --bs-btn-bg: var(--bo-primary);
  --bs-btn-border-color: var(--bo-primary);
  --bs-btn-hover-bg: var(--bo-primary-hover);
  --bs-btn-hover-border-color: var(--bo-primary-hover);
  --bs-btn-active-bg: var(--bo-primary-active);
  --bs-btn-active-border-color: var(--bo-primary-active);
  --bs-btn-disabled-bg: var(--bo-primary);
  --bs-btn-disabled-border-color: var(--bo-primary);
  --bs-btn-focus-shadow-rgb: var(--bo-primary-rgb);
}
.btn-outline-primary {
  --bs-btn-color: var(--bo-primary);
  --bs-btn-border-color: var(--bo-primary);
  --bs-btn-hover-bg: var(--bo-primary);
  --bs-btn-hover-border-color: var(--bo-primary);
  --bs-btn-active-bg: var(--bo-primary-active);
  --bs-btn-active-border-color: var(--bo-primary-active);
  --bs-btn-focus-shadow-rgb: var(--bo-primary-rgb);
}

/* --- Thème sombre : on reprend la palette historique des pages auth -------- */
[data-bs-theme="dark"] {
  --bs-body-bg:        #1a1d22;
  --bs-body-color:     #e6e6e6;
  --bs-secondary-bg:   #2a2d33;
  --bs-tertiary-bg:    #23262c;
  --bs-border-color:   #3a3d44;
  --bs-emphasis-color: #ffffff;
}
[data-bs-theme="dark"] .card {
  --bs-card-bg: #2a2d33;
  --bs-card-cap-bg: #2a2d33;
  border-color: #3a3d44;
}
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
  background-color: #1a1d22;
  border-color: #3a3d44;
  color: #e6e6e6;
}
[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
  background-color: #1a1d22;
  border-color: var(--bo-primary);
  color: #e6e6e6;
}

/* --- Toggle de thème (soleil / lune) -------------------------------------- */
.theme-toggle { line-height: 0; }
.theme-toggle .icon-moon { display: none; }
.theme-toggle .icon-sun  { display: inline; }
[data-bs-theme="dark"] .theme-toggle .icon-moon { display: inline; }
[data-bs-theme="dark"] .theme-toggle .icon-sun  { display: none; }

/* --- Pages d'authentification --------------------------------------------- */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.auth-card  { width: 100%; max-width: 400px; }
.auth-brand { font-weight: 600; letter-spacing: .02em; }
.auth-topbar { position: fixed; top: 1rem; right: 1rem; z-index: 1030; }
.auth-logo  { height: 40px; width: auto; }

/* Champ code TOTP : grand, espacé, centré, monospace */
.otp-input {
  font-size: 1.5rem;
  letter-spacing: .4rem;
  text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* Bloc secret TOTP (saisie manuelle) */
.totp-secret {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  word-break: break-all;
  user-select: all;
}

/* --- Coquille Phase 2 : espacement entre la navbar sticky-top et le contenu - */
/* (les pages métier utilisent <div class="content-wrapper"> hérité de SB Admin) */
.content-wrapper {
  padding-top: 1.5rem;
}

/* --- Cards stats accueil -------------------------------------------------- */
.stat-card {
  color: inherit;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.stat-card:hover {
  transform: translateY(-1px);
  border-color: var(--bo-primary);
  box-shadow: 0 .25rem .75rem rgba(0,0,0,.06);
}
.stat-card-icon {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.stat-card-value {
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1;
}

/* --- Icônes d'action dans les tables (info/edit/delete) ------------------- */
.action-icons a {
  font-size: 1.25rem;
  margin-right: .35rem;
  color: var(--bs-body-color);
  opacity: .65;
  transition: opacity .12s ease, color .12s ease;
}
.action-icons a:hover {
  opacity: 1;
  color: var(--bo-primary);
}
.action-icons a.text-danger:hover {
  color: var(--bs-danger) !important;
}
