:root {
    
--panel-width-desktop: 310px;
  --panel-width-mobile: 85vw;
  --panel-gap: 3.2rem; /* espace vertical entre les deux panels */

            /* Light theme variables */
            --primary-light: #667eea;
            --secondary-light: #764ba2;
            --accent-light: #4facfe;
            --background-light: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
            --card-bg-light: rgba(255, 255, 255, 0.95);
            --text-primary-light: #2d3748;
            --text-secondary-light: #4a5568;
            --border-light: rgba(255, 255, 255, 0.2);
            --shadow-light: 0 20px 40px rgba(0, 0, 0, 0.1);
            --hover-shadow-light: 0 30px 60px rgba(0, 0, 0, 0.15);

            /* Dark theme variables */
            --primary-dark: #4e54c8;
            --secondary-dark: #8f94fb;
            --accent-dark: #00d4ff;
            --background-dark: linear-gradient(135deg, #0c0c0c 0%, #1a1a2e 100%);
            --card-bg-dark: rgba(30, 30, 30, 0.95);
            --text-primary-dark: #e2e8f0;
            --text-secondary-dark: #a0aec0;
            --border-dark: rgba(255, 255, 255, 0.1);
            --shadow-dark: 0 20px 40px rgba(0, 0, 0, 0.5);
            --hover-shadow-dark: 0 30px 60px rgba(0, 0, 0, 0.7);

            /* Active theme (default light) */
            --primary: var(--primary-light);
            --secondary: var(--secondary-light);
            --accent: var(--accent-light);
            --background: var(--background-light);
            --card-bg: var(--card-bg-light);
            --text-primary: var(--text-primary-light);
            --text-secondary: var(--text-secondary-light);
            --border: var(--border-light);
            --shadow: var(--shadow-light);
            --hover-shadow: var(--hover-shadow-light);

            /* Animation variables */
            --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
            --transition-medium: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
            --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
        }

        [data-theme="dark"] {
            --primary: var(--primary-dark);
            --secondary: var(--secondary-dark);
            --accent: var(--accent-dark);
            --background: var(--background-dark);
            --card-bg: var(--card-bg-dark);
            --text-primary: var(--text-primary-dark);
            --text-secondary: var(--text-secondary-dark);
            --border: var(--border-dark);
            --shadow: var(--shadow-dark);
            --hover-shadow: var(--hover-shadow-dark);
        }

        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(30px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .employee-card {
            animation: fadeInUp 0.8s ease-out;
        }

        .sidebar {
            animation: fadeInUp 0.8s ease-out 0.2s both;
        }

        .containerMenu{
            position: absolute;
            width: 60px;
            height: 60px;
            left: 47%;
            bottom: 0;
            z-index: 5;
        }
        .wrapper{
            display: flex;
            list-style: none;
        }
        .wrapper .icon{
            position: relative;
            background: #ffffff;
            border-radius: 50%;
            padding: 15px;
            width: 60px;
            height: 60px;
            font-size: 18px;
            display: flex;
            justify-content: center;
            align-items: center;
            flex-direction: column;
            box-shadow: 0 10px 10px rgba(0, 0, 0, 0.1);
            cursor: pointer;
            transition: all 0.2a cubic-bezier(0.68, -0.55, 0.265, 1.55);
        }
        .wrapper .tooltip {
            position: absolute;
            top: 0;
            font-size: 18px;
            width: 210px;
            background: #ffffff;
            color: #ffffff;
            padding: 5px 8px;
            border-radius: 5px;
            box-shadow: 0 10px 10px rgba(0, 0, 0, 0.1);
            opacity: 0;
            pointer-events: none;
            transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        }
        
        .wrapper .tooltip::before {
            position: absolute;
            content: "";
            height: 8px;
            width: 8px;
            background: #ffffff;
            bottom: -3px;
            left: 50%;
            transform: translate(-50%) rotate(45deg);
            transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        }
        
        .wrapper .icon:hover .tooltip {
            top: -45px;
            opacity: 1;
            visibility: visible;
            pointer-events: auto;
        }
        
        .wrapper .icon:hover span,
        .wrapper .icon:hover .tooltip {
            text-shadow: 0px -1px 0px rgba(0, 0, 0, 0.1);
        }
        
        .wrapper .telegram:hover,
        .wrapper .telegram:hover .tooltip,
        .wrapper .telegram:hover .tooltip::before {
            background: #1DA1F2;
            color: #ffffff;
        }

        .glow {
        border-radius: 50%;
        box-shadow: 0 0 10px #00f;
        animation: pulseGlow 2s infinite;
        }

        @keyframes pulseGlow {
        0% {
            box-shadow: 0 0 10px #00f;
        }
        25% {
            box-shadow: 0 0 20px #0ff, 0 0 30px #0ff;
        }
        50% {
            box-shadow: 0 0 20px #0f0, 0 0 30px #0f0;
        }
        75% {
            box-shadow: 0 0 20px #f0f, 0 0 30px #f0f;
        }
        100% {
            box-shadow: 0 0 10px #00f;
        }

        }

        .nicebox {
        position: relative;
        text-align: center;
        font-family: "Roboto", "Arial", sans-serif;
        font-size: 13px;
        z-index: 5;
        padding: 5px 10px;
        }

        #data-box {
        top: 10px;
        left: 500px;
        height: 45px;
        line-height: 45px;
        display: none;
        }

        #census-variable {
        width: 360px;
        height: 20px;
        }

        .legend {
            font-family: 'AlternateGothic', sans-serif; /* ou ta police préférée */
            color: #5d2a2c;    /* couleur personnalisée */
            display: -webkit-box;
            padding-top: 7px;
            padding-bottom: 7px;
            display: flex;
            align-items: center;         /* aligne verticalement les éléments */
            justify-content: space-between; /* espace entre les éléments */
            gap: 1rem;  
        }

        .color-key {
        background: linear-gradient(
                    to right,
                    rgba(255, 255, 255, 1) 0%,
                    rgba(180, 255, 180, 1) 25%,
                    rgba(60, 200, 60, 1) 50%,
                    rgba(30, 120, 30, 1) 75%,
                    rgba(0, 60, 0, 1) 100%
                    );
        flex: 1;
        -webkit-box-flex: 1;
        margin: 0 5px;
        text-align: left;
        font-size: 1em;
        line-height: 1em;
        }

        #data-value {
        font-size: 2em;
        font-weight: bold;
        }

        #data-label {
        font-size: 2em;
        font-weight: normal;
        padding-right: 10px;
        }

        #data-label:after {
        content: ":";
        }

        #data-caret {
        margin-left: -5px;
        display: inline-block;
        font-size: 14px;
        width: 14px;
        }

