/* ============================================================
   AGRILEV · ERP · Module Ressources Humaines
   Charte : vert #1F6B3B · or #E5A11C · terre cuite #B5561F
   Fond ivoire (jamais blanc pur) · Archivo + Inter
   Règles maison DIDASCO : zéro dégradé, zéro tiret cadratin
   ============================================================ */

:root {
  /* Marque */
  --vert:        #1F6B3B;
  --vert-800:    #164E2B;
  --vert-600:    #2A8049;
  --vert-100:    #E4EFE7;
  --vert-clair:  #8FB89B;
  --or:          #E5A11C;
  --or-100:      #FBEECF;
  --terre:       #B5561F;
  --terre-100:   #F5E2D6;
  --encre:       #23241F;
  --ivoire:      #FAF7F0;

  /* Jetons sémantiques */
  --bg:          #F2EEE4;
  --surface:     #FFFFFF;
  --surface-2:   #FAF7F0;
  --surface-3:   #F1ECE0;
  --text:        #23241F;
  --text-2:      #5B5D53;
  --text-3:      #8A8B80;
  --border:      #E3DECF;
  --border-2:    #D6D0BF;

  /* États */
  --ok:          #2A8049;
  --ok-bg:       #E4EFE7;
  --warn:        #C57A12;
  --warn-bg:     #FBEECF;
  --danger:      #B5561F;
  --danger-bg:   #F5E2D6;
  --info:        #2F6B8F;
  --info-bg:     #E1ECF2;

  /* Rayons & espacements */
  --r-sm: 8px;
  --r:    12px;
  --r-lg: 18px;
  --r-xl: 24px;

  --sidebar-w: 282px;
  --topbar-h: 64px;

  --shadow-sm: 0 1px 2px rgba(35,36,31,.06), 0 1px 3px rgba(35,36,31,.05);
  --shadow:    0 2px 8px rgba(35,36,31,.07), 0 8px 24px rgba(35,36,31,.05);

  --font-head: 'Archivo', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-serif: 'Source Serif 4', Georgia, serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 { font-family: var(--font-head); font-weight: 700; line-height: 1.15; letter-spacing: -.01em; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
ul { list-style: none; }

/* Scrollbars discrètes */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 20px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); background-clip: content-box; }

/* ============================================================
   LAYOUT PRINCIPAL
   ============================================================ */
.app { display: flex; min-height: 100vh; }

/* -------- Sidebar (coquille ERP) -------- */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--vert-800);
  color: #EAF1EC;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
}

.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand__logo {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--ivoire);
  display: grid; place-items: center; flex-shrink: 0;
  overflow: hidden;
}
.brand__logo img { width: 90%; height: 90%; object-fit: contain; }
.brand__txt { display: flex; flex-direction: column; line-height: 1.1; }
.brand__name { font-family: var(--font-head); font-weight: 800; font-size: 16px; letter-spacing: .02em; color: #fff; }
.brand__sub { font-size: 10.5px; color: var(--vert-clair); letter-spacing: .06em; text-transform: uppercase; }

.erp-label {
  font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  color: rgba(234,241,236,.5);
  padding: 18px 20px 8px;
}

.nav { flex: 1; overflow-y: auto; padding-bottom: 12px; }
.nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); background-clip: content-box; }

