body {
    max-height: 297mm;  /* Limite la hauteur maximale */
    overflow: auto;  /* Ajoute un défilement si nécessaire */
    font-family: Arial;
}

table, th, td {
    border-collapse: collapse;
    padding: 3px;
    font-size: 13px;
}

.a4 {
    position: relative;
    width: 210mm;
    height: 297mm;
    padding: 40px;
    margin-top: 20px;
    margin-left: 240px;
    border: 1px solid #ccc;
}

/* Base pour tous les boutons */
button {
    display: inline-block;
    text-align: center;
    padding: 0px 10px;
    height: 25px;
    font-size: 12px;
    font-weight: bold;
    background-color: #F2EC7E;
    color: rgb(68, 68, 68);
    border: none;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.2s;
}

button:hover {
    background-color: #736D02;
    color: white;
}

button.active {
    background-color: #F2EC7E;
    color: rgb(68, 68, 68);
}

button:disabled {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Modificateurs de couleur */
.btn-success {
    background-color: #28a745;
    color: white;
}

.btn-success:hover {
    background-color: #218838;
}

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

.btn-danger:hover {
    background-color: #c82333;
}

.btn-alert {
    background-color: #ff4444;
    color: white;
}

.btn-alert:hover {
    background-color: #cc0000;
}

/* Modificateurs de taille */
.btn-icon-sm {
    width: 12px;
    height: 12px;
    font-size: 6px;
    line-height: 0.8;
    padding: 0;
    border-radius: 0px;
    vertical-align: top;
}





/* Bouton avec flèche déroulante */
.btn-with-dropdown {
    position: relative;
    padding-right: 1.5rem;
}

/* Wrapper pour positionner le dropdown relativement au bouton */
.dropdown-wrapper {
    position: relative;
    display: inline-block;
}

/* Flèche de menu déroulant */
.dropdown-arrow {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    pointer-events: none;
}

/* Conteneur du menu déroulant */
.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.25rem;
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    min-width: 200px;
    max-height: 300px;
    overflow-y: auto;
}

/* Option dans le menu déroulant */
.dropdown-option {
    padding: 0.3rem 0.8rem;
    cursor: pointer;
    transition: background-color 0.2s;
    border-bottom: 1px solid #f0f0f0;
    font-size: 12px;
    line-height: 1.2;
}

.dropdown-option:last-child {
    border-bottom: none;
}
s
.dropdown-option:hover {
    background-color: #f5f5f5;
}

.dropdown-option.active {
    background-color: #e3f2fd;
    color: #1976d2;
    font-weight: bold;
}

img.logo {
    height: 45px;
}

/* Styles d'impression globaux */
@media print {
    .non-impression {
        display: none;
    }

    @page {
        size: A4;
        margin: 0cm; /* Marge d'impression */

    }

    body {
        counter-reset: page; /* Initialise le compteur de pages */
    }

    /* Remonter le contenu en haut de la page */
    .a4 {
        width: 210mm;
        height: 297mm;
        border: none !important;
        margin: auto;

    }

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

    .highlight {
        background-color: yellow !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }


}


.sidebar {
    width: 125px;
    height: 100vh;
    background-color: #363636;
    color: white;
    position: fixed;
    left: 0;
    top: 0;
    padding-top: 20px;
    padding-left: 10px; /* Ajout de margin-left via padding-left */
    display: block;
}
.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.sidebar ul li {
    padding: 10px;
    text-align: left;
}
.sidebar ul li a {
    color: white;
    text-decoration: none;
    display: block;
}
.sidebar ul li:hover {
    background-color: #575757;
}
.sidebar .auth-section {
    text-align: left;
    padding: 10px;
}
.sidebar input, .sidebar button {
    width: 100px;
    padding: 0px;
    text-align: left;
    margin: 5px 0;
}

/* 📌 A4 Container */
.a4-container {
    margin-left: 160px; /* Décalage pour éviter l’overlap avec la sidebar */
    padding: 40px;
}
/* Styles globaux pour le layout de l'en-tête */
.a4-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 20px;
}
.a4-header .logo {
    height: 45px;
    flex-shrink: 0;
}
.a4-header h1 {
    margin: 0;
    font-size: 2em;
    text-align: right;
    font-weight: normal;
}
.logo {
    height: 35px;
}

/* Impression: masquer le menu latéral */
@media print {
    #sidebar-menu,
    .sidebar {
        display: none !important;
    }
}


/* User info - padding réduit */
.user-info {
  margin-bottom: 15px;
  border-bottom: 1px solid #555;
  padding-bottom: 10px;
}

.user-info p {
  margin: 5px 0;
  font-size: 14px; /* Même taille que le reste */
  font-weight: bold;
}

