/* ============================================================
   Bon Sens Digital — Design System
   Réutilisable dans tous les modules (passmanager, futurs clients, site)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;700&family=Inter:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  /* Couleurs de marque (dégradé du logo) */
  --bsd-blue: #1E4FD8;
  --bsd-blue-light: #3E7BEB;
  --bsd-teal: #22C7B0;
  --bsd-mint: #6EE7D0;
  --bsd-gradient: linear-gradient(135deg, var(--bsd-blue), var(--bsd-teal));

  /* Surfaces */
  --bg-page: #F6F5F1;
  --bg-card: #F9FBFE;
  --bg-sidebar: #FBFAF7;
  --bg-hover: #EFEEE8;

  /* Texte */
  --text-primary: #132242;
  --text-secondary: #5B6478;
  --text-muted: #9AA1B0;

  /* États sémantiques */
  --danger: #A32D2D;
  --danger-bg: #FAECEA;
  --success: #0F6E56;
  --success-bg: #E1F5EE;

  /* Bordures / rayons */
  --border: #E4E2DA;
  --border-strong: #C9C6BA;
  --radius: 8px;
  --radius-card: 12px;

  /* Typo */
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  /* Espacements */
  --gap-xs: 4px;
  --gap-sm: 8px;
  --gap-md: 16px;
  --gap-lg: 24px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg-page);
  color: var(--text-primary);
}

/* ============================================================
   Navbar
   ============================================================ */

.bsd-navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

.bsd-navbar .logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
}
.bsd-navbar .logo img {
  width: 250px;
  height: auto;
}

.bsd-navbar .logo .bs { color: var(--bsd-blue); }
.bsd-navbar .logo .d { color: var(--bsd-teal); }

.bsd-navbar .app-name {
  font-size: 24px;
  color: var(--bsd-blue-light);
  margin-left: 6px;
}

/* ============================================================
   Layout : sidebar + contenu
   ============================================================ */

.bsd-layout {
  display: flex;
  min-height: calc(100vh - 53px);
}

.bsd-sidebar {
  width: 200px;
  background: #132242;
  border-right: 1px solid var(--border);
  padding: var(--gap-md) var(--gap-sm);
  flex-shrink: 0;
}

.bsd-sidebar .nav-item {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
  padding: 8px 10px;
  border-radius: var(--radius);
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  font-size: 13px;
  cursor: pointer;
  margin-bottom: 2px;
  transition: background 0.15s ease;
}

.bsd-sidebar .nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
}

.bsd-sidebar .nav-item.active {
  background: rgba(34, 199, 176, 0.15);
  color: var(--bsd-mint);
  font-weight: 500;
  border-left: 3px solid var(--bsd-teal);
  padding-left: 7px; /* compense la bordure pour garder l'alignement */
}

.bsd-sidebar .nav-divider {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin: var(--gap-md) 0 var(--gap-sm);
}

.bsd-content {
  flex: 1;
  padding: var(--gap-lg);
}

/* ============================================================
   Cards
   ============================================================ */

.bsd-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--gap-md);
  overflow: hidden;
}

.bsd-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--bsd-gradient);
}

.bsd-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--gap-md);
}

.bsd-card .card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--gap-sm);
}

.bsd-card .card-title {
  font-weight: 500;
  font-size: 15px;
  margin: 0;
}

.bsd-card .card-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 0 var(--gap-sm);
}

.bsd-card .card-value {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ============================================================
   Boutons
   ============================================================ */

.bsd-btn {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.15s ease;
}

.bsd-btn:hover {
  background: var(--bg-hover);
}

.bsd-btn-primary {
  background: var(--bsd-gradient);
  color: white;
  border: none;
}

.bsd-btn-primary:hover {
  background: var(--bsd-gradient);
  opacity: 0.92;
}

/* ============================================================
   Champs de formulaire
   ============================================================ */

.bsd-input {
  font-family: var(--font-body);
  font-size: 13px;
  padding: 8px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text-primary);
}

.bsd-input:focus {
  outline: none;
  border-color: var(--bsd-blue-light);
  box-shadow: 0 0 0 3px rgba(62, 123, 235, 0.15);
}

/* ============================================================
   Toolbar (barre recherche + ajouter, au-dessus de la grille)
   ============================================================ */

.bsd-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--gap-md);
}

/* ============================================================
   Boutons icône (dans les cartes : modifier, supprimer, copier...)
   ============================================================ */

.icon-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius);
  font-size: 14px;
  transition: background 0.15s ease, color 0.15s ease;
}

.icon-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.card-actions {
  display: flex;
  gap: 2px;
}

/* ============================================================
   État vide
   ============================================================ */

.bsd-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.bsd-empty-state .icon {
  font-size: 2.5rem;
  opacity: 0.3;
  margin-bottom: 12px;
}

/* ============================================================
   Écran de connexion
   ============================================================ */

.bsd-auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-page);
  padding: var(--gap-md);
}

.bsd-auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 380px;
  text-align: center;
  box-shadow: 0 4px 24px rgba(19, 34, 66, 0.06);
}

.bsd-auth-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--bsd-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin: 0 auto 16px;
}

.bsd-fade-in {
  animation: bsd-fade-in 0.25s ease;
}

@keyframes bsd-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   Utilitaires
   ============================================================ */

.bsd-text-muted { color: var(--text-muted); }
.bsd-text-danger { color: var(--danger); }
.bsd-text-success { color: var(--success); }
