/* ============================================================
   app.css – Styles personnalisés Formations
   ============================================================ */

/* ---- Layout général admin ---- */
html, body { height: 100%; }

.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
  width: 260px;
  min-width: 260px;
  background: #1e2a3a;
  color: #c9d4e0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  overflow-y: auto;
  transition: transform .25s ease;
}

.sidebar-brand {
  background: #141e2b;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  border-bottom: 1px solid #0d1620;
}

.sidebar-brand .brand-icon {
  width: 36px;
  height: 36px;
  background: #1f8a1f;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #fff;
  flex-shrink: 0;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
}

.sidebar-section-title {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #5a7292;
  padding: 14px 20px 4px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: #c9d4e0;
  text-decoration: none;
  border-radius: 0;
  font-size: .9rem;
  transition: background .15s, color .15s;
  border-left: 3px solid transparent;
}

.sidebar-link:hover {
  background: #253447;
  color: #fff;
}

.sidebar-link.active {
  background: #1a3a5c;
  color: #fff;
  border-left-color: #1f8a1f;
  font-weight: 600;
}

.sidebar-link i {
  font-size: 1rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 14px 20px;
  border-top: 1px solid #253447;
  font-size: .8rem;
  color: #5a7292;
}

/* ---- Main content (à droite de la sidebar) ---- */
.main-content {
  margin-left: 260px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: #f0f4f8;
}

/* ---- Topbar ---- */
.topbar {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  padding: 0 28px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 99;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}

.topbar-title {
  font-size: 1rem;
  font-weight: 600;
  color: #1e2a3a;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ---- Content padding ---- */
.content-area {
  padding: 28px;
  flex: 1;
}

/* ---- Stat icon (dashboard) ---- */
.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.stat-icon.bg-primary-soft { background: #dbeafe; color: #1f8a1f; }
.stat-icon.bg-success-soft { background: #dcfce7; color: #15803d; }
.stat-icon.bg-warning-soft { background: #fef9c3; color: #a16207; }
.stat-icon.bg-purple-soft  { background: #ede9fe; color: #7c3aed; }

/* ---- Avatar circle ---- */
.avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #1f8a1f;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .82rem;
  flex-shrink: 0;
}

.avatar-circle-lg {
  width: 52px;
  height: 52px;
  font-size: 1.1rem;
}

.avatar-circle-sm {
  width: 28px;
  height: 28px;
  font-size: .72rem;
}

/* Variantes couleur avatar */
.avatar-circle.av-green  { background: #15803d; }
.avatar-circle.av-purple { background: #7c3aed; }
.avatar-circle.av-orange { background: #ea580c; }

/* ---- Participant layout ---- */
.participant-header {
  background: linear-gradient(135deg, #1f8a1f 0%, #1e40af 100%);
  color: #fff;
  padding: 20px 24px;
}

.participant-header h5 { font-size: 1rem; font-weight: 700; margin: 0; }
.participant-header .sub { font-size: .82rem; opacity: .85; margin-top: 2px; }

/* ---- Doc card (page accueil participant) ---- */
.doc-card {
  background: #fff;
  border-radius: 12px;
  border: 2px solid #e2e8f0;
  padding: 20px;
  transition: border-color .2s, box-shadow .2s;
  text-decoration: none;
  color: inherit;
  display: block;
}

.doc-card:hover {
  border-color: #1f8a1f;
  box-shadow: 0 4px 16px rgba(26,86,219,.1);
  color: inherit;
}

.doc-card.done {
  border-color: #86efac;
  background: #f0fdf4;
}

.doc-card.locked {
  opacity: .55;
  pointer-events: none;
}

.doc-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 12px;
}

.doc-card-title {
  font-weight: 700;
  font-size: .95rem;
  margin-bottom: 4px;
}

.doc-card-desc {
  font-size: .82rem;
  color: #64748b;
}

/* ---- Badge état participant ---- */
.badge-done   { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }
.badge-todo   { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.badge-na     { background: #f1f5f9; color: #64748b; border: 1px solid #cbd5e1; }

/* ---- Canvas signature ---- */
.signature-canvas-wrap {
  position: relative;
  border: 2px dashed #cbd5e1;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.signature-canvas-wrap canvas {
  display: block;
  cursor: crosshair;
  touch-action: none;
}

.signature-canvas-wrap.signed {
  border-color: #86efac;
  border-style: solid;
}

/* ---- Tables ---- */
.table-hover tbody tr:hover { background: rgba(26,86,219,.03); }

/* ---- Page cards (admin) ---- */
.page-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
  padding: 24px;
}

/* ---- Mobile responsive sidebar ---- */
@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0;
  }
  .content-area {
    padding: 16px;
  }
}

/* ---- Utilities ---- */
.fw-600 { font-weight: 600; }
.text-blue { color: #1f8a1f; }
.text-purple { color: #7c3aed; }
.rounded-10 { border-radius: 10px; }

/* ===== Aide contextuelle (bouton ? + visite guidée) ===== */
.help-btn { width: 32px; height: 32px; padding: 0; border-radius: 50%; font-weight: 700; line-height: 1; }
.help-btn-float { position: fixed; right: 16px; bottom: 16px; z-index: 1030; width: 44px; height: 44px; font-size: 1.2rem;
                  box-shadow: 0 4px 12px rgba(0,0,0,.25); }
.help-pulse { animation: help-pulse 1.8s ease-out infinite; }
@keyframes help-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(26,86,219,.55); }
  70%  { box-shadow: 0 0 0 12px rgba(26,86,219,0); }
  100% { box-shadow: 0 0 0 0 rgba(26,86,219,0); }
}
.help-tip { color: #6c757d; cursor: help; margin-left: .25rem; font-size: .85em; }
.driver-popover { font-family: inherit; max-width: 340px; }
.driver-popover-title { font-weight: 700; }

/* Visite guidée : bulle plus grande et plus lisible */
.driver-popover.help-popover { max-width: 460px; min-width: 340px; padding: 22px 24px; border-radius: 12px; }
.help-popover .driver-popover-title { font-size: 1.25rem; margin-bottom: 6px; }
.help-popover .driver-popover-description { font-size: 1.02rem; line-height: 1.55; margin-top: 8px; }
.help-popover .driver-popover-footer { margin-top: 18px; }
.help-popover .driver-popover-footer button { font-size: .95rem; padding: 8px 16px; border-radius: 8px; }
.help-popover .driver-popover-progress-text { font-size: .9rem; }
.help-tip { font-size: 1rem; }
