/* ===========================================================
   VARIABLES GLOBALES
=========================================================== */
:root {
  --clr-primary: #8B0000;
  --clr-secondary: #8B0000;
  --clr-hover: #d40303;
  --clr-light-bg: #f9f9f9;
  --clr-hover-bg: #f1f1f1;
  --clr-text: #000;
  --clr-bg: #fff;
  --clr-header-bg: #f2f2f2;
  --font-family: 'Roboto Mono', sans-serif;
  --fs-base: 20px;
  --fs-md: 1.2em;
  --fs-lg: 50px;
  --fs-h1: 40px;
  --radius: 8px;
  --transition: 0.3s ease;
}

/* ===========================================================
   RESET & BASE
=========================================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background: var(--clr-bg);
  color: var(--clr-text);
  font: normal var(--fs-base)/1.4 var(--font-family);
  text-align: center;
}

/* ===========================================================
   TYPOGRAPHIE
=========================================================== */
.titre0, t0 {
  font: bold var(--fs-lg)/1 var(--font-family);
  color: var(--clr-bg);
}

.titre1,h1 {
  display: block;
  margin-top: 80px;
  font: bold var(--fs-h1)/0 var(--font-family);
  color: var(--clr-text);
}

.titre2, h2 {
  font: normal var(--fs-base)/1.2 var(--font-family);
  color: var(--clr-secondary);
}

p, .texte-normal {
  text-align: center;
}

/* ===========================================================
   HEADER & NAVIGATION
=========================================================== */
header {
  background: var(--clr-header-bg);
  color: var(--clr-text);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 90%;
  margin: 0 auto;
  height: 60px;
  padding-left: 10px;
  padding-right: 10px;
}

.logo-left img {
  height: 50px;
  width: auto;
  display: block;
  margin-left: 2px;
}

/* Menu principal */
.main-nav ul {
  list-style: none;
  display: flex;
  flex-direction: row;
  gap: 20px;
  margin: 0;
  padding: 0;
}

.main-nav li {
  display: inline-block;
}

.main-nav a {
  text-decoration: none;
  color: var(--clr-text);
  font-weight: normal;
  transition: color var(--transition);
}

.main-nav a:hover {
  color: var(--clr-hover);
}

.main-nav a.active {
  color: red;
  font-weight: bold;
}

/* Hamburger menu */
.hamburger {
  display: none;
  margin-right: 2px;
}

/* Responsive menu hamburger */
@media (max-width: 1024px) {
  .hamburger {
    display: block;
    cursor: pointer;
    font-size: 28px;
    background: none;
    border: none;
    color: var(--clr-text);
    position: relative;
    z-index: 5001;
  }
  .main-nav {
    display: none;
    position: absolute;
    top: 60px;
    right: 0;
    background-color: #fff;
    width: 220px;
    border-radius: 0 0 0 var(--radius);
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
    z-index: 5000;
    padding: 16px 0;
  }
  .main-nav.open {
    display: block;
  }
  .main-nav ul {
    flex-direction: column;
    gap: 0;
    padding: 0;
    margin: 0;
  }
  .main-nav li {
    width: 100%;
    margin: 0;
    padding: 0;
    display: block;
  }
  .main-nav a {
    display: block;
    width: 100%;
    padding: 14px 24px;
    margin: 0;
    border-radius: 0;
    color: var(--clr-text);
    font-size: 1.08em;
    text-align: left;
    background: none;
    border-bottom: 1px solid #eee;
    transition: background 0.2s, color 0.2s;
  }
  .main-nav a:last-child {
    border-bottom: none;
  }
  .main-nav a:hover,
  .main-nav a.active {
    background: var(--clr-hover-bg);
    color: var(--clr-hover);
    font-weight: bold;
  }
}

/* ===========================================================
   IMAGE DE COUVERTURE
=========================================================== */
.cover-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* ===========================================================
   MAIN & BOUTONS
=========================================================== */
main {
  padding: 40px 10px;
  margin: 20px auto;
  max-width: 80%;
  font-size: var(--fs-md);
}

