/* ============================================================
   JTG MULTISERVICE — Feuille de style de l'administration
   Palette : bleu marine #0B1F3A, bleu #1E6BFF, blanc, gris #F3F5F8
   ============================================================ */

:root {
  --navy: #0B1F3A;
  --blue: #1E6BFF;
  --white: #FFFFFF;
  --gray: #F3F5F8;
  --green: #16a34a;
  --orange: #f59e0b;
  --red: #dc2626;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
}

body {
  background: var(--gray);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---------- Structure ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 252px;
  background: var(--navy);
  color: #cbd5e1;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 1040;
  display: flex;
  flex-direction: column;
  transition: transform .25s ease;
}
.sidebar-brand { padding: 20px 20px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-nav { padding: 12px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.sidebar-nav .nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 8px;
  color: #cbd5e1; text-decoration: none; font-size: 14px; font-weight: 500;
}
.sidebar-nav .nav-link i { font-size: 18px; width: 20px; text-align: center; }
.sidebar-nav .nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar-nav .nav-link.active { background: var(--blue); color: #fff; }
.sidebar-nav .nav-link--danger:hover { background: rgba(220,38,38,.18); color: #fca5a5; }

.main { flex: 1; margin-left: 252px; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: 60px; background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px; padding: 0 20px;
  position: sticky; top: 0; z-index: 1030;
}
.topbar-title { font-weight: 700; font-size: 15px; }
.topbar-user { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.topbar-user-avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--blue); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.btn-icon { border: 0; background: transparent; font-size: 22px; line-height: 1; color: var(--text); padding: 4px 8px; }

.content { flex: 1; }

/* ---------- Cartes de statistiques ---------- */
.stat-card {
  background: #fff; border-radius: 12px; padding: 18px;
  display: flex; align-items: center; gap: 14px; height: 100%;
  box-shadow: 0 1px 3px rgba(15,23,42,.06);
}
.stat-icon {
  width: 48px; height: 48px; border-radius: 12px; flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.stat-value { font-size: 24px; font-weight: 800; line-height: 1; }
.stat-label { font-size: 12px; color: var(--muted); }

.bg-primary-soft { background: #e7efff; }
.bg-success-soft { background: #e6f7ee; }
.bg-warning-soft { background: #fdf3e0; }
.bg-danger-soft  { background: #fdeaea; }
.bg-info-soft    { background: #e3f6fc; }

/* ---------- Avatars ---------- */
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.avatar--lg { width: 64px; height: 64px; }
.avatar--empty {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--navy); color: #fff; font-weight: 700;
}

/* ---------- Marque ---------- */
.brand-mark { display: flex; align-items: center; gap: 10px; }
.brand-badge {
  width: 40px; height: 40px; border-radius: 10px; background: var(--navy); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px; letter-spacing: .5px; flex: none;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 800; color: var(--navy); font-size: 15px; }
.brand-tagline { color: #7a8aa0; font-size: 11px; }
.sidebar-brand .brand-badge { background: #fff; color: var(--navy); }
.sidebar-brand .brand-name { color: #fff; }
.sidebar-brand .brand-tagline { color: #9db6ff; }

/* ---------- Carte badge (aperçu PVC) ---------- */
.badge-card {
  width: 520px; max-width: 100%;
  aspect-ratio: 85.6 / 53.98;
  background: #fff; border-radius: 12px; overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 8px 30px rgba(11,31,58,.16);
  font-family: Arial, Helvetica, sans-serif; color: var(--navy);
}
.badge-card__header {
  background: var(--navy); color: #fff; padding: 12px 18px;
  display: flex; align-items: center; justify-content: space-between;
}
.badge-card__brand { display: flex; align-items: center; gap: 10px; }
.badge-card__mono {
  width: 30px; height: 30px; background: #fff; color: var(--navy); border-radius: 6px;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 12px;
}
.badge-card__company { font-weight: 800; font-size: 15px; line-height: 1.1; }
.badge-card__tagline { font-size: 10px; color: #9db6ff; }
.badge-card__title { font-size: 9px; letter-spacing: 1px; color: #8FA7E8; text-align: right; line-height: 1.4; }
.badge-card__body { flex: 1; display: flex; padding: 14px 18px; gap: 14px; min-height: 0; }
.badge-card__left { flex: 1; display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
.badge-card__photo { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; border: 1px solid #dbe2ec; flex: none; }
.badge-card__photo--empty { display: flex; align-items: center; justify-content: center; background: #e9eef5; color: #93a1b6; font-size: 9px; }
.badge-card__name { font-weight: 800; font-size: 16px; line-height: 1.1; }
.badge-card__fonction { color: var(--blue); font-weight: 700; font-size: 12px; margin-top: 3px; }
.badge-card__dept { color: #5a6b85; font-size: 10px; margin-top: 2px; }
.badge-card__mat { margin-top: 6px; font-size: 9px; color: #5a6b85; }
.badge-card__mat b { color: var(--navy); font-size: 11px; }
.badge-card__right { width: 120px; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.badge-card__qr { width: 96px; height: 96px; }
.badge-card__scan { font-size: 8px; color: #5a6b85; margin-top: 4px; }
.badge-card__footer { background: var(--gray); padding: 8px 18px; }
.badge-card__dates { display: flex; gap: 18px; font-size: 9px; color: #33415c; flex-wrap: wrap; }
.badge-card__mention { border-top: 1px solid var(--blue); margin-top: 6px; padding-top: 4px; color: var(--blue); font-size: 8px; text-align: center; }

/* ---------- Page de connexion ---------- */
.auth-body {
  background: linear-gradient(135deg, #0B1F3A 0%, #14325e 55%, #1E6BFF 150%);
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
}
.auth-wrap { width: 100%; max-width: 400px; }
.auth-card { background: #fff; border-radius: 16px; padding: 32px; }
.auth-brand { display: flex; justify-content: center; }

/* ---------- Page publique de vérification ---------- */
.verify-body { background: var(--gray); min-height: 100vh; }
.verify-wrap { max-width: 520px; margin: 0 auto; padding: 40px 16px; }
.verify-brand { display: flex; justify-content: center; }
.verify-card {
  background: #fff; border-radius: 18px; padding: 32px 24px; text-align: center;
  border-top: 6px solid #cbd5e1;
}
.verify-card--ok { border-top-color: var(--green); }
.verify-card--warn { border-top-color: var(--orange); }
.verify-card--bad { border-top-color: var(--red); }
.verify-card--unknown { border-top-color: #94a3b8; }
.verify-icon {
  width: 76px; height: 76px; border-radius: 50%; margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center; font-size: 38px;
}
.verify-card--ok .verify-icon { background: #e6f7ee; color: var(--green); }
.verify-card--warn .verify-icon { background: #fdf3e0; color: var(--orange); }
.verify-card--bad .verify-icon { background: #fdeaea; color: var(--red); }
.verify-card--unknown .verify-icon { background: #eef1f5; color: #64748b; }
.verify-title { font-size: 19px; font-weight: 800; letter-spacing: .3px; margin-bottom: 16px; }
.verify-photo { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; border: 3px solid #e5e7eb; }
.verify-photo--empty {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--navy); color: #fff; font-size: 32px; font-weight: 800;
}
.verify-person { margin: 8px 0 16px; }
.verify-person-name { font-size: 18px; font-weight: 800; margin-top: 8px; }
.verify-person-role { color: var(--blue); font-weight: 600; }
.verify-details {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border);
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
  text-align: left; margin-bottom: 16px;
}
.verify-details > div { background: #fff; padding: 10px 14px; }
.verify-details dt { font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.verify-details dd { margin: 0; font-weight: 700; font-size: 14px; }
.verify-mention { color: var(--green); font-weight: 600; font-size: 13px; margin-bottom: 0; }
.verify-text { color: var(--text); font-size: 15px; margin-bottom: 8px; }
.verify-sub { color: var(--muted); font-size: 13px; margin-bottom: 0; }
.verify-footer { text-align: center; color: #94a3b8; font-size: 12px; margin-top: 24px; }

/* ---------- Mobile ---------- */
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 1039; }
.sidebar-backdrop.show { display: block; }

@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.sidebar--open { transform: translateX(0); }
  .main { margin-left: 0; }
}
