/* style.css – Design System & ITELEC Theme - VERSION CORRIGÉE */

/*==================================
  Variables Globales
==================================*/
:root {
  /* Couleurs */
  --bleu: #0078d7;
  --bleu-fonce: #003366;
  --jaune: #ffc107;
  --jaune-light: rgba(255, 193, 7, 0.15);
  --gris: #f4f4f4;
  --color-primary: var(--bleu);
  --color-secondary: var(--jaune);
  --color-secondary-light: var(--jaune-light);
  --color-accent: #ff7900;
  --color-text: var(--bleu-fonce);
  --color-bg: var(--gris);
  --color-muted: #f6f6f6;
  --color-border: #dddddd;
  --color-white: #ffffff; 

  /* Typographie */
  --font-family-sans: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --font-size-base: 1rem;
  --line-height-base: 1.5;

  /* Espacements */
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;

  /* Breakpoints */
  --breakpoint-mobile: 480px;
  --breakpoint-tablet: 768px;
  --breakpoint-desktop: 1024px;

  /* Rayons et ombres */
  --radius-sm: 4px;
  --radius-md: 8px;
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
}

/*==================================
  Reset & Global - CORRIGÉ
==================================*/
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; line-height: var(--line-height-base); }
body {
  margin: 0;
  padding: 0;
  font-family: var(--font-family-sans);
  font-size: var(--font-size-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  scroll-behavior: smooth;
  display: flex;
  flex-direction: column;
  min-height: 100vh; /* Force la hauteur minimale */
}

/*==================================
  Thème PUBLIC (Index, Navigation, Hero)
==================================*/

/* Header & Navigation */
header {
  background-color: var(--color-primary);
  color: white;
  padding: var(--space-md) var(--space-xl);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 10;
}
/* Desktop Nav */
#desktopNav {
  display: flex;
  align-items: center;
}
#desktopNav ul {
  list-style: none;
  display: flex;
  gap: var(--space-lg);
  margin: 0;
  padding: 0;
}
#desktopNav a {
  color: white;
  text-decoration: none;
  font-weight: bold;
  cursor: pointer;
  border-bottom: 2px solid transparent; 
  transition: border-bottom 0.3s;
}

#desktopNav a:hover {
  border-bottom: 2px solid #e6b800; 
}

/* Bouton "Espace interne" */
#desktopNav a.btn-tech,
header > .btn-tech {
  background-color: var(--color-secondary);
  color: var(--color-primary);
  padding: var(--space-xs) var(--space-md);
  border-radius: 6px;
  transition: background 0.2s;
}
#desktopNav a.btn-tech:hover,
header > .btn-tech:hover {
  background-color: #e6b800;
}
/* Burger (mobile) caché par défaut */
.burger { display: none; }

/* Hero */
.hero-container { position: relative; }
.hero {
  background: url('chantier-tranchee.jpeg') center/cover no-repeat;
  background-color: #1e1e1e;
  color: white;
  padding: 12rem var(--space-md) 6rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 0;
}
.hero > * { position: relative; z-index: 1; }

/* Logo animée */
.logo-hero {
  position: absolute;
  top: -50px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 120px;
  z-index: 10;
}
.logo-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: white;
  border-radius: 50%;
  box-shadow: 0 0 30px rgba(0,0,0,0.2);
  z-index: -1;
}
.logo-hero img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
  padding: 8px;
  animation: bounceIn 0.8s ease;
}

/*==================================
  Sections « Nos services » et « Nous recrutons »
==================================*/
#services, #recrutement {
  background-color: var(--color-secondary-light);
  border-radius: 16px;
  /* on supprime la limite statique et on passe en % */
  max-width: none;
  width: 90%;
  margin: var(--space-lg) auto;
  padding: var(--space-lg) var(--space-md);
  box-sizing: border-box;
}
/* Titre en bulle blanche */
#services h2, #recrutement h2 {
  background: none;
  color: var(--color-primary);
  display: block;
  padding: 0;
  margin: 0 0 var(--space-md);
  font-size: clamp(1.5rem, 5vw, 2rem);
}