.nav-item {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  padding: 10px 20px;
  color: #D4E1D7;
  font-size: 13.5px;
  font-weight: 500;
  position: relative;
  border-radius: 0;
  text-align: left;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.nav-item svg { width: 19px; height: 19px; flex-shrink: 0; stroke-width: 1.7; }
.nav-item > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* En-tête de module repliable */
.nav-group { cursor: pointer; }
.nav-group .count { margin-left: auto; }
.nav-item > span.chev { flex: 0 0 auto; margin-left: 8px; display: inline-flex; align-items: center; opacity: .8; overflow: visible; transition: transform .2s; }
.nav-group .count + .chev { margin-left: 8px; }
.chev svg { width: 16px; height: 16px; }
.chev.is-collapsed { transform: rotate(-90deg); }
.nav-item > span.pending-dot { flex: 0 0 8px; width: 8px; height: 8px; min-width: 8px; border-radius: 50%; background: var(--or); overflow: visible; }
.pending-dot + .chev { margin-left: 8px; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }

.nav-item.is-active {
  background: rgba(255,255,255,.10);
  color: #fff;
  font-weight: 600;
}
.nav-item.is-active::before {
  content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px;
  background: var(--or); border-radius: 0 3px 3px 0;
}

.nav-item.is-disabled { color: rgba(212,225,215,.38); cursor: not-allowed; }
.nav-item.is-disabled:hover { background: none; color: rgba(212,225,215,.38); }

.nav-item .soon {
  margin-left: auto;
  font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: rgba(234,241,236,.55);
  border: 1px solid rgba(234,241,236,.22);
  padding: 2px 6px; border-radius: 20px;
}
.nav-item .count {
  margin-left: auto;
  min-width: 20px; height: 20px; padding: 0 6px;
  background: var(--or); color: var(--encre);
  font-size: 11px; font-weight: 700;
  border-radius: 20px; display: grid; place-items: center;
}

/* Sous-navigation RH */
.subnav { background: rgba(0,0,0,.14); }
.subnav .nav-item { padding-left: 51px; font-size: 13px; }
.subnav .nav-item svg { width: 17px; height: 17px; }

.sidebar__foot {
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 12px;
}
.sidebar__user {
  display: flex; align-items: center; gap: 10px;
  padding: 8px; border-radius: var(--r-sm);
}
.sidebar__user:hover { background: rgba(255,255,255,.06); }

/* -------- Zone principale -------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 30;
}
.topbar__menu { display: none; }
.breadcrumb { display: flex; align-items: center; gap: 8px; color: var(--text-3); font-size: 13px; }
.breadcrumb b { color: var(--text); font-weight: 600; }
.breadcrumb .sep { color: var(--border-2); }

.search {
  margin-left: 8px;
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-3);
  border: 1px solid transparent;
  border-radius: 20px;
  padding: 8px 14px;
  width: 300px; max-width: 34vw;
  color: var(--text-3);
}
.search:focus-within { border-color: var(--vert-clair); background: var(--surface); }
.search input { border: none; background: none; outline: none; flex: 1; font-size: 13px; color: var(--text); }
.search svg { width: 17px; height: 17px; }

.topbar__spacer { flex: 1; }

.role-switch {
  display: flex; background: var(--surface-3); border-radius: 20px; padding: 3px; gap: 2px;
}
.role-switch button {
  padding: 6px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; color: var(--text-2);
  display: flex; align-items: center; gap: 6px;
}
.role-switch button svg { width: 14px; height: 14px; }
.role-switch button.is-active { background: var(--vert); color: #fff; }

.icon-btn {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center; color: var(--text-2);
  position: relative;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn .dot {
  position: absolute; top: 8px; right: 8px; width: 8px; height: 8px;
  background: var(--terre); border-radius: 50%; border: 2px solid var(--surface);
}

.avatar {
  border-radius: 50%; background: var(--vert-100); color: var(--vert-800);
  display: grid; place-items: center; font-weight: 700; font-family: var(--font-head);
  flex-shrink: 0; overflow: hidden;
}
.avatar--sm { width: 30px; height: 30px; font-size: 11px; }
.avatar--md { width: 40px; height: 40px; font-size: 14px; }
.avatar--lg { width: 64px; height: 64px; font-size: 22px; }
.avatar.c1 { background: var(--vert-100); color: var(--vert-800); }
.avatar.c2 { background: var(--or-100); color: #8A5A06; }
.avatar.c3 { background: var(--terre-100); color: #7A3612; }
.avatar.c4 { background: var(--info-bg); color: #1E4A63; }

/* -------- Contenu -------- */
.content { padding: 24px; max-width: 1400px; width: 100%; margin: 0 auto; }

.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head__txt { flex: 1; min-width: 240px; }
.page-title { font-size: 24px; font-weight: 800; }
.page-sub { color: var(--text-2); margin-top: 4px; font-size: 13.5px; }
.page-sub svg { width: 14px; height: 14px; vertical-align: -2px; }
.site-card .muted svg { width: 13px; height: 13px; vertical-align: -1px; }
.page-head__actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ============================================================
   COMPOSANTS
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.card__head {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.card__head h3 { font-size: 15px; font-weight: 700; }
.card__head h3 svg { width: 16px; height: 16px; vertical-align: -2px; stroke-width: 2; }
.card__head .sub { color: var(--text-3); font-size: 12px; }
.card__head .spacer { flex: 1; }
.card__body { padding: 20px; }
.card__foot { padding: 12px 20px; border-top: 1px solid var(--border); }
.card__foot > svg { width: 15px; height: 15px; vertical-align: middle; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: 10px;
  font-size: 13px; font-weight: 600; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-2);
  transition: .14s;
}
.btn svg { width: 16px; height: 16px; stroke-width: 2; }
.btn:hover { border-color: var(--text-3); background: var(--surface-2); }
.btn--primary { background: var(--vert); color: #fff; border-color: var(--vert); }
.btn--primary:hover { background: var(--vert-800); border-color: var(--vert-800); }
.btn--or { background: var(--or); color: var(--encre); border-color: var(--or); }
.btn--or:hover { background: #CE9017; border-color: #CE9017; }
.btn--ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn--ghost:hover { background: var(--surface-3); }
.btn--sm { padding: 6px 11px; font-size: 12px; border-radius: 8px; }
.btn--danger { color: var(--danger); border-color: var(--danger); background: var(--danger-bg); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600;
  background: var(--surface-3); color: var(--text-2);
}
.chip svg { width: 13px; height: 13px; }
.chip--ok { background: var(--ok-bg); color: var(--ok); }
.chip--warn { background: var(--warn-bg); color: var(--warn); }
.chip--danger { background: var(--danger-bg); color: var(--danger); }
.chip--info { background: var(--info-bg); color: var(--info); }
.chip--or { background: var(--or-100); color: #8A5A06; }
.chip--vert { background: var(--vert-100); color: var(--vert-800); }
.chip--terre { background: var(--terre-100); color: #7A3612; }
.dot-status { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.badge-halal {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 6px;
  background: var(--vert-100); color: var(--vert-800);
  font-size: 10.5px; font-weight: 700; letter-spacing: .03em;
}
.badge-halal svg { width: 12px; height: 12px; }

/* KPI */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.kpi {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
}
.kpi__top { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.kpi__ico {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0;
}
.kpi__ico svg { width: 20px; height: 20px; stroke-width: 1.8; }
.kpi__ico.v { background: var(--vert-100); color: var(--vert); }
.kpi__ico.o { background: var(--or-100); color: #B77C0C; }
.kpi__ico.t { background: var(--terre-100); color: var(--terre); }
.kpi__ico.i { background: var(--info-bg); color: var(--info); }
.kpi__label { color: var(--text-2); font-size: 12.5px; font-weight: 500; }
.kpi__val { font-family: var(--font-head); font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.kpi__val small { font-size: 15px; font-weight: 600; color: var(--text-3); }
.kpi__foot { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; color: var(--text-3); }
.trend { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; }
.trend svg { width: 13px; height: 13px; }
.trend--up { color: var(--ok); }
.trend--down { color: var(--danger); }

/* Grilles dashboard */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: 2fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

/* Grille de cartes (magasins, points de vente, produits finis) : responsive */
.card-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.card-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card-grid--auto { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
@media (max-width: 1180px) { .card-grid, .card-grid--3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .card-grid, .card-grid--3, .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* Grille des panneaux « Indicateurs par domaine » (Pilotage) : 2 colonnes égales */
.dom-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 900px) { .dom-grid { grid-template-columns: 1fr; } }

/* Tableaux */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  text-align: left; font-weight: 600; color: var(--text-3);
  font-size: 11px; letter-spacing: .04em; text-transform: uppercase;
  padding: 10px 16px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.data td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr { transition: background .12s; }
table.data tbody tr:hover { background: var(--surface-2); cursor: pointer; }
table.data td > svg { width: 18px; height: 18px; vertical-align: middle; color: var(--text-3); }
.cell-person { display: flex; align-items: center; gap: 10px; }
.cell-person b { font-weight: 600; display: block; }
.cell-person span { color: var(--text-3); font-size: 12px; }

/* Barre de progression */
.bar { height: 8px; background: var(--surface-3); border-radius: 20px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--vert); border-radius: 20px; }
.bar > i.o { background: var(--or); }
.bar > i.t { background: var(--terre); }

/* Liste tâches / demandes */
.req { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.req:last-child { border-bottom: none; }
.req__body { flex: 1; min-width: 0; }
.req__body b { font-weight: 600; }
.req__body p { color: var(--text-3); font-size: 12px; }
.req__actions { display: flex; gap: 6px; }
.mini-btn {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  border: 1px solid var(--border-2); color: var(--text-2);
}
.mini-btn svg { width: 16px; height: 16px; }
.mini-btn.ok:hover { background: var(--ok-bg); color: var(--ok); border-color: var(--ok); }
.mini-btn.no:hover { background: var(--danger-bg); color: var(--danger); border-color: var(--danger); }

/* Barres verticales (mini graphe présence) */
.vbars { display: flex; align-items: flex-end; gap: 10px; height: 130px; padding-top: 8px; }
.vbar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.vbar__col { width: 100%; max-width: 34px; background: var(--vert-100); border-radius: 7px 7px 4px 4px; position: relative; display: flex; flex-direction: column; justify-content: flex-end; }
.vbar__fill { width: 100%; background: var(--vert); border-radius: 7px 7px 0 0; }
.vbar__fill.o { background: var(--or); border-radius: 0 0 4px 4px; }
.vbar__lbl { font-size: 11px; color: var(--text-3); font-weight: 600; }

/* Donut légende */
.legend { display: flex; flex-direction: column; gap: 10px; }
.legend li { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.legend .sw { width: 12px; height: 12px; border-radius: 4px; }
.legend .val { margin-left: auto; font-weight: 700; font-family: var(--font-head); }

/* Placeholder (écrans à construire) */
.placeholder {
  text-align: center; padding: 70px 24px; color: var(--text-3);
  border: 2px dashed var(--border-2); border-radius: var(--r-xl);
  background: var(--surface-2);
}
.placeholder .ico { width: 60px; height: 60px; border-radius: 16px; background: var(--surface-3); display: grid; place-items: center; margin: 0 auto 16px; color: var(--vert); }
.placeholder .ico svg { width: 28px; height: 28px; }
.placeholder h3 { font-size: 18px; color: var(--text); margin-bottom: 6px; }
.placeholder p { max-width: 420px; margin: 0 auto; }

/* Module ERP grisé */
.module-note {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 14px;
  padding: 8px 14px; border-radius: 20px; background: var(--warn-bg); color: var(--warn);
  font-size: 12.5px; font-weight: 600;
}

/* Utilitaires */
.muted { color: var(--text-3); }
.strong { font-weight: 700; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }
.hide { display: none !important; }

/* Segmented control (période) */
.seg { display: inline-flex; background: var(--surface-3); border-radius: 12px; padding: 3px; gap: 2px; }
.seg button {
  padding: 8px 14px; border-radius: 10px; font-size: 12.5px; font-weight: 600; color: var(--text-2); white-space: nowrap;
}
.seg button:hover { color: var(--text); }
.seg button.is-active { background: var(--vert); color: #fff; box-shadow: var(--shadow-sm); }

/* Filtres (selects) */
.filter-sel {
  font-family: inherit; font-size: 13px; color: var(--text);
  background: var(--surface-3); border: 1px solid transparent;
  border-radius: 10px; padding: 9px 12px; cursor: pointer; outline: none;
}
.filter-sel:hover { border-color: var(--border-2); }
.filter-sel:focus { border-color: var(--vert-clair); background: var(--surface); }

/* En-tête de fiche employé */
.fiche-head {
  display: flex; align-items: center; gap: 20px; padding: 20px 22px; margin-bottom: 18px; flex-wrap: wrap;
}
.fiche-head__id { flex: 1; min-width: 220px; }
.fiche-head__stats { display: flex; gap: 12px; }
.fstat {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r); padding: 12px 16px; text-align: center; min-width: 120px;
}
.fstat__v { display: block; font-family: var(--font-head); font-weight: 800; font-size: 18px; }
.fstat__l { font-size: 11.5px; color: var(--text-3); }

/* Onglets */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tab {
  padding: 11px 16px; font-size: 13.5px; font-weight: 600; color: var(--text-2);
  border-bottom: 2px solid transparent; white-space: nowrap; border-radius: 8px 8px 0 0;
}
.tab:hover { color: var(--text); background: var(--surface-2); }
.tab.is-active { color: var(--vert); border-bottom-color: var(--vert); }
.tab-panel { display: none; }
.tab-panel.is-active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Grille d'informations */
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 24px; }
.info { display: flex; flex-direction: column; padding: 9px 0; border-bottom: 1px solid var(--border); gap: 2px; }
.info__l { font-size: 11px; letter-spacing: .03em; text-transform: uppercase; color: var(--text-3); font-weight: 600; }
.info__v { font-size: 13.5px; color: var(--text); font-weight: 500; }

/* Documents */
.doc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.doc {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--border); border-radius: var(--r); padding: 12px 14px; background: var(--surface-2);
}
.doc__ico { width: 40px; height: 40px; border-radius: 10px; background: var(--vert-100); color: var(--vert); display: grid; place-items: center; flex-shrink: 0; }
.doc__ico svg { width: 20px; height: 20px; }
.doc__body { flex: 1; min-width: 0; }
.doc__body b { font-weight: 600; display: block; font-size: 13px; }
.doc__body span { font-size: 11.5px; color: var(--text-3); }
.doc > svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--text-3); }
.doc[data-open-bulletin]:hover { border-color: var(--vert-clair); background: var(--vert-100); }

/* Note paie */
.pay-note {
  display: flex; align-items: center; gap: 8px; margin-top: 14px;
  background: var(--warn-bg); color: #7a5410; border-radius: var(--r-sm);
  padding: 10px 12px; font-size: 12.5px;
}
.pay-note svg { width: 16px; height: 16px; flex-shrink: 0; }

/* Congés */
.conge-line { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 13px; }
.conge-line b { font-family: var(--font-head); font-weight: 800; }
.conge-legend { display: flex; gap: 18px; margin-top: 10px; font-size: 12.5px; color: var(--text-2); }
.conge-legend .sw, .legend .sw { display: inline-block; }

/* ============================================================
   TEMPS & PRÉSENCE
   ============================================================ */
.tstrip {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 16px;
}
.tstat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  padding: 14px 16px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 2px;
}
.tstat__v { font-family: var(--font-head); font-weight: 800; font-size: 22px; letter-spacing: -.02em; }
.tstat__l { font-size: 11.5px; color: var(--text-3); font-weight: 500; }

.date-nav { display: flex; align-items: center; gap: 10px; }
.mini-btn.flip svg, .date-nav .mini-btn:first-child svg { }
.date-nav .mini-btn:first-child { transform: scaleX(-1); }

.live-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ok);
  margin-left: 2px; box-shadow: 0 0 0 0 rgba(42,128,73,.5); animation: pulse 1.8s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(42,128,73,.45); }
  70% { box-shadow: 0 0 0 6px rgba(42,128,73,0); }
  100% { box-shadow: 0 0 0 0 rgba(42,128,73,0); }
}

.shift {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px;
  font-family: var(--font-head); font-weight: 800; font-size: 13px;
}
.rota td { padding: 8px 16px; }
.shift-legend { display: flex; gap: 14px; flex-wrap: wrap; }
.shift-leg { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; color: var(--text-2); }
.shift-leg .shift { width: 24px; height: 24px; font-size: 11px; }

@media (max-width: 1080px) { .tstrip { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .tstrip { grid-template-columns: repeat(2, 1fr); } .shift-legend { display: none; } }

/* ============================================================
   PRODUCTION & ÉLEVAGE
   ============================================================ */
.alert-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.alert-row:last-child { border-bottom: none; }
.alert-row:hover { background: var(--surface-2); }
.alert-row > svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--text-3); }
.alert-ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; }
.alert-ico svg { width: 19px; height: 19px; }
.alert-ico.danger { background: var(--danger-bg); color: var(--danger); }
.alert-ico.warn { background: var(--warn-bg); color: var(--warn); }
.alert-ico.ok { background: var(--ok-bg); color: var(--ok); }
.alert-ico.info { background: var(--info-bg); color: var(--info); }

/* Couvoir & éclosion */
.couvee { border: 1px solid var(--border); border-radius: var(--r); padding: 14px 16px; background: var(--surface-2); }
.couvee__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.couvee__head b { font-size: 14px; }
.couvee__bar { margin-bottom: 8px; }
.couvee__ticks { display: flex; justify-content: space-between; margin-top: 6px; font-size: 10.5px; color: var(--text-3); font-weight: 600; }

/* Sites & bâtiments */
.site-card { cursor: pointer; transition: .15s; }
.site-card:hover { border-color: var(--vert-clair); transform: translateY(-2px); box-shadow: var(--shadow); }
.site-card > .card__body > .row > svg { width: 18px; height: 18px; color: var(--text-3); }
.site-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; border-top: 1px solid var(--border); padding-top: 12px; }
.site-stats > div { display: flex; flex-direction: column; }
.site-stats b { font-family: var(--font-head); font-weight: 800; font-size: 18px; }
.site-stats span { font-size: 11px; color: var(--text-3); }