/* ScreenRecorder section - padding réduit */
.screen-recorder-section {
  margin-top: 10px;
  border-top: 1px solid #555;
  padding-top: 8px;
}

/* ============================================
   STYLES DE FORMULAIRES (générique)
   ============================================ */

/* Tableau de formulaire générique */
table.tableau-formulaire {
  border-collapse: collapse;
  width: 100%;
  table-layout: fixed;
  margin-bottom: 20px;
  margin-top: 20px;

}

table.tableau-formulaire th,
table.tableau-formulaire td {
  border: 1px solid #ddd;
  padding: 4px;
  text-align: left;
  height: 8px;
}

table.tableau-formulaire th {
  background-color: #f2f2f2;
  font-weight: bold;
}

/* Titre de section dans les formulaires */
.section-title {
  font-size: 10px;
  color: #666;
}

/* Valeur dans les formulaires */
.value {
  font-size: 13px;
  font-weight: bold;
  margin-top: 3px;
  display: block;
}
.value input {
  width: 100%;
  text-align: left;
  border: none;
  outline: none;
  font-size: 13px;
  font-weight: bold;
  display: block;
  margin-top: 5px;
}

/* Ajouter ces 2 lignes : */
.value select {
  border: none;
  outline: none;
  font-size: 13px;
  font-weight: bold;
}

/* Input dans section-title doit hériter du style */
.section-title-input {
  font-size: 8px !important;
  color: #666 !important;
  font-family: inherit !important;
  text-align: left !important;
  display: inline-block !important;
  margin-top: 5px !important;
  font-weight: normal !important;
}

/* Messages de succès et d'erreur */
.success-message {
  display: inline-block;
  padding: 5px 10px;
  margin-left: 10px;
  background-color: #d4edda;
  color: #155724;
  border-radius: 3px;
}

.error-message {
  display: inline-block;
  padding: 5px 10px;
  margin-left: 10px;
  background-color: #f8d7da;
  color: #721c24;
  border-radius: 3px;
}

/* ============================================
   STYLES POUR POINTAGES/FACTURES (partagés)
   ============================================ */

/* Conteneur des filtres */
.filter-container {
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.period-filters {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mission-filter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Conteneur du tableau avec scroll */
.table-container {
  max-height: 650px;
  overflow-y: auto;
  display: block;
}

/* Tableau de contact/sessions */
.tableau-contact {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  padding-top: 40px;
  margin-bottom: 20px;
}

.tableau-contact th,
.tableau-contact td {
  border: 1px solid #ccc;
  padding: 4px;
  line-height: 1.2;
}

/* Figer l'en-tête du tableau */
.tableau-contact thead th {
  position: sticky;
  top: 0;
  background-color: #f9f9f9;
  z-index: 1;
}

/* Statistiques totales */
.total-stats {
  font-weight: bold;
  margin-left: 1rem;
  font-size: 0.9em;
  color: #555;
}

.video-indicator {
  color: #2196f3;
  font-size: 12px;
  font-weight: bold;
}

.session-delete {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px;
}

.session-id {
  font-weight: bold;
}

.btn-delete {
  padding: 2px 6px;
  font-size: 14px;
  min-width: 28px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Cellule de session (cliquable pour vidéo) */
.session-id-cell {
  cursor: pointer;
}

.session-id-cell.has-video {
  cursor: pointer;
}

/* Ajustements spécifiques */
.btn-save,
.btn-cancel {
  padding: 4px 8px;
  min-width: 30px;
}

.btn-save:hover,
.btn-cancel:hover {
  transform: scale(1.05);
}

/* Lecteur vidéo */
.video-player-container {
  margin-top: 2rem;
  border-top: 1px solid #ccc;
  padding-top: 1rem;
  max-width: 100%;
}

.video-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.video-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.speed-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.speed-controls label {
  font-weight: bold;
  color: #333;
}

.video-player-container video {
  width: 100%;
  height: auto;
  display: block;
}

/* Responsive pour mobile */
@media (max-width: 768px) {
  .video-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  
  .video-header h4 {
    text-align: center;
    margin: 0;
    font-size: 1rem;
  }
  
  .video-controls {
    flex-direction: column;
    gap: 0.5rem;
    align-items: stretch;
  }
  
  .speed-controls {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    justify-content: center;
    flex-wrap: wrap;
  }
  
  .speed-controls label {
    font-size: 0.7rem;
    min-width: auto;
    margin-right: 0.3rem;
  }
  
  button {
    padding: 0.3rem 0.4rem;
    font-size: 0.7rem;
    min-width: 28px;
    border-radius: 3px;
  }
  
  .video-player-container {
    margin-top: 1rem;
    padding-top: 0.5rem;
  }
}
