/* ═══════════════════════════════════════════════════════════
   VoyageIQ Pro — Brand Identity (Bootstrap 5 overlay)
   ═══════════════════════════════════════════════════════════ */
:root {
  --viq-primary: #1a5276;
  --viq-primary-light: #2980b9;
  --viq-secondary: #2c3e50;
  --viq-accent: #e67e22;
  --viq-success: #27ae60;
  --viq-danger: #c0392b;
  --viq-warning: #f39c12;
  --viq-info: #2980b9;
  --viq-light: #f8f9fa;
  --viq-sidebar-bg: #1a2332;
  --viq-sidebar-hover: #243447;
  --viq-sidebar-active: #0d6efd;
  --viq-sidebar-text: #adb5bd;
  --viq-sidebar-width: 250px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--viq-light);
  font-size: .875rem;
}

/* ── Sidebar ─────────────────────────────────────────── */
.sidebar {
  width: var(--viq-sidebar-width);
  min-height: 100vh;
  background: var(--viq-sidebar-bg);
  position: fixed;
  left: 0; top: 0;
  z-index: 1040;
  transition: transform .3s ease;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 2px; }

.sidebar .nav-link {
  color: var(--viq-sidebar-text);
  padding: .55rem 1rem;
  border-radius: .375rem;
  margin: 1px 8px;
  font-size: .85rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  text-decoration: none;
}
.sidebar .nav-link:hover { background: var(--viq-sidebar-hover); color: #fff; }
.sidebar .nav-link.active { background: var(--viq-sidebar-active); color: #fff; font-weight: 500; }
.sidebar .nav-link .bi { width: 20px; text-align: center; font-size: 1rem; flex-shrink: 0; }
.sidebar .nav-link .badge { margin-left: auto; font-size: .65rem; }

.sidebar .sidebar-brand {
  padding: .875rem 1rem;
  display: flex;
  align-items: center;
  gap: .6rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
  text-decoration: none;
}
.sidebar .sidebar-brand img { width: 32px; height: 32px; border-radius: 6px; }
.sidebar .sidebar-brand .brand-name { color: #fff; font-weight: 700; font-size: 1rem; line-height: 1.2; }
.sidebar .sidebar-brand .brand-tag {
  background: var(--viq-accent);
  color: #fff;
  font-size: .55rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.sidebar .sidebar-section {
  padding: .6rem 1.1rem .2rem;
  color: rgba(255,255,255,.35);
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .8px;
  font-weight: 600;
  margin-top: .5rem;
}

.sidebar .sidebar-user {
  padding: .75rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: .6rem;
}
.sidebar .sidebar-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--viq-accent);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: .85rem;
  flex-shrink: 0;
  overflow: hidden;
}
.sidebar .sidebar-avatar img { width: 100%; height: 100%; object-fit: cover; }
.sidebar .sidebar-user-info { color: var(--viq-sidebar-text); font-size: .8rem; line-height: 1.3; }
.sidebar .sidebar-user-info small { display: block; color: rgba(255,255,255,.35); font-size: .7rem; }

.sidebar .sidebar-footer {
  margin-top: auto;
  padding: .75rem 1rem;
  border-top: 1px solid rgba(255,255,255,.08);
}
.sidebar .sidebar-footer .nav-link { color: #e74c3c; }
.sidebar .sidebar-footer .nav-link:hover { background: rgba(231,76,60,.15); color: #e74c3c; }

/* ── Main Content ─────────────────────────────────────── */
.main-content {
  margin-left: var(--viq-sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Topbar ─────────────────────────────────────────── */
.topbar {
  background: #fff;
  border-bottom: 1px solid #dee2e6;
  padding: .5rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: sticky; top: 0; z-index: 1030;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.topbar .breadcrumb { margin: 0; font-size: .8rem; }
.topbar .btn-icon {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: .375rem; border: none; background: transparent;
  color: var(--viq-secondary); font-size: 1.1rem;
  position: relative;
}
.topbar .btn-icon:hover { background: #f0f0f0; }
.topbar .btn-icon .badge {
  position: absolute; top: 2px; right: 2px;
  font-size: .55rem; padding: 1px 4px;
}

.topbar .profile-menu { display: flex; align-items: center; gap: .5rem; cursor: pointer; }
.topbar .profile-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--viq-primary);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 600; font-size: .75rem;
  overflow: hidden;
}
.topbar .profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.topbar .profile-info { font-size: .8rem; line-height: 1.2; }
.topbar .profile-info small { color: #6c757d; font-size: .7rem; }

/* ── Page Content ──────────────────────────────────── */
.page-content { padding: 1.25rem; flex: 1; }

/* ── Stat Cards ──────────────────────────────────────── */
.stat-card {
  border: none; border-radius: .75rem;
  transition: transform .15s ease, box-shadow .15s ease;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.08); }
.stat-card .stat-icon {
  width: 48px; height: 48px;
  border-radius: .75rem;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
}
.stat-card .stat-value { font-size: 1.5rem; font-weight: 700; line-height: 1.2; }
.stat-card .stat-label { font-size: .75rem; color: #6c757d; text-transform: uppercase; letter-spacing: .3px; }

/* ── Tables ──────────────────────────────────────────── */
.table-viq { font-size: .85rem; }
.table-viq th {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #6c757d;
  font-weight: 600;
  border-bottom-width: 1px;
  white-space: nowrap;
}
.table-viq td { vertical-align: middle; }
.table-viq tbody tr:hover { background: rgba(13,110,253,.03); }

/* ── Badges ─────────────────────────────────────────── */
.badge-operationnel { background: #d1fae5; color: #065f46; }
.badge-maintenance { background: #fef3c7; color: #92400e; }
.badge-hors_service { background: #fee2e2; color: #991b1b; }
.badge-actif { background: #d1fae5; color: #065f46; }
.badge-inactif { background: #e5e7eb; color: #374151; }
.badge-suspendu { background: #fee2e2; color: #991b1b; }
.badge-en_conge { background: #dbeafe; color: #1e40af; }
.badge-en_attente { background: #fef3c7; color: #92400e; }
.badge-valide { background: #d1fae5; color: #065f46; }
.badge-rejete { background: #fee2e2; color: #991b1b; }

/* ── Flash Messages ──────────────────────────────────── */
.viq-flash {
  border-radius: .5rem;
  padding: .75rem 1rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: .85rem;
}
.viq-flash .btn-close { margin-left: auto; }
.viq-flash-success { background: #d1e7dd; color: #0f5132; border: 1px solid #badbcc; }
.viq-flash-danger { background: #f8d7da; color: #842029; border: 1px solid #f5c2c7; }
.viq-flash-warning { background: #fff3cd; color: #664d03; border: 1px solid #ffecb5; }
.viq-flash-info { background: #cff4fc; color: #055160; border: 1px solid #b6effb; }

/* ── Module en attente ───────────────────────────────── */
.module-attente {
  background: #fff;
  border: 2px dashed #dee2e6;
  border-radius: .75rem;
  padding: 3rem 2rem;
  text-align: center;
}
.module-attente .bi { font-size: 3rem; color: #adb5bd; display: block; margin-bottom: 1rem; }
.module-attente h4 { color: #6c757d; font-weight: 600; }
.module-attente p { color: #adb5bd; max-width: 500px; margin: .5rem auto 0; font-size: .9rem; }

/* ── Chart Containers ───────────────────────────────── */
.chart-container {
  background: #fff;
  border-radius: .75rem;
  padding: 1rem;
  border: 1px solid #e5e7eb;
}
.chart-container canvas { max-height: 300px; }

/* ── Responsive ─────────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1035;
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.show { display: block; }
  .main-content { margin-left: 0; }
  .topbar .profile-info { display: none; }
}

/* ── Cards ──────────────────────────────────────────── */
.card-viq { border: 1px solid #e5e7eb; border-radius: .75rem; }
.card-viq .card-header { background: #fff; border-bottom: 1px solid #e5e7eb; font-weight: 600; font-size: .9rem; padding: .75rem 1rem; }
.card-viq .card-body { padding: 1rem; }

/* ── Forms ──────────────────────────────────────────── */
.form-label-viq { font-size: .8rem; font-weight: 600; color: #374151; margin-bottom: .3rem; }

/* ── Print ─────────────────────────────────────────── */
@media print {
  .sidebar, .topbar, .sidebar-overlay { display: none !important; }
  .main-content { margin-left: 0 !important; }
}

/* ── Boutons & texte de marque (48 usages dans les templates,
   jamais définis jusqu'ici -> boutons invisibles partout) ─────── */
.btn-viq-primary {
  background: var(--viq-primary);
  border: 1px solid var(--viq-primary);
  color: #fff;
}
.btn-viq-primary:hover,
.btn-viq-primary:focus {
  background: var(--viq-primary-light);
  border-color: var(--viq-primary-light);
  color: #fff;
}
.text-viq-primary { color: var(--viq-primary) !important; }