.add-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  border: 2px dashed var(--border-2); background: var(--surface-2); text-align: center; min-height: 200px; color: var(--text-2);
}
.add-card:hover { border-color: var(--vert-clair); color: var(--vert); }
.add-card__ico { width: 44px; height: 44px; border-radius: 12px; background: var(--surface-3); display: grid; place-items: center; }
.add-card__ico svg { width: 22px; height: 22px; }

.bat-card { box-shadow: var(--shadow-sm); }
.bat-card.is-clickable { cursor: pointer; transition: .14s; }
.bat-card.is-clickable:hover { border-color: var(--vert-clair); transform: translateY(-2px); box-shadow: var(--shadow); }
.bat-card__ico { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; background: var(--surface-3); color: var(--text-2); }
.bat-card__ico svg { width: 20px; height: 20px; }
.bat-card__ico.occupe { background: var(--vert-100); color: var(--vert); }
.bat-card__ico.actif { background: var(--info-bg); color: var(--info); }
.bat-card__ico.nettoyage { background: var(--warn-bg); color: var(--warn); }
.bat-occ { margin-top: 4px; }

/* Cycle de production (stepper) */
.cycle { display: flex; align-items: flex-start; }
.cycle-step { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; flex-shrink: 0; }
.cycle-dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border-2); background: var(--surface); position: relative; }
.cycle-lbl b { font-size: 12.5px; font-weight: 700; display: block; }
.cycle-lbl small { font-size: 11px; color: var(--text-3); }
.cycle-line { flex: 1; height: 2px; background: var(--border-2); margin: 9px -4px 0; min-width: 24px; }
.cycle-step.is-done .cycle-dot { background: var(--vert); border-color: var(--vert); }
.cycle-step.is-done .cycle-dot::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: #fff; transform: scale(.5); }
.cycle-step.is-current .cycle-dot { border-color: var(--vert); box-shadow: 0 0 0 4px var(--vert-100); }
.cycle-step.is-current .cycle-dot::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--vert); }
.cycle-step.is-current .cycle-lbl b { color: var(--vert); }
.cycle-step.is-todo .cycle-lbl b { color: var(--text-3); }
@media (max-width: 640px) { .cycle-lbl small { display: none; } .cycle-line { min-width: 12px; } }

