/* Shared status-color system: one source of truth for CONNU/INVITE/INCONNU/INTRUS
   across Dashboard feed dots, Galeries card borders, Personnes rings, Kiosque marker. */
.status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.status-dot--CONNU { background: var(--status-connu); }
.status-dot--INVITE { background: var(--status-invite); }
.status-dot--INCONNU { background: var(--status-inconnu); }
.status-dot--INTRUS { background: var(--status-intrus); }

.status-border--CONNU { border-color: var(--status-connu) !important; }
.status-border--INVITE { border-color: var(--status-invite) !important; }
.status-border--INCONNU { border-color: var(--status-inconnu) !important; }
.status-border--INTRUS { border-color: var(--status-intrus) !important; }

.status-text--CONNU { color: var(--status-connu); }
.status-text--INVITE { color: var(--status-invite); }
.status-text--INCONNU { color: var(--status-inconnu); }
.status-text--INTRUS { color: var(--status-intrus); }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 11px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 700;
}
.status-badge--CONNU { background: var(--status-connu-light); color: #1B5E20; }
.status-badge--INVITE { background: var(--status-invite-light); color: #A85700; }
.status-badge--INCONNU { background: var(--status-inconnu-light); color: #4A4A4A; }
.status-badge--INTRUS { background: var(--status-intrus-light); color: #B71C1C; }

/* Evenement "ajout manuel" (Nouvelle personne, sans passage camera) dans la
   Timeline Magnetique - reutilise --action (deja la couleur des boutons
   d'action) plutot qu'une nouvelle couleur de statut, pour bien le
   distinguer visuellement des 4 statuts CONNU/INVITE/INCONNU/INTRUS (qui
   representent tous une detection reelle) sans laisser croire que c'en
   est un cinquieme. */
.status-border--MANUAL { border-color: var(--action) !important; }
.status-badge--MANUAL { background: var(--action-light); color: #006978; }

/* Shared card grid, reused by Galeries / Personnes */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.card { background: var(--card-bg); border-radius: var(--radius); overflow: hidden; border: 2px solid var(--border); box-shadow: var(--shadow); }
.card-body { padding: 12px 14px; }
.empty { color: var(--text-muted); margin-top: 30px; text-align: center; font-size: 0.9rem; }
.count { color: var(--text-muted); margin-bottom: 16px; font-size: 0.88rem; }

button.btn {
  padding: 9px 16px;
  border: none;
  border-radius: 9px;
  cursor: pointer;
  font-weight: 700;
  font-size: 12.5px;
}
button.btn-action { background: var(--action); color: white; }
button.btn-action:hover { background: #00A2B8; }
button.btn-accent { background: var(--accent); color: white; }
button.btn-accent:hover { background: #429846; }
button.btn-ghost { background: var(--action-light); color: var(--action); }
button.btn-ghost:hover { background: #C9EFF3; }
button.btn-danger { background: var(--status-intrus-light); color: var(--status-intrus); }
button.btn-danger:hover { background: #FADCDC; }
button.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.tabs { display: flex; gap: 6px; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.tab-btn {
  border: none;
  background: none;
  padding: 12px 18px;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
}
.tab-btn.active { color: var(--action); border-bottom-color: var(--action); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Live camera view (Admin's Live tab, Dashboard's toggleable live section) */
.video-container {
  position: relative;
  width: 100%;
  max-width: 960px;
  aspect-ratio: 16/9;
  background: #0B0F14;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.video-container iframe { width: 100%; height: 100%; border: none; }
.video-container #overlayCanvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; }

/* Aperçu plein écran au clic sur une photo de capture (voir lightbox.js,
   chargé globalement dans base.html - ne s'applique volontairement qu'aux
   <img> pointant vers /storage/, pas aux icônes/logos de l'interface). */
img[src^="/storage/"] { cursor: zoom-in; }
.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 14, 0.88);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 24px;
  cursor: zoom-out;
}
.lightbox-overlay.active { display: flex; animation: lb-fade 0.22s ease both; }
.lightbox-overlay.closing { animation: lb-fade-out 0.3s ease both; }
@keyframes lb-fade { from { background: rgba(8, 10, 14, 0); } }
@keyframes lb-fade-out { to { background: rgba(8, 10, 14, 0); } }
/* Jamais recadree : l'image entiere tient dans l'ecran */
.lightbox-overlay img {
  max-width: 92vw;
  max-height: 92vh;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  cursor: default;
}
.lb-btn {
  position: absolute;
  border: 0;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}
.lb-btn:hover { background: rgba(255, 255, 255, 0.26); }
.lb-btn[hidden] { display: none; }
.lb-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 14px; top: 50%; transform: translateY(-50%); }
.lb-close { right: 14px; top: calc(14px + env(safe-area-inset-top)); font-size: 1.1rem; }
.lb-count { position: absolute; bottom: calc(16px + env(safe-area-inset-bottom)); left: 0; right: 0; text-align: center; color: rgba(255,255,255,0.8); font-size: 0.85rem; }
@media (prefers-reduced-motion: reduce) { .lightbox-overlay.active, .lightbox-overlay.closing { animation: none; } }

/* Modale generique (detail Statistiques Kiosque, reutilisable ailleurs) */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 20, 0.55);
  z-index: 200;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 40px 16px;
}
.modal-backdrop.open { display: flex; }
.modal-box { width: 100%; max-width: 640px; padding: 24px 26px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-header h3 { margin: 0; font-size: 1.05rem; }
.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
}

/* Liste generique photo+nom+sous-titre (detail Statistiques Kiosque,
   membres d'un Groupe) */
.stats-detail-section { margin-bottom: 18px; }
.stats-detail-section:last-child { margin-bottom: 0; }
.stats-detail-section h4 { margin: 0 0 8px; font-size: 0.85rem; color: var(--text-muted); }
.stats-detail-list { display: flex; flex-direction: column; gap: 8px; }
.stats-detail-row { display: flex; align-items: center; gap: 10px; }
.stats-detail-thumb { width: 42px; height: 42px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.stats-detail-info { display: flex; flex-direction: column; flex: 1; }
.stats-detail-name { font-weight: 600; font-size: 0.88rem; }
.stats-detail-time { font-size: 0.75rem; color: var(--text-muted); }
.stats-detail-remove-btn { background: none; border: none; color: var(--status-intrus); cursor: pointer; font-size: 1.1rem; line-height: 1; padding: 4px; }

/* Liens affiches comme des boutons (ex. « Voir la facture », « Se connecter ») -
   memes styles que button.btn ci-dessus. */
a.btn { display: inline-flex; align-items: center; padding: 9px 16px; border-radius: 9px; font-weight: 700; font-size: 12.5px; text-decoration: none; cursor: pointer; }
a.btn-action { background: var(--action); color: white; }
a.btn-ghost { background: var(--action-light); color: var(--action); }
a.btn-ghost:hover { background: #C9EFF3; }

/* Mentions legales */
.legal { max-width: 720px; }
.legal p { line-height: 1.6; }
.legal-todo { color: var(--text-muted); font-style: italic; }

/* Mobile : les rangees d'onglets defilent horizontalement au lieu d'elargir
   la page (pas de defilement horizontal de la page entiere). */
@media (max-width: 760px) {
  .page { padding: 20px 16px 48px; }
  .tabs { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab-btn { white-space: nowrap; flex-shrink: 0; }
  .live-header { flex-wrap: wrap; gap: 8px; }
}