.button-container {
  margin-top: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.btn {
  display: inline-block;
  max-width: 50px;
  width: 100%;
  padding: 20px;
  background: var(--clr-primary);
  color: var(--clr-bg);
  border-radius: var(--radius);
  font: normal var(--fs-base)/1.2 var(--font-family);
  text-decoration: none;
  transition: background var(--transition);
}

.btn:hover {
  background: var(--clr-hover);
}

.button-container .icon {
  margin-right: 0.3rem;
  font-size: 1.2rem;
}

.top-right-buttons {
  display: flex;
  flex-direction: row;
  gap: 10px; /* Espace entre les boutons */
  align-items: center;
  position: absolute;
  top: 120px;
  right: 5%;
  margin: 0;
}

/* Boutons top-right : fond rouge et icône blanche partout */
.top-right-buttons .icon-btn {
  background: var(--clr-primary) !important;
  color: #fff !important;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(139,0,0,0.10);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  width: 40px;
  height: 40px;
  transition: background 0.2s, color 0.2s;
  text-decoration: none !important;
}

.top-right-buttons .icon-btn i {
  color: #fff !important;
  font-size: 1.3em;
  text-decoration: none !important;
}

.top-right-buttons .icon-btn:hover {
  background: var(--clr-hover) !important;
  color: #fff !important;
}

/* Responsive : sur mobile, les boutons restent côte à côte et centrés */
@media (max-width: 1024px) {
  .top-right-buttons {
    position: static !important;
    margin-top: 8px !important;
    margin-bottom: 0 !important;
    margin-left: auto !important;
    margin-right: auto !important;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
  }
}

/* ===========================================================
   TABLEAUX
=========================================================== */
.table-container {
  max-width: 90%;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  overflow-x: auto;
}

#instrumentTable.dataTable {
  width: 100% !important;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
  margin-bottom: 15px;
}

/* Tableaux généraux */
.instrument-table,
.service-table {
  width: 100%;
  min-width: 320px;
  max-width: 100%;
  margin: 20px auto;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 1rem;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  border-radius: 8px;
  overflow: hidden;
}

.instrument-table th,
.instrument-table td,
.service-table th,
.service-table td {
  padding: 8px 8px;
  text-align: left;
  border: 1px solid #ccc;
  white-space: normal;         /* Retour à la ligne sur les espaces */
  word-break: normal;          /* Ne coupe pas les mots */
  overflow-wrap: normal;       /* Ne coupe pas les mots */
  max-width: 120px;
  vertical-align: middle;
  font-size: 1em;
}

.instrument-table th,
.service-table th {
  background: #f5f5f5;
  color: var(--clr-text);
  font-weight: bold;
  font-size: 0.98em;
}

.instrument-table tr:hover,
.service-table tr:hover {
  background-color: var(--clr-hover-bg);
  transition: background-color var(--transition);
}

/* Largeurs des colonnes pour desktop */
.instrument-table th:nth-child(1),
.instrument-table td:nth-child(1) {
  width: 4%;
  text-align: center;
  padding: 0;
}

.instrument-table th:nth-child(2),
.instrument-table td:nth-child(2) {
  width: 14%;
}

.instrument-table th:nth-child(3),
.instrument-table td:nth-child(3) {
  width: 12%;
}

.instrument-table th:nth-child(4),
.instrument-table td:nth-child(4) {
  width: 12%;
}

.instrument-table th:nth-child(5),
.instrument-table td:nth-child(5) {
  width: 12%;
}

.instrument-table th:nth-child(6),
.instrument-table td:nth-child(6) {
  width: 12%;
}

.instrument-table th:nth-child(7),
.instrument-table td:nth-child(7) {
  width: 12%;
}

.instrument-table th:nth-child(8),
.instrument-table td:nth-child(8) {
  width: 12%;
}

.instrument-table th:nth-child(9),
.instrument-table td:nth-child(9) {
  width: 10%;
}

/* Largeurs des colonnes pour service-table */
.service-table th:nth-child(1),
.service-table td:nth-child(1) {
  width: 25%;
}

.service-table th:nth-child(2),
.service-table td:nth-child(2) {
  width: 25%;
}

.service-table th:nth-child(3),
.service-table td:nth-child(3) {
  width: 25%;
}

.service-table th:nth-child(4),
.service-table td:nth-child(4) {
  width: 25%;
}

