:root {
  /* --- PALETTE AMBERGATE (ACCINOR) --- */
  --bg: #fdfaf6;                /* Crème très clair */
  --panel: #ffffff;
  --text: #2d1102;             /* Brun très sombre pour la lecture */
  --text-dark: #000000;        /* Noir pur pour les titres */
  --muted: #78350f;            /* Ambre profond (très visible) */
  --muted-light: #9a6644;      /* Ton terreux pour les éléments discrets */
  
  /* ACCENT : Orange Vif Accinor */
  --accent: #FF8000;           
  --accent-soft: rgba(255, 128, 0, 0.1);
  --accent-hover: #fff3e6;     
  --accent-border: #ffcc80;    
  
  /* ÉTATS (Harmonisation chaude) */
  --danger: #b91c1c;           
  --danger-soft: #fef2f2;
  --danger-border: #fee2e2;
  --danger-text: #991b1b;
  --warning: #f59e0b;
  --ok: #0d9488;               /* Teal 600 : Plus moderne que le vert pur */
  --ok-soft: #f0fdfa;          /* Fond très léger */
  --ok-border: #99f6e4;        /* Bordure douce */
  --ok-text: #0f766e;          /* Texte lisible */
  
  /* STRUCTURE */
  --border: #e2d1c3;           
  --shadow: 0 4px 6px -1px rgba(69, 26, 3, 0.1), 0 2px 4px -1px rgba(69, 26, 3, 0.06);
  --radius: 12px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  height: 100vh;
  overflow: hidden;
}

/* --- STRUCTURE PRINCIPALE --- */
.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 20px;
  padding: 20px;
  height: 100vh;
  width: 100vw;
}

.sidebar,
main.card {
  background: var(--panel);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  overflow: hidden;
}

main.card>.main {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  min-height: 0;
}

/* --- HEADER & USER INFO --- */
.header {
  padding: 20px 16px;
  border-bottom: 1px solid var(--border);
}

.title {
  font-weight: 800;
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 0.05em;
  text-align: center;
  margin-bottom: 15px;
}