/* Saisie journalière */
.saisie { display: grid; grid-template-columns: 1fr 320px; gap: 16px; align-items: start; }
.saisie__main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.s-sticky { position: sticky; top: 84px; }

.bat-picker { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.bat-chip {
  display: flex; align-items: center; gap: 9px; flex-shrink: 0;
  border: 1px solid var(--border-2); border-radius: 12px; padding: 9px 13px; background: var(--surface);
  transition: .14s; text-align: left;
}
.bat-chip:hover { border-color: var(--vert-clair); }
.bat-chip.is-current { border-color: var(--vert); background: var(--vert-100); }
.bat-chip__ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); flex-shrink: 0; }
.bat-chip__ico svg { width: 16px; height: 16px; }
.bat-chip.is-done .bat-chip__ico { background: var(--vert); color: #fff; }
.bat-chip__t { display: flex; flex-direction: column; line-height: 1.15; }
.bat-chip__t b { font-size: 13px; }
.bat-chip__t small { font-size: 11px; color: var(--text-3); }

.s-form { display: flex; flex-direction: column; gap: 20px; }
.s-block h4 { font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 7px; margin-bottom: 12px; color: var(--text); }
.s-block h4 svg { width: 16px; height: 16px; color: var(--vert); }
.num { width: 100%; font-family: inherit; font-size: 15px; font-weight: 600; padding: 9px 12px; border-radius: 10px; background: var(--surface-3); border: 1px solid transparent; outline: none; }
.num:focus { border-color: var(--vert-clair); background: var(--surface); }
.s-ref { font-size: 15px; font-weight: 700; padding: 9px 12px; border-radius: 10px; background: var(--surface-2); border: 1px dashed var(--border-2); color: var(--text-2); }
.cal-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.obs-tag { font-size: 12px; font-weight: 600; color: var(--text-2); border: 1px solid var(--border-2); border-radius: 20px; padding: 6px 12px; }
.obs-tag:hover { border-color: var(--text-3); }
.obs-tag.is-active { background: var(--vert); color: #fff; border-color: var(--vert); }

.s-sum-hl { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.s-sum-hl span { font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.s-sum-hl b { font-family: var(--font-head); font-weight: 800; font-size: 26px; color: var(--vert); }
.s-sum-sec { font-size: 11.5px; color: var(--text-3); margin: 8px 0 12px; }
.s-sum-grp { border-top: 1px solid var(--border); padding-top: 10px; margin-top: 4px; }
.s-sum-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 13px; }
.s-sum-row span { color: var(--text-2); }
.s-sum-row b { font-weight: 700; }
.s-stock { display: flex; align-items: flex-start; gap: 9px; margin-top: 14px; padding: 11px 12px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--border); }
.s-stock svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--vert); margin-top: 1px; }
.s-stock b { display: block; font-size: 13px; }
.s-stock span { font-size: 11.5px; color: var(--text-3); }
.s-stock.is-low { background: var(--danger-bg); border-color: var(--danger); }
.s-stock.is-low svg, .s-stock.is-low b { color: var(--danger); }
.s-stock.is-low span { color: #8a3a18; }

@media (max-width: 900px) {
  .saisie { grid-template-columns: 1fr; }
  .s-sticky { position: static; }
  .cal-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   RECRUTEMENT & INTÉGRATION
   ============================================================ */
.stars { font-size: 13px; color: var(--or); letter-spacing: 1px; white-space: nowrap; }
.stars__off { color: var(--border-2); }

/* Pipeline kanban */
.kanban { display: grid; grid-template-columns: repeat(5, minmax(180px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.kcol { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r); display: flex; flex-direction: column; min-width: 180px; }
.kcol__head {
  display: flex; align-items: center; gap: 8px; padding: 12px 14px;
  font-size: 12.5px; font-weight: 700; border-bottom: 1px solid var(--border);
}
.kdot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.kcount { margin-left: auto; background: var(--surface-3); color: var(--text-2); font-size: 11px; min-width: 20px; height: 20px; border-radius: 20px; display: grid; place-items: center; }
.kcol__body { padding: 10px; display: flex; flex-direction: column; gap: 10px; min-height: 60px; }
.kcard { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 11px; cursor: pointer; transition: .14s; box-shadow: var(--shadow-sm); }
.kcard:hover { border-color: var(--vert-clair); transform: translateY(-2px); box-shadow: var(--shadow); }
.kcard b { display: block; line-height: 1.2; }
.kempty { text-align: center; color: var(--text-3); font-size: 12px; padding: 14px 0; }

/* Intégration / onboarding */
.onb-steps { display: flex; flex-direction: column; gap: 2px; }
.onb-step { display: flex; align-items: center; gap: 11px; padding: 8px 0; cursor: pointer; font-size: 13.5px; }
.onb-step.is-done > span { color: var(--text-3); text-decoration: line-through; }
.onb-check {
  width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--border-2);
  display: grid; place-items: center; flex-shrink: 0; color: #fff; background: var(--surface);
}
.onb-check svg { width: 13px; height: 13px; stroke-width: 3; }
.onb-step.is-done .onb-check { background: var(--vert); border-color: var(--vert); }

@media (max-width: 700px) { .kanban { grid-template-columns: repeat(5, 76vw); } }

/* ============================================================
   MODALE · formulaire d'absence
   ============================================================ */
.modal-scrim {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px;
  background: rgba(35,36,31,.5); opacity: 0; transition: opacity .18s;
}
.modal-scrim.is-open { opacity: 1; }
.modal {
  background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow);
  width: 100%; max-width: 460px; max-height: 90vh; overflow-y: auto;
  transform: translateY(10px) scale(.98); transition: transform .18s;
}
.modal-scrim.is-open .modal { transform: none; }
.modal__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 12px; }
.modal__head h3 { font-size: 17px; font-weight: 700; }
.modal__body { padding: 4px 20px 8px; display: flex; flex-direction: column; gap: 14px; }
.modal__foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px 20px; }
.modal__foot .btn { flex: 1; justify-content: center; }