/* =========================
   RESPONSIVE TABLEAUX
========================= */
@media (max-width: 1024px) {
  :root {
    --fs-base: 18px;
    --fs-md: 1.1em;
    --fs-lg: 42px;
    --fs-h1: 34px;
  }
  main {
    max-width: 98%;
    padding: 18px 2px;
    margin: 10px auto;
  }
  .header-content {
    max-width: 98%;
    height: 56px;
  }
  .logo-left img {
    height: 44px;
  }
  .main-nav ul {
    gap: 12px;
    flex-wrap: wrap;
  }
  .table-container {
    max-width: 100%;
    padding: 0 2px;
  }
  .instrument-table,
  .service-table {
    font-size: 0.5rem!important;
    min-width: 320px !important;
  }
  .instrument-table th,
  .instrument-table td,
  .service-table th,
  .service-table td {
    padding: 0.5px 0.5px !important;
    max-width: 20px !important;
    font-size: 0.5rem !important;
  }
}

@media (max-width: 1024px) {
  :root {
    --fs-base: 15px;
    --fs-md: 0.95em;
    --fs-lg: 28px;
    --fs-h1: 22px;
  }
  main {
    max-width: 100%;
    padding: 8px 0;
    margin: 6px auto;
  }
  .header-content {
    max-width: 100%;
    height: 48px;
  }
  .main-nav ul {
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
  }
  .button-container {
    margin-top: 24px;
    gap: 10px;
  }
  .btn {
    max-width: 100%;
    width: 100%;
    padding: 10px;
    font-size: 0.95rem;
  }
  .top-right-buttons {
    position: static;
    margin: 8px auto 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
  }
  .table-container {
    max-width: 100vw;
    padding: 0 1px;
    overflow-x: auto;
  }
  .instrument-table,
  .service-table {
    width: 100%;
    min-width: 320px;
    font-size: 0.8rem;
    border-radius: 4px;
  }
  .instrument-table th,
  .instrument-table td,
  .service-table th,
  .service-table td {
    padding: 4px 2px;
    font-size: 0.8rem;
    max-width: 60px;
    white-space: normal;
    word-break: normal;
    overflow-wrap: normal;
    border-width: 1px !important;   /* Bordure plus fine */
    border-style: solid !important;

  }
  .instrument-table th,
  .service-table th {
    font-size: 0.9em;
  }
  .instrument-table td,
  .service-table td {
    font-size: 0.75rem;
  }
}

/* ===========================================================
   MODALS
=========================================================== */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  overflow-y: auto;
  z-index: 1000;
}

.modal-content {
  background: var(--clr-bg);
  margin: 12px auto;
  padding: 1rem;
  max-width: 1024px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  max-height: 100vh;
  overflow-y: auto;
  position: relative;
}

.modal-content .close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  font-size: 2rem;
  cursor: pointer;
}

.modal-content form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-content label {
  font: bold 1.5rem/1 var(--font-family);
  margin-bottom: 4px;
  text-align: left;
}

.modal-content input,
.modal-content select,
.modal-content button[type="submit"] {
  width: 100%;
  font: normal 18px/1 var(--font-family);
  border-radius: 6px;
  padding: 8px 12px;
  border: 1px solid #ccc;
}

.modal-content select {
  background: #f8f8f8;
  appearance: none;
  transition: all var(--transition);
}

.modal-content select:focus {
  border-color: #007bff;
  box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
}

.modal-content button[type="submit"] {
  margin-top: 12px;
  background: var(--clr-primary);
  color: var(--clr-bg);
  border: none;
  transition: background var(--transition);
}

.modal-content button[type="submit"]:hover {
  background: var(--clr-hover);
}

/* Modal plein écran */
.modal-fullscreen {
  display: none;
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0,0,0,0.85);
  z-index: 99999;
  overflow: hidden;
}

.modal-fullscreen.show {
  display: block;
}

.edit-modal-header {
  position: sticky;
  top: 0;
  background: #111;
  padding: 8px 12px;
  justify-content: flex-end;
  align-items: center;
  z-index: 1;
}

.edit-modal-header .close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
}

.edit-modal-body {
  width: 100%;
  height: calc(100vh - 44px);
}

.edit-modal-body iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

/* Message d'erreur */
.edit-error {
  position: absolute;
  inset: 44px 0 0 0;
  color: #fff;
  background: rgba(0,0,0,0.6);
  padding: 16px;
  font-size: 16px;
}

/* ===========================================================
   FORMULAIRES
=========================================================== */
.form-modern {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 1024px;
  margin: 40px auto;
  font-family: 'Segoe UI', 'Roboto', sans-serif;
}