.namebox-below {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.namefield {
  background: #f1f5f9;
  border-radius: 8px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.namefield input {
  border: none;
  background: transparent;
  font-weight: 600;
  font-size: 13px;
  width: 100%;
}

/* --- SIDEBAR BUTTONS --- */
.sidebar button:not(.iconbtn) {
  width: 100%;
  margin-top: 8px;
  background: white;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.sidebar button:not(.iconbtn):hover {
  background: #f8fafc;
  border-color: var(--muted-light);
  color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* --- TABS --- */
.tabs {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tab {
  font-size: 0 !important;
  /* Cache le texte original (emojis) */
  padding: 14px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.2s;
  color: var(--muted);
  font-weight: 600;
  border: 1px solid transparent;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.tab:hover {
  background: #f1f5f9;
}

.tab.active {
  background: var(--accent-hover);
  color: var(--accent);
  border-color: var(--accent-border);
}

/* Description des tabs (small) */
.tab small {
  display: block;
  font-size: 11px !important;
  font-weight: 500;
  color: var(--muted);
  opacity: 0.8;
  margin-top: 4px;
  width: 100%;
  padding-left: 34px;
}

/* Icônes SVG des Tabs */
.tab::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 24px;
  margin-right: 10px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  filter: grayscale(100%) opacity(0.6);
}

.tab.active::before {
  filter: none;
}

.tab::after {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
}

.tab.active::after {
  color: var(--accent);
}

/* Définitions des icônes Tabs */
.tab[data-tab="newTrip"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FF8000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='3 11 22 2 13 21 11 13 3 11'%3E%3C/polygon%3E%3C/svg%3E");
}

.tab[data-tab="newTrip"]::after {
  content: "Nouveau Trajet";
}

.tab[data-tab="trips"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FF8000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3h18v18H3zM21 9H3M21 15H3M12 3v18'/%3E%3C/svg%3E");
}

.tab[data-tab="trips"]::after {
  content: "Liste des trajets";
}

.tab[data-tab="ndf"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FF8000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z'%3E%3C/path%3E%3C/svg%3E");
}

.tab[data-tab="ndf"]::after {
  content: "Notes de frais";
}

.tab[data-tab="admin"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FF8000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.09a2 2 0 0 1-1-1.74v-.47a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z'%3E%3C/path%3E%3Ccircle cx='12' cy='12' r='3'%3E%3C/circle%3E%3C/svg%3E");
}

.tab[data-tab="admin"]::after {
  content: "Administration";
}

.tab[data-tab="data"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FF8000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12V7H5a2 2 0 0 1 0-4h14v4'%3E%3C/path%3E%3Cpath d='M3 5v14a2 2 0 0 0 2 2h16v-5'%3E%3C/path%3E%3Cpath d='M18 12a2 2 0 0 0 0 4h4v-4Z'%3E%3C/path%3E%3C/svg%3E");
}

.tab[data-tab="data"]::after {
  content: "Données / Export";
}

/* --- NOUVEL ONGLET PRINCIPAL (VOITURE) --- */
.tab[data-tab="ik-global"]::before {
  /* Icone Voiture (SVG bleu) */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FF8000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 17h2c.6 0 1-.4 1-1v-3c0-.9-.7-1.7-1.5-1.9C18.7 10.6 16 10 16 10s-1.3-1.4-2.2-2.3c-.5-.4-1.1-.7-1.8-.7H5c-.6 0-1.1.4-1.4.9l-1.4 2.9A3.7 3.7 0 0 0 2 12v4c0 .6.4 1 1 1h2'%3E%3C/path%3E%3Ccircle cx='7' cy='17' r='2'%3E%3C/circle%3E%3Ccircle cx='17' cy='17' r='2'%3E%3C/circle%3E%3C/svg%3E");
}

.tab[data-tab="ik-global"]::after {
  content: "Indemnités Km";
}

/* --- FORMULAIRES --- */
.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
  align-items: start;
}

/* FIX POUR LE TIP DE LA MODALE */
.grid>.tip {
  grid-column: span 12;
}

.field label {
  font-size: 13px;
  font-weight: 800;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 6px;
  display: block;
  letter-spacing: 0.05em;
}

.control {
  display: flex;
  align-items: center;
  gap: 6px;
}

input,
select,
textarea {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 14px;
  color: var(--text-dark);
  font-weight: 700;
}

::placeholder {
  color: var(--muted-light);
  font-weight: 400;
  opacity: 1;
}

select:invalid,
select option[disabled] {
  color: var(--muted-light);
}

input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* --- BOUTONS --- */
.btn {
  background: var(--ok);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s;
  white-space: nowrap;
}

.btn:hover {
  background: #0d9488;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.25);
}

.btn.secondary {
  background: #f1f5f9;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn.secondary:hover {
  background: #e2e8f0;
  box-shadow: none;
}

.btn.danger {
  background: var(--danger);
  color: white;
}

.btn.danger:hover {
  background: #dc2626;
  box-shadow: 0 4px 6px -1px rgba(220, 38, 38, 0.25);
}

.btn:disabled,
.btn.disabled {
  background: #cbd5e1 !important;
  color: var(--muted) !important;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* --- BOUTONS ICONES --- */
.iconbtn {
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  transition: all 0.2s;
  background-repeat: no-repeat;
  background-position: center;
  font-size: 0 !important;
  /* Cache le texte s'il y en a */
}

.iconbtn:hover {
  background-color: #f1f5f9;
}

/* Types d'icônes spécifiques */
/* PDF (Rouge) */
.iconbtn[title="Voir la note de frais"] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 384 512'%3E%3Cpath fill='%23dc2626' d='M369.9 97.9L286 14C277 5 264.8-.1 252.1-.1H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V131.9c0-12.7-5.1-25-14.1-34zM332.1 128H256V51.9l76.1 76.1zM48 464V48h160v104c0 13.3 10.7 24 24 24h104v288H48zm250.2-143.7c-12.2-12-47-8.7-64.4-6.5-17.2-10.5-28.7-25-36.8-46.3 3.9-16.1 10.1-27.3 10.1-34.8 0-4.8-3.3-6.8-9.4-6.8-17.7 0-21.4 21-21.4 26 0 17.1 2.3 60.8 32.8 94.8-22.9 29-57.8 54.6-69.1 63.4-3 11.3-19 32.5-9.8 45.3 5.4 7.6 15 8.1 18.7 8.1 9.2 0 24.3-14.5 40.2-46.9 31.2-11.2 71.9-22 93-24.3 21.8 14.1 39.1 16.1 47.9 16.1 14.3 0 22.8-9.6 19.2-22.7-3.2-11.7-16.3-17.4-25.1-19.4z'/%3E%3C/svg%3E");
  background-size: 20px;
}

.iconbtn[title="Voir la note de frais"]:hover {
  background-color: #fff1f2;
  border-color: #e11d48;
}

/* Comptabiliser (Vert) */
.iconbtn[title="Comptabiliser la note de frais"] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230d9488' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='22' y1='2' x2='11' y2='13'%3E%3C/line%3E%3Cpolygon points='22 2 15 22 11 13 2 9 22 2'%3E%3C/polygon%3E%3C/svg%3E");
  background-size: 20px;
  border-color: rgba(16, 185, 129, 0.3);
}

.iconbtn[title="Comptabiliser la note de frais"]:hover {
  background-color: var(--ok-soft);
  border-color: var(--ok);
}

/* Supprimer (Rouge) */
.iconbtn[title*="Supprimer"] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23dc2626' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='3 6 5 6 21 6'%3E%3C/polyline%3E%3Cpath d='M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2'%3E%3C/path%3E%3Cline x1='10' y1='11' x2='10' y2='17'%3E%3C/line%3E%3Cline x1='14' y1='11' x2='14' y2='17'%3E%3C/line%3E%3C/svg%3E");
  background-size: 18px;
  border-color: rgba(220, 38, 38, 0.3);
}

.iconbtn[title*="Supprimer"]:hover {
  background-color: var(--danger-soft);
  border-color: var(--danger);
  box-shadow: 0 2px 4px rgba(220, 38, 38, 0.15);
}

/* Editer / Modifier / Crayon (Bleu) */
.iconbtn[title*="Éditer"],
.iconbtn[title*="Modifier"],
#editUserBtn,
#editCompanyBtn,
#editCarBtn {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FF8000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7'%3E%3C/path%3E%3Cpath d='M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z'%3E%3C/path%3E%3C/svg%3E");
  background-size: 18px;
}

/* Ajouter (Bleu) */
.iconbtn[title*="Ajouter"],
#addCompanyBtn,
#addCarBtn {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FF8000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='12' y1='5' x2='12' y2='19'%3E%3C/line%3E%3Cline x1='5' y1='12' x2='19' y2='12'%3E%3C/line%3E%3C/svg%3E");
  background-size: 20px;
}