/* ================================
   DOWN-BOX — Position fixe à droite, centré verticalement
=================================== */
/*
.down-box {
  position: fixed;
  top: 0;
  right: 0.75rem;
  transform: translateY(-50%);
  transform-origin: right center;

  width: var(--panel-width-desktop);
  max-width: var(--panel-width-desktop);

  background: #fff;
  border: 2px solid #5d2a2c;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 999;
}
*/
.down-box {
  position: fixed;
  top: auto;
  right: 0;

  /* ✅ occupe toute la hauteur */
  height: 100vh;

  /* ✅ largeur fixe */
  width: var(--panel-width-desktop);
  max-width: var(--panel-width-desktop);

  background: #fdf3d7;
  border-left: 2px solid #5d2a2c; /* optionnel : plus logique sur le côté */
  border-radius: 0; /* optionnel : enlève arrondi pour plein écran */

  box-shadow: -4px 0 12px rgba(0,0,0,0.15);

  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 999;
  
  border-top-left-radius: 12px;
  border-bottom-left-radius: 12px;

  /* important si tu avais mis border-radius: 0 ailleurs */
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;

}

/* ================================
   EMPLOYEE CARD
=================================== */

.employee-card {
  display: flex;
  flex-direction: column;
  height: 100%; /* ✅ IMPORTANT */
  min-height: 0;
  flex: 1; /* ✅ prend tout l’espace restant */
}

/* ================================
   HEADER
=================================== */