.form-modern label {
  font: bold 1.3rem/1 var(--font-family);
  color: #333;
  margin-bottom: 4px;
  display: block;
  text-align: center;
}

.form-modern input[type="text"],
.form-modern input[type="email"],
.form-modern input[type="password"],
.form-modern input[type="date"],
.form-modern input[type="number"],
.form-modern select,
.form-modern textarea {
  padding: 12px 14px;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  transition: border-color 0.3s, box-shadow 0.3s;
}

.form-modernform-modern input[type="submit"],
.form-modern button[type="submit"] {
  background: var(--clr-primary);
  color: var(--clr-bg);
  border: none;
  padding: 12px 20px;
  font-size: 1rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition);
}

.form-modern input[type="submit"]:hover,
.form-modern button[type="submit"]:hover {
  background: var(--clr-hover);
}

/*Soulignement rouge du champ actif */
.form-modern input:focus,
.form-modern select:focus,
.form-modern textarea:focus {
  border-color: transparent;
  outline: none;
  box-shadow: inset 0 -2px 0 0 var(--clr-primary);
}

/* ===========================================================
   UTILITAIRES
=========================================================== */
.separateur-rouge {
  border: none;
  border-top: 4px dotted var(--clr-secondary);
  margin: 15px auto;
  width: 90%;
}

.edit-btn {
  background: none;
  border: none;
  color: var(--clr-secondary);
  font-size: 1.1rem;
  cursor: pointer;
  transition: color var(--transition), transform 0.2s;
}

.edit-btn:hover {
  color: var(--clr-hover);
  transform: scale(1.2);
}

.box-section {
  text-align: left;
  background: var(--clr-header-bg);
  border-radius: var(--radius);
  padding: 20px;
  margin: 30px auto;
  max-width: 60%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0);
}

/* ===========================================================
   RESPONSIVE DIVERS
=========================================================== */
@media (max-width: 1024px) {
  .box-section {
    max-width: 96%;
    padding: 16px;
    margin: 16px auto;
  
  }
}

/* ===========================================================
   PRESENCES
=========================================================== */
.presences-container {
    padding-top: 20px;
}

.presences-list a {
    color: #990000;
    text-align: left;
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    text-decoration: none;
}

.presences-list a:hover {
    text-decoration: underline;
}

.presences-container {
    padding-top: 30px;
}

.presences-title {
    font-size: 2em;
    color: #990000;
    margin-bottom: 10px;
    text-align: center;
}

.presences-subtitle {
    font-size: 1.5em;
    color: #333;
    margin-bottom: 30px;
    text-align: center;
}

.box-section .presences-table {
  width: 100%;
  margin: 0 auto;
  table-layout: fixed;
  display: table;
}

@media (max-width: 700px) {
  /* Masquer le tableau sur mobile */
  .box-section .presences-table {
    display: none !important;
  }
}

/* ===========================================================
   PRESENCES - MOBILE : AFFICHAGE EN BLOCS
=========================================================== */
@media (max-width: 700px) {
  .presences-block-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 0 auto;
    padding: 0;
    width: 100%;
  }

  .presences-block {
    background: #f8f8f8;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 1rem;
  }

  .presences-block-row {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
  }

  .presences-block-label {
    font-weight: bold;
    color: #990000;
    min-width: 90px;
    margin-right: 8px;
  }

  .presences-block-value {
    color: #222;
    word-break: break-word;
    flex: 1;
    text-align: left;
  }

  .presences-block-select,
  .presences-block-textarea {
    width: 100%;
    font-size: 0.95em;
    margin-top: 4px;
    border-radius: 6px;
    border: 1px solid #ccc;
    padding: 6px 8px;
    background: #fff;
  }

  .presences-block-select.present {
    background-color: #e6ffe6;
  }
  .presences-block-select.partiel {
    background-color: #fff3cc;
  }
  .presences-block-select.absent {
    background-color: #ffe6e6;
  }
}

/* =========================
   PRESENCES - TABLEAU CLASSIQUE (PC et tablette)
========================= */
.box-section .presences-table {
  width: 100%;
  margin: 0 auto;
  table-layout: fixed;
  border-collapse: collapse;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  border-radius: 8px;
  overflow: hidden;
  font-size: 1rem;
}

