/* ====================================================
   LIVRET APPRENTISSAGE NUMÉRIQUE — Feuille de style
   ==================================================== */

:root {
  --navy:       #1F3864;
  --navy-light: #2a4a7f;
  --blue:       #2E75B6;
  --sidebar-w:  240px;
  --header-h:   56px;
}

/* ── Base ── */
body { background: #f0f2f5; font-family: 'Segoe UI', Arial, sans-serif; padding-top: var(--header-h); }
.bg-navy       { background-color: var(--navy) !important; }
.bg-navy-light { background-color: var(--navy-light) !important; }
.text-navy     { color: var(--navy) !important; }
.border-navy   { border-color: var(--navy) !important; }

/* ── Sidebar desktop ── */
.sidebar-desktop {
  position: fixed;
  top: var(--header-h);
  left: 0;
  width: var(--sidebar-w);
  height: calc(100vh - var(--header-h));
  background: var(--navy);
  overflow-y: auto;
  z-index: 100;
  display: flex;
  flex-direction: column;
}
.sidebar-user { border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar-desktop .nav-link {
  color: rgba(255,255,255,0.75);
  border-radius: 6px;
  padding: 8px 12px;
  transition: all 0.2s;
  font-size: 0.88rem;
}
.sidebar-desktop .nav-link:hover,
.sidebar-desktop .nav-link.active {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

/* Sidebar offcanvas mobile */
.sidebar-offcanvas { width: var(--sidebar-w) !important; background: var(--navy); }
.sidebar-offcanvas .nav-link {
  color: rgba(255,255,255,0.75);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.88rem;
}
.sidebar-offcanvas .nav-link:hover,
.sidebar-offcanvas .nav-link.active {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

/* ── Main content ── */
.main-content {
  min-height: calc(100vh - var(--header-h));
  padding: 0;
}
@media (min-width: 992px) {
  .main-content { margin-left: var(--sidebar-w); }
}

/* ── Cards ── */
.card { border-radius: 10px; transition: box-shadow 0.2s; }
.card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.1) !important; }
.card-header { border-radius: 10px 10px 0 0 !important; font-weight: 600; }

/* ── Statut badges ── */
.badge { font-size: 0.78em; padding: 5px 10px; border-radius: 20px; }

/* ── Tables ── */
.table { font-size: 0.9rem; }
.table th { background: #f8f9fa; font-weight: 600; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.03em; color: #6c757d; }
.table-hover tbody tr:hover { background: #f0f4ff; }

/* ── Canvas signature ── */
.signature-container {
  border: 2px dashed #ced4da;
  border-radius: 10px;
  background: #fff;
  position: relative;
  touch-action: none;
}
.signature-container.has-sig { border-color: #198754; border-style: solid; }
.signature-canvas { display: block; width: 100%; cursor: crosshair; border-radius: 8px; }
.signature-actions { border-top: 1px solid #dee2e6; padding: 8px 12px; background: #f8f9fa; border-radius: 0 0 8px 8px; }

/* ── Bilan ── */
.bilan-section { border-left: 4px solid var(--blue); padding-left: 16px; margin-bottom: 20px; }
.bilan-section h6 { color: var(--navy); font-weight: 700; }

/* ── Journal de bord ── */
.journal-entry { border-left: 3px solid #dee2e6; padding-left: 16px; margin-bottom: 16px; transition: border-color 0.2s; }
.journal-entry:hover { border-color: var(--blue); }
.journal-entry .entry-date { font-size: 0.8rem; color: #6c757d; }

/* ── Progress ── */
.progress { height: 8px; border-radius: 4px; }
.progress-label { font-size: 0.8rem; color: #6c757d; }

/* ── Timeline visites ── */
.timeline { position: relative; padding-left: 30px; }
.timeline::before { content: ''; position: absolute; left: 10px; top: 0; bottom: 0; width: 2px; background: #dee2e6; }
.timeline-item { position: relative; margin-bottom: 20px; }
.timeline-dot { position: absolute; left: -26px; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: var(--blue); border: 2px solid #fff; box-shadow: 0 0 0 2px var(--blue); }
.timeline-dot.success { background: #198754; box-shadow: 0 0 0 2px #198754; }
.timeline-dot.warning { background: #ffc107; box-shadow: 0 0 0 2px #ffc107; }

/* ── Page connexion ── */
.login-page { min-height: 100vh; background: linear-gradient(135deg, var(--navy) 0%, #2E75B6 100%); display: flex; align-items: center; justify-content: center; }
.login-card { width: 100%; max-width: 420px; border-radius: 16px; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.login-header { background: var(--navy); padding: 32px; text-align: center; color: #fff; }

/* ── Impression PDF ── */
@media print {
  .sidebar-desktop, .navbar, .btn, .no-print { display: none !important; }
  .main-content { margin-left: 0 !important; }
  body { background: #fff; padding-top: 0; }
}

/* ── Mobile ── */
@media (max-width: 576px) {
  .container-fluid { padding: 0 12px; }
  .fs-2 { font-size: 1.5rem !important; }
  .table { font-size: 0.8rem; }
  h1.h3 { font-size: 1.3rem; }
}

/* ── Utilitaires ── */
.cursor-pointer { cursor: pointer; }
.text-truncate-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rounded-pill-sm { border-radius: 20px; }
.hover-shadow:hover { box-shadow: 0 4px 15px rgba(0,0,0,0.1); }