/* Dupliquer (Bleu) */
.iconbtn[title*="Dupliquer"] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FF8000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='9' width='13' height='13' rx='2' ry='2'%3E%3C/rect%3E%3Cpath d='M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1'%3E%3C/path%3E%3C/svg%3E");
  background-size: 18px;
}

/* --- FORCER LA TAILLE 0 POUR LES BOUTONS AVEC IMAGES --- */
.iconbtn[title*="Éditer"],
.iconbtn[title*="Modifier"],
.iconbtn[title*="Ajouter"],
.iconbtn[title*="Dupliquer"],
.iconbtn[title*="Supprimer"],
.iconbtn[title="Voir la note de frais"],
.iconbtn[title="Comptabiliser la note de frais"],
.iconbtn[title*="Calculer"],
/* Nouveau */
.iconbtn[title*="Recalculer"],
/* Nouveau */
#editUserBtn,
#editCompanyBtn,
#editCarBtn,
#addCompanyBtn,
#addCarBtn,
#calcKmBtn

/* Nouveau */
  {
  font-size: 0 !important;
}

.chip {
  background: #f1f5f9;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0 16px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.chip:hover {
  background: #e2e8f0;
}

/* --- TABLEAUX --- */
.tableWrap {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow-y: auto;
  overflow-x: auto;
  margin-top: 10px;
  max-height: calc(100vh - 280px);
  position: relative;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 800px;
}

th {
  position: sticky;
  top: 0;
  background: var(--accent);
  color: white;
  z-index: 10;
  padding: 14px 12px;
  text-align: left;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid #b45309;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

thead tr.noPrint th {
  top: 45px;
  z-index: 9;
  background: #f1f5f9;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  box-shadow: none;
  padding: 8px;
}

td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-dark);
  font-weight: 700;
  vertical-align: middle;
}

tbody tr:nth-child(even) {
  background-color: #f8fafc;
}

tbody tr:hover {
  background-color: #e2e8f0;
}

.actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  vertical-align: middle;
}

td.nowrap:has(.pill) .actions {
  margin-left: 10px;
}

.ndf-status-ok {
  color: var(--ok-text);
  font-weight: 800;
}

.chip-danger {
  color: var(--danger-text) !important;
  background: var(--danger-soft);
  border: 1px solid var(--danger-border);
  border-radius: 4px;
  padding: 2px 6px;
  font-weight: 800;
}

/* --- BADGES ET PILLS --- */
#tripCountPill,
#availableCountPill {
  background: #f1f5f9;
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  border: 1px solid var(--border);
  cursor: default;
  display: inline-flex;
  align-items: center;
}

#availableCountPill {
  background: var(--ok-soft);
  color: var(--ok-text);
  border-color: var(--ok-border);
}

#availableCountPill.empty {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: var(--danger-border);
}

.pill {
  background: transparent;
  padding: 0;
  border-radius: 0;
  font-size: 13px;
  font-weight: 800;
  color: #000;
  text-decoration: none;
  cursor: pointer;
}

.pill:hover {
  color: var(--accent);
}

.tip {
  font-size: 11px;
  color: var(--muted);
  margin-top: 5px;
}

.num {
  text-align: right;
}

/* --- MODALS & OVERLAYS --- */
#adminOverlay,
#authOverlay,
.modalOverlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

#adminOverlay,
#authOverlay {
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
}

.modalOverlay {
  background: rgba(15, 23, 42, 0.5);
  display: none;
  z-index: 10000;
}

#adminOverlay.hidden,
#authOverlay.hidden {
  display: none !important;
}

#adminCard,
#authCard,
.modal {
  background: white;
  border-radius: var(--radius);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  width: min(800px, 95vw);
  max-height: 90vh;
}

#adminCard,
#authCard {
  padding: 30px;
  overflow-y: auto;
}

.modal {
  overflow: hidden;
}

.modal table {
  min-width: 100%;
  width: 100%;
}