.box-section .presences-table th,
.box-section .presences-table td {
  padding: 8px 8px;
  text-align: left;
  border: 1px solid #ccc;
  vertical-align: middle;
  font-size: 1em;
  background: #f8f8f8;
}

.box-section .presences-table th {
  background: #f5f5f5;
  color: var(--clr-text);
  font-weight: bold;
}

.box-section .presences-table tr:hover {
  background-color: var(--clr-hover-bg);
  transition: background-color var(--transition);
}

.box-section .presences-table select.present {
  background-color: #e6ffe6;
}
.box-section .presences-table select.partiel {
  background-color: #fff3cc;
}
.box-section .presences-table select.absent {
  background-color: #ffe6e6;
}

/* Largeurs des colonnes */
.box-section .presences-table th:nth-child(1),
.box-section .presences-table td:nth-child(1) { width: 10%; }
.box-section .presences-table th:nth-child(2),
.box-section .presences-table td:nth-child(2) { width: 30%; }
.box-section .presences-table th:nth-child(3),
.box-section .presences-table td:nth-child(3) { width: 10%; }
.box-section .presences-table th:nth-child(4),
.box-section .presences-table td:nth-child(4) { width: 50%; }

/* =========================
   PRESENCES - MOBILE : BLOCS
========================= */
@media (max-width: 700px) {
  .box-section .presences-table {
    display: none !important;
  }
  .presences-block-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 0 auto;
    padding: 0;
    width: 100%;
  }
  .presences-block {
    background: #f8f8f8;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 1rem;
  }
  .presences-block-row {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
  }
  .presences-block-label {
    font-weight: bold;
    color: #990000;
    min-width: 90px;
    margin-right: 8px;
  }
  .presences-block-value {
    color: #222;
    word-break: break-word;
    flex: 1;
    text-align: left;
  }
  .presences-block-select,
  .presences-block-textarea {
    width: 100%;
    font-size: 0.95em;
    margin-top: 4px;
    border-radius: 6px;
    border: 1px solid #ccc;
    padding: 6px 8px;
    background: #fff;
  }
  .presences-block-select.present {
    background-color: #e6ffe6;
  }
  .presences-block-select.partiel {
    background-color: #fff3cc;
  }
  .presences-block-select.absent {
    background-color: #ffe6e6;
  }
}

/* Masquer les blocs sur desktop/tablette */
.presences-block-list {
  display: none;
}

/* Afficher les blocs uniquement sur mobile */
@media (max-width: 700px) {
  .presences-block-list {
    display: flex;
    flex-direction: column;
  }
}

/* Liste des membres - affichage moderne */
.presences-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0;
  margin: 0;
  align-items: center; /* Centre les blocs horizontalement */
}

.presences-list li {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 500px; /* Largeur max pour un effet centré */
}

.presences-list a {
  display: block;
  background: #f8f8f8;
  border-radius: 8px;
  padding: 14px 18px;
  color: #990000;
  font-weight: 500;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  transition: background 0.2s, box-shadow 0.2s;
  text-align: left; /* Texte aligné à gauche */
  margin: 0 auto;   /* Centre le bloc dans la colonne */
}

.presences-list a:hover {
  background: #ffe6e6;
  box-shadow: 0 4px 16px rgba(139,0,0,0.08);
  text-decoration: underline;
  color: #d40303;
}

@media (max-width: 700px) {
  .top-right-buttons {
    position: static !important;
    margin-top: 8px !important;
    margin-bottom: 0 !important;
    margin-left: auto !important;
    margin-right: auto !important;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
  }
  h1 {
    margin-top: 16px !important;
  }
}

/* =========================
   Tableau synthèse des présences - Style moderne et coloré
========================= */

.presences-synthese-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  box-shadow: 0 2px 12px rgba(139,0,0,0.07);
  border-radius: 14px;
  overflow: hidden;
  font-size: 1.05rem;
  margin: 0 auto 30px auto;
}

/* En-têtes */
.presences-synthese-table th {
  background: #fff;
  color: #8B0000;
  font-weight: bold;
  font-size: 1.08em;
  border-bottom: 2px solid #d40303;
  padding: 16px 12px;
}

/* Cellules */
.presences-synthese-table td {
  padding: 14px 12px;
  text-align: left;
  border-bottom: 1px solid #f3f3f3;
  font-size: 1em;
  background: #fff;
  vertical-align: middle;
  word-break: break-word;
}

