/* ─────────────────────────────────────────────────────────────────────────────
   SIABIMS - Système de design
   Registre visuel : application grand public chaleureuse (école Duolingo).

   Principes tenus dans tout le fichier :
   · Formes généreuses : grands rayons, bordures épaisses de 2 px, éléments
     larges et faciles à viser au doigt.
   · Boutons en relief : un liseré inférieur plein fait office d'épaisseur, et
     le bouton s'enfonce à l'appui. Le retour est physique, pas décoratif.
   · Palette vive mais bornée : vert pour agir et réussir, rouge pour l'urgence,
     jaune pour l'attention, bleu pour l'information. Rien d'autre.
   · Le vert du drapeau béninois sert de couleur d'action - il porte à la fois
     l'identité nationale et l'engagement, comme le vert de Duolingo.
   · Typographie ronde et lourde : Nunito, graisses 700 à 900.

   Note : registre volontairement chaleureux, y compris sur les écrans métier.
   Les repères de gravité restent portés par la couleur ET par le texte, pour
   qu'un écran d'urgence reste lisible sans décodage.
   ───────────────────────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@600;700;800;900&display=swap');
@import url('https://cdn.jsdelivr.net/npm/@tabler/icons-webfont@3.24.0/dist/tabler-icons.min.css');

.ti { font-size: 1.05em; line-height: 1; vertical-align: -0.08em; }
.ti-sm { font-size: 0.88em; }
.ti-lg { font-size: 1.3em; }
.ti-xl { font-size: 1.75rem; }
.ti-hero { font-size: 2.4rem; }

:root {
  /* Déclare explicitement le schéma clair. Sans cela, le mode sombre
     automatique de Chrome réinvente les contrôles de formulaire en sombre :
     les champs de saisie ressortaient en bleu nuit sur fond blanc. */
  color-scheme: light;

  /* Surfaces - blanc dominant, gris très clair pour les zones secondaires */
  --bg:        #ffffff;
  --bg2:       #f7f7f7;
  --surface:   #ffffff;
  --surface2:  #f7f7f7;
  --surface3:  #efefef;
  --border:    #e5e5e5;   /* toujours posée en 2 px */
  --border2:   #d6d6d6;

  /* Action - vert du drapeau béninois, avec sa teinte d'épaisseur */
  --primary:      #00A651;
  --primary-edge: #00803e;   /* liseré inférieur des boutons */
  --primary2:     #22c06a;
  --primary-soft: #ddf4e7;

  /* Identité nationale */
  --bj-green:  #00A651;
  --bj-yellow: #FCD116;
  --bj-red:    #E8352F;

  /* Sémantique */
  --success:      #00A651;
  --success-edge: #00803e;
  --danger:       #E8352F;
  --danger-edge:  #c31f1a;
  --warning:      #E0A400;
  --warning-edge: #b98700;
  --info:         #1899d6;
  --info-edge:    #147bb0;
  --success-soft: #ddf4e7;
  --danger-soft:  #ffdfde;
  --warning-soft: #fff4d6;
  --info-soft:    #ddf4ff;

  /* Texte - gris chaud plutôt que noir pur, c'est ce qui adoucit l'ensemble */
  --text:      #3c3c3c;
  --text2:     #4b4b4b;
  --muted:     #afafaf;

  /* Formes généreuses */
  --radius-sm: 10px;
  --radius:    14px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  --shadow:    0 2px 0 var(--border);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --glow:      none;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Nunito', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Chiffres alignés partout où l'on compare des données */
table, .mono, .stat-number, .npi { font-variant-numeric: tabular-nums; }
.mono, .npi { font-family: ui-monospace, 'SFMono-Regular', monospace; letter-spacing: -0.02em; }

/* Bandeau drapeau - l'identité nationale tient dans 3 px */
.flag-bar {
  height: 3px; width: 100%; flex: none;
  background: linear-gradient(90deg,
    var(--bj-green) 0 33.33%, var(--bj-yellow) 33.33% 66.66%, var(--bj-red) 66.66% 100%);
}

/* ── Cartes ──────────────────────────────────────────────────────────────────── */
/* .glass est conservé (8 pages l'utilisent) mais n'a plus rien de vitreux. */
.glass, .card-plain {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
}