.modalHeader {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modalBody {
  padding: 20px;
  overflow-y: auto;
  max-height: calc(90vh - 120px);
}

.modalFooter {
  padding: 16px 20px;
  background: #f8fafc;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

#authEmail {
  margin: 20px 0 10px 0;
}


/* --- SUGGESTIONS --- */
.suggest {
  position: absolute;
  z-index: 100;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 100%;
  box-shadow: var(--shadow);
}

.suggest .item {
  padding: 10px;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
}

.suggest .item:hover {
  background: var(--accent-soft);
}

/* --- ADMIN SPECIFIC --- */
.btnToggleCabinet,
.btnCabinetSettings {
  background: white;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* --- ICONES ACTIVATION / DESACTIVATION (Remplacement Emojis) --- */

/* Configuration de base pour les boutons toggle (Cabinets et SubCabinets) */
.btnToggleCabinet,
.btnToggleSubCab {
  font-size: 0 !important;
  /* Cache l'émoji texte */
  background-position: center;
  background-repeat: no-repeat;
  background-size: 18px;
  transition: all 0.2s;
}

/* ÉTAT ACTIF (data-active="true") -> Affiche icône "STOP/DÉSACTIVER" (Rouge) */
.btnToggleCabinet[data-active="true"],
.btnToggleSubCab[data-active="true"] {
  /* SVG Sens Interdit Rouge */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ef4444' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='4.93' y1='4.93' x2='19.07' y2='19.07'%3E%3C/line%3E%3C/svg%3E");
  border-color: var(--danger-border);
}

/* Survol de l'état Actif (devient rouge vif) */
.btnToggleCabinet[data-active="true"]:hover,
.btnToggleSubCab[data-active="true"]:hover {
  background-color: var(--danger-soft);
  border-color: var(--danger);
}


/* ÉTAT INACTIF (data-active="false") -> Affiche icône "CHECK/ACTIVER" (Vert) */
.btnToggleCabinet[data-active="false"],
.btnToggleSubCab[data-active="false"] {
  /* SVG Check Vert */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230d9488' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
  border-color: var(--ok-border);
}

/* Survol de l'état Inactif (devient vert vif) */
.btnToggleCabinet[data-active="false"]:hover,
.btnToggleSubCab[data-active="false"]:hover {
  background-color: var(--ok-soft);
  border-color: var(--ok);
}

/* --- BARRE D'OUTILS TABLEAUX (Modern UI) --- */
.table-tools {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  align-items: center;
}

/* Champ de recherche globale */
.search-group {
  position: relative;
  flex: 1;
  /* Prend toute la largeur disponible */
  max-width: 400px;
}

.search-group input {
  padding-left: 36px;
  /* Place pour l'icône loupe */
  border-radius: 99px;
  /* Forme pilule moderne */
  background: white;
  transition: all 0.2s;
}

.search-group input:focus {
  width: 100%;
  max-width: 100%;
  box-shadow: 0 4px 12px var(--accent-soft);
  border-color: var(--accent);
}

/* Icône loupe en CSS pur (via SVG en background) */
.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
  background-repeat: no-repeat;
  pointer-events: none;
}

/* Bouton Filtres */
.btn-filter-toggle {
  background: white;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 16px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: 0.2s;
}

.btn-filter-toggle:hover,
.btn-filter-toggle.active {
  background: #f1f5f9;
  border-color: var(--muted-light);
  color: var(--accent);
}

/* Panneau de filtres avancés (caché par défaut) */
.filter-panel {
  display: none;
  /* Caché */
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.filter-panel.visible {
  display: grid;
}

/* --- FIX ALIGNEMENT COLONNE NDF / ACTIONS --- */

/* 1. On transforme la dernière cellule (NDF) en conteneur Flex */
#tripsTable td:last-child {
  display: flex;
  align-items: center;
  /* Conserve le padding original du td mais change le comportement interne */
}

/* 2. On force le bloc d'actions (.actions) à aller tout à droite */
#tripsTable td:last-child .actions {
  margin-left: auto;
  /* C'est la clé : cela pousse les boutons vers la droite */
  padding-left: 15px;
  /* Espace de sécurité entre le texte NDF et les boutons */
}

.btnToggleCabinet:hover,
.btnCabinetSettings:hover {
  background-color: #f1f5f9;
  color: var(--text);
  transform: translateY(-1px);
}

.admin-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  margin-bottom: 20px;
  color: var(--muted);
}

.breadcrumb-item {
  cursor: pointer;
  font-weight: 600;
}

.breadcrumb-item:hover {
  color: var(--accent);
  text-decoration: underline;
}

.breadcrumb-item.current {
  color: var(--text);
  cursor: default;
  text-decoration: none;
  font-weight: 800;
}

.breadcrumb-sep {
  color: var(--border);
}

.admin-link {
  color: var(--accent);
  text-decoration: none;
  cursor: pointer;
  font-weight: 800;
}

.admin-link:hover {
  text-decoration: underline;
}

.col-actions {
  text-align: right;
  white-space: nowrap;
}

.col-actions .btn,
.col-actions .iconbtn {
  display: inline-flex;
  margin-left: 6px;
  vertical-align: middle;
}

.breadcrumb-icon {
  font-size: 16px;
  margin-right: 6px;
  vertical-align: text-bottom;
}

/* --- ICONE BOUSSOLE / CALCUL KM --- */
#calcKmBtn,
.iconbtn[title*="Calculer"],
/* Pour le tooltip "Calculer..." */
.iconbtn[title*="Recalculer"]

/* Pour le tooltip "Recalculer..." (mode édition) */
  {
  /* SVG Boussole (Bleu Accent) */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FF8000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cpolygon points='16.24 7.76 14.12 14.12 7.76 16.24 9.88 9.88 16.24 7.76'%3E%3C/polygon%3E%3C/svg%3E");
  background-size: 20px;
}

