﻿/* ================================================================
   IRITEL Compétences — styles.css
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  /* Palette IRITEL */
  --red:     #D71920;
  --red-d:   #B8151B;
  --red-bg:  #FEF2F2;
  --dark:    #1F2933;

  /* Surfaces */
  --bg:      #F5F6F8;
  --surface: #FFFFFF;
  --bg-alt:  #F8FAFC;

  /* Typographie */
  --text:    #1F2933;
  --muted:   #6B7280;
  --subtle:  #9CA3AF;

  /* Bordures */
  --border:  #E5E7EB;
  --line:    #E5E7EB;

  /* Aliases sémantiques (utilisés par les composants drawer, badges) */
  --ink:     #1F2933;
  --primary: #D71920;
  --danger:  #DC2626;

  /* Bleu d'accent (secondaire — liens, focus ring) */
  --accent:   #2563EB;
  --accent-d: #1D4ED8;

  /* Ombres */
  --shadow-xs: 0 1px 2px rgba(0,0,0,.04);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.04), 0 2px 6px rgba(0,0,0,.04);
  --shadow-md: 0 4px 14px rgba(0,0,0,.08), 0 1px 3px rgba(0,0,0,.04);

  /* Ombres cartes org */
  --sh-director: 0 2px 12px rgba(0,0,0,.08), 0 1px 3px rgba(0,0,0,.04);
  --sh-team:     0 1px 6px rgba(0,0,0,.05),  0 1px 2px rgba(0,0,0,.03);
  --sh-emp:      0 1px 3px rgba(0,0,0,.04),  0 1px 6px rgba(0,0,0,.03);

  /* Rayon */
  --radius:    .75rem;
  --r-card:    .875rem;
  --r-card-lg: 1rem;

  /* Hauteur header */
  --topbar: 64px;
}

/* ── Reset ──────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  padding-top: var(--topbar);
  font-family: Inter, system-ui, -apple-system, sans-serif;
  font-size: .9375rem;
  line-height: 1.55;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ================================================================
   TOPBAR — 60px, fond blanc
   ================================================================ */

.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar);
  display: flex;
  align-items: center;
  gap: .875rem;
  padding: 0 1.5rem;
  background: #FFFFFF;
  z-index: 50;
  border-top: 3px solid var(--red);
  border-bottom: 3px solid var(--red);
  box-shadow: 0 1px 3px rgba(0,0,0,.18);
}

/* ── 1. Logo ──────────────────────────────────────────────────── */
.topbar-brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
}
.brand-logo {
  width: 148px;
  height: auto;
  max-width: none;
  display: block;
  object-fit: contain;
}

/* Séparateur vertical */
.topbar-sep {
  width: 1px;
  height: 24px;
  background: var(--border);
  flex-shrink: 0;
}

/* ── 2. Barre de recherche ────────────────────────────────────── */
.topbar-search-wrap {
  position: relative;
  width: 260px;
  flex-shrink: 0;
}
.topbar-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--subtle);
  pointer-events: none;
  z-index: 1;
}
.topbar-search-input {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 36px;
  padding: 0 .75rem 0 2.125rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: .8375rem;
  line-height: 36px;
  outline: none;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.topbar-search-input::placeholder { color: var(--subtle); }
.topbar-search-input:focus {
  background: #fff;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(215,25,32,.09);
}
/* Supprimer les décorations natives du navigateur sur type="search" */
.topbar-search-input::-webkit-search-decoration,
.topbar-search-input::-webkit-search-cancel-button,
.topbar-search-input::-webkit-search-results-button,
.topbar-search-input::-webkit-search-results-decoration {
  -webkit-appearance: none;
  display: none;
}

/* ── 3. Navigation ────────────────────────────────────────────── */
.topbar-nav {
  display: flex;
  align-items: center;
  gap: .125rem;
  height: 100%;
}
.topbar-nav-link {
  position: relative;
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 .75rem;
  color: var(--muted);
  font-size: .875rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: color .15s;
  border-radius: 0;
}
.topbar-nav-link.active        { color: var(--text); font-weight: 600; }
.topbar-nav-link:hover         { color: var(--text); text-decoration: none; }

/* ── 4. Utilisateur ───────────────────────────────────────────── */
.topbar-user {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-left: auto;
  flex-shrink: 0;
  padding: .3rem .5rem;
  border-radius: .5rem;
  cursor: default;
  transition: background .12s;
}
.topbar-user:hover { background: var(--bg-alt); }

.topbar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #FEF2F2;
  color: var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .73rem;
  flex-shrink: 0;
  letter-spacing: .01em;
  border: 1px solid #FECACA;
}
.topbar-user-info {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.topbar-user-name {
  font-size: .8125rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  line-height: 1.3;
}
.topbar-user-role {
  font-size: .7rem;
  color: var(--muted);
  white-space: nowrap;
  line-height: 1.3;
}

/* ── 5. Bouton Déconnexion ────────────────────────────────────── */
.topbar-logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .12s, color .12s;
}
.topbar-logout-btn svg { width: 16px; height: 16px; }
.topbar-logout-btn span { display: none; }
.topbar-logout-btn:hover {
  background: var(--bg-alt);
  color: var(--text);
}

/* ================================================================
   MISE EN PAGE
   ================================================================ */

.container {
  width: min(1180px, calc(100% - 2rem));
  margin: 1.5rem auto 4rem;
}
.container--wide { width: calc(100% - 3rem); max-width: none; }

.tree-canvas {
  position: relative;
  width: 100%;
  padding: 0;
  min-height: calc(100vh - var(--topbar));
  overflow: hidden;
}
.tree-canvas::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url('images/tree-background.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 0;
}



/* ── Barre d'outils secondaire — page arborescence ──────────── */

.tree-toolbar {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  height: 48px;
  padding: 0 2rem;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 3px solid var(--red);
  box-shadow: 0 2px 6px rgba(0,0,0,.03);
}

.tree-toolbar-left {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-shrink: 0;
}

.tree-toolbar-right {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-shrink: 0;
}

/* Séparateur vertical */
.ttb-sep {
  display: inline-block;
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 .375rem;
  flex-shrink: 0;
}

