/* =========================================================
   VARIABLES
========================================================= */

:root {
  --bg: #fafafa;
  --card: #ffffff;
  --muted: #e8e8e8;

  --text: #1c1c1c;
  --text-dim: #6b6b6b;

  --brand: #4c6ef5;        /* soft blue */
  --brand-weak: #edf2ff;
  --accent: #15aabf;       /* light cyan */
  --bg-sidebar1 : #0E2747;
  --bg-sidebar2 : #60a3bc;

  --ok: #40c057;
  --warn: #fab005;
  --bad: #fa5252;
  --orange : #fc5d00;
}

/* =========================================================
   RESET
========================================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body { 
    background: var(--bg); 
    color: var(--text); 
    font-family: "Inter", "Segoe UI", Roboto, system-ui, -apple-system, sans-serif; 
}

a {
    text-decoration : inherit;
    color : inherit;
}

/* =========================================================
   LAYOUT
========================================================= */
.app {
    display: flex;
    min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
    position: fixed;        /* Rend la sidebar fixe */
    top: 0;                 /* Collée en haut */
    left: 0;                /* Collée à gauche */
    height: 100vh;          /* Prend toute la hauteur de l'écran */
    width: 220px;
    background-color: var(--bg-sidebar1);
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    transition: width 0.3s ease;
    overflow-y: auto;       /* Scroll interne si contenu trop grand */
}

.sidebar h1 {
    color: #fff;
    font-size: 20px;
    text-align: center;
}

.menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    color: #cbd5f5;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.menu-item:hover {
    background-color: #0a3d62;
    color: #fff;
}

.menu-item .active {
    background-color: #FF7A18;
    color: #fff;
}

.menu-item span {
    font-size: 15px;
}

/* MAIN */
.main {
    position: relative;
    margin-left: 220px;   /* largeur de la sidebar */
    height: 100vh;        /* prend toute la hauteur écran */
    width: calc(100% - 230px); /* prend le reste de la largeur */    
    display: flex;
    flex-direction: column;
    overflow-y: hidden;     /* scroll uniquement dans le main */
}

/* TOPBAR */
.topbar {
    height: 60px;
    background-color: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    flex-shrink: 0;
}

.topbar h2 {
    font-size: 18px;
    font-weight: 600;
}

.topbar .actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* CONTENT */
.content {
    padding: 24px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    overflow-y: auto;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    text-align:center;
    margin-left : auto;
    background-color: #3b82f6;
}

/* ITEM AVEC SOUS-MENU */
.has-submenu {
    flex-direction: column;
    align-items: stretch;
}

/* ligne icône + texte */
.menu-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom:-10px;
}

/* sous-menu caché */
.submenu {
    max-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    margin-left: 28px;
    transition: max-height 0.3s ease;
}

/* hover */
.has-submenu:hover .submenu {
    max-height: 300px;
}

/* ouvert si page active */
.has-submenu.open .submenu {
    max-height: 300px;
}

/* liens */
.submenu a {
    padding: 8px 12px;
    font-size: 14px;
    color: #cbd5f5;
    text-decoration: none;
    border-radius: 8px;
}

.submenu a:hover {
    background-color: #FF7A18;
    color: #fff;
}

/* =========================================================
   CARD
========================================================= */

.card {
    background-color: #ffffff;
    border-radius: 14px;
    padding: 20px;
    min-height: 140px;
    height :100%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.card h3 {
    margin-bottom: 12px;
    font-size: 16px;
}

.menu-toggle {
    display: none;
    font-size: 20px;
}

/* LAYOUT */
.login-wrapper {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-left: 8%;
}

/* LOGIN CARD */
.login-card {
    width: 100%;
    max-width: 420px;
    background-color: #ffffff;
    border-radius: 16px;
    padding: 36px 32px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.login-card h1 {
    font-size: 24px;
    margin-bottom: 8px;
}

.login-card p {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 32px;
}

/* =========================================================
   FORM MODERNE (BLEU)
========================================================= */
.image-upload-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .8rem;
  padding: 1rem;
  background: var(--card);
  border: 1px solid var(--muted);
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* Image preview */
.image-preview {
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--muted);
  background: var(--muted);
  box-shadow: 0 2px 6px rgba(0,0,0,.07);
}

/* Bouton custom */
.upload-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .55rem 1rem;
  background: var(--brand);
  color: #fff;
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease;
}