/* --- ICONES DES SOUS-ONGLETS (SVG) --- */

/* 1. Alignement général pour les boutons du sous-menu */
#ikSubNav .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  /* Espace entre l'icône et le texte */
}

/* 2. Création de l'espace pour l'icône */
#ikSubNav .btn::before {
  content: '';
  display: block;
  width: 18px;
  height: 18px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

/* 3. Définition des icônes spécifiques (Même bleu que le menu) */

/* Icône Plus (Nouveau Trajet) */
#btnSubNewTrip::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='12' y1='5' x2='12' y2='19'%3E%3C/line%3E%3Cline x1='5' y1='12' x2='19' y2='12'%3E%3C/line%3E%3C/svg%3E");
}

/* Petite astuce : quand le bouton est actif (fond bleu), l'icône est blanche. 
   Mais s'il devient gris (inactif), on change la couleur de l'icone pour qu'elle reste visible ? 
   Le CSS gère ça automatiquement si on change l'image selon la classe .secondary */

/* Cas bouton "Secondaire" (Fond gris/blanc) -> Icône Bleue */
#ikSubNav .btn.secondary#btnSubNewTrip::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FF8000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='12' y1='5' x2='12' y2='19'%3E%3C/line%3E%3Cline x1='5' y1='12' x2='19' y2='12'%3E%3C/line%3E%3C/svg%3E");
}

/* Icône Liste (Liste des trajets) - Toujours bleue car souvent en secondaire, mais on prévoit les deux cas */
#btnSubTrips::before {
  /* Par défaut (si actif/bleu) -> Blanc */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='8' y1='6' x2='21' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='12' x2='21' y2='12'%3E%3C/line%3E%3Cline x1='8' y1='18' x2='21' y2='18'%3E%3C/line%3E%3Cline x1='3' y1='6' x2='3.01' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='12' x2='3.01' y2='12'%3E%3C/line%3E%3Cline x1='3' y1='18' x2='3.01' y2='18'%3E%3C/line%3E%3C/svg%3E");
}

#ikSubNav .btn.secondary#btnSubTrips::before {
  /* Si secondaire (fond clair) -> Bleu */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FF8000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='8' y1='6' x2='21' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='12' x2='21' y2='12'%3E%3C/line%3E%3Cline x1='8' y1='18' x2='21' y2='18'%3E%3C/line%3E%3Cline x1='3' y1='6' x2='3.01' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='12' x2='3.01' y2='12'%3E%3C/line%3E%3Cline x1='3' y1='18' x2='3.01' y2='18'%3E%3C/line%3E%3C/svg%3E");
}


/* Icône Dossier (Notes de frais) */
#btnSubNdf::before {
  /* Blanc */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z'%3E%3C/path%3E%3C/svg%3E");
}

#ikSubNav .btn.secondary#btnSubNdf::before {
  /* Bleu */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FF8000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z'%3E%3C/path%3E%3C/svg%3E");
}

/* --- ICONE ACCUEIL --- */
.tab[data-tab="home"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FF8000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'%3E%3C/path%3E%3Cpolyline points='9 22 9 12 15 12 15 22'%3E%3C/polyline%3E%3C/svg%3E");
}

.tab[data-tab="home"]::after {
  content: "Accueil";
}

/* --- BOUTON VÉRIFICATION (Loupe SVG) --- */
#checkAllPennylaneBtn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  /* Espace entre l'icône et le texte */
}

#checkAllPennylaneBtn::before {
  content: '';
  display: block;
  width: 16px;
  height: 16px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  /* Loupe Bleue */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FF8000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
}

/* --- BOUTONS ADMIN AVEC ICONES (DESIGN AMÉLIORÉ) --- */

/* 1. Style de base plus "propre" pour ces boutons spécifiques */
.btn-sub-cabinets,
.btn-connectivity,
.btn-clients,
.btn-team {
  /* <--- AJOUT ICI */
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 10px !important;
  background-color: #ffffff !important;
  color: var(--accent) !important;
  border: 1px solid var(--border) !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
  z-index: 2;
}

/* 2. Espace pour l'icône */
.btn-sub-cabinets::before,
.btn-connectivity::before,
.btn-clients::before,
.btn-team::before {   /* <--- AJOUT ICI */
  content: '';
  display: block;
  width: 16px;
  height: 16px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

/* 3. EFFET DE SURVOL (HOVER) */
.btn-sub-cabinets:hover,
.btn-connectivity:hover,
.btn-clients:hover,
.btn-team:hover {    /* <--- AJOUT ICI */
  background-color: #eff6ff !important;
  border-color: var(--accent) !important;
  color: var(--accent) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.15);
}


/* --- DÉFINITION DES ICÔNES (SVG BLEU) --- */

/* Icône Cabinets Rattachés (Organigramme) */
.btn-sub-cabinets::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FF8000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='3' width='6' height='6' rx='1'%3E%3C/rect%3E%3Cpath d='M12 9v3'%3E%3C/path%3E%3Cpath d='M8 14h8'%3E%3C/path%3E%3Cpath d='M8 14v2'%3E%3C/path%3E%3Cpath d='M16 14v2'%3E%3C/path%3E%3Crect x='5' y='16' width='6' height='6' rx='1'%3E%3C/rect%3E%3Crect x='13' y='16' width='6' height='6' rx='1'%3E%3C/rect%3E%3C/svg%3E");
}