/* Grilles internes */
.services, .recrutement {
  display: grid;
  gap: var(--space-md);
  /* 3 colonnes sur desktop, 2 sur tablette, 1 sur mobile */
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* Cartes blanches */
.services .card,
.recrutement .card {
  background: white;
  color: var(--bleu-fonce);
  padding: var(--space-md);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.services .card:hover,
.recrutement .card:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
/* Bouton « Postulez » harmonisé */
.btn-postulez {
  align-self: flex-start;
  margin-top: var(--space-sm);
  background-color: var(--color-primary);
  color: white;
  padding: var(--space-xs) var(--space-md);
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  transition: background 0.2s;
}
.btn-postulez:hover {
  background-color: var(--bleu-fonce);
}
/*==================================
  Contact
==================================*/
#contact {
  padding: var(--space-lg) var(--space-md);
  max-width: 1000px;
  margin: var(--space-lg) auto;
  text-align: center;
}
#contact h2 { margin-top: 0; }
#contact p { font-size: var(--font-size-base); }

/*==================================
  Footer collé en bas - CORRIGÉ
==================================*/
footer {
  background-color: #222;
  color: #ccc;
  text-align: center;
  padding: var(--space-xl) var(--space-md);
  font-size: 0.9rem;
  margin-top: auto; /* Pousse le footer vers le bas */
  width: 100%;
  flex-shrink: 0; /* Empêche le footer de rétrécir */
}

/*==================================
  Drawer mobile – version simplifiée
==================================*/

/* 1) Par défaut, tout est caché */
.burger,
#mainNav,
#navOverlay {
  display: none;
}

/* 2) Mobile & tablettes (<=1024px) */
@media (max-width: 1024px) {
  /* on cache la nav desktop */
  #desktopNav { display: none; }

  /* on affiche le burger */
  .burger {
    display: block;
    position: fixed;
    top: var(--space-md);
    right: var(--space-md);
    background: rgba(0,0,0,0.3);
    padding: var(--space-xs);
    border-radius: 4px;
    font-size: 1.8rem;
    color: white;
    border: none;
    cursor: pointer;
    z-index: 102;
  }

  /* overlay, caché par défaut */
  #navOverlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 100;
  }
  /* nav caché par défaut et positionné off-canvas */
  #mainNav {
    display: none;
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    width: 75%; max-width: 300px;
    background-color: var(--color-primary);
    padding: var(--space-lg) var(--space-md);
    z-index: 101;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
  }
  /* styling de la liste */
  #mainNav ul {
    list-style: none;
    margin: 2rem 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }
  #mainNav a {
    color: white;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: bold;
  }

  /* 3) Au clic, on ajoute .show sur nav + overlay */
  #mainNav.show {
    display: block;
    transform: translateX(0);
  }
  #navOverlay.show {
    display: block;
  }
}

/* 4) Desktop (>1024px) : on s'assure que tout reste caché */
@media (min-width: var(--breakpoint-desktop)) {
  .burger   { display: none !important; }
  #mainNav  { display: none !important; }
  #navOverlay { display: none !important; }
  .table-dashboard {
    width: 100%;
    table-layout: auto;
  }
  #services,
  #recrutement {
    width: 100%;
    padding: var(--space-xl) var(--space-lg);
  }
}


/*==================================
  Thème LOGIN
==================================*/
body.public.login-page {
  display: grid;         /* remplace le flex global */
  place-items: center;   /* centre à la fois vertical et horizontal */
  min-height: 100vh;
  background-color: var(--gris);
}

body.public.login-page.modern {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--bleu-fonce) 80%);
}
.login-wrapper {
  background: white; border-radius: 12px; padding: 2.5rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  width: 100%; max-width: 450px; text-align: center;
  flex: none; /* Empêche le wrapper de grandir */
}

.login-logo img {
  width: 90px;
  margin-bottom: -0.15rem;
}
.login-wrapper h1 {
  color: var(--bleu-fonce);
  margin: var(--space-sm) 0 var(--space-md);
  font-size: 1.6rem;
  font-weight: 700;
}
.login-wrapper label {
  display: block;
  text-align: left;
  margin: var(--space-xs) 0 var(--space-xs);
  font-weight: 600;
  color: var(--bleu-fonce);
}
.login-wrapper input {
  width: 100%;
  padding: var(--space-xs);
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: var(--font-size-base);
  transition: border-color 0.3s;
}
.login-wrapper input:focus {
  outline: none;
  border-color: var(--color-primary);
}
.login-wrapper button {
  width: 100%;
  margin-top: var(--space-sm);
  padding: 0.65rem;
  background: var(--color-secondary);
  color: var(--bleu-fonce);
  border: none;
  border-radius: 6px;
  font-size: var(--font-size-base);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s, transform 0.2s;
}
.login-wrapper button:hover {
  background: #e6b800;
  transform: translateY(-2px);
}
.login-wrapper .error {
  color: #ff4d4d;
  margin-top: var(--space-md);
  font-size: 0.9rem;
  text-align: center;
}

