:root {
  --primary: #004A7F;
  /* Bleu SERG */
  --secondary: #F39200;
  /* Orange SERG */
  --accent: #A9A9A9;
  /* Gris SERG */
  --bg-color: #F8FAFC;
  /* Gris-bleu très clair */
  --text-color: #1E293B;
  /* Slate 800 */
  --sidebar-width: 250px;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: 'Inter', sans-serif;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* Custom Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--primary);
  font-weight: 700;
}

/* Bootstrap Overrides */
.btn-primary {
  background-color: var(--primary);
  border-color: var(--primary);
  border-radius: 8px;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  background-color: #00365d;
  border-color: #00365d;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 74, 127, 0.2);
}

.btn-warning {
  background-color: var(--secondary);
  border-color: var(--secondary);
  color: #333;
  font-weight: 600;
  border-radius: 8px;
}

.btn-warning:hover {
  background-color: #d68100;
  border-color: #d68100;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(243, 146, 0, 0.3);
}

.btn-success {
  background-color: #10B981;
  /* Vert émeraude */
  border-color: #10B981;
  color: #fff;
  font-weight: 600;
  border-radius: 8px;
}

.card {
  border: none;
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
  background-color: #ffffff;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

/* Sidebar Styling */
#sidebar {
  width: var(--sidebar-width);
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  background-color: var(--primary);
  color: #fff;
  padding-top: 20px;
  z-index: 1000;
  transition: all 0.3s;
}

#sidebar .sidebar-header {
  padding: 20px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 20px;
}

#sidebar .sidebar-header img {
  background-color: white;
  padding: 0;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#sidebar .sidebar-header h3 {
  color: var(--secondary);
  margin: 0;
  font-weight: 800;
  letter-spacing: 1px;
}

#sidebar ul p {
  color: #fff;
  padding: 10px;
}

#sidebar ul li a {
  padding: 15px 20px;
  font-size: 1.1em;
  display: block;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: all 0.3s;
  border-left: 4px solid transparent;
}

#sidebar ul li a:hover,
#sidebar ul li.active>a {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
  border-left: 4px solid var(--secondary);
}

#sidebar ul li a i {
  margin-right: 10px;
  color: var(--accent);
}

/* Page Content */
#content {
  width: calc(100% - var(--sidebar-width));
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  padding: 30px;
  transition: all 0.3s;
}

/* Navbar */
.navbar-custom {
  background-color: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  border-radius: 12px;
  padding: 15px 20px;
  margin-bottom: 30px;
}

/* Login Page specific */
/* Login Page split-screen & showcase */
.login-page {
  margin: 0;
  padding: 0;
  overflow: hidden;
  font-family: 'Inter', sans-serif;
}

.login-wrapper {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.login-showcase {
  flex: 0 0 60%;
  position: relative;
  background-color: #0c1220;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  /* top padding for logo badge, bottom padding so text never clips */
  padding: clamp(80px, 8vh, 110px) clamp(24px, 4vw, 50px) clamp(28px, 4vh, 44px);
}

.showcase-slider {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.showcase-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1);
  background-size: cover;
  background-position: center;
}

.showcase-slide::after {
  content: '';
  position: absolute;
  inset: 0;
  /* stronger gradient at bottom so text is always readable */
  background: linear-gradient(
    to bottom,
    rgba(10, 15, 30, 0.15) 0%,
    rgba(10, 15, 30, 0.35) 40%,
    rgba(10, 15, 30, 0.85) 75%,
    rgba(10, 15, 30, 0.97) 100%
  );
}

.showcase-slide.active {
  opacity: 1;
  z-index: 2;
  animation: kenBurns 20s ease infinite alternate;
}

@keyframes kenBurns {
  0% {
    transform: scale(1);
  }
  100% {
    transform: scale(1.08);
  }
}