/* Icône Connectivités (Prise) */
.btn-connectivity::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FF8000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71'%3E%3C/path%3E%3Cpath d='M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71'%3E%3C/path%3E%3C/svg%3E");
}

/* Icône Clients (Valise) */
.btn-clients::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FF8000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='7' width='20' height='14' rx='2' ry='2'%3E%3C/rect%3E%3Cpath d='M16 21V5a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16'%3E%3C/path%3E%3C/svg%3E");
}


/* Icône Clients (Valise) */
.btn-clients::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FF8000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='7' width='20' height='14' rx='2' ry='2'%3E%3C/rect%3E%3Cpath d='M16 21V5a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16'%3E%3C/path%3E%3C/svg%3E");
}

/* Icône Équipe (Groupe d'utilisateurs) */
.btn-team::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FF8000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2'%3E%3C/path%3E%3Ccircle cx='9' cy='7' r='4'%3E%3C/circle%3E%3Cpath d='M23 21v-2a4 4 0 0 0-3-3.87'%3E%3C/path%3E%3Cpath d='M16 3.13a4 4 0 0 1 0 7.75'%3E%3C/path%3E%3C/svg%3E");
}

/* --- CORRECTIF POUR LE BOUTON PLUS --- */

/* 1. Assurer l'alignement du texte et de l'icône */
.btn-plus {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  /* Espace entre l'icône et le texte */
  padding-left: 12px;
  padding-right: 16px;
}

/* 2. Créer l'espace pour l'icône (C'est ce qui manquait) */
.btn-plus::before {
  content: '';
  /* Indispensable pour que l'icône existe */
  display: block;
  width: 20px;
  height: 20px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;

  /* Icône Plus BLANCHE (stroke='%23ffffff') pour être visible sur le fond vert */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='12' y1='5' x2='12' y2='19'%3E%3C/line%3E%3Cline x1='5' y1='12' x2='19' y2='12'%3E%3C/line%3E%3C/svg%3E");
}

/* --- ICONE FILTRE (ENTONNOIR) --- */

/* 1. Ajustement du bouton pour accueillir l'icône */
.btn-filter-toggle {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  /* Espace entre icône et texte */
  padding-left: 12px !important;
  /* Un peu d'air à gauche */
}

/* 2. L'image SVG (Entonnoir Bleu) */
.btn-filter-toggle::before {
  content: '';
  display: block;
  width: 16px;
  height: 16px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;

  /* SVG Entonnoir (Funnel) */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FF8000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3'%3E%3C/polygon%3E%3C/svg%3E");
}

/* --- ICONE MISE A JOUR (SYNC) --- */

/* 1. Alignement texte/icône */
.btn-update {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  padding-left: 12px;
  padding-right: 16px;
}

/* 2. L'image SVG (Flèches circulaires Blanches) */
/* Conçu pour être utilisé sur un bouton à fond coloré (classe .btn standard) */
.btn-update::before {
  content: '';
  display: block;
  width: 18px;
  height: 18px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;

  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21.5 2v6h-6M2.5 22v-6h6M2 11.5a10 10 0 0 1 18.8-4.3M22 12.5a10 10 0 0 1-18.8 4.3'/%3E%3C/svg%3E");
}

/* --- BOUTON FERMER MODAL (Croix) --- */

#modalCloseBtn {
  /* L'emoji HTML est masqué par le font-size:0 de .iconbtn */
  /* On applique ici l'image SVG de la croix (Gris foncé) */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'%3E%3C/line%3E%3Cline x1='6' y1='6' x2='18' y2='18'%3E%3C/line%3E%3C/svg%3E");
  background-size: 20px;
}

/* Au survol : la croix devient rouge et le fond légèrement rouge */
#modalCloseBtn:hover {
  background-color: var(--danger-soft);
  border-color: var(--danger-border);
  /* Croix Rouge */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23dc2626' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'%3E%3C/line%3E%3Cline x1='6' y1='6' x2='18' y2='18'%3E%3C/line%3E%3C/svg%3E");
}

/* --- ICONE RECHERCHE (LOUPE) --- */
/* Utilisé pour le bouton à côté du champ SIREN */
.icon-search {
  /* Masque le texte éventuel (comme les autres .iconbtn) */
  font-size: 0 !important;

  /* Image SVG (Loupe gris foncé) */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
  background-size: 20px;
  background-position: center;
  background-repeat: no-repeat;
}

/* Au survol, la loupe devient bleue (couleur d'accentuation) */
.icon-search:hover:not(:disabled) {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230f766e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
  border-color: var(--accent);
  background-color: var(--accent-soft);
}

/* Icône CRM (module dynamique) */
.tab[data-tab="module-crm"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FF8000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Ccircle cx='17' cy='7' r='3'/%3E%3Cpath d='M2 21v-2a6 6 0 0 1 6-6h2a6 6 0 0 1 6 6v2'/%3E%3Cpath d='M14 13h1a5 5 0 0 1 5 5v3'/%3E%3C/svg%3E");
}