/*==================================
  Composants Standards
==================================*/
.btn {
  display: inline-block;
  font-family: inherit;
  font-size: var(--font-size-base);
  padding: var(--space-sm) var(--space-md);
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s ease;
}
.btn-primary {
  background-color: var(--color-primary);
  color: #fff;
}
.btn-secondary {
  background-color: var(--color-secondary);
  color: var(--color-text);
}
.btn:disabled {
  background-color: var(--color-muted);
  cursor: not-allowed;
}
.btn:not(:disabled):hover {
  background-color: var(--color-accent);
}

/*==================================
  Thème Dashboard Admin - CORRIGÉ
==================================*/
body.public.dashboard-page {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--bleu-fonce) 80%);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
}

/* Le contenu principal doit prendre tout l'espace disponible */
.dashboard-wrapper {
  width: 90%;
  max-width: 1200px;
  background-color: white;
  border-radius: 12px;
  padding: var(--space-lg);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  margin: var(--space-lg) auto;
  overflow-x: auto; /* scroll si trop large */
  flex: 1; /* Prend l'espace disponible */
}

.dashboard-wrapper h1 {
  color: var(--color-primary);
  text-align: center;
  margin-bottom: var(--space-md);
}

/* Groupes de boutons dans les headers - CORRIGÉ */
.btn-group {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: var(--space-md);
}

.btn-group button,
.btn-group select,
.btn-group input {
  background-color: var(--color-secondary);
  color: var(--color-primary);
  border: none;
  padding: var(--space-xs) var(--space-md);
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9rem;
}

.btn-group button:hover,
.btn-group select:hover {
  background-color: #e6b800;
  transform: translateY(-1px);
}

/* Boutons spéciaux */
.btn-group input[type="date"],
.btn-group input[type="text"] {
  background-color: white;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

/*==================================
  Table Dashboard
==================================*/
/* base : largeur naturelle + scroll */
.table-dashboard {
  width: 100%;
  min-width: 100%;
  table-layout: auto;      /* colonnes selon contenu */
  border-collapse: collapse;
  margin-top: var(--space-md);
  white-space: nowrap;      /* pas de retour à la ligne */
}

.table-dashboard th,
.table-dashboard td {
  padding: var(--space-sm);
  border: 1px solid var(--color-border);
  text-align: center;
}

/* header général (sticky) */
.table-dashboard thead th {
  position: sticky;
  top: 0;
  background: var(--color-primary);
  color: white;
  z-index: 2;
}

/* colonne "Technicien" sticky */
.table-dashboard .sticky {
  position: sticky;
  left: 0;
  background-color: var(--color-bg);
  z-index: 3;
}

/* colorer première et dernière colonne */
.table-dashboard th:first-child,
.table-dashboard td:first-child,
.table-dashboard th:last-child,
.table-dashboard td:last-child {
  background-color: var(--color-primary);
  color: white;
}

.table-dashboard a {
  color: inherit;
  text-decoration: none;
  border-bottom: 2px solid transparent; 
  transition: border-bottom 0.3s;

}

.table-dashboard a:hover {
  border-bottom: 2px solid #e6b800; 
}

/* sur desktop (>1024px), on force 100% */
@media (min-width: var(--breakpoint-desktop)) {
  .table-dashboard {
    width: 100%;
  }
  .dashboard-wrapper {
    width: 100%;       /* prend toute la largeur dispo */
    max-width: none;   /* plus de limite à 1000px */
    padding: 2rem 4%;  /* on garde un peu d'air sur les côtés */
  }
}


/*==================================
  Bouton remonter en haut
==================================*/
/* Bouton "remonter en haut" – fixe en bas à droite */
#topBtn {
  position: fixed;
  bottom: var(--space-md);
  right: var(--space-md);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: var(--color-primary);
  color: white;
  border: none;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 1000;
}
#topBtn.show {
  display: flex;
}