.fld { display: flex; flex-direction: column; gap: 6px; }
.fld > span { font-size: 12px; font-weight: 600; color: var(--text-2); }
.fld .filter-sel, .fld input, .fld textarea, .fld select { width: 100%; font-family: inherit; }
.fld textarea { resize: vertical; padding: 9px 12px; border-radius: 10px; background: var(--surface-3); border: 1px solid transparent; outline: none; }
.fld textarea:focus { border-color: var(--vert-clair); background: var(--surface); }
.fld-row { display: flex; gap: 12px; flex-wrap: wrap; }
.fld-row .fld { flex: 1; min-width: 150px; }
@media (max-width: 560px) { .fld-row { flex-direction: column; } }
.af-emp-fixed { display: flex; align-items: center; gap: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r); padding: 12px; }
.af-summary { font-size: 12.5px; font-weight: 600; color: var(--vert-800); background: var(--vert-100); border-radius: var(--r-sm); padding: 10px 12px; }
.af-summary.is-error { color: var(--danger); background: var(--danger-bg); }

/* Note badge */
.badge-note { display: flex; align-items: flex-start; gap: 8px; margin-top: 14px; padding: 10px 12px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); font-size: 12px; color: var(--text-2); line-height: 1.5; }
.badge-note svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--vert); margin-top: 1px; }
.badge-inline { display: inline-flex; align-items: center; gap: 5px; }
.badge-inline svg { width: 14px; height: 14px; }

