/* === Polices auto-hébergées (Poppins / Inter — licence SIL Open Font, voir static/fonts/LICENSE-*.txt) === */
@font-face { font-family: 'Inter'; src: url('../fonts/inter-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../fonts/inter-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../fonts/inter-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Poppins'; src: url('../fonts/poppins-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Poppins'; src: url('../fonts/poppins-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }

/* =============================================================================
   Refonte 2026 — palette SaaS RH premium (bleu #2563EB, sidebar sombre #0B1220,
   fond clair #F6F8FC), inspirée Microsoft 365 / Workday / SAP SuccessFactors.
   Le doré reste disponible (--gold) mais n'est plus la couleur d'accent par
   défaut des boutons/liens/états actifs — réservé aux touches "premium"
   ponctuelles (ex. certains badges). Architecture 100% par variables CSS pour
   que le mode sombre ([data-theme="dark"] plus bas) se propage à toute
   l'application sans dupliquer les règles.
   ============================================================================= */
:root {
  --navy: #0F172A; --navy-light: #2563EB;
  --primary: #2563EB; --primary-dark: #1D4ED8;
  --sidebar: #0B1220;
  --paper: #F6F8FC; --surface: #FFFFFF;
  --gold: #D4A63D; --gold-soft: #FBF0DA;
  --ink: #0F172A; --ink-muted: #64748B;
  --border: #E2E8F0;
  --th-bg: #F1F5F9; --hover-bg: #EFF4FF; --subsection-bg: #F7F8FA;
  --green: #10B981; --green-soft: #D1FAE5;
  --red: #EF4444; --red-soft: #FEE2E2;
  --blue: #2563EB; --blue-soft: #DBEAFE;
  --orange: #F59E0B; --orange-soft: #FEF3C7;
  --badge-purple-bg: #EDE6F5; --badge-purple-ink: #6B4C93;
  --badge-teal-bg: #DCF0EC; --badge-teal-ink: #1E7A6B;
  --badge-violet-bg: #EDE2F5; --badge-violet-ink: #5B3E80;
  --radius: 14px; --radius-lg: 24px;
  --shadow-sm: 0 1px 2px rgba(15,23,42,0.06), 0 1px 3px rgba(15,23,42,0.08);
  --shadow-md: 0 4px 10px rgba(15,23,42,0.07), 0 2px 4px rgba(15,23,42,0.06);
  --shadow-lg: 0 15px 40px rgba(15,23,42,0.08);
  --shadow-table: 0 10px 40px rgba(15,23,42,0.07);
  --font-title: 'Poppins', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Inter', 'Segoe UI', system-ui, sans-serif;
}

/* Mode sombre — même jeu de variables redéfini ; la sidebar reste sombre dans
   les deux modes (identité de marque constante), seule la zone de contenu
   bascule. Les couleurs d'accent (bleu, vert, rouge, orange, doré) restent
   volontairement identiques entre les deux modes : ce sont des couleurs de
   données/action, pas des couleurs de surface — les faire varier nuirait à la
   cohérence visuelle plutôt que d'y aider. */
[data-theme="dark"] {
  --paper: #0B1220; --surface: #16213A;
  --ink: #F1F5F9; --ink-muted: #94A3B8;
  --border: #2B3B57;
  --th-bg: #1C2942; --hover-bg: #1A2C4D; --subsection-bg: #182238;
  --green-soft: rgba(16,185,129,0.18); --red-soft: rgba(239,68,68,0.18);
  --blue-soft: rgba(37,99,235,0.22); --orange-soft: rgba(245,158,11,0.18);
  --gold-soft: rgba(212,166,61,0.18);
  --badge-purple-bg: rgba(139,92,246,0.18); --badge-purple-ink: #C4B5FD;
  --badge-teal-bg: rgba(13,148,136,0.2); --badge-teal-ink: #5EEAD4;
  --badge-violet-bg: rgba(139,92,246,0.18); --badge-violet-ink: #D8B4FE;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3), 0 1px 3px rgba(0,0,0,0.35);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.35);
  --shadow-lg: 0 15px 40px rgba(0,0,0,0.4);
  --shadow-table: 0 10px 30px rgba(0,0,0,0.35);
}
[data-theme="dark"] body { background: var(--paper); }
[data-theme="dark"] .btn-outline { color: var(--ink); }
[data-theme="dark"] img.logo-clair { filter: brightness(0) invert(1); }

* { box-sizing: border-box; }
html { transition: background 0.15s ease; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font-body); font-size: 15.5px; line-height: 1.5; transition: background 0.15s ease, color 0.15s ease; }
h1, h2, h3, h4, h5, h6 { font-family: var(--font-title); }

/* Ancien écran de connexion en dégradé — non utilisé (login.html a son propre
   style autonome depuis la refonte de l'écran de connexion), conservé tel
   quel pour ne rien casser en cas d'usage résiduel. Non concerné par cette
   refonte (l'écran de connexion est explicitement exclu). */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(rgba(10,14,24,0.45), rgba(10,14,24,0.45)), linear-gradient(135deg, var(--navy), var(--navy-light), var(--gold));
  overflow: hidden; padding: 20px; }
.login-card { width: 420px; max-width: 100%; padding: 40px; border-radius: 24px;
  background: rgba(255,255,255,0.08); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.15); box-shadow: 0 20px 60px rgba(0,0,0,0.35); }
.login-logo { width: 68px; height: 68px; margin: 0 auto 20px; border-radius: 18px;
  background: linear-gradient(135deg, var(--gold), var(--navy-light));
  display: flex; align-items: center; justify-content: center; overflow: hidden; }
.login-logo img { width: 100%; height: 100%; object-fit: cover; }
.login-logo span { color: #fff; font-family: var(--font-title); font-size: 28px; font-weight: 600; }
.login-card h1 { text-align: center; color: #fff; margin-bottom: 8px; font-family: var(--font-title); font-weight: 600; font-size: 24px; }
.login-card .subtitle { text-align: center; color: #C9CEDB; margin-bottom: 28px; font-size: 13.5px; line-height: 1.5; }
.login-card .field { margin-bottom: 18px; }
.login-card .field label { color: #fff; }
.login-card .field input { background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.18); color: #fff; }
.login-card .field input::placeholder { color: #C9CEDB; }
.login-card .field input:focus { border-color: var(--gold); }
.login-card .btn-primary { width: 100%; justify-content: center; margin-top: 6px;
  background: linear-gradient(135deg, var(--gold), var(--navy-light)); border: none; }
.login-hint { font-size: 11.5px; color: #C9CEDB; text-align: center; margin-top: 18px; }
.password-field { position: relative; }
.password-field input { width: 100%; box-sizing: border-box; padding-right: 40px; }
.password-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; font-size: 15px; opacity: 0.7; padding: 6px; line-height: 1; }
.password-toggle:hover { opacity: 1; }
.login-options { display: flex; align-items: center; justify-content: space-between; margin: -6px 0 18px; font-size: 12.5px; }
.login-options a { color: var(--gold); text-decoration: none; }
.login-options a:hover { text-decoration: underline; }
.remember-me { display: flex; align-items: center; gap: 6px; color: #C9CEDB; cursor: pointer; font-weight: 400; }
.remember-me input { margin: 0; }
.login-wrap { position: relative; overflow: hidden; }
#networkCanvas { position: absolute; inset: 0; z-index: 0; }
.login-card { position: relative; z-index: 2; }
.floating-icon { position: absolute; z-index: 1; color: #fff; opacity: 0.06; font-size: 46px; animation: float-icon 14s infinite linear; }
@keyframes float-icon { from { transform: translateY(100vh) rotate(0deg); } to { transform: translateY(-160px) rotate(360deg); } }
.login-footer { margin-top: 20px; text-align: center; font-size: 11px; color: #C9CEDB; opacity: 0.7; }

.layout { display: flex; min-height: 100vh; }
.sidebar { width: 280px; flex-shrink: 0; color: #E7E9EE; display: flex; flex-direction: column;
  background: linear-gradient(180deg, #0D1526 0%, var(--sidebar) 45%, #080D18 100%); border-right: 1px solid rgba(255,255,255,0.05);
  box-shadow: 0 0 40px rgba(0,0,0,0.15); position: relative; z-index: 41; }
.brand { padding: 28px 24px 20px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.brand-mark { width: 38px; height: 38px; border: 1.5px solid var(--primary); border-radius: 12px; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-title); font-weight: 700; color: var(--primary); font-size: 16px; margin-bottom: 14px; background: rgba(37,99,235,0.1); }
.brand-title { font-family: var(--font-title); font-weight: 700; font-size: 18px; color: #fff; letter-spacing: -0.1px; }
.brand-sub { font-size: 11px; color: #8B93A8; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 4px; }
.nav-group { padding: 14px 12px; }
.nav-label { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: #A8B0C8; padding: 6px 10px 8px;
  cursor: pointer; display: flex; align-items: center; justify-content: space-between; user-select: none; }
.nav-sublabel { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: #6C7690;
  padding: 12px 12px 4px; user-select: none; }
.nav-sublabel:first-child { padding-top: 2px; }
.nav-arrow { font-size: 9px; color: #7C86A0; }
.nav-group.collapsed .nav-arrow { transform: rotate(-90deg); display: inline-block; }
.nav-group.collapsed .nav-group-body { display: none; }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 12px 15px; border-radius: var(--radius); color: #C9CEDB;
  text-decoration: none; font-size: 14px; font-weight: 500; margin-bottom: 2px; transition: background 0.15s, transform 0.15s, box-shadow 0.15s; position: relative; }
.nav-link:hover { transform: translateX(3px); background: rgba(255,255,255,0.06); color: #fff; }
.nav-link.active { background: var(--primary); color: #fff; font-weight: 600; box-shadow: 0 4px 12px rgba(37,99,235,0.35); }
.nav-link .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: 0.6; }
.nav-link .count { margin-left: auto; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 10px; }
.nav-link.active .count { background: rgba(255,255,255,0.25); color: #fff; }
.user-box { margin-top: auto; padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.1); font-size: 12px; }
.user-box .uname { color: #fff; font-weight: 600; margin-bottom: 2px; }
.user-box .urole { color: #9AA3B5; text-transform: uppercase; font-size: 10px; letter-spacing: 0.3px; margin-bottom: 10px; }
.user-box a { color: #C9CEDB; text-decoration: none; font-size: 12px; margin-right: 12px; }
.user-box a:hover { color: var(--primary); }

.niveau-boutons { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 12px 14px; }
.niveau-bouton { background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.14); color: #C9CEDB;
  font-family: var(--font-body); font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 999px;
  cursor: pointer; transition: background 0.15s ease, color 0.15s ease; }
.niveau-bouton:hover { background: rgba(255,255,255,0.15); color: #fff; }
.niveau-bouton.actif { background: var(--primary); border-color: var(--primary); color: #fff; }

.main { flex: 1; min-width: 0; }
.topbar { padding: 12px 40px; min-height: 78px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border); background: var(--surface); position: sticky; top: 0; z-index: 40;
  box-shadow: 0 1px 3px rgba(15,23,42,0.03); }
.topbar .date { font-family: 'Consolas', 'Cascadia Mono', monospace; font-size: 12px; color: var(--ink-muted); white-space: nowrap; }
.topbar-right { display: flex; align-items: center; gap: 18px; margin-left: auto; }
.content { padding: 26px 36px 50px; max-width: 1400px; }
/* Titre de page — sorti de la topbar (qui ne contient plus que recherche/icônes) pour ne plus
   être écrasé par la largeur fixe de la barre de recherche (420px) sur les écrans pas très
   larges : avant, topbar+h1 partageaient la même ligne flex et le titre se repliait mot par mot
   dans la colonne restante, parfois réduite à ~150px. Le titre a maintenant toute la largeur du
   contenu, sur sa propre ligne. */
.page-title { font-family: var(--font-title); font-weight: 700; font-size: 27px; margin: 0 0 20px; letter-spacing: -0.3px; }

/* Icône d'info discrète à côté d'un titre de page, pour remplacer un bandeau .hint verbeux --
   affiche le texte d'explication au survol via l'attribut title natif du navigateur (même
   convention déjà utilisée ailleurs dans l'app pour les infobulles, ex. barres de graphique). */
.info-icon { display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-body);
  font-size: 14px; font-weight: 400; color: var(--ink-muted); cursor: help; vertical-align: middle;
  margin-left: 6px; letter-spacing: 0; }

.theme-toggle { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border); background: var(--paper);
  color: var(--ink-muted); display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease; }
.theme-toggle:hover { background: var(--hover-bg); color: var(--primary); }
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

.global-search { position: relative; width: 420px; max-width: 100%; }
.global-search svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--ink-muted); pointer-events: none; }
.global-search input { width: 100%; height: 48px; padding: 0 14px 0 42px; box-sizing: border-box; border-radius: 999px; background: var(--paper); border: 1px solid var(--border); font-size: 13.5px; color: var(--ink); }
.global-search input:focus { background: var(--surface); border-color: var(--primary); }
/* La règle générique de formulaire (input:not([type="checkbox"])...) a une spécificité CSS plus
   élevée que .global-search input malgré les apparences (le :not() compte comme un sélecteur
   d'attribut) -- elle écrasait silencieusement tout le style ci-dessus. On cible donc directement
   les ID, qui l'emportent toujours, plutôt que de se fier au sélecteur de classe seul. */
#recherche-globale, #recherche-dashboard { padding: 0 14px 0 42px !important; box-sizing: border-box; border-radius: 999px; }

.global-search.large { width: 100%; max-width: none; margin-bottom: 24px; }
.global-search.large svg { left: 20px; width: 20px; height: 20px; }
.global-search.large input { padding: 16px 20px 16px 50px; border-radius: var(--radius-lg); font-size: 15px; background: var(--surface); box-shadow: var(--shadow-sm); }
.global-search.large input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.15); }
.global-search.large .search-results { width: 100%; }
.global-search.large #recherche-dashboard { padding: 16px 20px 16px 50px !important; border-radius: var(--radius-lg) !important; }
.search-results { display: none; position: absolute; top: calc(100% + 8px); left: 0; width: 320px; max-height: 360px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); z-index: 50; padding: 8px; }
.search-group-title { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; color: var(--ink-muted); padding: 8px 10px 4px; }
.search-result-item { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: var(--radius);
  text-decoration: none; color: var(--ink); font-size: 13.5px; }
.search-result-item:hover { background: var(--hover-bg); }
.search-result-item .sri-sub { font-size: 11.5px; color: var(--ink-muted); white-space: nowrap; }
.search-empty { padding: 14px 10px; font-size: 13px; color: var(--ink-muted); text-align: center; }

.topbar-bell { position: relative; display: flex; align-items: center; color: var(--ink-muted); text-decoration: none; }
.topbar-bell:hover { color: var(--primary); }
.topbar-bell-count { position: absolute; top: -6px; right: -7px; background: var(--red); color: #fff; font-size: 9.5px; font-weight: 700;
  min-width: 15px; height: 15px; border-radius: 999px; display: flex; align-items: center; justify-content: center; padding: 0 3px; }
.topbar-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--primary); color: #fff; text-decoration: none;
  display: flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 700; font-family: var(--font-title); flex-shrink: 0; }
.topbar-avatar:hover { filter: brightness(1.1); }

.flash { padding: 11px 16px; border-radius: var(--radius); margin-bottom: 18px; font-size: 13.5px; font-weight: 500; border: 1px solid transparent; }
.flash.success { background: var(--green-soft); color: var(--green); border-color: #c3ddc9; }
.flash.error { background: var(--red-soft); color: var(--red); border-color: #e3c3c3; }
.flash.warning { background: #fdf3dc; color: #8a5a00; border-color: #ecd9a8; }
[data-theme="dark"] .flash.success, [data-theme="dark"] .flash.error, [data-theme="dark"] .flash.warning { border-color: transparent; }

.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px 22px; position: relative; box-shadow: var(--shadow-md); transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease; }
.kpi:hover { box-shadow: 0 24px 55px rgba(15,23,42,0.14); transform: translateY(-4px); border-color: rgba(37,99,235,0.25); }
[data-theme="dark"] .kpi:hover { box-shadow: 0 24px 55px rgba(0,0,0,0.55); }
.kpi::before { content: ""; position: absolute; top: 0; left: 0; bottom: 0; width: 3px; background: var(--primary); border-radius: var(--radius-lg) 0 0 var(--radius-lg); }
.kpi > .icon-badge { margin-bottom: 10px; }
.kpi.alert::before { background: var(--red); }
.kpi.kpi-blue::before { background: var(--blue); }
.kpi.kpi-gold::before { background: var(--gold); }
.kpi.kpi-teal::before { background: #0D9488; }
.kpi.kpi-orange::before { background: var(--orange); }
.kpi.kpi-green::before { background: var(--green); }
.kpi-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--ink-muted); margin-bottom: 6px; font-weight: 600; }
.kpi-value { font-family: 'Consolas', 'Cascadia Mono', monospace; font-size: 30px; font-weight: 700; color: var(--ink); letter-spacing: -0.7px; line-height: 1.1; }
.kpi-value.small { font-size: 20px; letter-spacing: -0.3px; }
.kpi-trend { font-size: 11.5px; font-weight: 600; margin-top: 6px; }
.kpi-trend.up { color: var(--green); }
.kpi-trend.down { color: var(--red); }

.welcome-banner { display: flex; align-items: center; justify-content: space-between; gap: 20px; position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--sidebar), var(--primary)); color: #fff;
  border-radius: var(--radius-lg); padding: 20px 26px; margin-bottom: 18px; box-shadow: var(--shadow-md); }
.welcome-banner::after { content: ""; position: absolute; top: -60px; right: -60px; width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.12), transparent 70%); pointer-events: none; }
.welcome-banner .wb-title { font-family: var(--font-title); font-weight: 700; font-size: 22px; margin-bottom: 5px; letter-spacing: -0.3px; }
.welcome-banner .wb-sub { font-size: 13.5px; color: rgba(255,255,255,0.82); }
.welcome-banner .btn-gold { flex-shrink: 0; }
@media (max-width: 700px) { .welcome-banner { flex-direction: column; align-items: flex-start; } }

.section-title { font-family: var(--font-title); font-weight: 700; font-size: 19px; margin: 30px 0 16px; display: flex; align-items: center; justify-content: space-between; letter-spacing: -0.2px; }
.section-title:first-child { margin-top: 0; }

.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow-x: auto; overflow-y: hidden; box-shadow: var(--shadow-table); }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--ink-muted); padding: 14px 14px; background: var(--th-bg); border-bottom: 1px solid var(--border); font-weight: 700; white-space: nowrap; }
td { padding: 13px 14px; border-bottom: 1px solid var(--border); font-size: 13.5px; vertical-align: middle; color: var(--ink); }
tr:last-child td { border-bottom: none; }
tr.clickable:hover td { background: var(--hover-bg); cursor: pointer; }
.table-wrap tbody tr:hover td { background: var(--hover-bg); }
td a.btn, td button.btn-text, td form { margin-right: 4px; }
td a.btn:last-child, td form:last-child { margin-right: 0; }
.num { font-family: 'Consolas', 'Cascadia Mono', monospace; text-align: right; }
.muted { color: var(--ink-muted); }

.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; letter-spacing: 0.2px; }
.badge.actif, .badge.paye, .badge.approuvee { background: var(--green-soft); color: #0D7A5A; }
[data-theme="dark"] .badge.actif, [data-theme="dark"] .badge.paye, [data-theme="dark"] .badge.approuvee { color: #6EE7B7; }
.badge.attente { background: var(--orange-soft); color: #92620A; }
[data-theme="dark"] .badge.attente { color: #FCD34D; }
.badge.inactif, .badge.annulee, .badge.rejetee { background: var(--red-soft); color: var(--red); }
.badge.type-conge { background: var(--blue-soft); color: var(--blue); }
[data-theme="dark"] .badge.type-conge { color: #93C5FD; }
.badge.type-attestation { background: var(--badge-purple-bg); color: var(--badge-purple-ink); }
.badge.type-avance { background: var(--orange-soft); color: #92620A; }
[data-theme="dark"] .badge.type-avance { color: #FCD34D; }
.badge.type-mission { background: var(--badge-teal-bg); color: var(--badge-teal-ink); }
.badge.type-recrutement { background: var(--badge-violet-bg); color: var(--badge-violet-ink); }
.badge.type-absence { background: var(--red-soft); color: var(--red); }
.badge.type-formation { background: var(--green-soft); color: var(--green); }

.tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.tab { padding: 9px 16px; font-size: 13px; font-weight: 600; color: var(--ink-muted); cursor: pointer; text-decoration: none; border-bottom: 2px solid transparent; }
.tab.active { color: var(--primary); border-color: var(--primary); }
.tab:hover { color: var(--primary); }

.btn { display: inline-flex; align-items: center; gap: 6px; padding: 11px 20px; border-radius: var(--radius); font-size: 13.5px; font-weight: 600; text-decoration: none; border: 1px solid transparent; cursor: pointer; font-family: var(--font-body); transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--primary-dark); box-shadow: var(--shadow-md); }
/* .btn-gold est la classe "action principale" utilisée dans tout WIN-RH (Enregistrer, Ajouter,
   Soumettre...) — repointée sur le bleu premium pour respecter "boutons principaux bleus" sans
   avoir à modifier le nom de la classe dans les 118 pages qui l'utilisent déjà. */
.btn-gold { background: var(--primary); color: #fff; box-shadow: var(--shadow-sm); }
.btn-gold:hover { background: var(--primary-dark); box-shadow: var(--shadow-md); }
.btn-premium { background: var(--gold); color: #fff; box-shadow: var(--shadow-sm); }
.btn-premium:hover { background: #BE9130; box-shadow: var(--shadow-md); }
.btn-green { background: var(--green); color: #fff; box-shadow: var(--shadow-sm); }
.btn-green:hover { background: #0D9668; box-shadow: var(--shadow-md); }
.btn-red-outline { background: transparent; border-color: var(--red); color: var(--red); }
.btn-red-outline:hover { background: var(--red-soft); }
.btn-outline { background: transparent; border-color: var(--border); color: var(--ink); }
.btn-outline:hover { background: var(--hover-bg); border-color: var(--primary); }
.btn-text { background: transparent; color: var(--ink-muted); padding: 6px 8px; font-weight: 500; border: none; cursor: pointer; font-family: var(--font-body); font-size: 13px; }
.btn-text:hover { color: var(--red); }
.btn-sm { padding: 6px 11px; font-size: 11.5px; }
.btn:active { transform: translateY(1px); }

.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 35px; max-width: 1000px; box-shadow: var(--shadow-sm); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 22px; }
/* Personnel -> panneau de filtres (employes.html) : grille resserrée à 4 colonnes (au lieu des 2
   de .form-grid) pour que les 12 filtres tiennent sur 3 lignes au lieu de 6 -- scopé à ce
   formulaire précis (#form-filtres-personnel) pour ne pas changer .form-grid partout ailleurs. */
#form-filtres-personnel .form-grid { grid-template-columns: repeat(4, 1fr); gap: 14px 16px; }
@media (max-width: 1100px) { #form-filtres-personnel .form-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px) { #form-filtres-personnel .form-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { #form-filtres-personnel .form-grid { grid-template-columns: 1fr; } }
.field { margin-bottom: 4px; }
.field.full { grid-column: 1 / -1; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-muted); margin-bottom: 6px; }
.field .hint { font-size: 11.5px; color: var(--ink-muted); margin-top: 4px; }
.hint { font-size: 12.5px; color: var(--ink-muted); line-height: 1.5; background: var(--hover-bg); border-left: 4px solid var(--primary); border-radius: 4px 8px 8px 4px; padding: 12px 16px; }
.hint.hint-warning { background: var(--orange-soft); border-left-color: var(--gold); color: var(--ink); }
input:not([type="checkbox"]):not([type="radio"]), select, textarea { width: 100%; padding: 11px 14px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 13.5px; font-family: var(--font-body); background: var(--surface); color: var(--ink); transition: border-color 0.15s ease, box-shadow 0.15s ease; }
input[type="checkbox"], input[type="radio"] { width: auto; flex-shrink: 0; }
textarea { resize: vertical; min-height: 70px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.15); }
.form-actions { margin-top: 22px; display: flex; gap: 10px; }
.search-bar { margin-bottom: 18px; max-width: 320px; }
.filter-bar { display: flex; gap: 10px; margin-bottom: 18px; }
.filter-bar select { width: auto; min-width: 160px; }

.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input { width: auto; }
.checkbox-row label { margin: 0; }
.subsection { background: var(--subsection-bg); border: 1px dashed var(--border); border-radius: var(--radius-lg); padding: 16px 18px; margin-top: 6px; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--ink-muted); }
.empty-state .brand-mark { margin: 0 auto 14px; }
.empty-state a { color: var(--primary); font-weight: 600; }

.lignes-table input { text-align: right; }
.lignes-table td:first-child input { text-align: left; }
.remove-ligne { color: var(--red); cursor: pointer; font-size: 18px; line-height: 1; background: none; border: none; }

.invoice-header, .demande-header { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px 32px; margin-bottom: 20px; box-shadow: var(--shadow-sm); }
.invoice-header .top-row, .demande-header .top-row { display: flex; justify-content: space-between; align-items: flex-start; }
.invoice-number { font-family: 'Consolas', 'Cascadia Mono', monospace; font-size: 13px; color: var(--primary); font-weight: 600; }
.total-row { font-size: 22px; font-family: 'Consolas', 'Cascadia Mono', monospace; font-weight: 600; color: var(--ink); }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 24px; margin-top: 16px; }
.detail-item.full { grid-column: 1 / -1; }
.detail-item .dt-label { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--ink-muted); margin-bottom: 4px; }
.detail-item .dt-value { font-size: 15px; font-weight: 500; margin-bottom: 14px; color: var(--ink); }

.action-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px 26px; margin-top: 18px; }

/* Fiche signalétique — en-tête avec photo + carte "informations clés" */
.fiche-header { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.fiche-header h1 { margin: 0; }
.fiche-photo { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; border: 3px solid var(--surface); box-shadow: var(--shadow-md); flex-shrink: 0; background: var(--th-bg); }
.fiche-photo-placeholder { width: 84px; height: 84px; border-radius: 50%; background: var(--blue-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 700; font-family: var(--font-title); flex-shrink: 0; }

/* Zone de dépôt de fichier, style "glisser-déposer" */
.zone-depot { border: 2px dashed var(--border); border-radius: var(--radius); padding: 22px; text-align: center;
  background: var(--paper); transition: border-color 0.15s ease, background 0.15s ease; cursor: pointer; position: relative; }
.zone-depot:hover, .zone-depot.survol { border-color: var(--primary); background: var(--blue-soft); }
.zone-depot input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.zone-depot .zone-depot-icone { font-size: 24px; margin-bottom: 6px; color: var(--ink-muted); }
.zone-depot .zone-depot-texte { font-size: 13px; color: var(--ink-muted); }
.zone-depot .zone-depot-nom-fichier { font-size: 13px; color: var(--primary); font-weight: 600; margin-top: 6px; }

/* Carte de gestion d'une liste liée (enfants, pièces jointes...) avec état vide illustré */
.liste-vide { text-align: center; padding: 30px 20px; color: var(--ink-muted); }
.liste-vide-icone { width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 50%; background: var(--blue-soft);
  display: flex; align-items: center; justify-content: center; font-size: 24px; }
.liste-vide-texte { font-size: 13.5px; }

/* Grille de cartes côte à côte — réutilisable sur toute page "fiche/détail" de l'appli */
.grille-cartes-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .grille-cartes-2col { grid-template-columns: 1fr; } }

/* Graphique en barres verticales — évolution d'une valeur dans le temps (masse salariale...) */
.graphique-evolution { display: flex; align-items: flex-end; gap: 12px; height: 160px; padding: 10px 4px 0; }
.graphique-evolution .barre-colonne { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
.graphique-evolution .barre { width: 100%; max-width: 40px; background: var(--primary); border-radius: 6px 6px 0 0; transition: opacity 0.15s ease; position: relative; }
.graphique-evolution .barre:hover { opacity: 0.85; }
.graphique-evolution .barre-valeur { font-size: 10.5px; font-weight: 700; color: var(--ink); text-align: center; margin-bottom: 4px; white-space: nowrap; }
.graphique-evolution .barre-mois { font-size: 11px; color: var(--ink-muted); margin-top: 8px; text-align: center; }

/* Fil d'activité récente */
.fil-activite { display: flex; flex-direction: column; gap: 2px; }
.fil-activite-item { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); text-decoration: none; color: inherit; }
.fil-activite-item:last-child { border-bottom: none; }
.fil-activite-item:hover .fil-activite-desc { color: var(--primary); }
.fil-activite-puce { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.fil-activite-puce.employe { background: var(--blue); }
.fil-activite-puce.contrat { background: var(--gold); }
.fil-activite-puce.facture { background: var(--green); }
.fil-activite-puce.demande { background: #7C3AED; }
.fil-activite-puce.rapport { background: #0EA5E9; }
.fil-activite-puce.juridique { background: #B45309; }
.fil-activite-puce.email { background: var(--red); }
.fil-activite-desc { font-size: 13.5px; color: var(--ink); transition: color 0.15s ease; }
.fil-activite-meta { font-size: 11.5px; color: var(--ink-muted); margin-top: 2px; }

/* Onglets — réutilisable sur toute page qui veut regrouper du contenu par section
   (introduit pour la fiche employé, mais pas spécifique à elle) */
.onglets-barre { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.onglet-bouton { background: none; border: none; padding: 12px 18px; font-size: 13.5px; font-weight: 600; color: var(--ink-muted);
  cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; transition: color 0.15s ease, border-color 0.15s ease; }
.onglet-bouton:hover { color: var(--ink); }
.onglet-bouton.actif { color: var(--primary); border-bottom-color: var(--primary); }
.onglet-panneau { display: none; }
.onglet-panneau.actif { display: block; animation: onglet-apparition 0.15s ease; }
@keyframes onglet-apparition { from { opacity: 0; } to { opacity: 1; } }

/* Ancienneté mise en avant */
.metrique-mise-en-avant { }
.metrique-mise-en-avant .valeur { font-size: 22px; font-weight: 700; color: var(--ink); font-family: var(--font-title); }
.metrique-mise-en-avant .sous-texte { font-size: 11.5px; color: var(--ink-muted); margin-top: 2px; }

/* Liste de documents compacte (widget "Documents récents") */
.liste-documents-compacte { display: flex; flex-direction: column; gap: 2px; }
.liste-documents-compacte a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0;
  border-bottom: 1px solid var(--border); text-decoration: none; color: inherit; font-size: 13px; }
.liste-documents-compacte a:last-child { border-bottom: none; }
.liste-documents-compacte .nom-fichier { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.liste-documents-compacte .voir-lien { color: var(--primary); font-weight: 600; flex-shrink: 0; font-size: 12px; }

@media (max-width: 900px) { .kpi-row { grid-template-columns: 1fr 1fr; } .form-grid { grid-template-columns: 1fr; } }

/* Sections repliables (fiche employé) */
details { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px 16px; background: var(--paper); }
details summary { cursor: pointer; font-size: 14px; color: var(--ink); list-style: none; }
details summary::-webkit-details-marker { display: none; }
details summary::before { content: "▸ "; }
details[open] summary::before { content: "▾ "; }

/* Liste de catégories repliable (Paramétrage -> Listes de valeurs) : une ligne cliquable par
   catégorie, qui se déroule pour révéler son contenu (tableau des valeurs, ajout, import), au
   lieu d'un empilement de blocs tous ouverts en permanence. */
.liste-categories { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); overflow: hidden; max-width: 1000px; margin-bottom: 20px; }
.liste-categories details { border: none; border-radius: 0; padding: 0; background: none; border-bottom: 1px solid var(--border); }
.liste-categories details:last-child { border-bottom: none; }
.liste-categories details[open] { background: var(--paper); }
.liste-categories summary { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 22px; font-size: 14.5px; font-weight: 600; }
.liste-categories summary:hover { background: var(--paper); }
.liste-categories summary::before { margin-right: 4px; }
.liste-categories summary .nb-valeurs, .liste-categories summary .ligne-info { font-weight: 500; font-size: 12.5px; color: var(--ink-muted); white-space: nowrap; }
.liste-categories .cat-corps { padding: 2px 22px 22px 22px; }

/* Icônes de navigation */
.nav-link svg { flex-shrink: 0; opacity: 0.85; }
.nav-link:hover svg, .nav-link.active svg { opacity: 1; }

/* Médaillons d'icônes — style plat à fond teinté (pas de dégradé ni de reflet brillant),
   conforme aux conventions SaaS premium actuelles. Chaque module garde sa couleur propre comme
   repère de navigation, simplement présentée de façon plus sobre. */
.icon-badge { display: inline-flex; align-items: center; justify-content: center; overflow: hidden;
  width: 26px; height: 26px; flex-shrink: 0; transition: transform 0.15s ease; }
.nav-link.active .icon-badge { background: rgba(255,255,255,0.2) !important; }
.nav-link.active .icon-badge svg { stroke: #fff !important; }
.quick-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 12px; margin: 14px 0 20px; }
.quick-tile { display: flex; flex-direction: column; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); text-align: center; }
.quick-tile .icon-badge { width: 44px; height: 44px; border-radius: 14px !important; }
.quick-tile .icon-badge svg { width: 21px; height: 21px; }
.quick-tile span.label { font-size: 12.5px; font-weight: 600; }
.quick-tile:hover .icon-badge { transform: translateY(-3px); }
.icon-badge { transition: transform 0.15s ease; }

a.kpi { display: block; text-decoration: none; color: inherit; }

/* Boutons Retour universels, en haut de chaque page (page précédente + tableau de bord) */
.barre-retour { display: flex; align-items: center; gap: 16px; margin-bottom: 4px; }
.btn-retour { display: inline-block; font-size: 12.5px; font-weight: 600; color: var(--ink-muted);
  text-decoration: none; }
.btn-retour:hover { color: var(--primary); }

/* Organigramme — arbre hiérarchique avec lignes de connexion en CSS pur */
.org-wrap { overflow: auto; max-height: 75vh; padding: 20px 10px; }
.orgtree, .orgtree ul { list-style: none; margin: 0; padding: 0; display: flex; }
.orgtree { justify-content: center; transform-origin: top center; transition: transform 0.15s ease; }
.orgtree ul { padding-top: 30px; position: relative; }
.orgtree li { position: relative; padding: 0 14px; display: flex; flex-direction: column; align-items: center; }
.orgtree li::before { content: ""; position: absolute; top: 0; left: 50%; width: 1px; height: 14px; background: var(--border); }
.orgtree > li::before { display: none; }
.orgtree ul::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: var(--border); }
.orgtree ul li:only-child::after,
.orgtree ul li:first-child::after { content: ""; position: absolute; top: 0; left: 0; width: 50%; height: 1px; background: var(--paper); }
.orgtree ul li:only-child::before,
.orgtree ul li:last-child::after { content: ""; position: absolute; top: 0; right: 0; width: 50%; height: 1px; background: var(--paper); }
.orgcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px 16px; min-width: 170px;
  text-align: center; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,0.06); transition: box-shadow 0.15s, border-color 0.15s; }
.orgcard:hover { box-shadow: 0 3px 8px rgba(0,0,0,0.12); }
.orgcard-nom { font-weight: 600; font-size: 13.5px; color: var(--ink); }
.orgcard-poste { font-size: 12px; color: var(--primary); margin-top: 2px; }
.orgcard-detail { display: none; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); font-size: 11.5px; color: var(--ink-muted); text-align: left; }
.orgcard.ouvert .orgcard-detail { display: block; }

/* Organigramme — recherche avec centrage automatique + zoom (01/10/2026) */
.org-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.org-recherche, .org-zoom { display: flex; align-items: center; gap: 8px; }
.org-recherche input[type="search"] { width: 260px; }
.org-recherche .muted, .org-zoom .muted { font-size: 12.5px; white-space: nowrap; }
.org-recherche #org-recherche-compteur { min-width: 78px; }
.org-zoom #org-zoom-niveau { min-width: 38px; text-align: center; }
.orgcard.org-correspondance { border-color: var(--primary); }
.orgcard.org-selection { outline: 2px solid var(--gold); outline-offset: 1px; box-shadow: 0 0 0 4px var(--gold-soft); }

/* =============================================================================
   Accueil administrateur (05/10/2026) -- tuiles de modules, entrées/sorties, lecture rapide.
   Tout passe par les variables du thème : le mode sombre suit sans règle dupliquée.
   ============================================================================= */
:root { --tuile-bg: #F8FAFC; --tuile-icone-bg: #FFFFFF; --es-entree: #2563EB; --es-sortie: #94A3B8; }
[data-theme="dark"] { --tuile-bg: #1C2942; --tuile-icone-bg: #E8EEF8; --es-entree: #60A5FA; }
.dash-accueil .kpi-value { font-family: var(--font-title); letter-spacing: -0.5px; }
.dash-accueil .kpi-row { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.modules-entete { margin: 6px 0 12px; }
.modules-sous-titre { color: var(--ink-muted); font-size: 13px; margin: 0; }
.modules-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-bottom: 26px; }
.module-tuile { display: flex; gap: 14px; align-items: flex-start; text-decoration: none; color: var(--ink); background: var(--tuile-bg);
  border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease; }
.module-tuile:hover { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(15,23,42,0.12); border-color: rgba(37,99,235,0.4); }
.module-icone { flex: 0 0 58px; height: 58px; border-radius: 16px; background: var(--tuile-icone-bg); box-shadow: var(--shadow-md); display: grid; place-items: center; }
.module-icone img { width: 40px; height: 40px; object-fit: contain; }
.module-texte { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.module-titre { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
.module-titre b { font-family: var(--font-title); font-weight: 600; font-size: 15.5px; }
.module-desc { font-size: 13px; color: var(--ink-muted); line-height: 1.4; }
.accueil-cartes .form-card { max-width: none; }
.legende-es { display: flex; gap: 16px; margin-top: 10px; font-size: 12.5px; color: var(--ink-muted); }
.legende-es span { display: flex; align-items: center; gap: 6px; }
.pastille-es { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.es-entree { background: var(--es-entree); }
.es-sortie { background: var(--es-sortie); }
.graphique-es { display: flex; align-items: flex-end; gap: 12px; height: 210px; margin-top: 8px; padding-top: 22px; border-bottom: 1px solid var(--border); }
.es-mois { flex: 1; height: 100%; }
.es-paire { display: flex; align-items: flex-end; justify-content: center; gap: 6px; height: 100%; width: 100%; }
.es-colonne { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; height: 100%; flex: 1; max-width: 30px; }
.es-colonne em { font-style: normal; font-size: 12px; font-weight: 600; }
.es-colonne i { display: block; width: 100%; border-radius: 6px 6px 0 0; min-height: 3px; }
.axe-es { display: flex; gap: 12px; margin-top: 6px; }
.axe-es span { flex: 1; text-align: center; font-size: 12px; color: var(--ink-muted); }
.lecture-rapide { margin-top: 6px; }
.lecture-ligne { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.lecture-ligne:last-child { border-bottom: 0; }
.lecture-ligne span { color: var(--ink-muted); }
.lecture-ligne b { font-weight: 600; text-align: right; }
@media (max-width: 600px) { .modules-grille { grid-template-columns: 1fr; } }

/* Sous-menu (ex. Tableau de bord Départs sous Dossiers de départ) */
.nav-link.nav-sub { margin-left: 14px; padding-left: 12px; font-size: 12.5px; opacity: .92; }