/* ── Overlay texte (ancré en bas du showcase, au-dessus du slider) ── */
.showcase-overlay {
  position: relative;
  z-index: 5;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Chaque bloc de contenu texte : masqué par défaut */
.showcase-content {
  display: none;
  width: 100%;
  max-width: min(560px, 100%);
  text-align: center;
  animation: fadeInUp 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Le bloc actif est visible */
.showcase-content.active-content {
  display: block;
}

/* ── Tag catégorie (pastille au-dessus du titre) ── */
.showcase-tag {
  display: inline-block;
  background: rgba(243, 146, 0, 0.18);
  color: var(--secondary);
  border: 1px solid rgba(243, 146, 0, 0.35);
  border-radius: 50px;
  font-size: clamp(0.68rem, 1vw, 0.78rem);
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 4px 14px;
  margin-bottom: 10px;
}

.showcase-logo-badge {
  position: absolute;
  top: clamp(16px, 3vh, 40px);
  left: clamp(16px, 4vw, 60px);
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 6px 14px;
  border-radius: 50px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.showcase-logo-badge img {
  height: clamp(24px, 2.5vw, 35px);
  background-color: white;
  border-radius: 4px;
  padding: 2px;
}

.showcase-logo-badge span {
  color: #ffffff;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 1px;
}

.showcase-title {
  /* Fluid: scales from 1.5rem at narrow panes up to 2.2rem at wide ones */
  font-size: clamp(1.4rem, 2.5vw, 2.2rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 10px;
  color: #ffffff;
  text-align: center;
  text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.showcase-desc {
  /* Fluid: scales from 0.85rem up to 1.0rem */
  font-size: clamp(0.82rem, 1.1vw, 1.0rem);
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 20px;
  text-align: center;
  text-shadow: 0 1px 5px rgba(0,0,0,0.2);
}

.slider-controls {
  position: relative;
  z-index: 5;
  display: flex;
  gap: 8px;
  justify-content: center;
  width: 100%;
}

.slider-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: all 0.3s ease;
}

.slider-dot.active {
  width: 30px;
  border-radius: 5px;
  background: var(--secondary);
}

/* Form Container on the Right */
.login-form-container {
  flex: 0 0 40%;
  background: linear-gradient(135deg, #0a1128 0%, #101f42 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  position: relative;
  overflow-y: auto;
}

.login-form-container::before {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(0, 74, 127, 0.2) 0%, transparent 70%);
  top: -50px;
  right: -50px;
  pointer-events: none;
}

.login-form-container::after {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(243, 146, 0, 0.1) 0%, transparent 70%);
  bottom: -50px;
  left: -50px;
  pointer-events: none;
}

/* Glassmorphic Login Card */
.glass-login-card {
  width: 100%;
  max-width: 420px;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 40px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  z-index: 10;
  animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.glass-login-card .form-label {
  color: rgba(255, 255, 255, 0.8) !important;
  font-size: 0.85rem;
  margin-bottom: 8px;
}

.glass-login-card .input-group-text {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: rgba(255, 255, 255, 0.6);
}

.glass-login-card .form-control {
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
  padding: 11px 15px;
  font-size: 0.95rem;
}

.glass-login-card .form-control::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.glass-login-card .form-control:focus {
  border-color: var(--secondary) !important;
  box-shadow: 0 0 12px rgba(243, 146, 0, 0.2);
}

.glass-login-card .password-toggle {
  background: rgba(255, 255, 255, 0.05) !important;
  border-left: none !important;
  color: rgba(255, 255, 255, 0.6);
}

.glass-login-card .password-toggle:hover {
  color: #ffffff;
}

.glass-login-card .form-check-label {
  color: rgba(255, 255, 255, 0.7) !important;
}

.glass-login-card .form-check-input {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
}

.glass-login-card .form-check-input:checked {
  background-color: var(--secondary);
  border-color: var(--secondary);
}

.glass-login-card .btn-primary {
  background-color: var(--primary);
  border-color: var(--primary);
  padding: 12px !important;
  border-radius: 12px;
  font-size: 1rem;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 74, 127, 0.3);
}

.glass-login-card .btn-primary:hover {
  background-color: #005fa3;
  border-color: #005fa3;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 74, 127, 0.4);
}

/* Responsive styles */
@media (max-width: 1199.98px) {
  .login-showcase {
    flex: 0 0 55%;
  }
  .login-form-container {
    flex: 0 0 45%;
    padding: 30px;
  }
}

@media (max-width: 991.98px) {
  .login-wrapper {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
    overflow-y: auto;
  }
  .login-showcase {
    flex: none;
    height: 48vh;
    min-height: 280px;
    justify-content: flex-end;
  }
  .showcase-title {
    font-size: clamp(1.2rem, 4vw, 1.6rem);
    margin-bottom: 6px;
  }
  .showcase-desc {
    font-size: clamp(0.78rem, 2.2vw, 0.9rem);
    margin-bottom: 12px;
    line-height: 1.55;
  }
  .login-form-container {
    flex: none;
    padding: 28px 16px;
  }
  .glass-login-card {
    max-width: 100%;
    padding: 28px 20px;
  }
}

@media (max-width: 576px) {
  .login-showcase {
    height: 40vh;
    min-height: 220px;
  }
  .showcase-title {
    font-size: clamp(1.1rem, 5vw, 1.4rem);
  }
  .showcase-desc {
    font-size: 0.8rem;
    line-height: 1.5;
  }
  .glass-login-card {
    padding: 22px 16px;
    border-radius: 16px;
  }
}

/* Tables */
.table-custom {
  border-collapse: separate;
  border-spacing: 0 10px;
}

.table-custom th {
  border: none;
  background-color: transparent;
  color: var(--primary);
  font-weight: 600;
  padding: 10px 15px;
  white-space: nowrap;
}

.table-custom tbody tr {
  background-color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
  border-radius: 8px;
  transition: transform 0.2s;
}

.table-custom tbody tr:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.table-custom td {
  border: none;
  padding: 15px;
  vertical-align: middle;
}

.table-custom td:first-child {
  border-top-left-radius: 8px;
  border-bottom-left-radius: 8px;
}

.table-custom td:last-child {
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
}

/* Status Badges */
.badge-active {
  background-color: rgba(16, 185, 129, 0.1);
  color: #059669;
  padding: 6px 12px;
  border-radius: 20px;
  font-weight: 600;
}

.badge-inactive {
  background-color: rgba(220, 53, 69, 0.1);
  color: #dc3545;
  padding: 6px 12px;
  border-radius: 20px;
  font-weight: 600;
}

/* Dashboard Specific Styles */
.dashboard-card {
  border: none;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
  background-color: #ffffff;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-card:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}

.icon-box {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px !important;
}

/* Pastel Colors inspired by reference image */
.pastel-purple {
  background-color: #F0EDFE;
  color: #6F42C1;
}

.pastel-yellow {
  background-color: #FEF9EB;
  color: #FFC107;
}

.pastel-teal {
  background-color: #EEF8F7;
  color: #20C997;
}

.pastel-pink {
  background-color: #FEF0F5;
  color: #E83E8C;
}

.pastel-green {
  background-color: #EEF7ED;
  color: #28A745;
}

/* Remove old hover translation for dashboard cards so they don't bounce too much */
.dashboard-card:hover {
  transform: none;
}

/* Managers Page */
.badge-dept {
  background-color: rgba(0, 75, 87, 0.1);
  color: var(--primary);
  border-radius: 6px;
  padding: 4px 10px;
  margin-right: 5px;
  margin-bottom: 5px;
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 500;
}

/* Password visibility toggle */
.password-toggle {
  cursor: pointer;
  background-color: var(--bg-color);
  border-left: none;
  color: #6c757d;
  transition: color 0.2s;
}

.password-toggle:hover {
  color: var(--primary);
}

.input-group:focus-within .form-control {
  border-color: var(--primary);
  box-shadow: none;
}

/* SweetAlert2 Customization */
.swal2-popup {
  border-radius: 16px !important;
  font-family: 'Inter', sans-serif !important;
}

.swal2-title {
  color: var(--primary) !important;
  font-weight: 800 !important;
}

.swal2-confirm {
  background-color: var(--primary) !important;
  border-radius: 8px !important;
}

.swal2-cancel {
  border-radius: 8px !important;
}

.swal2-icon.swal2-warning {
  border-color: var(--secondary) !important;
  color: var(--secondary) !important;
}

/* --- Animations & Micro-interactions --- */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.animate-up {
  animation: fadeInUp 0.5s ease backwards;
}

.animate-fade {
  animation: fadeIn 0.4s ease backwards;
}

/* Staggered animation classes (applied via JS) */
.stagger-1 {
  animation-delay: 0.1s;
}

.stagger-2 {
  animation-delay: 0.2s;
}

.stagger-3 {
  animation-delay: 0.3s;
}

.stagger-4 {
  animation-delay: 0.4s;
}

/* Enhanced Hover Effects */
.card,
.dashboard-card {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.card:hover,
.dashboard-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 30px rgba(0, 74, 127, 0.1) !important;
}

.btn {
  transition: all 0.2s ease;
}

.btn:active {
  transform: scale(0.96);
}

.table-hover tbody tr {
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.table-hover tbody tr:hover {
  background-color: rgba(0, 75, 87, 0.03) !important;
  transform: scale(1.002);
}

/* Sidebar hover animation */
#sidebar ul li {
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

#sidebar ul li::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0;
  background-color: rgba(255, 255, 255, 0.1);
  transition: width 0.3s ease;
  z-index: 0;
}

#sidebar ul li:hover::after {
  width: 100%;
}

#sidebar ul li a {
  position: relative;
  z-index: 1;
}

/* Smooth content transition */
#content {
  animation: fadeIn 0.6s ease;
}

/* --- Responsive Design --- */
@media (max-width: 991.98px) {
  #sidebar {
    margin-left: calc(-1 * var(--sidebar-width));
    transition: margin-left 0.3s ease-in-out;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.2);
  }

  #sidebar.active {
    margin-left: 0;
  }

  #content {
    width: 100%;
    margin-left: 0;
    padding: 15px;
  }

  /* Removed login-card styles inside responsive query, now handled above */
  
  .navbar-custom {
    padding: 10px 15px;
  }
  
  .dashboard-card {
    margin-bottom: 20px;
  }
}

/* Sidebar Toggle Overlay for Mobile */
.overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  transition: all 0.5s ease-in-out;
}

.overlay.active {
  display: block;
  opacity: 1;
}

/* Specific button for mobile toggle */
#sidebarCollapse {
  background: var(--bg-color);
  border: none;
  border-radius: 8px;
  color: var(--primary);
  padding: 8px 12px;
  display: none;
}

@media (max-width: 991.98px) {
  #sidebarCollapse {
    display: inline-block;
  }
  
  #navbar-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
  }
  
  #navbar-actions .btn {
    flex: 0 1 auto;
    font-size: 0.75rem !important;
    padding: 8px 12px !important;
    white-space: nowrap;
    border-radius: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 5px;
  }
  
  #navbar-actions .btn i {
    font-size: 0.9rem;
    display: inline-block;
    margin-bottom: 0;
  }
}