.upload-btn:hover {
  background: color-mix(in oklab, var(--brand), #000 12%);
}

.upload-btn svg {
  stroke: currentColor;
}

.form-container {
    background: #ffffff;
    padding: 32px;
    border-radius: 14px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.06);
    max-width: 100%;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 5px 20px;
}

.form-group label {
    font-size: 14px;
    margin-bottom: 6px;
    font-weight: 600;
    color: #2c7be5;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: #f8fafc;
}


.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    background: #ffffff;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #FF7A18;
    background: #ffffff;
    outline: none;
    box-shadow: 0 0 0 4px rgba(224, 155, 59, 0.15);
}

.form-actions {
    margin-top: 25px;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

.btn-primary {
  padding: .55rem 1rem;
  background: var(--brand);
  color: #fff;
  border-radius: 8px;
  cursor: pointer;
  border: none;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(79,70,229,0.25);
    background: color-mix(in oklab, var(--brand), #000 12%);
}

.btn-secondary {
    background: #eef2ff;
    color: #2c7be5;
    border: none;
    padding: 12px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: #e0e7ff;
}

.span-2 {
    grid-column: span 2;
}

.span-3 {
    grid-column: span 3;
}


.checkbox-group {
    display: flex;
    margin-top : auto;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 44px; /* même hauteur que tes inputs */
    font-size: 14px;
    font-weight: 500;
    color: #334155;
    cursor: pointer;
}

.checkbox-wrapper input {
    display: none;
}

.custom-checkbox {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 2px solid #cbd5e1;
    background: #f8fafc;
    transition: all 0.2s ease;
    position: relative;
}

/* Hover */
.checkbox-wrapper:hover .custom-checkbox {
    border-color: #6366f1;
}

/* Etat coché */
.checkbox-wrapper input:checked + .custom-checkbox {
    background: linear-gradient(135deg, #2c7be5, #4f46e5);
    border-color: #4f46e5;
}

/* Check animé */
.custom-checkbox::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: translate(-50%, -60%) rotate(45deg) scale(0);
    transition: transform 0.15s ease;
}

.checkbox-wrapper input:checked + .custom-checkbox::after {
    transform: translate(-50%, -60%) rotate(45deg) scale(1);
}

.autocomplete-wrapper {
    position: relative;
    display: inline-block; /* important */
    width: 100%; /* ou supprime si tu veux largeur auto */
}

.autocomplete-wrapper input {
    width: 100%; /* prend la largeur du wrapper */
    box-sizing: border-box;
}

.autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-top: 6px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    max-height: 240px;
    overflow-y: auto;
    display: none;
    z-index: 1000;
}

.autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.15s ease;
}

.autocomplete-item:hover,
.autocomplete-item.active {
    background: #eef2ff;
}

.autocomplete-code {
    font-weight: 600;
    color: #2c7be5;
}

.autocomplete-address {
    display: block;
    font-size: 13px;
    color: #64748b;
}

.file-upload {
    display: flex;
    align-items: center;
    gap: 15px;
}

.file-upload input[type="file"] {
    display: none;
}

.file-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: 10px;
    background: #eef2ff;
    color: #0E2747;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.file-label:hover {
    background: #e0e7ff;
    transform: translateY(-1px);
}

.file-name {
    font-size: 14px;
    color: #475569;
}

.article-select {
    width: 100% !important;
    max-width: 100%;
    box-sizing: border-box;
}

.article-row {
    display: grid;
    grid-template-columns: 1fr 130px 130px auto;
    gap: 10px;
    align-items: center;
    margin-bottom : 20px;
}
.remove-article {
    height: 42px;
    width: 42px;
    border-radius: 10px;
    border: none;
    background: #fee2e2;
    color: #dc2626;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s ease;
}

.remove-article:hover {
    background: #fecaca;
}

/* ===== SELECT2 UNIFORMISÉ ===== */

.select2-container {
    width: 100% !important;
    font-size: 12px;
}

/* Boîte principale */
.select2-container .select2-selection--single {
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;

    display: flex !important;
    align-items: center !important;

    border: 1px solid #dcdcdc !important;
    border-radius: 8px !important;
    padding: 0 12px !important;

    background-color: #fff !important;
}