.card-header {
  background-color: #fdf3d7;

  padding: 3rem 0.8rem; /* ✅ plus haut */

  width: 100%;
  display: flex;
  align-items: center;

  border-bottom: 1px solid rgba(43,33,24,0.12);
}

.card-header h2 {
  font-family: 'AlternateGothic';
  font-weight: bold;
  font-size: 0.8rem;
  color: #5d2a2c;
  margin: 0;
}

.card-header::after {
  content: "";
  position: absolute;
  top: 6em; 
  width: 36px;
  height: 3px;
  border-radius: 2px;
  background: #f5c243;
}

.close-panel {
    position: absolute;
    top: 12px;
    right: 12px;

    width: 32px;
    height: 32px;

    border: none;
    border-radius: 50%;

    background: rgba(93, 42, 44, 0.1);
    color: #5d2a2c;

    font-size: 20px;
    font-weight: bold;
    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    transition: all 0.2s ease;
    z-index: 1000;
}

.close-panel:hover {
    background: #5d2a2c;
    color: white;
}

/* ================================
   PROFILE SECTION
=================================== */

.profile-section h2 {
  font-family: 'AlternateGothic';
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: 0.01em;
  line-height: 1.15;
  color: #5d2a2c;
  margin: 0;
  text-transform: uppercase;
}

.employee-info {
  position: relative;
  display: inline-block;
}

.farmer-label {
  font-size: 18px;
  font-family: 'AlternateGothic';
  font-weight: 400;
  letter-spacing: 0.16em;
  color: #5d2a2c;
  text-transform: uppercase;

  position: absolute;
  top: -25px;
  left: 0;
  min-width: 200px;
}

/* ================================
   BODY
=================================== */

.card-body {
  margin-top: 5px;

  display: flex;
  flex-direction: column;
  padding: 0.3rem;

  background-image: url("./images/bgbox.png");
  background-size: 125px 125px;
  background-repeat: no-repeat;
  background-position: top right;

  flex: 1; /* ✅ prend tout l’espace restant */
  min-height: 0;
}

/* ================================
   DETAILS GRID
=================================== */

.details-grid {
  display: flex;
  flex-direction: column;

  flex: 1; /* ✅ prend toute la hauteur */
  min-height: 0;
  /*gap: 0.5rem;*/
}

.detail-item {
  display: flex;
  align-items: center; /* ✅ centre verticalement */
  gap: 0.5rem;
  padding: 0.6em 0;
  border-bottom: 1px solid rgba(43,33,24,0.12);
}

#farmerlabel7 {  
  position: relative;
  display: block;
}

/* Icône gauche */
.detail-content .icon-left {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #4a3326;
    margin: 0 10px;
    padding: 7px;
}

.detail-icon {
  font-size: 1rem;
  color: #5d2a2c;
  flex-shrink: 0;
}
/*
.detail-content {
  display: flex;
  flex-direction: row;     
  align-items: center;
  gap: 0.25rem;
  width: 100%;
  min-width: 0;      
}*/
.detail-content {
  display: flex;
  /*grid-template-columns: 180px 1fr;  colonne fixe + fluide */
  align-items: center;
  width: 100%;
  justify-content: space-between !important;
}

.detail-label {
  font-family: 'AlternateGothic';
  font-weight: 500;
  font-size: 1.2rem;
  color: #5d2a2c;
  text-align: left;
  flex: 1;
  /*flex: 0 1 auto;
  min-width: 0;*/
}

.detail-value {
  font-family: 'AlternateGothic';
  font-weight: 700;
  font-size: 1.2rem;
  color: #5d2a2c;
  /*margin-left: 0.2rem;*/

  /* 🔒 Ne pas passer à la ligne */
  white-space: nowrap;

  /* Si ça dépasse vraiment, on tronque proprement (optionnel) */
  overflow: hidden;
  text-overflow: ellipsis;
 /*  max-width: 60%;             ajuste selon la longueur des labels/valeurs */
}