/* ── Boutons ─────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 0.7rem 1.15rem; border: none; border-radius: var(--radius);
  font-family: inherit; font-size: 0.9rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.045em;
  cursor: pointer; white-space: nowrap; line-height: 1.35;
  transition: filter 0.1s, transform 0.06s, box-shadow 0.06s;
}
/* L'épaisseur du bouton : un liseré plein sous la surface, qui disparaît à
   l'appui pendant que le bouton descend. Rien de décoratif - c'est le retour. */
.btn:active:not(:disabled) { transform: translateY(4px); box-shadow: none !important; }
.btn:hover:not(:disabled) { filter: brightness(1.06); }
.btn:focus-visible { outline: 2px solid var(--primary2); outline-offset: 2px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 4px 0 var(--primary-edge); }

.btn-ghost {
  background: var(--surface); color: var(--text2);
  border: 2px solid var(--border); box-shadow: 0 4px 0 var(--border);
}

.btn-danger { background: var(--danger); color: #fff; box-shadow: 0 4px 0 var(--danger-edge); }

.btn-success { background: var(--success); color: #fff; box-shadow: 0 4px 0 var(--success-edge); }

/* white-space: normal - .btn impose nowrap, ce qui convient à un bouton court
   mais faisait déborder le texte hors d'un bouton pleine largeur au libellé
   long (« Forcer sans contrôle anti-usurpation… » sur l'écran secouriste). */
.btn-full { width: 100%; padding: 0.85rem; font-size: 0.95rem; white-space: normal; }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.78rem; box-shadow: 0 3px 0 var(--border); }
.btn-sm.btn-primary { box-shadow: 0 3px 0 var(--primary-edge); }
.btn-sm.btn-danger  { box-shadow: 0 3px 0 var(--danger-edge); }

/* ── Champs ──────────────────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 0.9rem; }
.field label {
  font-size: 0.82rem; font-weight: 800; color: var(--text2); letter-spacing: 0.01em;
}

.input {
  background: #fff;
  border: 2px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 0.7rem 0.9rem;
  font-family: inherit; font-size: 0.95rem; font-weight: 700;
  transition: border-color 0.12s;
  outline: none; width: 100%;
}
.input:focus { border-color: var(--primary); }
.input::placeholder { color: var(--muted); font-weight: 700; }
.input:disabled { background: var(--surface2); color: var(--muted); }
select.input { cursor: pointer; }

/* ── Étiquettes d'état ───────────────────────────────────────────────────────── */
/* Rectangulaires et discrètes : dans un tableau dense, la pastille arrondie
   colorée attire l'œil sans hiérarchie et finit par ne plus rien signaler. */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 11px; border-radius: 999px;
  font-size: 0.74rem; font-weight: 800; line-height: 1.5;
  border: 2px solid transparent; white-space: nowrap;
}
.badge-success  { background: var(--success-soft); color: var(--success-edge); border-color: #a8e6c4; }
.badge-danger   { background: var(--danger-soft);  color: var(--danger-edge);  border-color: #ffbdba; }
.badge-warning  { background: var(--warning-soft); color: var(--warning-edge); border-color: #ffe4a1; }
.badge-info     { background: var(--info-soft);    color: var(--info-edge);    border-color: #b6e5ff; }
.badge-primary  { background: var(--primary-soft); color: var(--primary-edge); border-color: #a8e6c4; }
.badge-neutral  { background: var(--surface2);     color: var(--text2);   border-color: var(--border); }

/* Rôles - teintes distinctes mais de même intensité, aucune ne domine */
.badge-admin      { background: #f0e8ff; color: #7c4dcc; border-color: #ddc9ff; }
.badge-secouriste { background: var(--danger-soft); color: var(--danger-edge); border-color: #ffbdba; }
.badge-urgentiste { background: var(--success-soft); color: var(--success-edge); border-color: #a8e6c4; }
/* agent_accueil n'avait aucune règle : le rôle s'affichait en texte nu, seul
   sans pastille au milieu des autres. */
.badge-agent_accueil { background: var(--info-soft); color: var(--info-edge); border-color: #b6e5ff; }
.badge-patient    { background: var(--info-soft);    color: var(--info-edge);    border-color: #b6e5ff; }

/* ── Tags ────────────────────────────────────────────────────────────────────── */
.tag {
  display: inline-block; padding: 4px 12px; border-radius: 999px;
  font-size: 0.8rem; font-weight: 800;
  background: var(--surface2); border: 2px solid var(--border); color: var(--text2);
}
.tag-danger  { background: var(--danger-soft);  color: var(--danger-edge);  border-color: #ffbdba; }
.tag-warning { background: var(--warning-soft); color: var(--warning-edge); border-color: #ffe4a1; }

/* ── Tableaux ────────────────────────────────────────────────────────────────── */
/* Denses : un agent qui balaie 48 lignes doit en voir le maximum sans défiler. */
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; padding: 0.6rem 0.9rem;
  font-size: 0.72rem; font-weight: 800; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.06em;
  background: var(--surface2);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
td {
  padding: 0.7rem 0.9rem; font-size: 0.88rem; font-weight: 700;
  border-bottom: 2px solid var(--border); color: var(--text2);
}
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--surface2); color: var(--text); }

/* ── Animations ──────────────────────────────────────────────────────────────── */
/* Réduites au strict utile : apparition, rien de décoratif. */
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.fade-up { animation: fadeUp 0.2s ease forwards; }
.fade-in { animation: fadeIn 0.18s ease forwards; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ── Barre de défilement ─────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--surface2); }
::-webkit-scrollbar-thumb { background: #c3ccd6; border-radius: 99px; border: 2px solid var(--surface2); }
::-webkit-scrollbar-thumb:hover { background: #a9b5c1; }

/* ── Compatibilité : anciens jetons décoratifs, neutralisés ──────────────────── */
/* Ces variables sont encore référencées par quelques pages. Elles pointent
   désormais vers des aplats : aucun dégradé ne peut donc réapparaître. */
:root {
  --grad:        var(--primary);
  --grad-warm:   var(--warning);
  --grad-cool:   var(--primary);
  --grad-purple: var(--primary);
  --grad-green:  var(--success);
  --grad-red:    var(--danger);
  --grad-blue:   var(--primary);
  --grad-amber:  var(--warning);
  --surface-card: var(--surface);
  --border-glow:  var(--border2);
}
.text-gradient, .text-gradient-warm, .text-gradient-green {
  background: none; -webkit-text-fill-color: currentColor; color: var(--text);
}

/* ── Carte survolable ────────────────────────────────────────────────────────── */
.card-hover { transition: border-color 0.12s, box-shadow 0.12s; }
.card-hover:hover { border-color: var(--border2); box-shadow: var(--shadow); }

/* ── Chiffre clé ─────────────────────────────────────────────────────────────── */
.stat-number {
  font-size: 2.1rem; font-weight: 900; line-height: 1.1;
  color: var(--primary); letter-spacing: -0.02em;
}

/* ── Titre de section ────────────────────────────────────────────────────────── */
.section-title { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 1rem; }
.section-title .st-icon {
  width: 38px; height: 38px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
  background: var(--surface2); color: var(--primary); border: 2px solid var(--border);
}
.section-title .st-label { font-size: 1rem; font-weight: 800; }
.section-title .st-sub { font-size: 0.76rem; color: var(--muted); margin-top: 1px; }

/* ── Pastille d'état en direct ───────────────────────────────────────────────── */
.dot-live {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--success);
}
.dot-live.dot-danger  { background: var(--danger); }
.dot-live.dot-warning { background: var(--warning); }

/* ── Décorations supprimées ──────────────────────────────────────────────────── */
/* Emoji flottants et orbes floutés : purement décoratifs, retirés du registre
   visuel. Les règles restent pour neutraliser le balisage encore présent. */
.floating-deco, .orb { display: none !important; }

/* ── État vide ───────────────────────────────────────────────────────────────── */
.empty-illus {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.5rem; padding: 2.5rem 1.5rem; text-align: center; color: var(--muted);
}
.empty-illus .ei-icon { font-size: 2rem; opacity: 0.4; }
.empty-illus h4 { font-size: 0.9rem; color: var(--text2); font-weight: 600; }
.empty-illus p { font-size: 0.8rem; max-width: 280px; }
.empty-state { text-align: center; color: var(--muted); padding: 2rem 1rem; font-size: 0.85rem; }

/* ── Chargement ──────────────────────────────────────────────────────────────── */
.skeleton { background: var(--surface3); border-radius: var(--radius); }
.skeleton-line { height: 12px; border-radius: var(--radius-sm); margin-bottom: 8px; }

/* ── Notifications ───────────────────────────────────────────────────────────── */
.toast-container {
  position: fixed; bottom: 1.25rem; right: 1.25rem; left: auto; transform: none;
  z-index: 9999; display: flex; flex-direction: column; gap: 0.5rem;
  pointer-events: none; min-width: 260px; max-width: 88vw;
}
.toast {
  background: var(--surface); border: 2px solid var(--border);
  border-left: 6px solid var(--muted);
  border-radius: var(--radius); padding: 0.65rem 0.9rem;
  font-size: 0.84rem; color: var(--text);
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 0.6rem;
  animation: fadeUp 0.2s ease forwards; pointer-events: all;
}
.toast.toast-success { border-left-color: var(--success); }
.toast.toast-danger  { border-left-color: var(--danger); }
.toast.toast-info    { border-left-color: var(--primary); }

/* ── Navigation basse (mobile) ───────────────────────────────────────────────── */
.bottom-nav {
  display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 0.3rem 0 calc(0.3rem + env(safe-area-inset-bottom, 0px));
}
.bottom-nav-inner { display: grid; grid-template-columns: repeat(3, 1fr); }
.bottom-nav-inner.bnav-2 { grid-template-columns: repeat(2, 1fr); }
.bottom-nav-inner.bnav-4 { grid-template-columns: repeat(4, 1fr); }
.bnav-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 0.4rem 0; cursor: pointer;
  font-size: 0.6rem; color: var(--muted); font-weight: 600;
  letter-spacing: 0.02em; text-transform: uppercase;
  transition: color 0.12s; border: none; background: none; font-family: inherit;
}
.bnav-item .bnav-icon { font-size: 1.2rem; display: block; }
.bnav-item.active { color: var(--primary); }
@media (max-width: 639px) { .bottom-nav { display: block; } }

/* ── Anneau d'accent (avatar/icône) ──────────────────────────────────────────── */
.glow-ring { box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--primary); }

/* ── Étiquette d'en-tête ─────────────────────────────────────────────────────── */
.hero-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--primary-soft); border: 2px solid #a8e6c4;
  border-radius: 999px; padding: 4px 12px;
  font-size: 0.76rem; font-weight: 800; color: var(--primary-edge);
  margin-bottom: 0.75rem;
}

/* ── Animations résiduelles (compat) ─────────────────────────────────────────── */
@keyframes pulse-dot { 0%,100% { opacity: 1; } 50% { opacity: 0.45; } }
@keyframes shimmer   { from { background-position: -200% 0; } to { background-position: 200% 0; } }
@keyframes shake     { 0%,100% { transform: rotate(0); } 20%,60% { transform: rotate(-8deg); } 40%,80% { transform: rotate(8deg); } }
.anim-shake { animation: shake 0.5s ease; }
.anim-bounce, .anim-pulse-ring, .anim-float { animation: none; }

/* ── Fenêtre modale de tutoriel ──────────────────────────────────────────────── */
.tuto-overlay {
  position: fixed; inset: 0; z-index: 9500;
  background: rgba(15,23,32,0.45);
  display: flex; align-items: center; justify-content: center; padding: 1rem;
  animation: fadeIn 0.15s ease forwards;
}
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }
.tuto-modal {
  background: var(--surface); border: 2px solid var(--border);
  border-radius: var(--radius-xl); width: 100%; max-width: 440px;
  padding: 1.5rem 1.75rem 1.25rem; position: relative;
  box-shadow: var(--shadow-lg);
  animation: fadeUp 0.2s ease forwards;
}
.tuto-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.25rem; }
.tuto-badge {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--primary);
  background: var(--primary-soft); border: 1px solid #c6d8e7;
  border-radius: var(--radius-sm); padding: 2px 8px;
}
.tuto-close {
  background: none; border: none; cursor: pointer; color: var(--muted);
  padding: 4px 6px; border-radius: var(--radius); line-height: 1;
  transition: color 0.12s, background 0.12s;
}
.tuto-close:hover { color: var(--text); background: var(--surface2); }
.tuto-icon {
  width: 56px; height: 56px; border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1rem; background: var(--surface2); border: 1px solid var(--border);
}
.tuto-icon .ti { font-size: 1.6rem; color: var(--primary); line-height: 1; }
.tuto-step-title { font-size: 1.05rem; font-weight: 600; text-align: center; margin-bottom: 0.5rem; color: var(--text); }
.tuto-step-desc { color: var(--text2); font-size: 0.85rem; line-height: 1.65; text-align: center; margin-bottom: 1.25rem; }
.tuto-dots { display: flex; justify-content: center; gap: 0.35rem; margin-bottom: 1.1rem; }
.tuto-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--border2); transition: all 0.2s; }
.tuto-dot.active { width: 24px; border-radius: 999px; background: var(--primary); }
.tuto-footer { display: flex; gap: 0.6rem; align-items: center; }
.tuto-btn-prev { flex: 0 0 auto; }
.tuto-btn-next { color: #fff !important; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 0.35rem; }
.tuto-skip { margin-top: 0.8rem; text-align: center; }
.tuto-skip button {
  background: none; border: none; cursor: pointer; color: var(--muted);
  font-size: 0.76rem; font-family: inherit; padding: 4px 8px;
  border-radius: var(--radius); transition: color 0.12s;
}
.tuto-skip button:hover { color: var(--text2); }

/* ─────────────────────────────────────────────────────────────────────────────
   Lecteur de démonstration (.vg-*)
   Reste sur fond sombre : c'est une maquette d'écran jouée dans un lecteur,
   pas une surface de l'application. Seul l'accent indigo a été repris.
   ───────────────────────────────────────────────────────────────────────────── */
.vg-overlay {
  position: fixed; inset: 0; z-index: 9600; background: rgba(15,23,32,0.62);
  display: flex; align-items: center; justify-content: center; padding: 1rem;
  animation: fadeIn 0.15s ease forwards;
}
.vg-player {
  background: #10151c; border: 1px solid #223040; border-radius: var(--radius-lg);
  width: 100%; max-width: 560px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(15,23,32,0.45);
  animation: fadeUp 0.2s ease forwards;
}
.vg-player-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 1.1rem; border-bottom: 1px solid rgba(255,255,255,0.07);
}
.vg-player-title { font-size: 0.76rem; font-weight: 600; color: rgba(255,255,255,0.5); display: flex; align-items: center; gap: 0.5rem; }
.vg-screen { height: 270px; position: relative; overflow: hidden; background: #0b1016; border-bottom: 1px solid rgba(255,255,255,0.05); }
.vg-progress-bar { height: 3px; background: rgba(255,255,255,0.08); }
.vg-progress-fill { height: 100%; background: var(--primary2); width: 0%; }
.vg-controls { display: flex; align-items: center; gap: 0.5rem; padding: 0.6rem 1.1rem; border-bottom: 1px solid rgba(255,255,255,0.05); }
.vg-ctrl-btn {
  background: rgba(255,255,255,0.08); border: none; border-radius: var(--radius);
  color: rgba(255,255,255,0.7); width: 32px; height: 32px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.12s; font-size: 0.85rem; flex-shrink: 0;
}
.vg-ctrl-btn:hover:not(:disabled) { background: rgba(255,255,255,0.16); color: #fff; }
.vg-ctrl-btn:disabled { opacity: 0.25; cursor: not-allowed; }
.vg-play-btn { background: var(--primary2); color: #fff; width: 36px; height: 36px; border-radius: 50%; }
.vg-play-btn:hover { background: #2380c4; }
.vg-step-counter { font-size: 0.7rem; color: rgba(255,255,255,0.35); margin-left: auto; flex-shrink: 0; }
.vg-dots { display: flex; gap: 4px; align-items: center; margin-left: 6px; }
.vg-dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,0.2); transition: all 0.2s; }
.vg-dot.active { width: 18px; border-radius: 3px; background: var(--primary2); }
.vg-narration-wrap { padding: 0.8rem 1.1rem; border-bottom: 1px solid rgba(255,255,255,0.05); min-height: 80px; }
.vg-narration-title { font-size: 0.86rem; font-weight: 600; color: rgba(255,255,255,0.88); margin-bottom: 0.3rem; }
.vg-narration { font-size: 0.79rem; color: rgba(255,255,255,0.5); line-height: 1.65; transition: opacity 0.2s; }
.vg-narration strong { color: rgba(255,255,255,0.75); }
.vg-narration em { color: rgba(255,255,255,0.65); font-style: normal; }
.vg-footer { padding: 0.7rem 1.1rem; display: flex; justify-content: space-between; align-items: center; }

.vg-scene { width: 100%; height: 100%; display: flex; flex-direction: column; }
.vg-topbar {
  height: 40px; background: rgba(255,255,255,0.05); border-bottom: 1px solid rgba(255,255,255,0.07);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px; font-size: 0.65rem; font-weight: 600; color: rgba(255,255,255,0.75); flex-shrink: 0;
}
.vg-topbar-left { display: flex; align-items: center; gap: 7px; }
.vg-topbar-dot { width: 24px; height: 24px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.vg-badge { font-size: 0.56rem; font-weight: 600; padding: 2px 7px; border-radius: var(--radius-sm); letter-spacing: 0.02em; }
.vg-badge-red  { background: rgba(232,53,47,0.2);  color: #f9a9a5; border: 1px solid rgba(232,53,47,0.35); }
.vg-badge-blue { background: rgba(27,107,168,0.25); color: #9ccbec; border: 1px solid rgba(27,107,168,0.4); }
.vg-scene-login { display: flex; flex-direction: column; align-items: center; padding: 12px 14px; gap: 10px; }
.vg-login-hero { text-align: center; }
.vg-login-icon {
  width: 42px; height: 42px; border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 5px; font-size: 1.15rem; color: #fff;
}
.vg-login-name { font-size: 0.72rem; font-weight: 700; color: rgba(255,255,255,0.88); }
.vg-login-sub  { font-size: 0.57rem; color: rgba(255,255,255,0.4); margin-top: 2px; }
.vg-login-card { width: 100%; max-width: 220px; }
.vg-scene-cam { display: flex; flex-direction: column; }
.vg-cam-view { flex: 1; background: #000; position: relative; display: flex; align-items: center; justify-content: center; }
.vg-face-silhouette {
  width: 60px; height: 80px; background: rgba(255,255,255,0.05);
  border-radius: 40px 40px 35px 35px; position: absolute;
  top: 50%; left: 50%; transform: translate(-50%, -55%);
}
.vg-oval {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -55%);
  width: 75px; height: 105px; border: 2px solid rgba(232,53,47,0.85); border-radius: 50%;
  animation: vg-pulse-oval 2s ease-in-out infinite;
}
@keyframes vg-pulse-oval {
  0%,100% { opacity: 0.75; transform: translate(-50%,-55%) scale(1); }
  50%     { opacity: 1;    transform: translate(-50%,-55%) scale(1.04); }
}
.vg-liveness-pill, .vg-brightness-pill {
  position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,0.78); padding: 2px 8px; border-radius: var(--radius-sm);
  font-size: 0.56rem; color: #5fd39a; white-space: nowrap;
  display: flex; align-items: center; gap: 3px;
}
.vg-brightness-pill { bottom: 4px; }
.vg-field {
  height: 28px; background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius); margin-bottom: 6px; display: flex; align-items: center;
  padding: 0 8px; transition: border-color 0.2s;
}
.vg-field-text { font-size: 0.6rem; color: rgba(255,255,255,0.55); }
.vg-btn {
  height: 30px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.63rem; font-weight: 600; color: #fff; cursor: default;
}
.vg-btn-red   { background: var(--danger); }
.vg-btn-blue  { background: var(--primary2); }
.vg-btn-green { background: var(--success); }
.vg-btn-ghost { background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.12); color: rgba(255,255,255,0.6); }
.vg-card { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); border-radius: var(--radius); padding: 7px 9px; margin-bottom: 5px; }
.vg-label { font-size: 0.55rem; color: rgba(255,255,255,0.35); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px; }
.vg-data-row { display: flex; justify-content: space-between; align-items: center; padding: 3px 0; border-bottom: 1px solid rgba(255,255,255,0.05); font-size: 0.6rem; }
.vg-data-row:last-child { border-bottom: none; }
.vg-data-key { color: rgba(255,255,255,0.4); }
.vg-data-val { color: rgba(255,255,255,0.82); font-weight: 600; }
.vg-data-val.red   { color: #f9a9a5; }
.vg-data-val.green { color: #7fd8ab; }
.vg-tag { display: inline-flex; align-items: center; gap: 2px; font-size: 0.57rem; padding: 2px 6px; border-radius: var(--radius-sm); font-weight: 600; }
.vg-tag-danger { background: rgba(232,53,47,0.16); color: #f9a9a5; border: 1px solid rgba(232,53,47,0.28); }
.vg-layout { display: flex; height: 100%; }
.vg-sidebar { width: 110px; background: rgba(255,255,255,0.025); border-right: 1px solid rgba(255,255,255,0.06); padding: 8px 0; flex-shrink: 0; }
.vg-main { flex: 1; padding: 8px 10px; overflow: hidden; }
.vg-nav-item { padding: 5px 9px; font-size: 0.57rem; color: rgba(255,255,255,0.4); display: flex; align-items: center; gap: 5px; border-radius: var(--radius); margin: 1px 4px; cursor: default; }
.vg-nav-item.active { background: rgba(27,107,168,0.25); color: #9ccbec; }
.vg-patient-item { display: flex; align-items: center; gap: 6px; padding: 5px 7px; font-size: 0.58rem; color: rgba(255,255,255,0.55); margin-bottom: 2px; cursor: default; }
.vg-patient-item.active { color: rgba(255,255,255,0.88); }
.vg-avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--primary2); display: flex; align-items: center; justify-content: center; font-size: 0.52rem; font-weight: 700; color: #fff; flex-shrink: 0; }
.vg-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.vg-stat { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.07); border-radius: var(--radius); padding: 7px 8px; }
.vg-stat-val { font-size: 1.05rem; font-weight: 700; color: rgba(255,255,255,0.88); }
.vg-stat-label { font-size: 0.5rem; color: rgba(255,255,255,0.35); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 1px; }
.vg-audit-row { display: flex; align-items: flex-start; gap: 7px; padding: 5px 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
.vg-audit-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; }
.vg-modal-mini { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.12); border-radius: var(--radius-lg); overflow: hidden; }
.vg-modal-mini-header { padding: 7px 10px; border-bottom: 1px solid rgba(255,255,255,0.07); font-size: 0.62rem; font-weight: 600; color: rgba(255,255,255,0.78); display: flex; align-items: center; gap: 5px; }
.vg-notif-popup { background: #172230; border: 1px solid rgba(27,107,168,0.4); border-radius: var(--radius-lg); padding: 8px 10px; width: 180px; animation: fadeIn 0.2s ease; }
.vg-notif-item { display: flex; align-items: flex-start; gap: 6px; padding: 4px 0; margin-bottom: 3px; }
.vg-table-row { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px; border-bottom: 1px solid rgba(255,255,255,0.05); font-size: 0.6rem; color: rgba(255,255,255,0.62); }
.vg-table-row:last-child { border-bottom: none; }
.vg-row { display: flex; align-items: center; }
.vg-highlight     { border-color: rgba(27,107,168,0.5) !important; }
.vg-highlight-red { border-color: rgba(232,53,47,0.5) !important; }
.vg-bell { display: inline-block; animation: shake 0.7s ease-in-out infinite; }

/* ── Bouton d'aide ───────────────────────────────────────────────────────────── */
.btn-help {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.3rem;
  background: var(--surface); border: 2px solid var(--border);
  color: var(--text2); cursor: pointer; font-family: inherit;
  font-size: 0.8rem; font-weight: 800;
  padding: 0.4rem 0.8rem; border-radius: 999px;
  transition: background 0.12s, color 0.12s;
}
.btn-help:hover { color: var(--text); background: var(--surface2); }

/* ── Utilitaires responsives ─────────────────────────────────────────────────── */
.table-responsive { width: 100%; overflow-x: auto; }

@media (max-width: 1023px) {
  .btn { min-height: 40px; }
  .btn-sm { min-height: 32px; }
}

@media (max-width: 639px) {
  th { padding: 0.4rem 0.6rem; font-size: 0.66rem; }
  td { padding: 0.5rem 0.6rem; font-size: 0.8rem; }
  .modal-actions { flex-direction: column-reverse; gap: 0.5rem; }
  .modal-actions .btn { width: 100%; justify-content: center; }
}