/* Texte affiché */
.select2-container .select2-selection__rendered {
    padding: 0 !important;
    margin: 0 !important;

    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;

    line-height: normal !important;
}

/* Icône flèche */
.select2-container .select2-selection__arrow {
    height: 42px !important;
    display: flex;
    align-items: center;
}

/* Focus cohérent avec tes inputs */
.select2-container--default.select2-container--focus
.select2-selection--single {
    border-color: var(--brand) !important;
    box-shadow: 0 0 0 2px rgba(76,110,245,0.15) !important;
}

.select2-results__option {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* =========================================================
   DATATABLE (MODULE ISOLÉ)
========================================================= */
.datatable {
  width: 100%;
  min-height : 0;
  grid-column: 1 / -1;
  max-width: none;     /* était 1200px : on retire la contrainte */
  margin: 0;           /* supprime l'auto-centering et l'espace autour */
  border-radius: 12px; /* garde un léger arrondi si tu veux l’aspect "carte" */
  box-shadow: none;    /* optionnel : supprime l’ombre si tu veux à plat */
}

/* Le wrapper scrollable conserve toute la largeur et hauteur utile */
.datatable__tablewrap {
  width: 100%;
  max-height: none;    /* laisse le parent gérer la hauteur; enlève le cap si tu veux */
  overflow: auto;
  min-height:0;
}

/* Header (barre de titre/recherche) : s'ajuste en petit écran aussi */
.datatable__header {
  display: flex;
  gap: .75rem;
  padding: 1rem 1.25rem;
  flex-wrap: wrap;                 /* la search passe dessous si pas assez de place */
}

.datatable__header { border-bottom: 1px solid var(--muted); }
.datatable__footer { border-top: 1px solid var(--muted); color: var(--text-dim); justify-content: space-between; }

.datatable__header h2 {
  margin: 0; font-size: 1.1rem; font-weight: 700; color: var(--brand);
}

/* ===== SEARCH ===== */
.datatable__search {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: .55rem;
  background: var(--brand-weak);
  border: 1px solid color-mix(in oklab, var(--brand), #000 0%);
  border-radius: 999px; min-width: 240px;
}
.datatable__search input {
  border: 0; outline: 0; background: transparent; color: var(--text); width: 100%; font-size: .95rem;
}
.datatable__search svg { width: 18px; height: 18px; color: var(--brand); }

/* ===== TABLE ===== */
.datatable__tablewrap {
  max-height: 75vh;
  overflow: auto; /* toujours actif, même avant injection JS */
  display: block; /* garantit que le tbody ne peut PAS pousser le parent */
}



/* La table elle-même s’étire à 100% */
.datatable__table {
  width: 100%;
  height:300px;
  min-width: 0;        /* important si le parent a un layout flex/grid */
  border-collapse: separate;
  border-spacing: 0;
}

.datatable__table tbody {
  display: table-row-group; /* comportement normal */
  overflow: visible;
}


.datatable__table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

thead th {
  position: sticky; top: 0; z-index: 2;
  background: linear-gradient(180deg, color-mix(in oklab, var(--brand-weak), #000 2%), var(--brand-weak));
  color: var(--text-dim);
  text-align: left; font-weight: 600;
  padding: .9rem 1rem;
  border-bottom: 1px solid var(--muted);
  backdrop-filter: blur(6px);
}

tbody td {
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--muted);
  color: var(--text);
}

/* Hover & focus sobres, avec une touche d’accent */
tbody tr:hover { background: color-mix(in oklab, var(--accent), transparent 92%); }
tbody tr:focus-within { outline: 2px solid color-mix(in oklab, var(--accent), #fff 30%); outline-offset: -2px; }

/* ===== TRI ===== */
.sort-btn {
  all: unset;
  display: inline-flex; vertical-align: middle;
  margin-left: .35rem;
  width: 1rem; height: 1rem;
  cursor: pointer; color: var(--text-dim);
  position: relative;
}
.sort-btn::before, .sort-btn::after {
  content: ""; position: absolute; left: 50%; transform: translateX(-50%);
  border-left: 4px solid transparent; border-right: 4px solid transparent;
}
.sort-btn::before { top: 0px; border-bottom: 6px solid currentColor; opacity: .45; }
.sort-btn::after  { bottom: 0px; border-top: 6px solid currentColor; opacity: .45; }

th[aria-sort="ascending"]  .sort-btn::before { opacity: 1; color: var(--brand); }
th[aria-sort="ascending"]  .sort-btn::after  { opacity: .25; }
th[aria-sort="descending"] .sort-btn::after  { opacity: 1; color: var(--brand); }
th[aria-sort="descending"] .sort-btn::before { opacity: .25; }

/* ===== STATUTS ===== */
.status {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .25rem .55rem; border-radius: 999px;
  font-size: .85rem; line-height: 1; font-weight: 600;
  border: 1px solid var(--muted);
}
.status--active  { color: var(--ok);  background: color-mix(in oklab, var(--ok), transparent 88%) !important; }
.status--pending { color: var(--warn); background: color-mix(in oklab, var(--warn), transparent 88%) !important; }
.status--st { color: var(--accent); background: color-mix(in oklab, var(--accent), transparent 88%) !important; }
.status--utilisateur { color: var(--brand); background: color-mix(in oklab, var(--brand), transparent 88%) !important; }
.status--blocked { color: var(--bad); background: color-mix(in oklab, var(--bad), transparent 88%) !important;  } 
.status--orange { color: #fc5d00; background: color-mix(in oklab, #fc5d00, transparent 88%) !important;  } 
.status--greenhard { color: #1f8d49; background: color-mix(in oklab, #1f8d49, transparent 88%) !important;  } 
 
/* A11y helper */
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.datatable-wrapper {
    background: #ffffff;
    padding: 20px;
    font-size:14px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* Header */
.modern-table thead th {
    background-color: #f8f9fb;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
    font-size: 14px;
    position: static !important;
}

/* Filtres */
.modern-table thead tr.filters input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #dcdcdc;
    border-radius: 6px;
    font-size: 13px;

}

/* Lignes */
.modern-table tbody tr {
    transition: background 0.2s ease;
}

.modern-table tbody tr:hover {
    background-color: #f3f4f6;
}

/* Pagination */
.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 6px !important;
    padding: 5px 10px !important;
}

.datatable-column-selector {
    position: relative;
    display: inline-block;
    margin-bottom: 10px;
}

#toggleColumnsBtn {
    background: #f8f9fb;
    border: 1px solid #dcdcdc;
    border-radius: 8px;
    padding: 6px 12px;
    cursor: pointer;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #fff;
    min-width: 180px;
    border: 1px solid #dcdcdc;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 1000;
}

.dropdown-content label {
    display: block;
    margin: 4px 0;
    cursor: pointer;
}

/* === OVERLAY === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: none;
  justify-content: center;
  align-items: flex-start;
  padding-top: 6vh;
  z-index: 9999;
}

/* visible */
.modal-overlay.active {
  display: flex;
}


/* =========================================================
   MODAL POP-UP
========================================================= */
.modal {
  width: 100%;
  max-width: 560px;            /* un peu plus large que 500, confortable */
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--muted);
  border-radius: 16px;         /* arrondi plus premium */
  box-shadow: 0 18px 60px rgba(0,0,0,0.18);
  overflow: hidden;            /* important pour que la bannière épouse l'arrondi */
}

/* ====== BANNIÈRE DE TITRE ====== */
.modal-banner {
  position: relative;
  padding: 18px 20px;
  background: linear-gradient(135deg,
    color-mix(in oklab, var(--brand), transparent 0%),
    color-mix(in oklab, var(--accent), transparent 30%)
  );
  border-bottom: 1px solid color-mix(in oklab, var(--brand), #000 20%);
  color: #fff;
}

/* Décor subtil (vague) */
.modal-banner__bg {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 80px;
  pointer-events: none;
}

/* Bannière — grille 3 colonnes : icône | titres | close */
.modal-banner__content {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
}


/* Icône circulaire */
.modal-banner__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 999px;
  background: color-mix(in oklab, #fff, transparent 80%);
  color: #fff;
  border: 1px solid color-mix(in oklab, #fff, transparent 70%);
  backdrop-filter: blur(2px);
}

/* Titres */
.modal-banner__titles h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;            /* plus “marqué” */
  letter-spacing: .2px;
  color: #fff;
}
.modal-subtitle {
  margin: 2px 0 0;
  font-size: .9rem;
  color: color-mix(in oklab, #fff, transparent 35%);
}

/* Badge action (Ajouter / Modifier) */
.modal-banner__badge {
  justify-self: end;
  padding: .35rem .65rem;
  font-size: .8rem;
  font-weight: 700;
  color: var(--brand);
  background: #fff;
  border-radius: 999px;
  border: 1px solid color-mix(in oklab, var(--brand), #000 10%);
  box-shadow: 0 1px 0 rgba(0,0,0,0.06);
}

/* HEADER */
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.modal-header h3 {
  margin: 0;
  font-size: 1.2rem;
  color: var(--brand);
}

/* Bouton de fermeture */
.modal-close {
  position: static;
  top: 10px; right: 12px;
  all: unset;
  width: 34px; height: 34px;
  border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: #fff;
  background: color-mix(in oklab, #000, transparent 75%);
  border: 1px solid color-mix(in oklab, #fff, transparent 80%);
}

/* Bouton fermer dans la bannière (à droite) */
.modal-close--inbanner {
  all: unset;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  cursor: pointer;
  color: #fff;
  background: color-mix(in oklab, #000, transparent 75%);
  border: 1px solid color-mix(in oklab, #fff, transparent 80%);
  transition: background .15s ease;
}
.modal-close--inbanner:hover {
  background: color-mix(in oklab, #000, transparent 65%);
}
.modal-close--inbanner:focus-visible {
  outline: 2px solid color-mix(in oklab, #fff, transparent 65%);
  outline-offset: 2px;
}

/* BODY */
.modal-body { 
  overflow-y: auto;
  padding: 1.2rem 1.5rem 1.4rem; 
}

/* FORM */
.form-group {
  display: flex;
  flex-direction: column;
}

/* FOOTER */
.modal-footer {
  margin-top: 1.2rem;
  display: flex;
  justify-content: flex-end;
  gap: .75rem;
}
.btn-cancel {
  padding: .55rem 1rem;
  background: var(--muted);
  color: var(--text);
  border-radius: 8px;
  cursor: pointer;
  border: none;
}


.section-title {
    font-size: 18px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 20px;
    padding: 0 0 12px 18px;
    border-bottom: 1px solid #e2e8f0;
    position: relative;
}

.section-title::before {
    content: "";
    position: absolute;
    left: 0;
    top: 2px;
    height: 70%;
    width: 4px;
    background: linear-gradient(180deg, #FF7A18, #FF7A18);
    border-radius: 4px;
}



/* =========================================================
   PLANNING (HARMONISÉ BLEU MODERNE)
========================================================= */
.card-planning {
    background: #ffffff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    margin-top: 20px;
}

.planning-header {
    margin-bottom: 15px;
}

#planning {
    background: #fff;
    border-radius: 10px;
    padding: 10px;
}

/* Harmonisation FullCalendar */
.fc {
    font-family: inherit;
    font-size: 13px;
}

.fc-toolbar {
    margin-bottom: 8px !important;
}

.fc-toolbar-title {
    font-size: 18px;
    font-weight: 600;
}

.fc-button {
    background-color: var(--brand) !important;
    border: none !important;
    border-radius: 6px !important;
    padding: 5px 10px !important;
}

/* Réduction hauteur événement */
.fc-event {
    padding: 2px 4px !important;
    font-size: 12px;
    border-radius: 6px;
    overflow  : hidden;
}

.fc-event-title,
.fc-event-main {
    overflow: hidden;
}

.fc-event .fc-event-title,
.fc-event div {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.fc-button:hover {
    background-color: var(--brand) !important;
}

.fc-timegrid-slot {
    height: 30px !important;
}

/* Réduction hauteur en-tête jours */
.fc-col-header-cell {
    padding: 6px 0 !important;
    font-size: 13px;
}


.preview-event {
    background-color: var(--brand) !important;
    border: 2px dashed var(--brand) !important;
    opacity: 0.65;
    transition: all 0.2s ease-in-out;
}

/* Effet hover */
.preview-event:hover {
    opacity: 0.85;
    transform: scale(1.01);
}

/* Animation d’apparition */
.fc-event.preview-event {
    animation: fadePreview 0.2s ease-in-out;
}

    /* Conteneur */
.dossier-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* Bouton */
.filter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    height: 42px;
    padding: 0 18px;

    border-radius: 8px;
    border: 1px solid #dcdcdc;
    background: #ffffff;
    cursor: pointer;

    font-size: 14px;
    font-weight: 500;
    color: #333;

    transition: all 0.2s ease;
}

/* Hover */
.filter-btn:hover {
    background: #f5f7fa;
    border-color: #c6d4e1;
}

/* Actif */
.filter-btn.active {
    background: #e7f1ff;
    border-color: #007bff;
    color: #007bff;
}

/* Compteur */
.filter-count {
    background: rgba(0,0,0,0.08);
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 12px;
}

.filter-btn.active .filter-count {
    background: rgba(255,255,255,0.2);
}


@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.current-event {
        font-weight: bold;
        box-shadow: 0 0 10px rgba(0,0,0,0.3); 
    }
.current-event::before {
    content: "";
    position: absolute;
    left: 80%;
    top: 10%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background-image: url('../image/icon/pin.svg'); 
    background-size: contain;
    background-repeat: no-repeat;
}

.current-event.blinking {
    animation: blink 2s infinite;
}


.info-card{
background:white;
border-radius:10px;
margin-bottom:20px;
}

.info-card h3{
font-size:15px;
margin-bottom:15px;
border-left:4px solid #4f8cff;
padding-left:10px;
}

.info-grid{
display:grid;
grid-template-columns:repeat(4,1fr);
gap:15px;
}

.info-grid5{
display:grid;
grid-template-columns:repeat(5,1fr);
gap:15px;
}

.info-item{
display:flex;
flex-direction:column;
}

.info-item label{
font-size:12px;
color: #2c7be5;
margin-bottom:5px;
}

.info-item input,
.info-item select,
.info-item textarea{
padding:8px 10px;
border:1px solid #ddd;
border-radius:6px;
background:#f9fafc;
}

.span-2{
grid-column:span 2;
}

.span-3{
grid-column:span 3;
}

.span-4{
grid-column:span 4;
}

.span-5{
grid-column:span 5;
}

.switch-item{
    justify-content:flex-end;
}
/* SWITCH */

.switch{
    position:relative;
    display:inline-block;
    width:42px;
    height:22px;
}

.switch input{
    opacity:0;
    width:0;
    height:0;
}

.slider{
    position:absolute;
    inset:0;
    background:#e2e8f0;
    border-radius:30px;
}

.slider:before{
    content:"";
    position:absolute;
    height:16px;
    width:16px;
    left:3px;
    bottom:3px;
    background:white;
    border-radius:50%;
    box-shadow:0 1px 3px rgba(0,0,0,0.2);
}

/* actif */

.switch input:checked + .slider{
    background:#4f8cff;
}

.switch input:checked + .slider:before{
    transform:translateX(20px);
}

/* mode readonly */

.switch-readonly{
    pointer-events:none;
    opacity:0.85;
}

/* =========================
TIMELINE COMMENTAIRES
=========================*/

.comments-container{
display:grid;
grid-template-columns:repeat(4,1fr);
gap:12px;
margin-top:10px;
}

.comment-card{
background:#f9fafc;
border-radius:8px;
padding:12px 14px;
border-left:4px solid #4f8cff;
display:flex;
flex-direction:column;
}

.comment-header{
display:flex;
justify-content:space-between;
align-items:center;
margin-bottom:6px;
}

.comment-author{
font-weight:600;
font-size:13px;
}

.comment-date{
font-size:12px;
color:#777;
}

/* TEXTE */

.comment-body{
font-size:14px;
line-height:1.4;
margin-bottom:8px;
white-space:pre-line;
}

/* ZOOM PHOTO */

.photo-modal{
position:fixed;
inset:0;
background:rgba(0,0,0,0.8);
display:flex;
align-items:center;
justify-content:center;
z-index:9999;
}

.photo-modal img{
max-width:90%;
max-height:90%;
border-radius:8px;
}

/* TIMELINE BASE */

.timeline{
position:relative;
padding-left:20px;
display:flex;
flex-direction:column;
gap:15px;
}

.timeline:before{
content:"";
position:absolute;
left:6px;
top:0;
bottom:0;
width:2px;
background:#e2e8f0;
}

.timeline-item{
position:relative;
}

/* GROUPE */

.timeline-item-group{
position:relative;
}

.timeline-dot{
width:12px;
height:12px;
background:#4f8cff;
border-radius:50%;
position:absolute;
left:-1px;
top:6px;
}

/* TYPES */

.timeline-event.type-etat{
border-color:#4f8cff;
}

.timeline-event.type-commentaire{
border-color:#f59e0b;
}

.timeline-event.type-intervention{
border-color:#10b981;
}

/* CARD */

.timeline-content{
background:#f9fafc;
padding:10px 12px;
border-radius:8px;
transition:0.2s;
}


/* HEADER DATE */

.timeline-header{
font-size:13px;
font-weight:600;
margin-bottom:6px;
}


.timeline-badge{
font-weight:600;
}

.timeline-body{
font-size:13px;
}

/* PHOTOS */

.timeline-photos{
margin-top:5px;
display:flex;
gap:6px;
flex-wrap:wrap;
}

.timeline-photos img{
width:100px;
height:100px;
object-fit:cover;
border-radius:6px;
cursor:pointer;
transition:0.15s;
}

.timeline-photos img:hover{
transform:scale(1.08);
}

/* Conteneur des photos */
.timeline-photos.comment-photos {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.timeline-photos.comment-photos .photo-item {
    position: relative; /* très important pour que l’icône soit positionnée par rapport à la photo */
    display: inline-block;
}

.timeline-photos.comment-photos img {
    display: block;
    width: 100px;
    height: 100px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.timeline-photos.comment-photos .hide-photo-checkbox {
    display: none;
}

.timeline-photos.comment-photos .eye-icon {
    position: absolute; /* positionné par rapport à photo-item */
    top: 0px;
    right: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.timeline-photos.comment-photos .eye-icon svg {
    display: block;
    fill: #406cc0; /* couleur par défaut */
}

/* Masquer la checkbox classique */
.hide-photo-checkbox {
    display: none;
}

/* Icône SVG */
.eye-icon svg {
    fill: #406cc0; /* bleu par défaut */
    transition: fill 0.2s;
}

/* Si la checkbox juste avant est cochée, passer au rouge */
.hide-photo-checkbox:checked + .eye-icon svg {
    fill: red;
}
/* EVENTS */

.timeline-event{
background:white;
padding:8px 10px;
border-radius:6px;
font-size:13px;
border-left:3px solid transparent;
}

.timeline-event{
background:white;
padding:8px 10px;
border-radius:6px;
font-size:13px;
border-left:3px solid transparent;
}

/* SUB TEXT */

.timeline-event .sub{
font-size:12px;
color:#777;
}

/* COMMENT */

.timeline-comment{
margin-top:6px;
padding-top:6px;
border-top:1px dashed #e2e8f0;
}

.comment-content {
    position: relative;
    padding-right: 80px; /* pour laisser de la place aux boutons */
}

.comment-edit {
    width: 100%;
    box-sizing: border-box;
    font-size: 13px;
    border-radius: 4px;
    border: 1px solid #ccc;
    padding: 4px;
    resize: vertical;
}

.edit-comment-btn,
.save-comment-btn,
.cancel-comment-btn {
    margin-left: 4px;
    cursor: pointer;
    background: none;
    border: none;
    font-size: 14px;
}

.edit-comment-btn:hover,
.save-comment-btn:hover,
.cancel-comment-btn:hover {
    color: #10b981; /* vert */
}

/* =========================================================
   RESPONSIVE
========================================================= */

@media(max-width:1200px){

    .comments-container{
     grid-template-columns:repeat(3,1fr);
    }

}

@media (max-width: 900px) {
    .sidebar {
    width: 72px;
    }

    .sidebar h1 {
    display: none;
    }

    .menu-item span {
    display: none;
    }

    .login-wrapper {
        justify-content: center;
        padding-left: 0;
    }

    .comments-container{
    grid-template-columns:repeat(2,1fr);
    }
}

@media (max-width: 768px) {
    

    .filter-btn {
        flex: 1 1 auto;
        justify-content: center;
    }
}


@media (max-width: 600px) {
    .sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    height: 100%;
    z-index: 10;
    }

    .sidebar.open {
    left: 0;
    }

    .menu-toggle {
    display: block;
    cursor: pointer;
    }
}

@media (max-width: 480px) {
    .login-card {
    margin: 16px;
    padding: 28px 24px;
    }

    .comments-container{
    grid-template-columns:1fr;
    }
}

@keyframes modalFade {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadePreview {
    from {
        opacity: 0;
        transform: scale(0.98);
    }
    to {
        opacity: 0.65;
        transform: scale(1);
    }
}