/*==================================
  Encodage – mise en page du formulaire - CORRIGÉ
==================================*/
body.encodage-page {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--bleu-fonce) 80%);
}

body.encodage-page .dashboard-wrapper {
  position: relative;
  max-width: 800px;
  margin: var(--space-lg) auto var(--space-lg);
  padding: var(--space-lg);
}

/* Formulaires plus élégants - CORRIGÉ */
body.encodage-page form label {
  display: block;
  margin: var(--space-md) 0 var(--space-xs);
  font-weight: 600;
  color: var(--color-text);
}

body.encodage-page form input:not([type="checkbox"]),
body.encodage-page form select,
body.encodage-page form textarea {
  width: 100%;
  padding: var(--space-sm);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: var(--font-size-base);
  margin-bottom: var(--space-sm);
  transition: border-color 0.3s ease;
}

body.encodage-page form input:focus,
body.encodage-page form select:focus,
body.encodage-page form textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(0, 120, 215, 0.1);
}

/* Amélioration du conteneur des tâches - CORRIGÉ */
body.encodage-page #taches-container {
  display: block;
  margin-bottom: var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: var(--space-md);
  background-color: var(--color-muted);
  position: relative;
}

/* Titre pour le conteneur des tâches */
body.encodage-page #taches-container::before {
  content: "Tâches à effectuer :";
  display: block;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: var(--space-sm);
  padding-bottom: var(--space-xs);
  border-bottom: 1px solid var(--color-border);
}

/* Chaque ligne de tâche - alignement propre - CORRIGÉ */
body.encodage-page #taches-container > div {
  margin-bottom: var(--space-sm);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* Labels des tâches - alignement avec les inputs - CORRIGÉ */
body.encodage-page #taches-container label {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin: 0;
  font-size: 0.9rem;
  cursor: pointer;
  flex: 1;
}

/* Inputs checkbox et number dans les tâches - CORRIGÉ */
body.encodage-page #taches-container input[type="checkbox"] {
  width: auto;
  margin: 0;
  cursor: pointer;
}

body.encodage-page #taches-container input[type="number"] {
  width: 80px;
  margin: 0;
  padding: var(--space-xs);
  text-align: center;
}

/* Bouton principal du formulaire - CORRIGÉ */
body.encodage-page form .btn-primary {
  display: block;
  width: 100%;
  padding: var(--space-md);
  background-color: var(--color-secondary);
  color: var(--color-primary);
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: var(--space-lg);
}

body.encodage-page form .btn-primary:hover {
  background-color: #e6b800;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/*==================================
  Headers uniformes pour toutes les pages dashboard - CORRIGÉ
==================================*/
header.dashboard-header,
header.encodage-header {
  background: transparent;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
  margin: var(--space-lg) auto 0;
  padding: 0 var(--space-md);
  max-width: 1200px; /* Largeur cohérente */
}

/* Titres des headers */
header.dashboard-header h1,
header.encodage-header h1 {
  color: white !important;
  text-shadow: 0 2px 4px rgba(0,0,0,0.6) !important;
  margin: 0;
  font-size: 1.8rem;
  font-weight: 700;
}

/* Groupes de boutons dans les headers */
header.dashboard-header .btn-group,
header.encodage-header .btn-group {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

/*==================================
  Galerie "Nos réalisations"
==================================*/
#realisations {
  padding: var(--space-lg) var(--space-md);
  background-color: var(--gris);      /* léger contraste avec le blanc */
  text-align: center;
}

#realisations h2 {
  color: var(--color-primary);
  margin-bottom: var(--space-md);
  font-size: clamp(1.75rem, 6vw, 2.25rem);
}

/* ———————————————————————————————
   Galerie slider horizontal & images carrées
———————————————————————————————————*/
#realisations .gallery {
  display: flex;               /* affiche les items en ligne */
  flex-wrap: nowrap;           /* pas de retour à la ligne */
  gap: var(--space-md);
  overflow-x: auto;            /* scroll horizontal */
  overflow-y: hidden;          /* pas de scroll vertical */
  padding-bottom: var(--space-md);
  scroll-snap-type: x mandatory; /* pour un alignement "snap" */
}