/* ============================================================
   PORTAIL EMPLOYÉ (self-service, mobile-first)
   ============================================================ */
.portail { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.pcard {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: 18px;
}
.pcard__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 6px; }
.pcard__head h3 { font-size: 15px; font-weight: 700; }
.pcard--hero { display: flex; align-items: center; gap: 16px; }

/* Pointage */
.punch { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.punch--poste { border-left: 4px solid var(--vert); }
.punch--parti { border-left: 4px solid var(--text-3); }
.punch__label {
  display: inline-flex; align-items: center; gap: 7px; font-weight: 700; font-size: 14px; color: var(--vert);
  margin-bottom: 12px;
}
.punch--poste .punch__label::before {
  content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--ok);
  box-shadow: 0 0 0 0 rgba(42,128,73,.5); animation: pulse 1.8s infinite;
}
.punch--parti .punch__label { color: var(--text-2); }
.punch__times { display: flex; gap: 26px; }
.punch__times > div { display: flex; flex-direction: column; gap: 2px; }
.punch__times span { font-size: 11px; }
.punch__times b { font-family: var(--font-head); font-weight: 800; font-size: 18px; }
.punch__btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 15px 26px; border-radius: 14px; font-size: 15px; font-weight: 700;
  background: var(--vert); color: #fff; box-shadow: var(--shadow-sm); transition: .15s;
}
.punch__btn:hover { background: var(--vert-800); transform: translateY(-1px); }
.punch__btn svg { width: 20px; height: 20px; }
.punch__btn.is-done { background: var(--surface-3); color: var(--text-2); cursor: default; box-shadow: none; }

/* Planning de la semaine */
.pw { display: flex; gap: 6px; justify-content: space-between; }
.pw-day { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; }
.pw-lbl { font-size: 10.5px; color: var(--text-3); font-weight: 600; }
.pw-day .shift { width: 100%; max-width: 40px; height: 34px; border-radius: 9px; }

@media (max-width: 560px) {
  .punch { flex-direction: column; align-items: stretch; }
  .punch__btn { width: 100%; }
  .punch__times { gap: 18px; }
}

/* ============================================================
   PRÉPARATION DE LA PAIE
   ============================================================ */
.src-note {
  display: flex; align-items: flex-start; gap: 9px; margin-bottom: 16px;
  background: var(--info-bg); color: #1e4a63; border-radius: var(--r);
  padding: 12px 16px; font-size: 12.5px; line-height: 1.5;
}
.src-note svg { width: 17px; height: 17px; flex-shrink: 0; margin-top: 1px; }
.lnk { color: var(--vert); font-weight: 600; text-decoration: underline; cursor: pointer; }
.lnk:hover { color: var(--vert-800); }

.paie-table th, .paie-table td { padding-left: 12px; padding-right: 12px; }
.paie-table tfoot td { border-top: 2px solid var(--border-2); background: var(--surface-2); padding-top: 12px; padding-bottom: 12px; }