/* Dernière ligne sans bordure */
.presences-synthese-table tr:last-child td {
  border-bottom: none;
}

/* Survol */
.presences-synthese-table tr:hover td {
  background: #fff3f3;
  transition: background 0.2s;
}

/* Statut coloré pour synthèse */
.presences-synthese-table .present {
  color: #107C41;
  font-weight: bold;
  background: #e6ffe6;
  border-radius: 6px;
  padding: 4px 10px;
  display: inline-block;
}
.presences-synthese-table .partiel {
  color: #b97a00;
  font-weight: bold;
  background: #fff3cc;
  border-radius: 6px;
  padding: 4px 10px;
  display: inline-block;
}
/* Absent Excusé : rouge clair */
.presences-synthese-table .absent-e {
  color: #d40303;
  font-weight: bold;
  background: #ffe6e6;
  border-radius: 6px;
  padding: 4px 10px;
  display: inline-block;
}
/* Absent Non Excusé : rouge foncé, texte blanc */
.presences-synthese-table .absent-ne {
  color: #fff;
  font-weight: bold;
  background: #8B0000;
  border-radius: 6px;
  padding: 4px 10px;
  display: inline-block;
}

/* Largeur des colonnes */
.presences-synthese-table th:nth-child(1),
.presences-synthese-table td:nth-child(1) { width: 23%; }
.presences-synthese-table th:nth-child(2),
.presences-synthese-table td:nth-child(2) { width: 20%; }
.presences-synthese-table th:nth-child(3),
.presences-synthese-table td:nth-child(3) { width: 27%; }
.presences-synthese-table th:nth-child(4),
.presences-synthese-table td:nth-child(4) { width: 30%; }

/* Responsive - Mobile */
@media (max-width: 700px) {
  .presences-synthese-table {
    font-size: 0.8rem;
    border-radius: 8px;
    box-shadow: 0 1px 6px rgba(139,0,0,0.09);
  }
  .presences-synthese-table th,
  .presences-synthese-table td {
    padding: 8px 6px;
    font-size: 0.8em;
    min-width: 60px;
    max-width: 120px;
  }
  .presences-synthese-table th {
    font-size: 1em;
    padding-top: 12px;
    padding-bottom: 12px;
  }
  .presences-synthese-table .present,
  .presences-synthese-table .partiel,
  .presences-synthese-table .absent {
    font-size: 0.95em;
    padding: 3px 8px;
  }
}

/* Optionnel : commentaire en gris clair si vide */
.presences-synthese-table td:last-child:empty::after {
  content: "-";
  color: #bbb;
  font-style: italic;
}

/* Couleurs pour le select du statut dans modifier_presence.php */
.statut-select.present {
  background-color: #e6ffe6;
  color: #107C41;
  font-weight: bold;
}
.statut-select.partiel {
  background-color: #fff3cc;
  color: #b97a00;
  font-weight: bold;
}
.statut-select.absent-e {
  background-color: #ffe6e6;
  color: #d40303;
  font-weight: bold;
}
.statut-select.absent-ne {
  background-color: #8B0000;
  color: #fff;
  font-weight: bold;
}

.drum-icon {
  font-size: 6rem;
  color: #ffe6e6; /* Rouge clair */
  filter: drop-shadow(0 2px 8px rgba(139,0,0,0.10));
}

/* Présences synthèse - affichage mobile en 2 colonnes, sans scroll horizontal */
@media (max-width: 700px) {
  .box-section {
    padding: 0;
    margin: 0;
    max-width: 100vw;
  }
  .presences-synthese-table {
    display: none !important; /* Masquer le tableau classique */
  }
  .presences-synthese-mobile-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;                /* Réduit l'espace entre les cases */
    width: 100%;
    padding: 0 2px;
    margin: 0;
  }
  .presences-synthese-mobile-item {
    background: #fff;
    border-radius: 4px;
    box-shadow: none;
    padding: 2px 1px;        /* Réduit la hauteur et largeur des cases */
    display: flex;
    align-items: center;
    gap: 1px;                /* Réduit l'espace entre les éléments */
    font-size: 0.6em;       /* Texte plus petit */
    min-height: 20px;
  }
  .presences-synthese-mobile-dot {
    width: 10px;
    height: 10px;
    margin-right: 3px;
    margin-left: 4px;
  }
  .presences-synthese-mobile-name {
    font-weight: 500;
    color: #222;
    flex: 1;
    white-space: normal;
    word-break: break-word;
    font-size: 1em;
  }
  .presences-synthese-mobile-remark {
    font-size: 1em;
    margin-left: 2px;
    margin-right: 12px;
    padding: 0;
    background: none;
    border: none;
    color: #4e4e4e;
    display: flex;
    align-items: center;
  }
  .presences-synthese-mobile-remark i {
    font-size: 1.2em;
    color: #4e4e4e;
    font-family: "Font Awesome 6 Free";
    font-weight: 400;
  }
}