.detail-item-bottom {
  display: flex;
  align-items: center; /* ✅ centre verticalement */
  gap: 0.5rem;
  padding: 0.4em 0;
  border-bottom: 1px solid rgba(43,33,24,0.12);
  
  overflow: hidden;  /* masque le texte hors zone */
  position: relative;

  flex: 1; /* ✅ prend tout l’espace restant */
  min-height: 0;
}

/* Icône gauche */
.detail-content-bottom .icon-left-bottom {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f5c243;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #4a3326;
    margin: 0 10px;
    padding: 7px;
}

.detail-icon-bottom {
  font-size: 1rem;
  color: #5d2a2c;
  flex-shrink: 0;
}

.detail-content-bottom {
  display: flex;
  /*grid-template-columns: 180px 1fr;  colonne fixe + fluide */
  /*align-items: center;*/
  width: 100%;
  height: 100%;
  overflow: hidden;
  /*justify-content: space-between !important;*/
}

.detail-label-bottom {
  font-family: 'AlternateGothic';
  font-weight: 500;
  font-size: 1rem;
  color: #5d2a2c;
  text-align: left;
  flex: 1;
  /*flex: 0 1 auto;
  min-width: 0;*/
}

/* ================================
   MOBILE — même carte mais plus petite (proportionnelle)
   On applique un scale, sans changer la disposition, 
   et on garde l’ancrage à droite / milieu.
=================================== */

@media (max-width: 480px) {

  .down-box {
    width: var(--panel-width-mobile);
    max-width: var(--panel-width-mobile);
    transform-origin: right center;
  }

  .down-box {
    transform: translateY(-50%) scale(0.70);
  }
  /* Si tu veux que la valeur prenne un peu plus de place sur mobile */
  .detail-value {
    max-width: 70%;
  }
  .down-box {
      position: fixed;
      bottom: 0;
      left: 50%;
      transform: translateX(-50%);

      width: 95%;
      max-width: 1200px;

      background: #fdf3d7;
      border-top-left-radius: 12px;
      border-top-right-radius: 12px;
      box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);

      z-index: 999;
      
      height: 63vh;
  }

  .card-body {
    margin-top: 5px;
    display: flex;
    flex-direction: column;
    padding: 0.3rem;
    background-image: url(./images/bgbox.png);
    background-size: 125px 125px;
    background-repeat: no-repeat;
    background-position: top right;
    flex: 1;
    min-height: 0;
  }

  .detail-content {
      flex: 1;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
  }

  .details-grid {
    display: flex;
    flex-direction: row;
    flex: 1;
    min-height: 0;
    align-items: stretch;
    gap: 0.5rem;
    overflow: scroll;
  }

  .detail-item {
    display: block;
    align-items: center;
    flex: 1;
    gap: 0.5rem;
    padding: 0.6em 0;
    border-bottom: 1px solid rgba(43, 33, 24, 0.12);
    min-height: 180px !important;
    min-width: 70px !important;
    width: fit-content !important;
  }

  .detail-content .icon-left {
      width: 30px;
      height: 30px;
  }

  .detail-label {
    font-family: 'AlternateGothic';
    font-weight: 500;
    font-size: 0.8rem;
    text-align: center;
  }

  .detail-value {
    font-family: 'AlternateGothic';
    font-weight: 700;
    font-size: 0.8rem;
  }

  .detail-item-bottom {
    top: 14.5em;
    display: block;
    align-items: center;
    padding: 0.4em 0;
    border-bottom: 1px solid rgba(43, 33, 24, 0.12);
    overflow: hidden;
    position: absolute;
    overflow-y: auto;
    max-height: clamp(3em, 20vh, 20em);
  }

  .detail-content-bottom {
      display: flex;
      /* align-items: center; */
      width: 100%;
      height: 100%;
      overflow: hidden;
      /* justify-content: space-between !important; */
  }

  .detail-label-bottom {
    font-family: 'AlternateGothic';
    font-weight: 500;
    font-size: 0.8rem;
    color: #5d2a2c;
    text-align: left;
    flex: 1;
    margin-right: 0.6em;
  }

  .detail-content-bottom .icon-left-bottom
  {
      width: 30px;
      height: 30px;
  }

}

  .hideItem {
      display:none;
  }