.bulletin { padding: 24px; }
.bulletin__head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  padding-bottom: 16px; border-bottom: 2px solid var(--encre); flex-wrap: wrap;
}
.bulletin__id {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 20px;
  padding: 16px 0; border-bottom: 1px solid var(--border); margin-bottom: 16px;
}
.bulletin__id > div { display: flex; flex-direction: column; gap: 2px; }
.bulletin__block h4 { font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); margin-bottom: 8px; }
table.mini { width: 100%; }
table.mini td { padding: 8px 4px; font-size: 13px; }
table.mini .tsum td { border-top: 1.5px solid var(--border-2); border-bottom: none; }
.bulletin__net {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
  margin-top: 18px; padding: 18px 20px; background: var(--vert-100); border-radius: var(--r-lg);
}
@media (max-width: 700px) { .bulletin__id { grid-template-columns: repeat(2, 1fr); } }

/* ============================================================
   ABSENCES & CONGÉS
   ============================================================ */
.fchips { display: flex; gap: 8px; flex-wrap: wrap; }
.fchip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 20px; font-size: 13px; font-weight: 600;
  color: var(--text-2); background: var(--surface); border: 1px solid var(--border-2);
}
.fchip:hover { border-color: var(--text-3); }
.fchip.is-active { background: var(--vert); color: #fff; border-color: var(--vert); }
.fchip__n {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 20px;
  background: var(--surface-3); color: var(--text-2);
  display: inline-grid; place-items: center; font-size: 11px; font-weight: 700;
}
.fchip.is-active .fchip__n { background: rgba(255,255,255,.25); color: #fff; }

/* Calendrier / planning des absences */
.cal-scroll { overflow-x: auto; padding: 8px 0; }
.cal-row { display: flex; align-items: stretch; min-width: 860px; }
.cal-label {
  width: 190px; flex-shrink: 0; display: flex; align-items: center; gap: 9px;
  padding: 7px 16px; border-bottom: 1px solid var(--border);
}
.cal-label .avatar { width: 28px; height: 28px; font-size: 10px; }
.cal-label b { font-size: 12.5px; font-weight: 600; display: block; line-height: 1.1; }
.cal-label span { font-size: 11px; color: var(--text-3); }
.cal-track {
  flex: 1; display: grid; grid-template-columns: repeat(31, 1fr);
  position: relative; border-bottom: 1px solid var(--border); min-height: 42px;
}
.cal-head .cal-track { min-height: 30px; border-bottom: 2px solid var(--border-2); }
.cal-head .cal-label { border-bottom: 2px solid var(--border-2); }
.cal-day {
  grid-row: 1; text-align: center; font-size: 11px; font-weight: 600; color: var(--text-3);
  align-self: center; padding: 4px 0;
}
.cal-day.we { color: var(--text-2); background: var(--surface-2); }
.cal-day.is-today { color: #fff; background: var(--vert); border-radius: 6px; }
.cal-cell { grid-row: 1; border-left: 1px solid var(--surface-3); }
.cal-cell.we { background: var(--surface-2); }
.cal-cell.is-today { background: rgba(31,107,59,.07); border-left-color: var(--vert-clair); }
.cal-abs {
  grid-row: 1; align-self: center; margin: 4px 2px; height: 26px; border-radius: 8px;
  display: flex; align-items: center; gap: 6px; padding: 0 10px;
  font-size: 11px; font-weight: 700; border: 1.5px solid transparent; overflow: hidden; white-space: nowrap;
}
.cal-abs.is-pending { background: transparent !important; border-style: dashed; }
.cal-pill {
  font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
  background: rgba(0,0,0,.06); padding: 1px 5px; border-radius: 10px;
}

/* ============================================================
   ORGANIGRAMME
   ============================================================ */
.org-legend { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.org-leg { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); font-weight: 500; }
.org-leg .sw { width: 11px; height: 11px; border-radius: 3px; }

.org-path { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.org-crumb {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 10px 4px 4px; border-radius: 20px; font-size: 12.5px; font-weight: 600; color: var(--text-2);
  background: var(--surface-3);
}
.org-crumb:hover { background: var(--vert-100); color: var(--vert-800); }
.org-crumb.is-current { background: var(--vert); color: #fff; }
.org-crumb .avatar { width: 24px; height: 24px; font-size: 10px; }
.org-crumb-sep { color: var(--border-2); display: inline-flex; }
.org-crumb-sep svg { width: 15px; height: 15px; }

.org-scroll { overflow-x: auto; padding: 24px 16px 8px; }

/* Arbre (connecteurs CSS classiques) */
.tree { display: inline-block; min-width: 100%; text-align: center; }
.tree ul { display: flex; justify-content: center; padding-top: 22px; position: relative; }
.tree li {
  list-style: none; position: relative; padding: 22px 10px 0; text-align: center;
}
.tree li::before, .tree li::after {
  content: ''; position: absolute; top: 0; right: 50%;
  border-top: 2px solid var(--border-2); width: 50%; height: 22px;
}
.tree li::after { right: auto; left: 50%; border-left: 2px solid var(--border-2); }
.tree li:only-child::after, .tree li:only-child::before { display: none; }
.tree li:only-child { padding-top: 0; }
.tree li:first-child::before, .tree li:last-child::after { border: 0 none; }
.tree li:last-child::before { border-right: 2px solid var(--border-2); border-radius: 0 6px 0 0; }
.tree li:first-child::after { border-radius: 6px 0 0 0; }
.tree ul ul::before {
  content: ''; position: absolute; top: 0; left: 50%;
  border-left: 2px solid var(--border-2); width: 0; height: 22px;
}
.tree > ul { padding-top: 0; }
.tree > ul > li:only-child::before, .tree > ul > li:only-child::after { display: none; }

.org-node {
  display: inline-flex; flex-direction: column; align-items: center; gap: 6px;
  width: 176px; padding: 14px 12px 12px; position: relative;
  background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--vert);
  border-radius: var(--r); box-shadow: var(--shadow-sm); cursor: pointer; transition: .15s; vertical-align: top;
}
.org-node:hover { border-color: var(--vert-clair); box-shadow: var(--shadow); transform: translateY(-2px); }
.org-node.is-focus { border-color: var(--vert); box-shadow: 0 0 0 3px var(--vert-100); }
.org-node__body { display: flex; flex-direction: column; gap: 2px; }
.org-node__body b { font-size: 13.5px; font-weight: 700; line-height: 1.2; }
.org-node__poste { font-size: 11.5px; color: var(--text-2); }
.org-node__ent { font-size: 10.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 3px; justify-content: center; }
.org-node__ent svg { width: 11px; height: 11px; }
.org-node__count {
  font-size: 10.5px; font-weight: 600; color: var(--vert-800);
  background: var(--vert-100); padding: 3px 8px; border-radius: 20px; margin-top: 2px;
}
.org-node__count.muted { background: var(--surface-3); color: var(--text-3); }
.org-node__fiche {
  font-size: 11px; font-weight: 600; color: var(--text-2);
  display: inline-flex; align-items: center; gap: 3px; padding: 4px 8px; border-radius: 7px;
}
.org-node__fiche:hover { background: var(--surface-3); color: var(--vert); }
.org-node__fiche svg { width: 13px; height: 13px; }

@media (max-width: 820px) {
  .org-legend { display: none; }
  .org-node { width: 150px; }
}

/* Overlay mobile */
.scrim { display: none; position: fixed; inset: 0; background: rgba(35,36,31,.5); z-index: 39; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1080px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .sidebar {
    position: fixed; left: 0; top: 0; transform: translateX(-100%);
    transition: transform .25s ease; box-shadow: var(--shadow);
  }
  .app.nav-open .sidebar { transform: translateX(0); }
  .app.nav-open .scrim { display: block; }
  .topbar__menu { display: grid; }
  .search { display: none; }
  .role-switch button span { display: none; }
  .content { padding: 16px; }
  .page-head__actions { width: 100%; }
  .page-head__actions .btn { flex: 1; justify-content: center; }
  .seg { width: 100%; }
  .seg button { flex: 1; text-align: center; padding: 8px 6px; }
  .info-grid, .doc-grid { grid-template-columns: 1fr; }
  .fiche-head { gap: 14px; }
  .fiche-head__stats { width: 100%; }
  .fstat { flex: 1; min-width: 0; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .kpi__val { font-size: 24px; }
  .breadcrumb .crumb-hide { display: none; }
}
@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .page-title { font-size: 20px; }
}

/* ============================================================
   DÉMO GUIDÉE · parcours de présentation client
   ============================================================ */
.btn-demo {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--or); color: var(--encre);
  border-radius: 20px; padding: 8px 15px;
  font-family: var(--font-head); font-weight: 700; font-size: 12.5px;
  flex-shrink: 0; transition: transform .12s, box-shadow .12s;
}
.btn-demo svg { width: 13px; height: 13px; }
.btn-demo:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
@media (max-width: 1080px) { .btn-demo span { display: none; } .btn-demo { padding: 8px 11px; } }

.demo-card {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 18px;
  width: min(600px, calc(100vw - 24px));
  background: var(--encre); color: #fff;
  border-radius: 16px; padding: 16px 18px 14px;
  z-index: 130;
  box-shadow: 0 14px 44px rgba(35,36,31,.4);
}
.demo-card__top { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.demo-card__step {
  font-family: var(--font-head); font-size: 10.5px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: var(--or);
}
.demo-card__quit {
  margin-left: auto; color: rgba(255,255,255,.55);
  display: inline-flex; padding: 4px; border-radius: 8px;
}
.demo-card__quit:hover { color: #fff; background: rgba(255,255,255,.1); }
.demo-card__quit svg { width: 15px; height: 15px; }
.demo-card h4 { font-size: 15.5px; color: #fff; margin-bottom: 5px; }
.demo-card p { font-size: 12.5px; line-height: 1.55; color: #E6E3D8; margin-bottom: 12px; }
.demo-card__bar { height: 4px; background: rgba(255,255,255,.16); border-radius: 2px; overflow: hidden; margin-bottom: 12px; }
.demo-card__bar i { display: block; height: 100%; background: var(--or); border-radius: 2px; transition: width .25s; }
.demo-card__foot { display: flex; align-items: center; gap: 8px; }
.demo-card__count { font-size: 11.5px; color: rgba(255,255,255,.55); margin-left: auto; margin-right: auto; }
.demo-btn {
  border: 1px solid rgba(255,255,255,.28); color: #fff;
  border-radius: 10px; padding: 7px 15px;
  font-size: 12.5px; font-weight: 600;
}
.demo-btn:hover { background: rgba(255,255,255,.08); }
.demo-btn:disabled { opacity: .35; cursor: default; }
.demo-btn:disabled:hover { background: none; }
.demo-btn--or { background: var(--or); border-color: var(--or); color: var(--encre); font-weight: 700; }
.demo-btn--or:hover { background: var(--or); filter: brightness(1.06); }
.demo-card__keys { font-size: 10.5px; color: rgba(255,255,255,.4); text-align: center; margin-top: 9px; }
@media (max-width: 640px) { .demo-card__keys { display: none; } }

/* Chapitres de la démo guidée */
.demo-card__chaps { display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0 10px; }
.demo-chap {
  font-family: var(--font-head); font-size: 9.5px; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 12px;
  color: rgba(255,255,255,.55); background: rgba(255,255,255,.09);
  transition: background .12s, color .12s;
}
.demo-chap:hover { color: #fff; background: rgba(255,255,255,.16); }
.demo-chap.is-active { background: var(--or); color: var(--encre); }
@media (max-width: 640px) { .demo-card__chaps { display: none; } }