/* Bouton texte compact */
.ttb-btn {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  height: 32px;
  padding: 0 .8rem;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: .8125rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s, border-color .12s, color .12s, box-shadow .12s;
  flex-shrink: 0;
}
.ttb-btn:hover { background: var(--bg-alt); border-color: #CBD5E1; color: var(--text); text-decoration: none; }

.ttb-btn--add {
  background: transparent;
  border-color: var(--red);
  color: var(--red);
  font-weight: 600;
  letter-spacing: .01em;
}
.ttb-btn--add:hover {
  background: rgba(215,25,32,.08);
  border-color: var(--red-d);
  color: var(--red-d);
  text-decoration: none;
}

/* Bouton icône seule */
.ttb-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
  flex-shrink: 0;
}
.ttb-icon-btn:hover { background: var(--bg-alt); color: var(--text); border-color: #CBD5E1; }


/* Barre de recherche organigramme */
.ttb-search {
  position: relative;
  width: 288px;
}
.ttb-search-icon {
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  width: 13px;
  height: 13px;
  color: var(--subtle);
  pointer-events: none;
}
.ttb-search-input {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 32px;
  padding: 0 .6rem 0 2rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  font: inherit;
  font-size: .8125rem;
  color: var(--text);
  outline: none;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.ttb-search-input::placeholder { color: var(--subtle); }
.ttb-search-input:focus {
  background: #fff;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(215,25,32,.08);
}
.ttb-search-input::-webkit-search-decoration,
.ttb-search-input::-webkit-search-cancel-button,
.ttb-search-input::-webkit-search-results-button,
.ttb-search-input::-webkit-search-results-decoration {
  -webkit-appearance: none;
  display: none;
}

/* Bouton × pour vider la recherche */
.ttb-search-clear {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--border);
  border: none;
  border-radius: 4px;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  transition: background .12s, color .12s;
  flex-shrink: 0;
}
.ttb-search-clear:hover {
  background: #CBD5E1;
  color: var(--text);
}
/* Padding supplémentaire pour ne pas que le texte passe sous le × */
.ttb-search.has-value .ttb-search-input {
  padding-right: 1.875rem;
}

/* Compteur de résultats */
.tree-search-status {
  margin: 0 0 .875rem;
  font-size: .84rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: .625rem;
  min-height: 1.4rem;
}

.tree-search-status-clear {
  display: inline-flex;
  align-items: center;
  padding: .18rem .55rem;
  border: 1px solid var(--border);
  border-radius: .375rem;
  background: transparent;
  font: inherit;
  font-size: .76rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: background .12s, color .12s;
}
.tree-search-status-clear:hover { background: var(--bg-alt); color: var(--text); }

/* Cartes atténuées lors d'une recherche active */
.org-emp-card.tree-dim {
  opacity: .14;
  pointer-events: none;
}
.org-emp-card { transition: opacity .2s ease, box-shadow .18s ease, border-color .18s ease, transform .15s ease; }

/* Contenu principal — zone de défilement sans scrollbars visibles */
.tree-canvas-content {
  position: relative;
  z-index: 1;
  padding: 0;
  height: calc(100vh - var(--topbar) - 48px);
  overflow: auto;
  cursor: grab;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.tree-canvas-content::-webkit-scrollbar { display: none; }
.tree-canvas-content.is-panning        { cursor: grabbing; }
/* Curseur normal sur les éléments interactifs */
.tree-canvas-content .org-emp-card,
.tree-canvas-content button,
.tree-canvas-content a { cursor: pointer; }

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

h1 { margin: 0 0 .25rem; font-size: clamp(1.35rem, 3.5vw, 1.875rem); font-weight: 700; line-height: 1.25; }
h2 { margin: 0 0 .75rem; font-size: 1.05rem; font-weight: 600; }
h3 { margin-bottom: .4rem; }
p  { margin: 0 0 .5rem; }
.muted { color: var(--muted); font-size: .875rem; }

/* ================================================================
   COMPOSANTS GÉNÉRIQUES
   ================================================================ */

.card, .panel, .auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card { padding: 1rem; display: flex; flex-direction: column; gap: .3rem; }
.metric { font-size: 1.75rem; font-weight: 800; color: var(--dark); }
.panel  { padding: 1rem; margin-bottom: 1rem; overflow-x: auto; }

.cards { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: .9rem; margin-bottom: 1rem; }
.cards.compact { grid-template-columns: repeat(3,minmax(0,1fr)); }
.grid { display: grid; gap: 1rem; }
.grid.two { grid-template-columns: repeat(2,minmax(0,1fr)); }

/* ── Boutons ─────────────────────────────────────────────────── */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  padding: .5rem .875rem;
  border: 1px solid var(--border);
  border-radius: .5rem;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background .12s, border-color .12s;
  white-space: nowrap;
}
.button:hover { background: var(--bg-alt); text-decoration: none; }
.button.primary { background: var(--red); border-color: var(--red); color: #fff; font-weight: 600; }
.button.primary:hover { background: var(--red-d); border-color: var(--red-d); }
.button.iritel { background: var(--red); border-color: var(--red); color: #fff; font-weight: 600; }
.button.iritel:hover { background: var(--red-d); border-color: var(--red-d); text-decoration: none; }
.button.danger { background: #DC2626; border-color: #DC2626; color: #fff; }
.button.danger:hover { background: #B91C1C; border-color: #B91C1C; text-decoration: none; }
.button.danger-outline { background: transparent; border-color: #FECACA; color: #DC2626; }
.button.danger-outline:hover { background: #FEF2F2; border-color: #FCA5A5; text-decoration: none; }

/* Bouton générique dans les formulaires */
button:not(.topbar-logout-btn):not(.drawer-close):not(.accordion-toggle):not(.comp-remove-btn):not(.expertise-remove-btn):not(.comp-add-btn):not(.btn-retirer):not(.expertise-add-btn):not(.button--green):not(.danger-outline):not(.arch-modal-confirm-btn):not(.arch-modal-delete-btn):not(.plan-action-btn) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .5rem .875rem;
  border: 1px solid var(--border);
  border-radius: .5rem;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .12s;
  white-space: nowrap;
}
button:not(.topbar-logout-btn):not(.drawer-close):not(.accordion-toggle):not(.comp-remove-btn):not(.expertise-remove-btn):not(.comp-add-btn):not(.btn-retirer):not(.expertise-add-btn):not(.button--green):not(.danger-outline):not(.arch-modal-confirm-btn):not(.arch-modal-delete-btn):not(.plan-action-btn):hover { background: var(--bg-alt); }

/* ── Boutons dans les pages planning/chantiers uniquement ─────── */
.plan-page .button {
  border: 1.5px solid var(--red);
  background: transparent;
  color: var(--red);
  font-size: .82rem;
  border-radius: 7px;
  padding: .42rem .9rem;
}
.plan-page .button:hover { background: rgba(215,25,32,.08); text-decoration: none; }
.plan-page .button.iritel { background: transparent; border-color: var(--ink); color: var(--ink); font-weight: 600; }
.plan-page .button.iritel:hover { background: rgba(0,0,0,.06); border-color: var(--ink); color: var(--ink); }
.plan-page .button.danger { background: #DC2626; border-color: #DC2626; color: #fff; }
.plan-page .button.danger:hover { background: #B91C1C; border-color: #B91C1C; }
.plan-page .button.danger-outline { background: transparent; border-color: #DC2626; color: #DC2626; }
.plan-page .button.danger-outline:hover { background: #FEF2F2; }

/* Bouton principal page utilisateurs */
.users-page .button.iritel { background: transparent; border-color: var(--red); color: var(--red); font-weight: 600; }
.users-page .button.iritel:hover { background: rgba(215,25,32,.08); border-color: var(--red-d); color: var(--red-d); text-decoration: none; }

/* Messages flash — toast fixe sous la topbar */
.messages {
  position: fixed;
  top: calc(var(--topbar) + .875rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 9500;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  width: max-content;
  max-width: calc(100vw - 2rem);
  pointer-events: none;
}
.message {
  padding: .6rem 1.25rem;
  border-radius: .625rem;
  border: 1.5px solid var(--border);
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(8px);
  font-size: .875rem;
  font-weight: 500;
  color: var(--text);
  opacity: 1;
  transition: opacity .45s ease;
  pointer-events: auto;
}
.message.success { border-color: #16a34a; color: #166534; }
.message.error   { border-color: #dc2626; color: #991b1b; }
.message.warning { border-color: #d97706; color: #92400e; }
.message--fade   { opacity: 0 !important; }

/* Tableaux */
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
th, td {
  border-bottom: 1px solid var(--border);
  padding: .6rem .55rem;
  text-align: left;
  vertical-align: top;
}
th { color: var(--muted); font-weight: 600; font-size: .73rem; text-transform: uppercase; letter-spacing: .04em; }

/* Badges / chips */
.chip {
  display: inline-flex;
  align-items: center;
  padding: .2rem .55rem;
  border-radius: 999px;
  background: #EEF2FF;
  color: #3730A3;
  font-size: .78rem;
  margin: .1rem;
}
.chip--primary { background: #DBEAFE; color: var(--accent-d); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: .25rem; }
.badge { display: inline-flex; align-items: center; padding: .2rem .55rem; border-radius: 999px; font-size: .78rem; }
.badge.ok { background: #dcfce7; color: #166534; }

.timeline { padding-left: 1rem; }
.timeline li { margin-bottom: .75rem; }

/* Formulaires */
.filters {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: .75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1rem;
}
label { display: block; font-weight: 600; font-size: .8375rem; margin-bottom: .2rem; color: #374151; }
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="search"]),
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: .5rem;
  padding: .55rem .75rem;
  font: inherit;
  font-size: .875rem;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="search"]):focus,
select:focus,
textarea:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(215,25,32,.08);
}
textarea { resize: vertical; }

.auth-card { max-width: 420px; margin: 3rem auto; padding: 1.5rem; }
.line-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; }
.line-card { border: 1px solid var(--border); background: var(--bg-alt); border-radius: .75rem; padding: 1rem; }

.sticky-actions {
  position: sticky;
  bottom: 1rem;
  display: flex;
  gap: .6rem;
  justify-content: flex-end;
  background: rgba(255,255,255,.92);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .7rem;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(6px);
}

/* ================================================================
   BADGES NIVEAUX — compétences & expertise
   ================================================================ */

.level-badge {
  display: inline-flex;
  align-items: center;
  padding: .16rem .5rem;
  border-radius: 999px;
  font-size: .71rem;
  font-weight: 600;
  white-space: nowrap;
}
.level-seen_assisted  { background: #F1F5F9; color: #475569; }
.level-done_with_help { background: #DBEAFE; color: #1E40AF; }
.level-done_alone     { background: #D1FAE5; color: #065F46; }
.level-confirmed      { background: #FEF3C7; color: #92400E; }
.level-referent       { background: #EDE9FE; color: #5B21B6; }

.expertise-beginner  { background: #F1F5F9; color: #475569; }
.expertise-confirmed { background: #D1FAE5; color: #065F46; }
.expertise-certified { background: #FEF3C7; color: #92400E; }

/* ================================================================
   FICHE SALARIÉ — section compétences
   ================================================================ */

.detail-row {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  margin-bottom: .85rem;
  flex-wrap: wrap;
}
.detail-label {
  font-size: .78rem;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  padding-top: .28rem;
  min-width: 140px;
  flex-shrink: 0;
}
.skill-levels-list { flex: 1; display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.skill-level-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .38rem .6rem;
  background: var(--bg);
  border-radius: .45rem;
}
.skill-level-name { font-size: .86rem; }

/* ================================================================
   ANIMATIONS
   ================================================================ */

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

/* ================================================================
   ORG CHART — ARBORESCENCE
   ================================================================ */

/* .tree-page-header supprimé — remplacé par .tree-toolbar */
.tree-empty {
  text-align: center;
  margin-top: 2.5rem;
  color: var(--muted);
  font-size: .9rem;
}

.org-chart {
  padding: 0 0 3rem;
  overflow-x: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ── Niveau 0 : carte IRITEL ─────────────────────────────────── */

.org-root {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.org-company-card {
  background: var(--surface);
  border-radius: .875rem;
  box-shadow: 0 2px 10px rgba(0,0,0,.07), 0 1px 3px rgba(0,0,0,.04);
  overflow: hidden;
  min-width: 280px;
  border: 1px solid rgba(0,0,0,.06);
}

.org-company-logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.375rem 1.5rem 1rem;
  background: var(--surface);
}

.company-logo {
  width: 220px;
  max-width: 90%;
  height: auto;
  display: block;
  object-fit: contain;
}

.org-company-ribbon {
  background: var(--red);
  color: #fff;
  text-align: center;
  padding: .35rem 1rem;
  font-size: .76rem;
  font-weight: 600;
  letter-spacing: .03em;
}
.ribbon-sep { margin: 0 .4rem; opacity: .6; }

/* Traits de liaison */
.org-trunk {
  width: 2px;
  height: 3rem;
  background: #CBD5E1;
  border-radius: 1px;
}

/* ── Niveau 0 : directeurs associés ─────────────────────────── */

.org-directors {
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.org-director-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 4rem 2px;
}

.org-director-wrap::before {
  content: '';
  position: absolute;
  bottom: 0; left: 50%; right: 0;
  height: 2px;
  background: #CBD5E1;
  border-radius: 1px;
}
.org-director-wrap::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 50%;
  height: 2px;
  background: #CBD5E1;
  border-radius: 1px;
}
.org-director-wrap:first-child::after { display: none; }
.org-director-wrap:last-child::before { display: none; }

.org-director-card {
  background: var(--surface);
  border: 1px solid #E2E8F0;
  border-radius: var(--r-card-lg);
  padding: 1rem 1.375rem;
  display: flex;
  align-items: center;
  gap: .875rem;
  min-width: 230px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  transition: box-shadow .2s ease, transform .2s ease;
}
.org-director-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.08), 0 1px 4px rgba(0,0,0,.04);
  transform: translateY(-1px);
}

.org-director-avatar {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .8rem;
  flex-shrink: 0;
  letter-spacing: .02em;
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
}

.org-director-body { display: flex; flex-direction: column; gap: .1rem; }
.org-director-name { font-weight: 700; font-size: .9rem; color: var(--text); white-space: nowrap; }
.org-director-role { font-size: .73rem; color: var(--muted); white-space: nowrap; font-weight: 400; }

/* ── Niveau 1 : équipes ───────────────────────────────────────── */

.org-teams {
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.org-branch {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2px 2.5rem 0;
}

.org-branch::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 50%;
  height: 1px;
  background: #E2E8F0;
}
.org-branch::after {
  content: '';
  position: absolute;
  top: 0; left: 50%; right: 0;
  height: 1px;
  background: #E2E8F0;
}
.org-branch:first-child::before { display: none; }
.org-branch:last-child::after   { display: none; }

.org-vtick {
  width: 2px;
  height: 2rem;
  background: #CBD5E1;
  flex-shrink: 0;
  border-radius: 1px;
}

/* Carte équipe */
.org-team-card {
  background: var(--surface);
  border: 1px solid #E5E7EB;
  border-radius: var(--r-card-lg);
  padding: .875rem 1.5rem 1rem;
  text-align: center;
  min-width: 220px;
  max-width: 290px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
  transition: box-shadow .2s ease, transform .2s ease;
}
.org-team-card:hover {
  box-shadow: 0 4px 18px rgba(0,0,0,.09), 0 1px 3px rgba(0,0,0,.04);
  transform: translateY(-2px);
}
.org-team-icon {
  width: 1.75rem; height: 1.75rem;
  border-radius: .45rem;
  background: var(--red-bg);
  color: var(--red);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto .5rem;
}
.org-team-icon svg { width: 13px; height: 13px; }
.org-team-name    { font-weight: 700; font-size: .875rem; color: var(--text); }
.org-team-manager { font-size: .74rem; color: var(--muted); margin-top: .15rem; }
.org-team-count   {
  display: inline-flex; align-items: center; gap: .3rem;
  margin-top: .5rem;
  background: var(--bg);
  color: var(--muted);
  font-size: .71rem; font-weight: 600;
  padding: .18rem .55rem;
  border-radius: 999px;
}

/* Colonne de cartes salariés */
.org-employees-col {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  min-width: 250px;
  max-width: 310px;
}

/* ── Carte salarié ─────────────────────────────────────────────── */

.org-emp-card {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  background: var(--surface);
  border: 2px solid #111111;
  border-radius: .75rem;
  padding: .875rem 1rem;
  text-decoration: none;
  color: var(--text);
  box-shadow: 0 0 0 1px #C0392B, 0 2px 6px rgba(0,0,0,.07);
  transition:
    box-shadow .22s cubic-bezier(.2, 0, 0, 1),
    transform  .22s cubic-bezier(.2, 0, 0, 1),
    border-color .15s ease;
  cursor: pointer;
  font: inherit;
  text-align: left;
  width: 100%;
}
.org-emp-card:hover {
  box-shadow: 0 0 0 1.5px #C0392B, 0 8px 24px rgba(0,0,0,.13), 0 2px 8px rgba(0,0,0,.07);
  border-color: #000;
  transform: translateY(-4px);
  text-decoration: none;
}
.org-emp-card:active {
  transform: translateY(-1px);
  box-shadow: 0 0 0 1.5px #C0392B, 0 2px 8px rgba(0,0,0,.1);
  transition-duration: .08s;
}

/* Avatar initiales */
.org-avatar {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .8rem;
  background: #334155;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: .02em;
}

/* Niveaux 1-7 — utilisés partout (org-chart, drawer) */
.lv1, .lv2, .lv3, .lv4, .lv5, .lv6, .lv7,
.org-lv1, .org-lv2, .org-lv3, .org-lv4, .org-lv5, .org-lv6, .org-lv7 {
  background: #F1F5F9;
  color: #475569;
}

.org-emp-body { flex: 1; min-width: 0; padding-top: .05rem; }
.org-emp-name {
  font-weight: 700;
  font-size: .875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
  color: var(--text);
}
.org-emp-meta {
  font-size: .74rem;
  color: var(--muted);
  margin-top: .125rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 400;
}

.org-level-pill {
  font-size: .7rem;
  font-weight: 600;
  color: #64748B;
  background: #F1F5F9;
  padding: .1rem .4rem;
  border-radius: .3rem;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: .01em;
  border: 1px solid #E2E8F0;
}

.org-emp-empty {
  font-size: .82rem;
  color: var(--muted);
  text-align: center;
  padding: .8rem;
  border: 1px dashed var(--border);
  border-radius: var(--r-card);
}

/* ── Grille salariés (vue directe, sans équipes) ─────────────── */

.org-employees-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1rem;
  width: 100%;
  max-width: 1200px;
  padding: 0;
}

/* ── Arborescence org chart ─────────────────────────────────── */

/* Conteneur principal : position relative pour le SVG overlay */
.org-chart-v2 {
  position: relative;
  display: block;
  padding: 0;
  overflow: visible;
  width: 100%;
}

/* Chaque niveau hiérarchique */
.org-level-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Espacement vertical entre niveaux (espace pour les lignes SVG) */
.org-level-wrap + .org-level-wrap {
  margin-top: 52px;
}

/* Rangée de cartes dans un niveau */
.org-level-cards {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
}

/* Cartes dans l'arborescence : largeur uniforme */
.org-level-cards .org-emp-card {
  min-width: 240px;
  max-width: 300px;
  flex: 1 1 240px;
}

/* Overlay SVG des lignes de connexion */
.org-svg-lines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  overflow: visible;
  pointer-events: none;
}

/* ── Arborescence récursive parent → enfants ─────────────────── */

/* Conteneur d'un nœud : structure sémantique, layout géré par JS */
.org-node {
  display: block;
}

/* Wrapper des enfants : hors flux, positions calculées par JS */
.org-node-children {
  display: block;
  position: static;
  margin-top: 0;
}

/* Taille uniforme des cartes dans les nœuds */
.org-node > .org-emp-card {
  min-width: 240px;
  max-width: 240px;
  width: 240px;
  min-height: 100px;
  flex: none;
}

.org-node > .org-director-card {
  flex-shrink: 0;
}


/* ── Badges (niveau + domaines) en bas de la zone texte ─────── */
.org-emp-badges {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
  margin-top: .5rem;
}

/* Badge domaine CFO / CFA */
.org-domain-badge {
  font-size: .7rem;
  font-weight: 600;
  padding: .1rem .4rem;
  border-radius: .3rem;
  white-space: nowrap;
  letter-spacing: .01em;
  background: #F1F5F9;
  color: #64748B;
  border: 1px solid #E2E8F0;
}
.org-domain-cfo { background: #EFF6FF; color: #1D4ED8; border-color: #BFDBFE; }
.org-domain-cfa { background: #F0FDF4; color: #15803D; border-color: #BBF7D0; }

/* ── Séparateur de niveau dans la grille ─────────────────────── */
.org-level-divider {
  display: flex;
  align-items: center;
  gap: .75rem;
  grid-column: 1 / -1;
  margin: .25rem 0 0;
}
.org-level-divider-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  white-space: nowrap;
}
.org-level-divider-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ================================================================
   FICHE SALARIÉ — PROFIL
   ================================================================ */

.profile-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card-lg);
  box-shadow: var(--sh-director);
  padding: 1.75rem 2rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.profile-header-main {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-width: 0;
}

.profile-avatar {
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.35rem;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: 0;
  box-shadow: 0 3px 12px rgba(0,0,0,.15);
}

.profile-identity { min-width: 0; }

.profile-name {
  margin: 0 0 .2rem;
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.profile-meta {
  margin: 0 0 .65rem;
  font-size: .875rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .3rem;
}

.profile-sep { opacity: .4; }

.profile-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem;
}

.profile-level-tag {
  display: inline-flex;
  align-items: center;
  padding: .2rem .55rem;
  border-radius: 999px;
  font-size: .73rem;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
}


.profile-domain-tag {
  display: inline-flex;
  align-items: center;
  padding: .2rem .6rem;
  border-radius: 999px;
  font-size: .73rem;
  font-weight: 700;
  letter-spacing: .02em;
}
.profile-domain-cfo { background: #EFF6FF; color: #1D4ED8; }
.profile-domain-cfa { background: #F0FDF4; color: #15803D; }

.profile-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.profile-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.profile-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.profile-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--sh-emp);
}

.profile-section--full { grid-column: 1 / -1; }

.profile-section-title {
  margin: 0 0 .875rem;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: .6rem;
  border-bottom: 1px solid var(--border);
}

.profile-section-empty {
  margin: 0;
  font-size: .875rem;
  color: var(--muted);
  font-style: italic;
}

.profile-fields {
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

.profile-field {
  display: flex;
  align-items: baseline;
  gap: .75rem;
}

.profile-field--full { align-items: flex-start; flex-direction: column; gap: .25rem; }

.profile-field-label {
  font-size: .73rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  min-width: 120px;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.profile-field--full .profile-field-label { min-width: 0; }

.profile-field-value {
  font-size: .875rem;
  color: var(--text);
  word-break: break-word;
}

.profile-field-empty {
  font-size: .875rem;
  color: #C4C9D4;
  font-style: italic;
}

.profile-domains { display: flex; flex-direction: column; gap: .5rem; }

.domain-card {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem .875rem;
  border-radius: .625rem;
  border: 1.5px solid;
}
.domain-card--cfo { border-color: #BFDBFE; background: #EFF6FF; }
.domain-card--cfa { border-color: #BBF7D0; background: #F0FDF4; }

.domain-card-code {
  font-size: .95rem;
  font-weight: 800;
  letter-spacing: .04em;
  flex-shrink: 0;
}
.domain-card--cfo .domain-card-code { color: #1D4ED8; }
.domain-card--cfa .domain-card-code { color: #15803D; }

.domain-card-name {
  font-size: .84rem;
  font-weight: 500;
  color: var(--text);
}

/* ================================================================
   MATRICE DE COMPÉTENCES
   ================================================================ */

.matrix-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .65rem;
  margin-bottom: 1rem;
  font-size: .8rem;
  color: var(--muted);
}
.matrix-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  background: #fff;
}
.matrix-table {
  border-collapse: collapse;
  font-size: .8rem;
  min-width: 600px;
}
.matrix-table th, .matrix-table td {
  border: 1px solid var(--border);
  padding: .4rem .45rem;
  vertical-align: middle;
}
.matrix-th-emp {
  background: var(--bg-alt);
  white-space: nowrap;
  position: sticky; left: 0; z-index: 2;
  min-width: 140px;
}
.matrix-th-team  { background: var(--bg-alt); white-space: nowrap; min-width: 100px; }
.matrix-th-skill { background: var(--bg-alt); text-align: center; min-width: 52px; }
.matrix-skill-label {
  display: block;
  font-size: .7rem;
  font-weight: 600;
  color: var(--muted);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  height: 82px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 66px;
}
.matrix-td-emp {
  position: sticky; left: 0;
  background: #fff; z-index: 1;
  font-weight: 600; white-space: nowrap;
}
.matrix-td-team { color: var(--muted); white-space: nowrap; }
.matrix-td-cell { text-align: center; }
.matrix-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 17px;
  border-radius: 3px;
  font-size: .64rem;
  font-weight: 700;
}

/* ================================================================
   GESTION SALARIÉS — formulaires & actions
   ================================================================ */

/* .tree-toolbar est défini dans le bloc "Barre d'outils secondaire" ci-dessus */

.page-header-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}

.form-page {
  display: flex;
  justify-content: center;
  padding: 2rem 1rem 4rem;
}

.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 2px solid var(--red);
  border-radius: var(--r-card-lg);
  box-shadow: var(--shadow-md);
  width: 100%;
  max-width: 640px;
  overflow: hidden;
}

/* ── Formulaire salarié pleine largeur ────────────────────────── */
.empf-page {
  padding: 1.5rem 2rem 4rem;
  max-width: 1400px;
  margin: 0 auto;
}

.empf-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.empf-title {
  margin: 0 0 .2rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

.empf-sub {
  margin: 0;
  font-size: .8125rem;
  color: #374151;
}

.empf-header-actions {
  display: flex;
  gap: .6rem;
  flex-shrink: 0;
}

.empf-btn {
  display: inline-flex;
  align-items: center;
  padding: .5rem 1.25rem;
  border-radius: .5rem;
  font-size: .875rem;
  font-weight: 600;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, border-color .15s;
}
.empf-btn:hover { background: var(--bg-alt); border-color: #CBD5E1; text-decoration: none; }
.empf-btn--primary {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}
.empf-btn--primary:hover { background: var(--red-d); border-color: var(--red-d); }

.empf-body {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 1.25rem;
  align-items: start;
}
@media (max-width: 900px) {
  .empf-body { grid-template-columns: 1fr; }
}

.empf-col { display: flex; flex-direction: column; gap: 1.25rem; }

.empf-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
}

.empf-card-title {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: #374151;
  margin: 0 0 1rem;
  padding-bottom: .6rem;
  border-bottom: 1px solid var(--border);
}

.empf-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .875rem 1.25rem;
}

.empf-group {
  display: flex;
  flex-direction: column;
  gap: .3rem;
}

.empf-group--full { grid-column: 1 / -1; }

.empf-group label,
.empf-group > label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text);
}

.empf-field-error {
  font-size: .75rem;
  color: #DC2626;
  margin: .15rem 0 0;
}

.empf-hint {
  font-size: .8rem;
  color: #374151;
  margin: .3rem 0 0;
}

.empf-global-error {
  background: var(--red-bg);
  border: 1px solid #FECACA;
  border-radius: .5rem;
  padding: .6rem .875rem;
  margin-bottom: 1rem;
  font-size: .8375rem;
  color: #991B1B;
}

.empf-photo-preview {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: .875rem;
}

.empf-photo-img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}

.empf-photo-hint {
  font-size: .78rem;
  color: var(--muted);
}

/* ── Sélecteur hiérarchique de compétences ────────────────────── */
.fc-domain {
  margin-bottom: 1.125rem;
}
.fc-domain:last-child { margin-bottom: 0; }

.fc-domain-hdr {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: .6rem;
}

.fc-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .12rem .5rem;
  border-radius: 4px;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .06em;
  color: #fff;
  min-width: 2rem;
  text-align: center;
  flex-shrink: 0;
}
.fc-pill--cfo    { background: #2563EB; }
.fc-pill--cfa    { background: #16A34A; }
.fc-pill--skills { background: #7C3AED; }
.fc-pill--hab    { background: #D97706; }

.fc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}

.fc-chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .4rem .8rem;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  font-size: .82rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  user-select: none;
  transition: border-color .15s, background .15s, color .15s;
}
.fc-chip:hover { border-color: #94A3B8; background: var(--bg-alt); }
.fc-chip:has(input:checked) {
  border-color: var(--red);
  background: var(--red-bg);
  color: var(--red);
  font-weight: 600;
}
.fc-chip input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--red);
  cursor: pointer;
  margin: 0;
  flex-shrink: 0;
}

/* Panneau de sous-classes propre à chaque sous-lot */
.fc-sublot-skills {
  border-left: 3px solid var(--red);
  background: #FFF8F8;
  border-radius: 0 .5rem .5rem 0;
  padding: .55rem .75rem .55rem .875rem;
  margin: .25rem 0 .25rem 1rem;
}
.fc-sublot-skills-label {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  color: var(--red);
  margin-bottom: .375rem;
  letter-spacing: .02em;
}

/* Groupe sous-lot → sous-classes dans le panneau salarié */
.panel-skill-group {
  margin-bottom: .75rem;
}
.panel-skill-group:last-child { margin-bottom: 0; }
.panel-skill-group-title {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .78rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: .35rem;
}

.fc-chip--skill:has(input:checked) {
  border-color: #7C3AED;
  background: #F5F3FF;
  color: #5B21B6;
}

.form-card--warning { border-top: 3px solid #DC2626; }

.form-card-header {
  padding: 1.5rem 2rem 1.125rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
}

.form-card-title {
  margin: 0 0 .2rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.form-card-sub {
  margin: 0;
  font-size: .8125rem;
  color: var(--muted);
}

.form-body { padding: 1.75rem 2rem; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.5rem;
  margin-bottom: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: .3rem;
}

.form-group--full { grid-column: 1 / -1; }

.form-group label {
  font-size: .8rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0;
}

.form-field-error {
  margin: .2rem 0 0;
  font-size: .76rem;
  color: #DC2626;
}

.form-global-error {
  background: var(--red-bg);
  border: 1px solid #FECACA;
  border-radius: .5rem;
  padding: .6rem .875rem;
  margin-bottom: 1rem;
  font-size: .8375rem;
  color: #991B1B;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .6rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.form-actions--spaced { justify-content: space-between; }

.danger-warning {
  display: flex;
  gap: .875rem;
  background: var(--red-bg);
  border: 1px solid #FECACA;
  border-radius: .75rem;
  padding: 1.125rem 1.25rem;
  margin-bottom: 1.5rem;
}

.danger-warning-icon {
  width: 22px;
  height: 22px;
  color: #DC2626;
  flex-shrink: 0;
  margin-top: .1rem;
}

.danger-warning-body {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  font-size: .875rem;
  color: #7F1D1D;
}

.danger-warning-body p { margin: 0; }

.danger-warning-title {
  font-weight: 700;
  font-size: .9rem;
  color: #991B1B;
}

.form-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  padding: .375rem 0 .25rem;
}

.form-checkbox-label {
  display: flex;
  align-items: center;
  gap: .45rem;
  cursor: pointer;
  padding: .5rem .875rem;
  border: 1.5px solid var(--border);
  border-radius: .5rem;
  background: var(--surface);
  font-size: .875rem;
  font-weight: 500;
  color: var(--text);
  transition: border-color .15s, background .15s;
  user-select: none;
}

.form-checkbox-label:has(input:checked) {
  border-color: var(--red);
  background: var(--red-bg);
  color: var(--red);
}

.form-checkbox-label input[type="checkbox"] {
  width: auto;
  margin: 0;
  accent-color: var(--red);
  cursor: pointer;
  box-shadow: none;
}
.form-checkbox-label input[type="checkbox"]:focus {
  box-shadow: none;
  border-color: transparent;
}

.form-field-hint {
  margin: .3rem 0 0;
  font-size: .74rem;
  color: var(--muted);
}

.form-section-label {
  margin: 1.375rem 0 .625rem;
  font-size: .71rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: .75rem;
}
.form-section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.form-section-label:first-child { margin-top: 0; }

/* form-comp-pill aliases (shared between old form-card and new empf layouts) */
.form-comp-pill     { display: inline-flex; align-items: center; justify-content: center;
                      padding: .12rem .5rem; border-radius: 4px; font-size: .68rem;
                      font-weight: 800; letter-spacing: .06em; color: #fff;
                      min-width: 2rem; text-align: center; flex-shrink: 0; }
.form-comp-pill--cfo    { background: #2563EB; }
.form-comp-pill--cfa    { background: #16A34A; }
.form-comp-pill--skills { background: #7C3AED; }
.form-comp-pill--hab    { background: #D97706; }
.form-checkboxes--grid  { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .4rem; }

/* Rangée expertise constructeur */
.form-group--action {
  display: flex;
  align-items: flex-end;
}
.btn-retirer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .5rem .75rem;
  border: 1px solid #FECACA;
  border-radius: .5rem;
  background: transparent;
  color: #DC2626;
  font: inherit;
  font-size: .8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .12s;
  white-space: nowrap;
}
.btn-retirer:hover { background: var(--red-bg); }

/* ── Lignes expertise constructeur compactes ────────────────── */
.expertise-inline-row {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  margin-bottom: .5rem;
}

.expertise-inline-fields {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: .5rem;
}

.expertise-inline-fields select {
  flex: 1;
  min-width: 0;
}

.expertise-remove-btn {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: 1.5px solid #E4E7EC;
  border-radius: 6px;
  background: white;
  color: #94A3B8;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: color .15s, border-color .15s;
}

.expertise-remove-btn:hover {
  color: #CC0000;
  border-color: #FCA5A5;
}

.expertise-add-btn {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  font-size: .78rem;
  font-weight: 600;
  color: #64748B;
  background: none;
  border: 1.5px dashed #CBD5E1;
  border-radius: 8px;
  cursor: pointer;
  padding: .5rem .875rem;
  margin-top: .375rem;
  transition: color .15s, border-color .15s;
}

.expertise-add-btn:hover {
  color: #CC0000;
  border-color: #FCA5A5;
}

/* ================================================================
   PAGES D'AUTHENTIFICATION (connexion, inscription)
   ================================================================ */

.auth-body {
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

.auth-messages {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  padding: 0 1rem;
  z-index: 100;
}

.auth-wrap {
  width: 100%;
  max-width: 420px;
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.auth-logo-link { display: block; }
.auth-logo {
  width: 220px;
  height: auto;
  max-width: none;
  display: block;
  object-fit: contain;
}

.auth-card-new {
  width: 100%;
  background: var(--surface);
  border-radius: var(--r-card-lg);
  box-shadow: 0 4px 20px rgba(0,0,0,.08), 0 1px 4px rgba(0,0,0,.04);
  border: 1px solid rgba(0,0,0,.06);
  border-top: 2px solid var(--red);
  overflow: hidden;
}

.auth-card-header {
  padding: 1.625rem 2rem 1.125rem;
  border-bottom: 1px solid var(--border);
  text-align: center;
}
.auth-card-title {
  font-size: 1.1875rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 .3rem;
}
.auth-card-sub {
  font-size: .8375rem;
  color: var(--muted);
  margin: 0;
}

.auth-form {
  padding: 1.625rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-field label {
  display: block;
  font-size: .8375rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: .35rem;
}

.auth-form input[type="text"],
.auth-form input[type="password"],
.auth-form input[type="email"] {
  display: block;
  width: 100%;
  height: 42px;
  padding: 0 .875rem;
  border: 1.5px solid var(--border);
  border-radius: .5rem;
  font-size: .9375rem;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  box-sizing: border-box;
}
.auth-form input[type="text"]:focus,
.auth-form input[type="password"]:focus,
.auth-form input[type="email"]:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(200,24,30,.08);
}

.auth-btn {
  display: block;
  width: 100%;
  height: 44px;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: .625rem;
  font-size: .9375rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s;
  margin-top: .375rem;
}
.auth-btn:hover { background: var(--red-d); }

.auth-card-footer {
  text-align: center;
  font-size: .8375rem;
  color: var(--muted);
  padding: .875rem 2rem 1.375rem;
  border-top: 1px solid var(--border);
}
.auth-card-footer a {
  color: var(--red);
  font-weight: 600;
  text-decoration: none;
}
.auth-card-footer a:hover { text-decoration: underline; }

.auth-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .875rem;
}

.auth-global-error {
  background: var(--red-bg);
  border: 1px solid #FECACA;
  border-radius: .5rem;
  padding: .7rem .875rem;
  font-size: .8375rem;
  color: #B91C1C;
}

/* ================================================================
   GESTION DES UTILISATEURS
   ================================================================ */

.users-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.page-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 .2rem;
}
.page-sub {
  font-size: .875rem;
  color: var(--muted);
  margin: 0;
}

.data-card {
  background: var(--surface);
  border-radius: var(--r-card-lg);
  box-shadow: var(--sh-emp);
  border: 1px solid var(--border);
  overflow: hidden;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
.data-table thead tr {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}
.data-table th {
  padding: .7rem 1rem;
  text-align: left;
  font-size: .73rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}
.data-table td {
  padding: .7rem 1rem;
  border-bottom: 1px solid #F3F4F6;
  vertical-align: middle;
  color: var(--text);
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: #FAFAFA; }

.data-row--inactive td { opacity: .55; }

.data-table-actions-col { width: 180px; }
.data-table-actions {
  display: flex;
  gap: .375rem;
  flex-wrap: wrap;
}

.data-empty { color: var(--muted); font-style: italic; }
.data-link { color: var(--accent); }
.data-link:hover { text-decoration: underline; }
.data-date { color: var(--muted); font-size: .8125rem; white-space: nowrap; }
.data-empty-row {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--muted);
  font-style: italic;
}

.user-cell {
  display: flex;
  align-items: center;
  gap: .625rem;
}
.user-cell-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #F1F5F9;
  color: #475569;
  border: 1px solid #E2E8F0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .71rem;
  font-weight: 600;
  flex-shrink: 0;
}
.user-cell-name {
  font-weight: 500;
  font-size: .875rem;
}


.status-pill {
  display: inline-flex;
  align-items: center;
  padding: .15rem .5rem;
  border-radius: .375rem;
  font-size: .73rem;
  font-weight: 600;
  white-space: nowrap;
}
.status-pill--active   { background: #D1FAE5; color: #065F46; }
.status-pill--inactive { background: #F3F4F6; color: #6B7280; }
.status-pill--yes      { background: #DBEAFE; color: #1D4ED8; }
.status-pill--no       { background: #F3F4F6; color: #6B7280; }

.button--sm {
  padding: .2rem .55rem;
  font-size: .76rem;
  border-radius: 5px;
}
/* Ghost */
.button--ghost { background: transparent; border-color: var(--border); color: var(--muted); }
.button--ghost:hover { background: var(--bg-alt); border-color: #9CA3AF; color: var(--text); }

/* Accent bleu */
.button--accent { background: #EFF6FF; border-color: #BFDBFE; color: #1D4ED8; }
.button--accent:hover { background: #DBEAFE; border-color: #93C5FD; }

/* ── Actions utilisateurs ───────────────────────────────────── */
.users-page .data-table-actions-col { width: 320px; }
.users-page .data-table-actions { flex-wrap: nowrap; align-items: center; width: 100%; }
.user-actions { display: flex; align-items: center; justify-content: space-between; gap: 1rem; width: 100%; }
.user-actions-main { display: flex; align-items: center; gap: .625rem; }
.user-delete-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  color: #DC2626;
  transition: background .12s, color .12s;
}
.user-delete-btn:hover { background: #FEE2E2; color: #B91C1C; }

/* ── Badges de rôle ─────────────────────────────────────────── */
.role-badge {
  display: inline-flex; align-items: center;
  padding: .2rem .55rem;
  border-radius: 4px;
  font-size: .72rem; font-weight: 600;
  white-space: nowrap;
}
.role-badge--admin  { background: #FEF3C7; color: #92400E; }
.role-badge--editor { background: #D1FAE5; color: #065F46; }
.role-badge--reader { background: #F3F4F6; color: #6B7280; }


/* ================================================================
   RÉFÉRENTIEL DES COMPÉTENCES
   ================================================================ */

.ref-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.ref-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}

.ref-page-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 .2rem;
}

.ref-page-sub {
  font-size: .875rem;
  color: var(--muted);
  margin: 0;
}

.ref-domain-card {
  background: var(--surface);
  border-radius: var(--r-card-lg);
  box-shadow: var(--sh-emp);
  border: 1px solid var(--border);
  border-left: 3px solid var(--red);
  margin-bottom: 1rem;
  overflow: hidden;
}

.ref-domain-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .75rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.ref-domain-identity {
  flex: 1;
  display: flex;
  align-items: baseline;
  gap: .75rem;
  flex-wrap: wrap;
}

.ref-domain-code {
  display: inline-flex;
  align-items: center;
  padding: .2rem .55rem;
  border-radius: .375rem;
  background: #FEE2E2;
  color: var(--red);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
}

.ref-domain-name {
  font-size: .9375rem;
  font-weight: 600;
  color: var(--text);
}

.ref-domain-meta {
  font-size: .8125rem;
  color: var(--muted);
  margin-left: auto;
}

.ref-families {
  padding: .75rem 1.25rem .875rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.ref-family-empty {
  font-size: .875rem;
  color: var(--muted);
  font-style: italic;
  padding: .25rem 0;
}

.ref-family {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: .625rem;
  overflow: hidden;
}

.ref-family-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .45rem .875rem;
  border-bottom: 1px solid var(--border);
}

.ref-family-name {
  font-size: .9375rem;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

.ref-family-count {
  font-size: .78rem;
  color: var(--muted);
  white-space: nowrap;
}

.ref-skills {
  list-style: none;
  margin: 0;
  padding: .25rem .875rem .5rem 1rem;
  display: flex;
  flex-direction: column;
}

.ref-skill {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .35rem .125rem;
  border-bottom: 1px solid #F0F2F5;
}
.ref-skill:last-child { border-bottom: none; }

.ref-skill-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #CBD5E1;
  flex-shrink: 0;
}

.ref-skill-name {
  flex: 1;
  font-size: .875rem;
  color: var(--text);
}

.ref-skill-desc {
  font-size: .8rem;
  color: var(--muted);
  font-style: italic;
  margin-left: .25rem;
}

.ref-skill-empty {
  font-size: .8125rem;
  color: var(--muted);
  font-style: italic;
  padding: .5rem 0;
}

.ref-row-actions {
  display: flex;
  align-items: center;
  gap: .25rem;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity .15s;
}
.ref-domain-header:hover .ref-row-actions,
.ref-family-header:hover .ref-row-actions,
.ref-skill:hover .ref-row-actions { opacity: 1; }

.ref-row-actions--skill { margin-left: auto; }

.ref-btn {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .2rem .5rem;
  border-radius: .375rem;
  font-size: .78rem;
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
  transition: background .12s, color .12s;
  color: var(--muted);
  background: transparent;
  border: none;
  cursor: pointer;
}
.ref-btn:hover {
  text-decoration: none;
  background: var(--border);
  color: var(--text);
}

.ref-btn--add { color: var(--accent); background: #EFF6FF; }
.ref-btn--add:hover { background: #DBEAFE; color: var(--accent-d); }

.ref-btn--danger { color: #DC2626; }
.ref-btn--danger:hover { background: var(--red-bg); color: #B91C1C; }

.ref-empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--muted);
}
.ref-empty-state svg {
  width: 48px;
  height: 48px;
  margin: 0 auto .75rem;
  display: block;
  opacity: .3;
}
.ref-empty-state p {
  font-size: .9375rem;
  margin: 0 0 1.25rem;
}

/* ================================================================
   PAGE LISTE DES COMPÉTENCES
   ================================================================ */

/* Conteneur pleine hauteur */
/* ════════════════════════════════════════════════════════════════
   LISTE DES COMPÉTENCES
   ════════════════════════════════════════════════════════════════ */

.liste-canvas {
  width: 100%;
  height: calc(100vh - var(--topbar));
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.liste-layout {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ── Sidebar ───────────────────────────────────────────────────── */
.liste-sidebar {
  width: 300px;
  min-width: 300px;
  height: 100%;
  overflow-y: auto;
  border-right: 1px solid var(--border);
  background: #FAFAFA;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.liste-sidebar-inner {
  padding: .5rem 0 3rem;
}
.liste-sidebar-empty {
  padding: 1rem;
  color: var(--muted);
  font-size: .85rem;
}

/* ── Domaine (CFO / CFA / HAB) ────────────────────────────────── */
.liste-domain {
  margin-bottom: .25rem;
}

.liste-domain-hdr {
  display: flex;
  align-items: center;
  gap: .5rem;
  width: 100%;
  padding: .6rem .875rem .6rem .75rem;
  background: var(--dark);
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: #fff;
  transition: background .12s;
  position: sticky;
  top: 0;
  z-index: 1;
}
.liste-domain-hdr:hover { background: #2D3748; }

.liste-domain-pill {
  font-family: 'JetBrains Mono', monospace;
  font-size: .7rem;
  font-weight: 700;
  padding: .15rem .45rem;
  border-radius: .3rem;
  flex-shrink: 0;
  letter-spacing: .05em;
}
[data-domain="CFO"] .liste-domain-pill {
  background: var(--accent);
  color: #fff;
}
[data-domain="CFA"] .liste-domain-pill {
  background: #16A34A;
  color: #fff;
}
[data-domain="HAB"] .liste-domain-pill {
  background: #D97706;
  color: #fff;
}

.liste-domain-title {
  flex: 1;
  min-width: 0;
  color: #E2E8F0;
  font-weight: 500;
  font-size: .78rem;
}
.liste-domain-chevron {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  color: #94A3B8;
  transition: transform .2s;
}
.liste-domain-hdr[aria-expanded="false"] .liste-domain-chevron {
  transform: rotate(180deg);
}

/* Corps du domaine */
.liste-domain-body {
  padding: .5rem 0;
}
.liste-domain-body[hidden] { display: none; }

/* ── Sous-lot (CFO/CFA) ────────────────────────────────────────── */
.liste-sub {
  padding: 0 .625rem .625rem;
}

.liste-sub-label {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  padding: .5rem .25rem .3rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}
.liste-sub-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.liste-sub-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
}

/* ── Bouton compétence (chip inline) ──────────────────────────── */
.liste-skill-btn {
  display: inline-flex;
  align-items: center;
  padding: .28rem .6rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: .74rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  transition: background .12s, border-color .12s, color .12s, box-shadow .12s;
  white-space: nowrap;
}
.liste-skill-btn:hover {
  background: var(--bg-alt);
  border-color: #94A3B8;
  color: var(--ink);
}

/* Feuille directe (Chemin de câble) */
.liste-skill-btn--leaf {
  border-style: dashed;
}

/* Sélectionné */
[data-domain="CFO"] .liste-skill-btn.is-selected {
  background: #DBEAFE;
  border-color: var(--accent);
  color: var(--accent-d);
  font-weight: 600;
  box-shadow: 0 0 0 2px rgba(37,99,235,.15);
}
[data-domain="CFA"] .liste-skill-btn.is-selected {
  background: #DCFCE7;
  border-color: #16A34A;
  color: #15803D;
  font-weight: 600;
  box-shadow: 0 0 0 2px rgba(22,163,74,.15);
}
[data-domain="HAB"] .liste-skill-btn.is-selected {
  background: #FEF3C7;
  border-color: #D97706;
  color: #B45309;
  font-weight: 600;
  box-shadow: 0 0 0 2px rgba(217,119,6,.15);
}

/* HAB : chips directement dans le body */
[data-domain="HAB"] .liste-domain-body {
  padding: .5rem .625rem .75rem;
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}

/* ── Sous-classes (s'affichent sous CFO/CFA quand un sous-lot est sélectionné) ── */
.liste-subcls {
  display: none; /* géré par JS */
  border-left: 3px solid #7C3AED;
  background: #F5F3FF;
  padding: .55rem .75rem .65rem 1rem;
  margin: 0 0 .25rem;
}

.liste-subcls-label {
  font-size: .68rem;
  font-weight: 700;
  color: #5B21B6;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: .45rem;
}

.liste-skill-btn--skill { /* surcharge de couleur pour les sous-classes */
  background: #fff;
  border-color: #DDD6FE;
}
.liste-skill-btn--skill:hover {
  background: #EDE9FE;
  border-color: #7C3AED;
  color: #5B21B6;
}
.liste-skill-btn--skill.is-selected {
  background: #7C3AED;
  border-color: #7C3AED;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 0 0 2px rgba(124,58,237,.2);
}

/* ── Panneau droit ─────────────────────────────────────────────── */
.liste-panel {
  flex: 1;
  min-width: 0;
  height: 100%;
  overflow-y: auto;
  padding: 1.25rem 1.75rem 2rem;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Barre de sélection */
.liste-selection-bar {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: .75rem;
  padding: .625rem .875rem;
  margin-bottom: 1rem;
  min-height: 46px;
  box-shadow: var(--shadow-xs);
}
.liste-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  flex: 1;
  min-width: 0;
  align-items: center;
}

/* Chip de sélection active */
.liste-chip {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  background: var(--ink);
  color: #fff;
  font-size: .73rem;
  font-weight: 500;
  padding: .2rem .45rem .2rem .6rem;
  border-radius: 20px;
  white-space: nowrap;
}
.liste-chip-remove {
  background: none;
  border: none;
  color: rgba(255,255,255,.7);
  cursor: pointer;
  font-size: .95rem;
  line-height: 1;
  padding: 0;
  display: flex;
  align-items: center;
  transition: color .1s;
}
.liste-chip-remove:hover { color: #fff; }

/* Contrôles droits de la barre */
.liste-bar-right {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-shrink: 0;
}
.liste-mode-group {
  display: flex;
  align-items: center;
  gap: .25rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .15rem .25rem;
}
.liste-mode-group[hidden] { display: none; }
.liste-mode-label {
  font-size: .68rem;
  color: #374151;
  white-space: nowrap;
  padding: 0 .25rem;
  font-weight: 600;
}
.liste-mode-btn {
  background: none;
  border: none;
  border-radius: 4px;
  padding: .15rem .45rem;
  font-size: .7rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: #374151;
  cursor: pointer;
  transition: background .12s, color .12s;
  letter-spacing: .04em;
}
.liste-mode-btn.is-active {
  background: var(--ink);
  color: #fff;
}
.liste-clear-btn {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .2rem .6rem;
  font-size: .72rem;
  color: #374151;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  transition: background .12s, border-color .12s, color .12s;
  white-space: nowrap;
}
.liste-clear-btn[hidden] { display: none; }
.liste-clear-btn:hover {
  background: var(--bg-alt);
  border-color: #CBD5E1;
  color: var(--ink);
}

/* Message vide / invite */
.liste-status {
  font-size: .83rem;
  color: var(--text);
  margin: 0 0 1rem;
  font-weight: 500;
}

/* Grille résultats */
.liste-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .875rem;
}
.liste-empty-msg {
  color: #374151;
  font-size: .88rem;
  font-weight: 500;
  grid-column: 1 / -1;
  padding: 2rem 0;
  text-align: center;
}

/* Carte salarié dans la liste */
.liste-emp-card {
  display: flex;
  align-items: center;
  gap: .75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: .75rem;
  padding: .75rem;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  width: 100%;
  transition: box-shadow .22s cubic-bezier(.2,0,0,1), border-color .15s ease, transform .22s cubic-bezier(.2,0,0,1);
  box-shadow: var(--shadow-xs);
}
.liste-emp-card:hover {
  border-color: #111;
  box-shadow: 0 6px 18px rgba(0,0,0,.1), 0 2px 6px rgba(0,0,0,.06);
  transform: translateY(-3px);
}
.liste-emp-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--dark);
  color: #fff;
  font-size: .85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: .02em;
}
.liste-emp-avatar--photo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1.5px solid var(--ink);
}
.liste-emp-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .1rem;
}
.liste-emp-name {
  font-size: .82rem;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.liste-emp-meta {
  font-size: .72rem;
  color: #374151;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.liste-emp-level {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--dark);
  border: none;
  font-size: .65rem;
  font-weight: 700;
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
  flex-shrink: 0;
}

/* Invite initiale (aucune sélection) */
.liste-invite {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  color: #374151;
  padding: 3rem 1rem;
}
.liste-invite-icon {
  width: 48px;
  height: 48px;
  opacity: .25;
}
.liste-invite-text {
  font-size: .9rem;
  text-align: center;
  max-width: 280px;
  line-height: 1.5;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */

/* ── Tablette large (≤ 1024px) ──────────────────────────────────── */
@media (max-width: 1024px) {
  .data-card { overflow-x: auto; }
  .lt-filter-table { grid-template-columns: 1fr 1fr; }
  .users-page { max-width: none; }
  .arch-page { max-width: none; }
}

/* ── Tablette (≤ 768px) ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .topbar { gap: .5rem; padding: 0 .875rem; }
  .topbar-search-wrap { display: none; }
  .topbar-sep { display: none; }
  .topbar-user-info { display: none; }

  .tree-canvas { padding: 1rem 1rem 3rem; }

  .cards, .cards.compact, .grid.two, .line-grid { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; gap: .75rem; }
  .page-header > div:last-child { display: flex; flex-wrap: wrap; gap: .5rem; }

  .org-directors { flex-direction: column; align-items: center; gap: 1rem; }
  .org-director-wrap { padding: 0; }
  .org-director-wrap::before, .org-director-wrap::after { display: none; }
  .org-director-card { min-width: 0; width: 100%; max-width: 300px; }

  .org-teams { flex-direction: column; align-items: center; gap: 1.5rem; }
  .org-branch { padding: 0; width: 100%; max-width: 340px; }
  .org-branch::before, .org-branch::after { display: none; }
  .org-employees-col, .org-team-card { width: 100%; max-width: none; min-width: 0; }

  .org-employees-grid { grid-template-columns: 1fr; padding: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .form-group--full { grid-column: auto; }
  .form-actions--spaced { flex-direction: column-reverse; align-items: stretch; }
  .page-header-actions { width: 100%; justify-content: flex-start; }

  .lt-filter-table { grid-template-columns: 1fr; }
  .lt-page { padding: 1rem 1rem 3rem; }

  .users-main { width: calc(100% - 1.5rem) !important; margin: 1rem auto 3rem !important; }
  .users-page .data-table-actions { flex-wrap: wrap; }
  .users-page .data-table-actions-col { width: auto; }

  .data-table th, .data-table td { padding: .55rem .75rem; font-size: .82rem; }
}

/* ── Mobile (≤ 600px) ───────────────────────────────────────────── */
@media (max-width: 600px) {
  /* Topbar : 2 rangées — logo+user en haut, nav en bas en grille 2×2 */
  :root { --topbar: 116px; }

  .topbar {
    flex-wrap: wrap;
    height: auto;
    min-height: var(--topbar);
    padding: .5rem .875rem .25rem;
    gap: .375rem;
    align-items: center;
  }
  .topbar-brand      { order: 1; flex: 1; }
  .topbar-user       { order: 2; margin-left: auto; }
  .topbar-logout-btn { order: 3; }
  .topbar-nav {
    order: 4;
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    height: auto;
    border-top: 1px solid var(--border);
    padding: .25rem 0;
    gap: 0;
  }
  .topbar-nav-link {
    height: auto;
    padding: .45rem .5rem;
    font-size: .8rem;
    justify-content: center;
    text-align: center;
    white-space: nowrap;
  }

  .brand-logo { width: 120px; }

  /* Layout */
  .container { width: calc(100% - 1rem); margin: 1rem auto 3rem; }
  .users-main { width: calc(100% - 1rem) !important; margin: 1rem auto 3rem !important; }

  /* Filtres : 1 colonne */
  .lt-filter-table { grid-template-columns: 1fr; }
  .lt-page { padding: .875rem .875rem 3rem; }

  /* Grille salariés */
  .lt-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

  /* Barre filtres actifs */
  .lt-bar-line { flex-wrap: wrap; gap: .375rem; }
  .lt-bar-line-label { width: 100%; }

  /* Tables */
  .data-table th, .data-table td { padding: .45rem .625rem; font-size: .8rem; }
  .data-table-actions { flex-wrap: wrap; gap: .25rem; }
  .users-page .data-table-actions { flex-wrap: wrap; }

  /* Selection bar */
  .sel-bar { flex-wrap: wrap; }
}

/* ── Très petit écran (≤ 400px) ─────────────────────────────────── */
@media (max-width: 400px) {
  :root { --topbar: 128px; }
  .brand-logo { width: 100px; }
  .lt-grid { grid-template-columns: 1fr; }
  .topbar-nav-link { font-size: .75rem; padding: .45rem .25rem; }
}

/* ================================================================
   DRAWER SALARIÉ
   ================================================================ */

body.drawer-open { overflow: hidden; }

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 17, 21, .4);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
  backdrop-filter: blur(1px);
}
.drawer-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

/* Sur l'arborescence, la topbar n'a pas de border-bottom rouge (le toolbar en tient lieu) */
body.page-tree .topbar { border-bottom: 1px solid var(--border); }

.emp-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 460px;
  max-width: 100vw;
  background: #fff;
  z-index: 201;
  display: flex;
  flex-direction: column;
  border-left: 3px solid var(--red);
  box-shadow: -6px 0 40px rgba(0,0,0,.1);
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.4, 0, .2, 1);
}
.emp-drawer.is-open { transform: translateX(0); }

.drawer-close {
  position: absolute;
  top: .875rem;
  right: .875rem;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  z-index: 2;
  transition: background .15s, color .15s;
  padding: 0;
}
.drawer-close:hover { background: var(--bg); color: var(--text); }

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.375rem 1.5rem 2rem;
}

.drawer-loading,
.drawer-error {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: var(--muted);
  font-size: .875rem;
}
.drawer-error { color: var(--danger); }

/* ── En-tête du panneau ──────────────────────────────────────── */
.drawer-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.375rem;
  border-bottom: 1px solid var(--border);
}
.drawer-header-info {
  flex: 1;
  min-width: 0;
}
.drawer-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: .15rem;
  line-height: 1.3;
}
.drawer-fonction {
  font-size: .84rem;
  color: var(--muted);
  margin-bottom: .5rem;
}
.drawer-badges {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
}

/* Avatar dans le drawer */
.drawer-header .panel-avatar {
  width: 46px;
  height: 46px;
  min-width: 46px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9375rem;
  font-weight: 700;
  background: #1F2933;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: .02em;
  border: none;
}

/* Badges niveau et statut dans le drawer */
.panel-badge-level {
  display: inline-flex;
  align-items: center;
  padding: .16rem .5rem;
  border-radius: .375rem;
  font-size: .67rem;
  font-weight: 600;
  color: #475569;
  background: #F1F5F9;
  border: 1px solid #E2E8F0;
  letter-spacing: .01em;
}

.panel-badge-status {
  display: inline-flex;
  align-items: center;
  padding: .18rem .55rem;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 600;
}
.panel-badge-status.inactive { background: #F1F5F9; color: #64748B; }

/* ── Grille d'infos ──────────────────────────────────────────── */
.drawer-info-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .375rem .75rem;
  font-size: .875rem;
  margin: 0;
}
.drawer-info-grid dt {
  color: var(--muted);
  white-space: nowrap;
  font-weight: 500;
  font-size: .8125rem;
}
.drawer-info-grid dd {
  margin: 0;
  color: var(--text);
  word-break: break-word;
  font-size: .875rem;
}
.drawer-info-grid a { color: var(--red); text-decoration: none; }
.drawer-info-grid a:hover { text-decoration: underline; }

/* ── Section générique du panneau ────────────────────────────── */
.panel-section {
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}
.panel-section:last-of-type { border-bottom: none; margin-bottom: 0; }
.panel-section-title {
  font-size: .67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #9CA3AF;
  margin-bottom: .75rem;
  display: flex;
  align-items: center;
  gap: .625rem;
}
.panel-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #F3F4F6;
}

/* ── Chips domaines ──────────────────────────────────────────── */
.panel-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}
.panel-chip {
  display: inline-flex;
  align-items: center;
  font-size: .78rem;
  font-weight: 500;
  padding: .22rem .65rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text);
  white-space: nowrap;
}
.chip-domain-cfo { background: #EFF6FF; color: #1D4ED8; border-color: #BFDBFE; }
.chip-domain-cfa { background: #F0FDF4; color: #15803D; border-color: #BBF7D0; }

/* ── Texte vide générique ────────────────────────────────────── */
.panel-empty-hint {
  font-size: .8375rem;
  color: var(--subtle);
  margin: .25rem 0 0;
  font-style: italic;
}

/* ── Badges compétences / niveaux technologiques ─────────────── */
.comp-badge-list {
  display: flex;
  flex-wrap: wrap;
  gap: .375rem;
  min-height: 1.5rem;
}
.comp-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .22rem .65rem;
  background: #F3F4F6;
  color: var(--text);
  border-radius: 6px;
  font-size: .8rem;
  font-weight: 500;
  border: 1px solid var(--border);
}
.comp-badge-domain {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .04em;
  background: #1E3A5F;
  color: #fff;
  padding: .1rem .35rem;
  border-radius: 4px;
  line-height: 1.3;
}
.comp-badge--hab {
  background: #FFFBEB;
  border-color: #FCD34D;
  color: #92400E;
}
.comp-remove-btn,
.sublot-remove-btn,
.hab-remove-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  opacity: .5;
  font-size: .95rem;
  line-height: 1;
  padding: 0 .1rem;
  margin-left: .05rem;
  border-radius: 3px;
  transition: opacity .15s, background .15s;
}
.comp-remove-btn:hover,
.sublot-remove-btn:hover,
.hab-remove-btn:hover { opacity: 1; background: rgba(0,0,0,.06); }
.comp-empty {
  font-size: .8375rem;
  color: var(--subtle);
  margin: .25rem 0 .5rem;
  font-style: italic;
}

/* ── Formulaire ajout compétence ────────────────────────────── */
.comp-add-form {
  display: flex;
  gap: .4rem;
  margin-top: .75rem;
  flex-wrap: wrap;
}
.comp-add-select {
  flex: 1;
  min-width: 0;
  padding: .35rem .6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: .8375rem;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color .15s;
  box-shadow: none;
}
.comp-add-select:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 2px rgba(200,24,30,.08);
}
.comp-add-btn {
  padding: .3rem .7rem;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: .5rem;
  font: inherit;
  font-size: .8rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s, border-color .12s;
}
.comp-add-btn:hover {
  background: var(--bg-alt);
  border-color: #D1D5DB;
}

/* ── Expertises constructeur (liste plate) ───────────────────── */
.expertise-flat-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .3rem 0;
  border-bottom: 1px solid #F3F4F6;
}
.expertise-flat-row:last-child { border-bottom: none; }
.expertise-flat-text {
  flex: 1;
  font-size: .875rem;
  color: var(--text);
}
.expertise-remove-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  opacity: .5;
  font-size: .95rem;
  line-height: 1;
  padding: 0 .2rem;
  border-radius: 4px;
  transition: opacity .15s, background .15s;
}
.expertise-remove-btn:hover { opacity: 1; background: rgba(0,0,0,.06); }

/* ── Boutons d'action admin ──────────────────────────────────── */
.drawer-actions {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  padding-top: 1.125rem;
  margin-top: .5rem;
  border-top: 1px solid var(--border);
}
.drawer-action-btn {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 1rem;
  border-radius: 8px;
  font-size: .8rem;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  white-space: nowrap;
  line-height: 1;
  color: var(--text);
  transition: background .15s ease, border-color .15s ease;
}
.drawer-action-btn:hover        { text-decoration: none; background: #ECEEF2; }
.drawer-action-btn:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

.drawer-action-btn--primary  { background: #F1F5F9; border-color: #CBD5E1; color: #1F2933; }
.drawer-action-btn--primary:hover  { background: #E2E8F0; border-color: #94A3B8; }

.drawer-action-btn--warning  { background: #FFFBEB; border-color: #FDE68A; color: #B45309; }
.drawer-action-btn--warning:hover  { background: #FEF3C7; border-color: #FCD34D; }

.drawer-action-btn--success  { background: #F0FDF4; border-color: #BBF7D0; color: #15803D; }
.drawer-action-btn--success:hover  { background: #DCFCE7; border-color: #86EFAC; }

.drawer-action-btn--danger   { background: #FEF2F2; border-color: #FECACA; color: #B91C1C; }
.drawer-action-btn--danger:hover   { background: #FEE2E2; border-color: #FCA5A5; }

/* ── Niveaux dans le drawer (chantier / historique) ──────────── */
.panel-level-badge {
  display: inline-flex;
  align-items: center;
  padding: .14rem .45rem;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 600;
  white-space: nowrap;
}
.level-seen_assisted  { background: #F1F5F9; color: #475569; }
.level-done_with_help { background: #DBEAFE; color: #1E40AF; }
.level-done_alone     { background: #D1FAE5; color: #065F46; }
.level-confirmed      { background: #FEF3C7; color: #92400E; }
.level-referent       { background: #EDE9FE; color: #5B21B6; }

/* ── Formations dans le drawer ───────────────────────────────── */
.panel-training-list { display: flex; flex-direction: column; gap: .5rem; }
.panel-training-row {
  padding: .5rem .75rem;
  background: var(--bg-alt);
  border-radius: .5rem;
  border: 1px solid var(--border);
}
.panel-training-title {
  font-size: .875rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: .2rem;
}
.panel-training-meta {
  font-size: .78rem;
  color: var(--muted);
}
.training-validity { display: inline-flex; align-items: center; gap: .25rem; padding: .08rem .4rem; border-radius: 999px; font-size: .72rem; font-weight: 600; margin-left: .25rem; }
.training-valid    { background: #D1FAE5; color: #065F46; }
.training-expiring { background: #FEF3C7; color: #92400E; }
.training-expired  { background: #FEE2E2; color: #B91C1C; }

/* ── Tableau historique chantier ─────────────────────────────── */
.panel-table { width: 100%; border-collapse: collapse; font-size: .8125rem; margin-top: .5rem; }
.panel-table th, .panel-table td {
  padding: .4rem .5rem;
  text-align: left;
  border-bottom: 1px solid #F3F4F6;
}
.panel-table th { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.panel-table tbody tr:last-child td { border-bottom: none; }

/* ── Accordion ───────────────────────────────────────────────── */
.accordion-body { display: none; }
.accordion-body.is-open { display: block; }
.accordion-toggle {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: none;
  border: none;
  cursor: pointer;
  font-size: .875rem;
  font-weight: 600;
  color: var(--text);
  padding: .25rem 0;
  text-align: left;
}
.accordion-toggle .acc-icon {
  font-size: .72rem;
  color: var(--muted);
  transition: transform .2s;
}
.accordion-toggle[aria-expanded="true"] .acc-icon { transform: rotate(180deg); }

/* ── Responsive drawer ───────────────────────────────────────── */
@media (max-width: 540px) {
  .emp-drawer { width: 100vw; }
  .drawer-body { padding: 1rem; }
}

/* ── Anciens groupes expertise (backward compat) ─────────────── */
.expertise-group { margin-bottom: .75rem; }
.expertise-group:last-child { margin-bottom: 0; }
.expertise-group-label {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; padding: .15rem .55rem; border-radius: 999px;
  display: inline-block; margin-bottom: .4rem;
}
.expertise-group-label--beginner  { background: #F0FDF4; color: #15803D; }
.expertise-group-label--confirmed { background: #EFF6FF; color: #1D4ED8; }
.expertise-group-label--certified { background: #FEF9C3; color: #A16207; }
.expertise-group-items { display: flex; flex-wrap: wrap; gap: .35rem; }

/* ================================================================
   PHOTOS DE PROFIL
   ================================================================ */

/* Org-chart card photo — standalone, n'hérite pas de .org-avatar */
.org-avatar--photo {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1.5px solid var(--ink);
  background: transparent;
}

/* Drawer header photo — standalone, surcharge .drawer-header .panel-avatar */
.panel-avatar--photo,
.drawer-header .panel-avatar--photo {
  display: block;
  width: 46px;
  height: 46px;
  min-width: 46px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1.5px solid var(--ink);
  background: transparent;
}

/* Form photo preview (edit mode) */
.form-photo-preview {
  display: flex;
  align-items: center;
  gap: .875rem;
  margin-bottom: .625rem;
}
.form-photo-img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  flex-shrink: 0;
}
.form-photo-hint {
  font-size: .8rem;
  color: var(--muted);
}

/* ================================================================
   CORRECTIFS INPUTS SPÉCIAUX
   ================================================================ */

input[type="checkbox"],
input[type="radio"] {
  width: auto;
  padding: 0;
  border: none;
  box-shadow: none;
  accent-color: var(--red);
}

input[type="file"] {
  padding: .3rem .5rem;
  cursor: pointer;
  font-size: .8375rem;
  color: var(--muted);
  background: var(--bg-alt);
}
input[type="file"]::file-selector-button {
  padding: .25rem .625rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: .375rem;
  font: inherit;
  font-size: .8rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--text);
  transition: background .12s;
  margin-right: .625rem;
}
input[type="file"]::file-selector-button:hover {
  background: var(--bg);
}

/* Pas de focus ring rouge sur les inputs file */
input[type="file"]:focus {
  border-color: var(--border);
  box-shadow: none;
}

/* ================================================================
   ARCHIVES
   ================================================================ */

.arch-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Barre de recherche */
.arch-search-wrap {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .4rem .75rem;
  margin-bottom: 1rem;
  max-width: 360px;
}
.arch-search-wrap svg { color: var(--muted); flex-shrink: 0; width: 14px; height: 14px; }
.arch-search-wrap input {
  border: none; background: transparent;
  font: inherit; font-size: .85rem; color: var(--text);
  width: 100%; outline: none;
}
.arch-search-wrap input::placeholder { color: var(--subtle); }

/* Avatar initiales */
.arch-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--red-bg);
  color: var(--red);
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700;
  flex-shrink: 0;
  border: 1.5px solid var(--ink);
}
.arch-avatar--photo {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--ink);
  flex-shrink: 0;
}

.arch-emp-name { font-weight: 600; font-size: .875rem; }
.arch-mono { font-family: monospace; font-size: .82rem; color: var(--muted); }

/* État vide */
.arch-empty {
  display: flex; flex-direction: column;
  align-items: center; gap: .75rem;
  padding: 3rem 1rem;
  color: var(--muted); font-size: .9rem; text-align: center;
}
.arch-empty svg { width: 40px; height: 40px; opacity: .35; }

/* Modale de confirmation */
.arch-modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.arch-modal-overlay[hidden] { display: none; }
.arch-modal {
  background: var(--surface);
  border-radius: 14px;
  padding: 2rem 2rem 1.5rem;
  width: 100%; max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
  display: flex; flex-direction: column; align-items: center;
  gap: .6rem; text-align: center;
  border-top: 4px solid #16A34A;
}
.arch-modal-icon svg {
  width: 36px; height: 36px;
  color: #16A34A; margin-bottom: .25rem;
}
.arch-modal-title {
  font-size: 1.1rem; font-weight: 700;
  color: var(--ink); margin: 0;
}
.arch-modal-body {
  font-size: .875rem; color: var(--muted);
  margin: 0; line-height: 1.5;
}
.arch-modal-actions {
  display: flex; gap: .625rem;
  margin-top: .75rem; width: 100%; justify-content: center;
}
.arch-modal-confirm-btn {
  background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600;
}
.arch-modal-confirm-btn:hover { background: var(--red); border-color: var(--red); }

/* Vert — désarchivage */
.button--green { background: transparent; border-color: #16A34A; color: #16A34A; }
.button--green:hover { background: #F0FDF4; border-color: #15803D; color: #15803D; }

/* Variante danger (suppression) */
.arch-modal--danger { border-top-color: #DC2626; }
.arch-modal-icon--danger svg { color: #DC2626; }
.arch-modal-delete-btn {
  background: #DC2626; border-color: #DC2626; color: #fff; font-weight: 600;
}
.arch-modal-delete-btn:hover { background: #B91C1C; border-color: #B91C1C; }

/* ================================================================
   LISTE — layout lt-*
   ================================================================ */

/* ── Page ──────────────────────────────────────────────────────── */
.lt-page {
  padding: 1.5rem 2rem 3rem;
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ── Zone filtres ──────────────────────────────────────────────── */
.lt-filters {
  display: flex;
  flex-direction: column;
  gap: .625rem;
}

/* ── Tableau 3 colonnes CFO / CFA / HAB ───────────────────────── */
.lt-filter-table {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
}

.lt-ft-col {
  background: #fff;
  border-radius: .875rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  border: 1px solid #E5E7EB;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.lt-ft-head {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1rem;
  border-bottom: 1px solid #E5E7EB;
}
.lt-ft-head--cfo { border-top: 3px solid var(--red); }
.lt-ft-head--cfa { border-top: 3px solid #1F2937; }
.lt-ft-head--hab { border-top: 3px solid #7F1D1D; }

.lt-ft-title {
  font-size: .8rem;
  font-weight: 600;
  color: #6B7280;
}

.lt-ft-body {
  padding: .875rem 1rem;
  flex: 1;
}

/* ── Panneau sous-classes (pleine largeur, sous le tableau) ────── */
.lt-subcls-panel {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid #FECACA;
  border-left: 3px solid var(--red);
  border-radius: .75rem;
  background: #FFF8F8;
  padding: .75rem 1rem;
  box-shadow: var(--shadow-xs);
}

.lt-subcls-group {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.lt-subcls-group--sep {
  margin-top: .625rem;
  padding-top: .625rem;
  border-top: 1px solid #FECACA;
}

.lt-subcls-group-label {
  font-size: .72rem;
  font-weight: 700;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* ── Groupes dans la barre active (ligne Sous-classes) ─────────── */
.lt-active-skill-group {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .3rem;
}

.lt-active-skill-group + .lt-active-skill-group {
  margin-left: .625rem;
  padding-left: .625rem;
  border-left: 1px solid #E5E7EB;
}

.lt-skill-group-label {
  font-size: .75rem;
  font-weight: 600;
  color: #6B7280;
  white-space: nowrap;
}

/* ── Pills domaine ─────────────────────────────────────────────── */
.lt-domain-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .65rem;
  font-weight: 800;
  padding: .15rem .4rem;
  border-radius: .3rem;
  letter-spacing: .04em;
  flex-shrink: 0;
}
.lt-domain-pill--cfo { background: #fff; color: var(--red); border: 1.5px solid var(--red); }
.lt-domain-pill--cfa { background: #fff; color: #1F2937;   border: 1.5px solid #1F2937; }
.lt-domain-pill--hab { background: #fff; color: #7F1D1D;   border: 1.5px solid #7F1D1D; }

/* ── Chips filtres ─────────────────────────────────────────────── */
.lt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}

.lt-chip {
  display: inline-flex;
  align-items: center;
  padding: .3rem .65rem;
  border-radius: 5px;
  border: 1px solid #E5E7EB;
  background: #F9FAFB;
  color: #4B5563;
  font-size: .78rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: border-color .12s, background .12s, color .12s;
  line-height: 1.4;
}
.lt-chip:hover { border-color: #9CA3AF; background: #F3F4F6; color: #1F2937; }
.lt-chip--on {
  border-color: var(--red);
  background: #FEF2F2;
  color: var(--red);
  font-weight: 600;
}
.lt-chip--on:hover { border-color: #b91c1c; background: #FEE2E2; }

.lt-chip--hab { border-color: #E5E7EB; background: #F9FAFB; color: #4B5563; }
.lt-chip--hab.lt-chip--on { border-color: #7F1D1D; background: #FFF1F2; color: #7F1D1D; }

.lt-chip--skill { border-color: #E5E7EB; background: #F9FAFB; color: #4B5563; }
.lt-chip--skill.lt-chip--on { border-color: var(--red); background: #FEF2F2; color: var(--red); font-weight: 600; }

/* ── Barre filtres actifs ──────────────────────────────────────── */
.lt-bar {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: .75rem;
  padding: 0 1rem;
  box-shadow: var(--shadow-xs);
}

.lt-bar-line {
  display: flex;
  align-items: center;
  gap: .625rem;
  min-height: 46px;
  padding: .5rem 0;
}

.lt-bar-line--skills {
  border-top: 1px dashed #E5E7EB;
}

.lt-bar-line-label {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #9CA3AF;
  white-space: nowrap;
  width: 88px;
  flex-shrink: 0;
}

.lt-bar-line-label--skills { color: var(--red); }

.lt-active-chips {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .375rem;
}
.lt-placeholder {
  font-size: .83rem;
  color: #6B7280;
  font-style: italic;
}
.lt-active-chip {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .2rem .5rem .2rem .7rem;
  background: #fff;
  color: var(--red);
  border: 1.5px solid var(--red);
  border-radius: 99px;
  font-size: .78rem;
  font-weight: 500;
}
.lt-active-chip--skill {
  color: #991B1B;
  border-color: #FECACA;
  background: #FFF8F8;
}
.lt-chip-arrow {
  color: var(--red);
  font-size: .85rem;
  line-height: 1;
}
.lt-active-chip button {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: .9rem;
  line-height: 1;
  padding: 0 .1rem;
  opacity: .55;
  transition: opacity .1s;
}
.lt-active-chip button:hover { opacity: 1; }

.lt-bar-right {
  display: flex;
  align-items: center;
  gap: .625rem;
  flex-shrink: 0;
}
.lt-operator {
  display: flex;
  align-items: center;
  gap: .25rem;
}
.lt-op-label {
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #6B7280;
  margin-right: .1rem;
}
.lt-op-btn {
  padding: .25rem .6rem;
  border-radius: .375rem;
  border: 1.5px solid var(--border);
  background: #F9FAFB;
  color: #374151;
  font-size: .75rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: .04em;
  transition: border-color .12s, background .12s;
}
.lt-op-btn--on { border-color: var(--red); background: #FEF2F2; color: var(--red); }
.lt-clear-btn {
  padding: .28rem .7rem;
  border-radius: .375rem;
  border: 1.5px solid var(--border);
  background: #fff;
  color: #374151;
  font-size: .78rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: border-color .12s, color .12s;
}
.lt-clear-btn:hover { border-color: var(--red); color: var(--red); }

/* ── Compteur ──────────────────────────────────────────────────── */
.lt-count {
  font-size: .83rem;
  font-weight: 500;
  color: #374151;
  margin: 0;
}

/* ── Grille salariés ───────────────────────────────────────────── */
.lt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .875rem;
}

.lt-card {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .875rem 1rem;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: .875rem;
  cursor: pointer;
  text-align: left;
  transition: border-color .14s, box-shadow .14s, transform .1s;
  font-family: inherit;
  font-size: inherit;
}
.lt-card:hover {
  border-color: var(--red);
  box-shadow: 0 2px 10px rgba(215,25,32,.09);
  transform: translateY(-1px);
}
.lt-card-av {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--red-bg);
  color: var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .825rem;
  font-weight: 700;
  flex-shrink: 0;
  border: 1.5px solid #FECACA;
}
.lt-card-photo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--border);
  flex-shrink: 0;
}
.lt-card-body { flex: 1; min-width: 0; }
.lt-card-name {
  font-size: .875rem;
  font-weight: 600;
  color: #1F2933;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lt-card-poste {
  font-size: .75rem;
  color: #374151;
  margin-top: .1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lt-card-lvl {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .15rem .45rem;
  border-radius: 99px;
  background: #1F2933;
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* ── État vide ───────────────────────────────────────────────── */
.lt-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
  color: #374151;
  font-size: .9rem;
}

/* ================================================================
   PLANNING CHANTIERS
   ================================================================ */

.plan-page { max-width: 1200px; margin: 0 auto; }

/* Onglets de filtre (statut chantier, etc.) */
.plan-week-nav {
  display: flex; gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1.5rem;
}
.plan-week-btn {
  padding: .45rem 1rem;
  font-size: .82rem; font-weight: 500; color: var(--muted);
  border: none; border-bottom: 2px solid transparent;
  background: none;
  text-decoration: none; white-space: nowrap;
  margin-bottom: -2px;
  transition: color .15s, border-color .15s;
}
.plan-week-btn:hover { color: var(--text); text-decoration: none; }
.plan-week-btn--active { color: var(--ink); font-weight: 600; border-bottom-color: var(--red); }

/* Bandeau de synthèse */
.plan-stats {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .875rem 1.5rem;
  margin-bottom: 1.25rem;
}
.plan-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  gap: .15rem;
}
.plan-stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1;
}
.plan-stat-label {
  font-size: .72rem;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.plan-stat-sep {
  width: 1px;
  height: 2rem;
  background: var(--border);
  flex-shrink: 0;
}

/* Filtre par date */
.plan-date-filter {
  display: flex; align-items: center; gap: .6rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.plan-date-filter label {
  font-size: .85rem; font-weight: 500; color: var(--muted);
}
.plan-date-filter input[type="date"] {
  padding: .35rem .65rem; border-radius: 6px;
  border: 1px solid var(--border); background: var(--surface);
  font-size: .85rem; color: var(--text);
}

/* Layout principal */
.plan-body { display: grid; grid-template-columns: 1fr 260px; gap: 1.25rem; align-items: start; }
@media (max-width: 860px) { .plan-body { grid-template-columns: 1fr; } }

/* Carte chantier */
.plan-project-card {
  background: var(--surface); border-radius: var(--r-card);
  border: 1px solid var(--border); box-shadow: var(--shadow-xs);
  margin-bottom: 1rem; overflow: hidden;
}
.plan-project-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .875rem 1.25rem;
  border-bottom: 1px solid var(--border); background: var(--bg-alt);
}
.plan-project-identity { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
.plan-project-name { font-size: .95rem; font-weight: 700; color: var(--text); }
.plan-project-client { font-size: .8rem; color: var(--muted); }
.plan-project-location {
  display: inline-flex; align-items: center; gap: .25rem;
  font-size: .78rem; color: var(--muted);
}
.plan-project-meta { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }

.plan-count-badge {
  display: inline-flex; align-items: center;
  padding: .15rem .55rem; border-radius: 99px;
  font-size: .72rem; font-weight: 600;
  background: #FEF2F2; color: var(--red); border: 1px solid #FECACA;
}
.plan-count-badge--neutral { background: var(--bg); color: var(--muted); border-color: var(--border); }

.plan-add-btn {
  font-size: .75rem; font-weight: 600; color: var(--red);
  text-decoration: none; padding: .2rem .5rem;
  border: 1px solid #FECACA; border-radius: 4px; background: #FEF2F2;
  white-space: nowrap;
}
.plan-add-btn:hover { background: #FEE2E2; border-color: #FCA5A5; text-decoration: none; }
.plan-add-btn--sm { padding: .1rem .4rem; }

/* Lignes employés */
.plan-employee-list { padding: .5rem 0; }
.plan-emp-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: .75rem; padding: .5rem 1.25rem;
  border-bottom: 1px solid #F3F4F6;
}
.plan-emp-row:last-child { border-bottom: none; }
.plan-emp-info { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.plan-emp-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--red); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 700; flex-shrink: 0;
}
.plan-emp-avatar--sm { width: 28px; height: 28px; font-size: .68rem; }
.plan-emp-avatar--photo {
  width: 32px; height: 32px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
  border: 1.5px solid var(--ink);
}
.plan-emp-avatar--photo.plan-emp-avatar--sm { width: 28px; height: 28px; }
.plan-emp-name { font-size: .85rem; font-weight: 600; color: var(--text); }
.plan-emp-meta { font-size: .75rem; color: var(--muted); margin-top: .1rem; }
.plan-emp-resp { color: var(--ink); font-weight: 500; }
.plan-emp-actions { display: flex; align-items: center; gap: .375rem; flex-shrink: 0; }
.plan-action-btn {
  display: inline-flex; align-items: center;
  font-size: .7rem; font-weight: 500; line-height: 1;
  padding: .25rem .55rem;
  border: 1px solid var(--border); border-radius: 4px;
  background: none; color: var(--muted);
  cursor: pointer; text-decoration: none;
  transition: border-color .12s, color .12s, background .12s;
}
.plan-action-btn:hover { border-color: #9CA3AF; color: var(--text); background: var(--bg-alt); text-decoration: none; }
.plan-action-btn--danger { border-color: #FECACA; color: #DC2626; }
.plan-action-btn--danger:hover { border-color: #FCA5A5; color: #B91C1C; background: #FEF2F2; }

/* Sidebar */
.plan-sidebar {
  background: var(--surface); border-radius: var(--r-card);
  border: 1px solid var(--border); box-shadow: var(--shadow-xs);
  padding: 1rem; position: sticky; top: 1rem;
  max-height: calc(100vh - 8rem);
  display: flex; flex-direction: column;
}
.plan-sidebar-title {
  display: flex; align-items: center; justify-content: space-between;
  font-size: .78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted); margin-bottom: .75rem;
}
.plan-sidebar-empty { font-size: .8rem; color: var(--muted); text-align: center; padding: .75rem 0; }

/* Recherche dans la sidebar */
.plan-sidebar-search {
  display: flex; align-items: center; gap: .4rem;
  border: 1px solid var(--border); border-radius: 6px;
  padding: .3rem .55rem; margin-bottom: .75rem;
  background: var(--bg);
}
.plan-sidebar-search svg { flex-shrink: 0; color: var(--muted); }
.plan-sidebar-search input {
  border: none; background: transparent; font: inherit;
  font-size: .8rem; color: var(--text); width: 100%; outline: none;
}
.plan-sidebar-search input::placeholder { color: var(--subtle); }

/* Listes scrollables */
.plan-sidebar-scroll {
  overflow-y: auto; flex: 1;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.plan-available-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .375rem; }
.plan-available-row {
  display: flex; align-items: center; gap: .625rem;
  padding: .375rem .25rem; border-radius: 6px;
}
.plan-available-row:hover { background: var(--bg-alt); }
.plan-available-row[hidden] { display: none; }

/* Badge semaine en cours */
.plan-today-badge {
  display: inline-flex; align-items: center;
  padding: .15rem .55rem; border-radius: 99px;
  font-size: .72rem; font-weight: 600;
  background: #D1FAE5; color: #065F46;
  margin-left: .5rem;
}

/* État vide planning */
.plan-empty {
  display: flex; flex-direction: column; align-items: center; gap: 1rem;
  padding: 3rem 1rem; text-align: center;
  background: var(--surface); border-radius: var(--r-card);
  border: 1px solid var(--border); color: var(--muted);
}
.plan-empty svg { width: 40px; height: 40px; opacity: .35; }

/* Formulaire affectation */
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .875rem; }
@media (max-width: 600px) { .form-grid-2 { grid-template-columns: 1fr; } }
.form-optional { font-weight: 400; color: var(--muted); font-size: .8em; }
.form-card { max-width: 680px; margin: 0 auto; padding: 1.75rem; }
.form-page-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.back-link { font-size: .85rem; color: var(--muted); text-decoration: none; }
.back-link:hover { color: var(--text); }
.form-actions { display: flex; align-items: center; gap: .625rem; margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.form-errors { background: #FEF2F2; border: 1px solid #FECACA; border-radius: .5rem; padding: .75rem 1rem; margin-bottom: 1rem; }
.form-error { color: var(--danger); font-size: .85rem; margin: 0; }
.form-field-error { color: var(--danger); font-size: .78rem; margin: .25rem 0 0; }

/* ── Référentiel admin sections ────────────────────────────────────────── */
.ref-admin-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  margin-bottom: 1.25rem;
  overflow: hidden;
}
.ref-admin-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .875rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
}
.ref-admin-section-title {
  font-weight: 700;
  font-size: .95rem;
  color: var(--text);
}
.ref-admin-section-count {
  font-size: .78rem;
  color: var(--muted);
  margin-left: .625rem;
}
.ref-admin-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  padding: 1rem 1.25rem;
}
.ref-admin-tag {
  display: flex;
  align-items: center;
  gap: .375rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: .3rem .75rem;
  font-size: .83rem;
  color: var(--text);
}
.ref-admin-tag span { font-weight: 500; }
.ref-tag-action {
  font-size: .72rem;
  color: var(--muted);
  text-decoration: none;
  padding: .1rem .35rem;
  border-radius: 4px;
  transition: background .15s, color .15s;
}
.ref-tag-action:hover { background: var(--border); color: var(--text); }
.ref-tag-action--danger { color: var(--danger); }
.ref-tag-action--danger:hover { background: #FEF2F2; color: var(--danger); }
.ref-admin-empty {
  color: var(--muted);
  font-size: .85rem;
  padding: .25rem 0;
  font-style: italic;
}