/* Tabs générés dynamiquement :
   - on affiche le texte réel (label)
   - on garde l'icône SVG via ::before
   - on désactive seulement ::after (car réservé aux tabs statiques) */
.tab.dynamic {
  font-size: 12px !important;
  color: var(--text);
}

/* On garde ::before (icône), mais on coupe ::after (label statique CSS) */
.tab.dynamic::after {
  content: none !important;
}


/* Sidebar en colonne pour pousser le footer en bas */
.sidebar {
  display: flex;
  flex-direction: column;
}

/* Footer collé en bas */
.sidebarFooter {
  margin-top: auto;
  padding: 14px 14px 16px;
  border-top: 1px solid #e2e8f0;
  background: transparent;
}

/* =================================================
   BOUTONS SIDEBAR FOOTER
   - Alignement parfait
   - Icônes SVG propres
   - Couleur uniquement au hover
   ================================================= */

/* ---- BASE COMMUNE ---- */
.sidebarFooter button.devtoolsBtn,
.sidebarFooter button.logoutBtn {
  width: 100%;

  display: grid;
  grid-template-columns: 18px 1fr 18px;
  /* icône | texte | spacer */
  align-items: center;

  padding: 12px;
  border-radius: 12px;

  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;

  cursor: pointer;
  transition: 0.15s ease;
}

/* Icône : colonne gauche */
.sidebarFooter button.devtoolsBtn::before,
.sidebarFooter button.logoutBtn::before {
  content: "";
  width: 18px;
  height: 18px;

  grid-column: 1;
  justify-self: center;

  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

/* Texte parfaitement centré */
.sidebarFooter button.devtoolsBtn,
.sidebarFooter button.logoutBtn {
  text-align: center;
}

/* -------------------------------------------------
   BOUTON OUTILS DEV (vert)
   ------------------------------------------------- */
.sidebarFooter button.devtoolsBtn {
  margin-bottom: 10px;
  background: #ffffff;
  border: 1px solid var(--border);
  color: var(--ok);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.sidebarFooter button.devtoolsBtn:hover {
  background: var(--ok);        /* Teal au lieu de vert émeraude */
  border-color: var(--ok);
  color: #ffffff;
}

.sidebarFooter button.devtoolsBtn::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230d9488' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 15l3.5 3.5a2 2 0 0 0 2.8-2.8L15 12'/%3E%3Cpath d='M12 9L8.5 5.5a2 2 0 0 0-2.8 2.8L9 12'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
}

.sidebarFooter button.devtoolsBtn:hover::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 15l3.5 3.5a2 2 0 0 0 2.8-2.8L15 12'/%3E%3Cpath d='M12 9L8.5 5.5a2 2 0 0 0-2.8 2.8L9 12'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
}

/* -------------------------------------------------
   BOUTON DÉCONNEXION (rouge)
   ------------------------------------------------- */
.sidebarFooter button.logoutBtn {
  background: #ffffff;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

.sidebarFooter button.logoutBtn:hover {
  background: #dc2626;
  border-color: #dc2626;
  color: #ffffff;
}

.sidebarFooter button.logoutBtn::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b91c1c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 17l5-5-5-5'/%3E%3Cpath d='M15 12H3'/%3E%3Cpath d='M21 4v16'/%3E%3Cpath d='M21 4H12a2 2 0 0 0-2 2v3'/%3E%3Cpath d='M10 15v3a2 2 0 0 0 2 2h9'/%3E%3C/svg%3E");
}

.sidebarFooter button.logoutBtn:hover::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 17l5-5-5-5'/%3E%3Cpath d='M15 12H3'/%3E%3Cpath d='M21 4v16'/%3E%3Cpath d='M21 4H12a2 2 0 0 0-2 2v3'/%3E%3Cpath d='M10 15v3a2 2 0 0 0 2 2h9'/%3E%3C/svg%3E");
}

/* Popover de recherche sous un <select> */
.search-select-popover {
  position: fixed;         /* important pour être stable même si scroll */
  z-index: 9999;
  background: white;
  border: 1px solid var(--border, #d0d7de);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0,0,0,.15);
  overflow: hidden;
}

.search-select-popover .head {
  padding: 10px;
  border-bottom: 1px solid var(--border, #d0d7de);
  background: #fff;
}

.search-select-popover input[type="search"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border, #d0d7de);
  outline: none;
}

.search-select-popover .list {
  max-height: 260px;
  overflow: auto;
  padding: 8px;
}

.search-select-popover .item {
  width: 100%;
  display: block;
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: #f6f8fa;
  margin: 6px 0;
  cursor: pointer;
}

.search-select-popover .item:hover {
  background: var(--accent-hover);
}

.search-select-popover .item.active {
  background: var(--accent-hover);
  border-color: var(--accent);
}

/* --- NOUVEAUX BOUTONS GESTION (SERVICES & PROFILS) --- */

/* 1. Style de base et alignement */
.btn-services,
.btn-profiles {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 10px !important;
  background-color: #ffffff !important;
  color: var(--accent) !important;
  border: 1px solid var(--border) !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
  z-index: 2;
  font-size: 11px !important;
}

/* 2. Espace pour l'icône */
.btn-services::before,
.btn-profiles::before {
  content: '';
  display: block;
  width: 16px;
  height: 16px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

/* 3. Effet de survol */
.btn-services:hover,
.btn-profiles:hover {
  background-color: #eff6ff !important;
  border-color: var(--accent) !important;
  color: var(--accent) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.15);
}

/* 4. Définition des Icônes SVG */

/* Icône Services (Liste/Tags) */
.btn-services::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FF8000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6h16M4 12h16M4 18h10'%3E%3C/path%3E%3C/svg%3E");
}

/* Icône Profils (Badge utilisateur) */
.btn-profiles::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FF8000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'%3E%3C/path%3E%3Ccircle cx='12' cy='7' r='4'%3E%3C/circle%3E%3Cpath d='M16 11h6'%3E%3C/path%3E%3C/svg%3E");
}
/* --- UI MODERNE : TOGGLES & MODULES (Admin Membres) --- */