#realisations .gallery-item {
  flex: 0 0 auto;              /* taille fixe, ne rétrécit pas */
  width: 200px;                /* largeur fixe : ajustable */
  aspect-ratio: 1 / 1;         /* hauteur = largeur */
  scroll-snap-align: start;    /* alignement au snap */
  background-color: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#realisations .gallery-item img {
  width: 100%;
  height: 100%;                /* remplit le carré */
  object-fit: cover;           /* coupe si besoin pour garder l'aspect */
  display: block;
  transition: transform 0.3s ease;
}

/* Hover : zoom sur le carré + l'image */
#realisations .gallery-item:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
#realisations .gallery-item:hover img {
  transform: scale(1.1);
}


/* spacing desktop un peu plus large */
@media (min-width: var(--breakpoint-desktop)) {
  #realisations {
    padding: var(--space-xl) var(--space-lg);
  }
}
/* ———————————————————————————————
   Lightbox Overlay
———————————————————————————————————*/
#lightbox-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
}

#lightbox-overlay.hidden { display: none; }

#lightbox-overlay img {
  max-width: 90%;
  max-height: 90%;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  border-radius: 8px;
  transition: opacity 0.2s ease;
}

#lightbox-close {
  position: absolute;
  top: 1rem; right: 1rem;
  font-size: 1.5rem;
  color: white;
  cursor: pointer;
  user-select: none;
}
/* Boutons précédent/suivant */
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 2rem;
  color: white;
  padding: 0.5rem 1rem;
  cursor: pointer;
  user-select: none;
  transition: color 0.2s;
}
#lightbox-prev { left: 1rem; }
#lightbox-next { right: 1rem; }
.lightbox-nav:hover { color: var(--color-secondary); }

/* --- Card pour le formulaire --- */
.card {
  background: var(--color-white);
  padding: 1.5rem;
  border-radius: 1rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  margin-bottom: 2rem;
}
.card .card-title {
  position: relative;
  display: inline-block;
  color: var(--color-primary);
  margin-bottom: 1rem;
  font-size: 1.5rem;
  z-index: 1;        /* on place le titre au-dessus de la bulle */
}
.card .card-title::before {
  content: "";
  position: absolute;
  left: -0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.2rem;
  height: 1.2rem;
  background: var(--color-secondary);
  border-radius: 50%;
  z-index: 0;
}
/* ==== Carte "Créer un utilisateur" === */
/* 1) Carte plus compacte */
.create-user-card {
  max-width: 600px;            /* passe de 700 → 600 */
  margin: 1.5rem auto;         /* moins d'espace au-dessus / dessous */
  padding: 1rem;               /* réduit le padding interne */
  background-color: var(--color-secondary-light);     /* fond crème/jaune pâle */
  border: 1px solid var(--color-secondary);          /* fine bordure jaune */
  border-radius: 0.5rem;                             /* coins arrondis */
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);             /* ombre légère */
}

/* 2) Grille 2 colonnes, gaps serrés */
.create-user-card .form-dashboard {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-column-gap: 1rem;       /* écart horizontal */
  grid-row-gap: 0.75rem;       /* écart vertical */
}

/* si vous aviez des .form-row, on les fait "pass-through" */
.create-user-card .form-row {
  display: contents;
}

/* 3) Labels + champs réduits */
.create-user-card label {
  font-size: 0.9rem;           /* texte un peu plus petit */
  display: flex;
  flex-direction: column;
}

.create-user-card input,
.create-user-card select {
  font-size: 0.9rem;           /* police des champs réduite */
  padding: 0.4rem 0.5rem;      /* moins de padding interne */
  border-radius: 4px;
}

/* bouton centré et plus petit */
.create-user-card button {
  grid-column: 1 / -1;         /* s'étale sur 2 colonnes */
  justify-self: center;
  padding: 0.5rem 1.25rem;
  font-size: 0.9rem;
}


