/* ===== Base ===== */
* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", system-ui, sans-serif;
  background: #f1f5f9;
  color: #0f172a;
  font-size: 15px;
}

h1, h2, h3 { margin: 0; }

/* ===== En-tête ===== */
.entete {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.entete-gauche {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #0d9488;
  color: #ffffff;
  font-weight: 700;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.entete h1 { font-size: 19px; font-weight: 700; }
.entete p { margin: 2px 0 0; font-size: 13px; color: #64748b; }

/* ===== Onglets ===== */
.onglets {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  padding: 0 32px;
  display: flex;
  gap: 28px;
}

.onglet {
  padding: 14px 2px 12px;
  text-decoration: none;
  color: #475569;
  font-size: 14px;
  font-weight: 500;
  border-bottom: 2px solid transparent;
}

.onglet.actif {
  color: #0d9488;
  border-bottom-color: #0d9488;
  font-weight: 600;
}

.onglet.desactive { color: #94a3b8; cursor: not-allowed; }

/* ===== Contenu ===== */
.contenu {
  max-width: 1400px;
  margin: 0 auto;
  padding: 28px 32px 48px;
}

.carte {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  padding: 22px 24px;
}

.carte-tete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.carte-tete h2 { font-size: 17px; font-weight: 700; }

.carte-tete-droite {
  display: flex;
  align-items: center;
  gap: 12px;
}

.champ-filtre {
  padding: 8px 11px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: #0f172a;
  background: #ffffff;
}

/* Badge "toxo" (orange, comme la maquette) */
.badge-toxo {
  display: inline-block;
  background: #fffbeb;
  color: #b45309;
  font-weight: 600;
  font-size: 12.5px;
  border-radius: 999px;
  padding: 3px 10px;
}

/* Cases à cocher (sérologies) */
.ligne-cases {
  display: flex;
  gap: 22px;
  margin-bottom: 13px;
}

.case-a-cocher {
  display: flex !important;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  margin-bottom: 0 !important;
  cursor: pointer;
}

.case-a-cocher input { width: 16px; height: 16px; accent-color: #0d9488; }

/* Deux champs côte à côte */
.ligne-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.sous-titre-equipe {
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 4px 0 10px;
}

.equipe-noms { color: #475569; font-size: 13.5px; }

.cellule-badges { white-space: nowrap; }

/* ===== Onglet Suivi du travail ===== */
.suivi-disposition {
  display: grid;
  grid-template-columns: 270px 1fr;
  gap: 20px;
  align-items: start;
}

.panneau-gauche {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.panneau-bloc {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 18px;
}

.panneau-titre {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 8px;
}

.panneau-titre:not(:first-child) { margin-top: 14px; }

.pleine-largeur { width: 100%; }

.suivi-infos {
  font-size: 13.5px;
  color: #475569;
  margin: 12px 0 0;
}

/* Pastilles d'information (groupe sanguin, âge, sérologies) */
.nuage-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.nuage-badges:empty { margin-top: 0; }

.badge-vert {
  display: inline-block;
  background: #ecfdf5;
  color: #047857;
  font-weight: 600;
  font-size: 12.5px;
  border-radius: 999px;
  padding: 4px 10px;
}

/* Équipe référente : pastilles avec initiales */
.liste-equipe {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 14px;
  color: #475569;
}

.item-equipe {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  color: #ffffff;
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nom-equipe { font-size: 14px; font-weight: 600; color: #0f172a; }
.role-equipe { font-size: 12.5px; color: #64748b; }

/* Barre de progression de la dilatation dans le tableau */
.barre-dilatation {
  display: inline-block;
  width: 84px;
  height: 8px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  vertical-align: middle;
  margin-right: 8px;
}

.barre-remplie {
  display: block;
  height: 100%;
  background: #0d9488;
  border-radius: 999px;
}

/* Badge d'orientation dans le tableau */
.badge-orientation {
  display: inline-block;
  background: #eef2ff;
  color: #4f46e5;
  font-weight: 600;
  font-size: 12.5px;
  border-radius: 999px;
  padding: 3px 10px;
}

.indication-survol { font-weight: 400; }

.suivi-colonne {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.grille-cartes {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.carte-indicateur {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px 16px;
}

.indicateur-titre {
  margin: 0;
  font-size: 12.5px;
  color: #64748b;
}

.indicateur-valeur {
  margin: 4px 0 0;
  font-size: 24px;
  font-weight: 700;
  color: #0f172a;
}

.indicateur-detail {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: #0d9488;
  font-weight: 600;
  min-height: 16px;
}

.legende {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #64748b;
}

.puce-couleur {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #0d9488;
  display: inline-block;
}

.conteneur-courbe {
  position: relative;
  height: 320px;
}

.texte-vide {
  color: #94a3b8;
  font-size: 14px;
  text-align: center;
  margin: 12px 0 0;
}

@media (max-width: 980px) {
  .suivi-disposition { grid-template-columns: 1fr; }
  .grille-cartes { grid-template-columns: repeat(2, 1fr); }
}

/* ===== Boutons ===== */
.bouton-principal {
  background: #0d9488;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

.bouton-principal:hover { background: #0f766e; }
.bouton-principal:disabled { opacity: 0.6; cursor: wait; }

.bouton-secondaire {
  background: #ffffff;
  color: #475569;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
}

.bouton-secondaire:hover { background: #f1f5f9; }

/* ===== Tableau ===== */
.tableau {
  width: 100%;
  border-collapse: collapse;
}

.tableau th {
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
}

.tableau td {
  padding: 12px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 14px;
}

.tableau tbody tr:hover { background: #f8fafc; }

.cellule-attente {
  color: #94a3b8;
  text-align: center;
  padding: 28px !important;
}

.badge-gs {
  display: inline-block;
  background: #fef2f2;
  color: #dc2626;
  font-weight: 600;
  font-size: 12.5px;
  border-radius: 999px;
  padding: 3px 10px;
}

.col-actions { width: 60px; }

.bouton-modifier {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 4px 6px;
  border-radius: 6px;
  color: #64748b;
}

.bouton-modifier:hover { background: #f1f5f9; color: #0f172a; }

/* ===== Messages ===== */
.message {
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  margin: 0 0 14px;
}

.message.erreur { background: #fef2f2; color: #b91c1c; }
.message.succes { background: #ecfdf5; color: #047857; }

/* ===== Fenêtre modale ===== */
.fenetre-fond {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 10;
}

.fenetre {
  background: #ffffff;
  border-radius: 14px;
  padding: 24px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.2);
}

.fenetre h3 { font-size: 16px; font-weight: 700; margin-bottom: 16px; }

.fenetre label {
  display: block;
  font-size: 13.5px;
  font-weight: 500;
  color: #334155;
  margin-bottom: 13px;
}

.fenetre .facultatif { color: #94a3b8; font-weight: 400; }

.fenetre input,
.fenetre select {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 9px 11px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: #0f172a;
  background: #ffffff;
}

.fenetre input:focus,
.fenetre select:focus {
  outline: 2px solid #99f6e4;
  border-color: #0d9488;
}

.message-fenetre {
  background: #fef2f2;
  color: #b91c1c;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13.5px;
  margin: 0 0 12px;
}

.fenetre-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

/* À la fin du fichier : cet état "caché" doit toujours l'emporter */
.cache { display: none; }

/* ===== Message éphémère (export Excel) ===== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  color: #ffffff;
  font-size: 14px;
  border-radius: 10px;
  padding: 11px 18px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.3);
  z-index: 20;
  max-width: 90%;
}

.toast.succes { background: #065f46; }