/* Pop-up remarque mobile */
.presences-synthese-popup {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%,-50%);
  background: #fff;
  color: #222;
  border-radius: 12px;
  box-shadow: 0 2px 16px rgba(139,0,0,0.18);
  padding: 22px 18px;
  z-index: 99999;
  min-width: 220px;
  max-width: 90vw;
  font-size: 1.05em;
  text-align: center;
  display: none;
}
.presences-synthese-popup.show {
  display: block;
}
.presences-synthese-popup-close {
  position: absolute;
  top: 8px;
  right: 14px;
  background: none;
  border: none;
  font-size: 1.5em;
  color: #d40303;
  cursor: pointer;
}

@media (max-width: 700px) {
  .presences-synthese-mobile-dot.present    { background: #107C41; }
  .presences-synthese-mobile-dot.partiel    { background: #b97a00; }
  .presences-synthese-mobile-dot.absent-e   { background: #eb6969; }
  .presences-synthese-mobile-dot.absent-ne  { background: #000000; }
  .presences-synthese-mobile-item.partiel {
    background: #fffbe6; /* Jaune très clair */
  }
  .presences-synthese-mobile-item.absent-e {
    background: #ffeaea; /* Rouge clair */
  }
  .presences-synthese-mobile-item.absent-ne {
    background: #8B0000; /* Fond rouge foncé */
    color: #fff;         /* Texte blanc */
  }
  .presences-synthese-mobile-item.present {
    background: #fff; /* Fond blanc */
  }
  .presences-synthese-mobile-item.absent-ne .presences-synthese-mobile-name,
  .presences-synthese-mobile-item.absent-ne .presences-synthese-mobile-remark i {
    color: #fff;
  }
}

@media (max-width: 700px) {
  .box-section {
    max-width: 96vw;
    margin: 12px auto;
    padding-left: 10px;
    padding-right: 10px;
    box-sizing: border-box;
  }
  .table-container {
    display: none !important;
  }
  .instruments-mobile-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0 auto;
    padding: 0 6px;
    width: 100%;
    background: #f4f4f4; /* Fond plus gris pour la zone mobile */
    padding-bottom: 20px;
  }
  .instruments-mobile-box {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(139,0,0,0.10);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    font-size: 0.95em;
    position: relative;
    min-height: 56px;
  }
  .instruments-mobile-row {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 2px;
    overflow-x: auto;
    font-size: 0.90em;
  }
  .instruments-mobile-label {
    font-weight: bold;
    color: #8B0000;
    margin-right: 4px;
    font-size: 0.95em;
    white-space: nowrap;
  }
  .instruments-mobile-value {
    color: #222;
    word-break: keep-all;
    font-size: 0.95em;
    white-space: nowrap;
  }
  .instruments-mobile-edit {
    position: absolute;
    top: 8px;
    right: 10px;
    background: none;
    border: none;
    color: #8B0000;
    font-size: 1.2em;
    cursor: pointer;
  }
  .instruments-mobile-filter {
    width: 100%;
    margin: 12px 0 18px 0;
    padding: 8px 12px;
    font-size: 1em;
    border-radius: 6px;
    border: 1px solid #ccc;
    box-sizing: border-box;
  }
}

@media (max-width: 700px) {
  .form-modern {
    font-size: 0.8em;
    gap: 4px;
    padding: 0 2px;
  }
  .form-modern label {
    font-size: 1em;
    text-align: left;
    margin-bottom: 2px;
  }
  .form-modern input,
  .form-modern select,
  .form-modern textarea {
    font-size: 0.95em;
    padding: 8px 10px;
    margin-bottom: 6px;
  }
}