/* Focus un peu plus prononcé */
.create-user-card input:focus,
.create-user-card select:focus,
.create-user-card textarea:focus {
  outline: none;
  box-shadow: 0 0 0 3px var(--color-secondary-light);
}
/*==================================
  Page Profil
==================================*/
body.public.dashboard-page .form-dashboard {
  max-width: 500px;
  margin: var(--space-lg) auto;
  background: var(--color-white);
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

body.public.dashboard-page .form-dashboard label {
  display: block;
  margin-bottom: var(--space-xs);
  font-weight: 500;
  color: var(--color-text);
}

body.public.dashboard-page .form-dashboard input {
  width: 100%;
  padding: var(--space-sm);
  margin-bottom: var(--space-md);
  background: var(--color-white);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

body.public.dashboard-page .form-dashboard hr {
  border-color: var(--color-border);
  margin: var(--space-md) 0;
}

body.public.dashboard-page .form-dashboard button {
  width: 100%;
  padding: var(--space-sm);
  background-color: var(--color-secondary);
  color: var(--color-primary);
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

body.public.dashboard-page .form-dashboard button:hover {
  background-color: var(--color-accent);
}
/*==================================
  Page Historique – frontend/history-page
==================================*/
body.public.history-page {
  background: var(--color-bg);
}

header.history-header {
  max-width: 1000px;
  margin: var(--space-lg) auto 0;
  padding: 0 var(--space-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header.history-header h1 {
  color: var(--bleu-fonce);
  margin: 0;
}

.filter-group {
  margin: var(--space-md) auto;
  max-width: 1000px;
  display: flex;
  gap: var(--space-sm);
  align-items: center;
}

.history-wrapper {
  max-width: 1000px;
  margin: var(--space-md) auto;
  overflow-x: auto;
}

table.table-history {
  width: 100%;
  border-collapse: collapse;
}

table.table-history th,
table.table-history td {
  padding: var(--space-sm);
  border: 1px solid var(--color-border);
  text-align: center;
}

table.table-history th.sticky,
table.table-history td.sticky {
  position: sticky;
  left: 0;
  background: var(--color-white);
  z-index: 1;
}

a.view-link {
  color: var(--color-primary);
  text-decoration: none;
}
/* Filtrage historique (inputs dans .btn-group) */
header.dashboard-header .btn-group input[type="text"] {
  background-color: var(--color-white);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  padding: var(--space-xs) var(--space-md);
  border-radius: 6px;
  font-weight: 600;
  min-width: 150px;
}
header.dashboard-header .btn-group input[type="number"],
header.dashboard-header .btn-group select {
  background-color: var(--color-white);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  padding: var(--space-xs) var(--space-md);
  border-radius: 6px;
  font-weight: 600;
  min-width: 150px;
  transition: box-shadow 0.2s;
}

header.dashboard-header .btn-group input[type="text"]::placeholder {
  color: var(--color-muted);
  opacity: 1;
}

header.dashboard-header .btn-group input[type="date"] {
  background-color: var(--color-white);
  color: var(--color-text); /* 👈 force la couleur foncée */
  border: 1px solid var(--color-border);
  padding: var(--space-xs) var(--space-md);
  border-radius: 6px;
  font-weight: 600;
  min-width: 150px;
  appearance: none;
  cursor: pointer;
  transition: box-shadow 0.2s;
}

header.dashboard-header .btn-group input:focus,
header.dashboard-header .btn-group select:focus {
  outline: none;
  box-shadow: 0 0 0 3px var(--color-secondary-light);
}

header.dashboard-header .btn-group #btn-clear-filters {
  background-color: var(--color-accent);
  color: var(--color-white);
}
header.dashboard-header .btn-group #btn-clear-filters:hover {
  background-color: var(--bleu-fonce);
}


/* ── Filtre historique (inputs + date) ── */
header.dashboard-header .btn-group input,
header.dashboard-header .btn-group select {
  background-color: var(--color-white);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

header.dashboard-header .btn-group input::placeholder {
  color: var(--color-muted);
}

.td-remarques {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- MODAL DETAILS HISTORIQUE --- */
.modal {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  position: relative;
  animation: fadeInUp 0.3s ease;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--color-primary);
}

#modal-body p {
  margin: 0.75rem 0;
}

.modal-close {
  cursor: pointer;
}

/*==================================
  Responsive amélioré - CORRIGÉ
==================================*/
@media (max-width: 768px) {
  /* Headers responsive */
  header.dashboard-header,
  header.encodage-header {
    flex-direction: column;
    gap: var(--space-sm);
    text-align: center;
  }
  
  header.dashboard-header h1,
  header.encodage-header h1 {
    font-size: 1.4rem;
  }
  
  /* Boutons en colonne sur mobile */
  .btn-group {
    flex-direction: column;
    width: 100%;
  }
  
  .btn-group button,
  .btn-group select,
  .btn-group input {
    width: 100%;
    margin-bottom: var(--space-xs);
  }
  
  /* Tâches en colonne sur mobile */
  body.encodage-page #taches-container > div {
    flex-direction: column;
    align-items: flex-start;
  }
  
  body.encodage-page #taches-container label {
    width: 100%;
  }
  
  /* Dashboard wrapper responsive */
  .dashboard-wrapper {
    width: 95%;
    padding: var(--space-md);
  }
  
  /* Stats grids responsive */
  .infra-stats-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/*==================================
  Animations
==================================*/
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes bounceIn {
  0%   { opacity: 0; transform: translateY(-50px) scale(0.7); }
  60%  { opacity: 1; transform: translateY(10px) scale(1.05); }
  80%  { transform: translateY(-4px) scale(0.97); }
  100% { transform: translateY(0) scale(1); }
}

/*==================================
  Styles spécifiques Infrastructure Dashboard
==================================*/
.infra-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.infra-stat-card {
  background: white;
  border-radius: 12px;
  padding: var(--space-md);
  text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transition: transform 0.3s ease;
  border-top: 4px solid var(--color-primary);
}

.infra-stat-card:hover {
  transform: translateY(-3px);
}

.infra-stat-value {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 5px;
}

.infra-stat-label {
  color: #7f8c8d;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.positive { color: #27ae60; }
.negative { color: #e74c3c; }
.neutral { color: var(--color-primary); }

.infra-card {
  background: white;
  border-radius: 12px;
  padding: var(--space-lg);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  margin-bottom: var(--space-lg);
}

.infra-card h2 {
  color: var(--color-primary);
  margin-bottom: var(--space-md);
  font-size: 1.4rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.infra-icon {
  width: 24px;
  height: 24px;
  background: var(--color-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 12px;
}

.infra-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-md);
}

.infra-form-group {
  margin-bottom: var(--space-md);
}

.infra-form-group label {
  display: block;
  margin-bottom: var(--space-xs);
  color: var(--color-text);
  font-weight: 500;
}

.infra-form-group input,
.infra-form-group select {
  width: 100%;
  padding: var(--space-sm);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: var(--font-size-base);
  transition: border-color 0.3s ease;
}

.infra-form-group input:focus,
.infra-form-group select:focus {
  outline: none;
  border-color: var(--color-primary);
}

.infra-btn {
  background: var(--color-secondary);
  color: var(--color-primary);
  border: none;
  padding: var(--space-sm) var(--space-md);
  border-radius: 6px;
  cursor: pointer;
  font-size: var(--font-size-base);
  font-weight: 600;
  transition: background 0.2s ease;
  margin-right: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.infra-btn:hover {
  background: #e6b800;
}

.infra-btn-danger {
  background: #e74c3c;
  color: white;
}

.infra-btn-danger:hover {
  background: #c0392b;
}

.chart-container {
  position: relative;
  height: 400px;
  margin-top: var(--space-md);
}

.transactions-list {
  max-height: 300px;
  overflow-y: auto;
  margin-top: var(--space-md);
}

.transaction-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md);
  margin-bottom: var(--space-sm);
  background: var(--color-muted);
  border-radius: 8px;
  transition: background-color 0.3s ease;
}

.transaction-item:hover {
  background: #e9ecef;
}

.transaction-info {
  flex: 1;
}

.transaction-description {
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 5px;
}

.transaction-details {
  font-size: 0.85rem;
  color: #7f8c8d;
}

.transaction-amount {
  font-weight: 700;
  font-size: 1.1rem;
}

.delete-btn {
  background: #e74c3c;
  color: white;
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-size: 12px;
  margin-left: var(--space-sm);
  transition: background-color 0.3s ease;
}

.delete-btn:hover {
  background: #c0392b;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}

/* Responsive pour le dashboard infra */
@media (max-width: 768px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  
  .infra-form-grid {
    grid-template-columns: 1fr;
  }
}