/* 1. Toggle Switch (Interrupteur style iOS/Moderne) */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #cbd5e1; /* Gris inactif */
  transition: .3s;
  border-radius: 34px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px; width: 20px;
  left: 3px; bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* État Actif (Checked) */
.toggle-switch input:checked + .toggle-slider {
  background-color: var(--ok); /* Vert */
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(22px);
}

/* Icônes SVG internes (Check/Croix) */
.toggle-icon-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%; height: 100%;
  padding: 0 7px;
  box-sizing: border-box;
}
.toggle-svg {
  width: 10px; height: 10px; fill: white; opacity: 0; transition: 0.3s;
}
/* Afficher check si actif */
.toggle-switch input:checked + .toggle-slider .icon-check { opacity: 1; }
/* Afficher croix si inactif */
.toggle-switch input:not(:checked) + .toggle-slider .icon-cross { opacity: 1; }


/* 2. Grille des Modules (Uniformisation) */
.modules-grid {
  display: grid;
  /* Colonnes automatiques : min 180px, max flexible */
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

.module-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 46px;
}

.module-card:hover {
  border-color: var(--accent);
  background: #f8fafc;
}

.module-card.selected {
  border-color: var(--accent);
  background: var(--accent-hover); 
}

.module-card.selected .module-name {
  color: var(--accent);
  font-weight: 700;
}

.module-card input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

.module-name {
  font-size: 12px;
  line-height: 1.3;
  color: var(--text);
  font-weight: 500;
  user-select: none;
}

/* 3. Lignes Droits Admin (Layout) */
.admin-right-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
}
.admin-right-info { display: flex; flex-direction: column; }
.admin-right-title { font-weight: 700; font-size: 13px; color: var(--text); }
.admin-right-desc { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* --- FOOTER : BLOC UTILISATEUR AVEC AVATAR --- */
.footer-user-section {
  margin: 10px 0;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: row; /* Alignement horizontal Avatar | Infos */
  align-items: center;
  gap: 10px;
}

/* Nouvelle icône Avatar (Rond gris avec silhouette) */
.user-avatar {
  width: 38px;
  height: 38px;
  min-width: 38px;
  background-color: #e2e8f0;
  border-radius: 50%;
  border: 1px solid #cbd5e1;
  /* SVG Silhouette Utilisateur */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2364748b'%3E%3Cpath d='M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z'/%3E%3C/svg%3E");
  background-size: 24px;
  background-position: center;
  background-repeat: no-repeat;
}

/* Colonne de droite (Inputs) */
.user-info-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0; /* Important pour que l'input ne déborde pas */
}

.footer-user-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  min-height: 20px;
}

.footer-user-row input {
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  width: 100%;
  padding: 2px 0;
  box-shadow: none !important;
  outline: none;
  text-overflow: ellipsis; /* Coupe le texte proprement si trop long */
}

/* Email plus discret */
.footer-user-row.read-only-row input {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

/* Mode édition du nom : fond blanc */
.footer-user-row input:not([readonly]) {
  background: white;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--accent);
}

/* --- BOUTON CRAYON (Ajustement) --- */
#editUserBtn {
  /* Réinitialisation */
  font-size: 0 !important;
  min-width: 24px;
  height: 24px;
  border: none;
  background-color: transparent;
  cursor: pointer;
  border-radius: 4px;
  opacity: 0.6;
  transition: opacity 0.2s;
  
  /* SVG Crayon */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z'%3E%3C/path%3E%3C/svg%3E");
  background-size: 14px;
  background-repeat: no-repeat;
  background-position: center;
}

#editUserBtn:hover {
  opacity: 1;
  background-color: #f1f5f9;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FF8000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z'%3E%3C/path%3E%3C/svg%3E");
}

/* Mode Validation (Check Vert) */
#editUserBtn.editing-mode {
  opacity: 1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230d9488' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
}


/* =========================
   AUTH OVERLAY – BOUTONS OTP
   ========================= */

#authOverlay .authActions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* --- VALIDER : petit, à gauche --- */
#authOverlay .btn-validate {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 800;
  border-radius: 8px;
  background: var(--ok);
}

/* --- ENVOYER / RENVOYER : petit, à droite, orange --- */
#authOverlay .btn-resend {
  margin-left: auto;          /* pousse à droite */
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;

  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
}

#authOverlay .btn-resend:hover {
  background: #ff9a33;
}
