/* =========================================================================
   IPD SIRH — Design System
   Source de vérité unique : Charte Graphique IPD — Septembre 2025
   ========================================================================= */

/* ----------------------------- Tokens ---------------------------------- */
:root {
  /* Couleurs primaires (charte) */
  --ipd-black: #000000;
  --ipd-blue: #0089d0;       /* Bleu Pasteur — signature */
  /* Secondaires */
  --ipd-navy: #052a62;
  --ipd-sky: #86b4dd;
  /* Neutres */
  --ipd-white: #ffffff;
  --ipd-gray-50: #f2f3f5;
  --ipd-gray-200: #d7d8db;
  /* Tertiaires (fonds chauds) */
  --ipd-sand-light: #e3e0d8;
  --ipd-sand: #bfb8b0;
  /* Overlay image charte : bleu IPD 14% */
  --ipd-overlay: rgba(0, 137, 208, 0.14);

  /* États sémantiques (dérivés — à valider Dpt Communication) */
  --st-success: #1f9d6b;
  --st-success-bg: #e7f5ef;
  --st-warning: #e0a100;
  --st-warning-bg: #fbf3df;
  --st-danger: #c0392b;
  --st-danger-bg: #fbeae8;
  --st-info: var(--ipd-blue);
  --st-info-bg: #e6f4fb;

  /* Surfaces (thème clair) */
  --bg: #f2f3f5;
  --bg-elev: #ffffff;
  --surface: #ffffff;
  --surface-2: #f7f9fb;
  --border: #e4e7ec;
  --border-strong: #d7d8db;
  --text: #0b1721;
  --text-muted: #5b6b73;
  --text-faint: #8a96a3;
  --sidebar-bg: #052a62;
  --sidebar-text: #c9dcef;
  --sidebar-active: #0089d0;

  /* Échelle typographique web (charte) */
  --t1: 2.5rem;   /* 40pt / ~54px */
  --t2: 2rem;     /* 32pt */
  --t3: 1.75rem;  /* 28pt */
  --t4: 1.5rem;   /* 24pt */
  --t5: 1.125rem; /* 18pt */
  --sub1: 1.25rem;
  --sub2: 1rem;
  --body1: 1rem;
  --body2: 0.875rem;
  --caption: 0.75rem;

  /* Rayons, ombres, espacements (échelle 4/8) */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-pill: 999px;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px; --sp-7: 48px;
  --shadow-sm: 0 1px 2px rgba(5, 42, 98, 0.05), 0 2px 8px rgba(5, 42, 98, 0.05);
  --shadow-md: 0 6px 22px rgba(5, 42, 98, 0.09), 0 2px 6px rgba(5, 42, 98, 0.06);
  --shadow-lg: 0 24px 60px rgba(5, 42, 98, 0.16), 0 8px 20px rgba(5, 42, 98, 0.08);
  --ring: 0 0 0 3px rgba(0, 137, 208, 0.30), 0 0 18px rgba(0, 137, 208, 0.25);

  /* Futuriste : dégradés, halos, surfaces verre */
  --grad-primary: linear-gradient(135deg, #0a96dd 0%, #0089d0 45%, #06579e 110%);
  --grad-sky: linear-gradient(135deg, #0089d0, #86b4dd);
  --grad-ink: linear-gradient(135deg, #052a62, #0089d0);
  --glow-blue: 0 8px 28px rgba(0, 137, 208, 0.28);
  /* Liquid glass — verre dépoli, reflets spéculaires, profondeur */
  --glass: rgba(255, 255, 255, 0.60);
  --glass-strong: rgba(255, 255, 255, 0.82);
  --glass-soft: rgba(255, 255, 255, 0.42);
  --glass-brd: rgba(255, 255, 255, 0.65);
  --glass-hi: linear-gradient(135deg, rgba(255,255,255,.95) 0%, rgba(255,255,255,.32) 24%, rgba(255,255,255,0) 52%);
  --glass-blur: blur(20px) saturate(180%);
  --glass-edge: inset 0 1px 0 rgba(255,255,255,.85), inset 0 0 0 1px rgba(255,255,255,.22), inset 0 -20px 40px rgba(255,255,255,.05);
  --hairline: rgba(5, 42, 98, 0.08);

  --sidebar-w: 264px;
  --topbar-h: 68px;
  --speed: 200ms;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);

  --font-title: "Poppins", "Arial", system-ui, sans-serif;
  --font-body: "Lato", "Arial", system-ui, sans-serif;
}

/* Thème sombre (dérivation charte : navy/noir + accents bleu/ciel) */
[data-theme="dark"] {
  --bg: #03152e;
  --bg-elev: #052a62;
  --surface: #07203f;
  --surface-2: #0a2950;
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #eef4fb;
  --text-muted: #a9c0db;
  --text-faint: #7e98b6;
  --sidebar-bg: #020e1f;
  --sidebar-text: #aac6e6;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 6px 18px rgba(0,0,0,.45);
  --shadow-lg: 0 22px 52px rgba(0,0,0,.55);
  --st-success-bg: rgba(31,157,107,.16);
  --st-warning-bg: rgba(224,161,0,.16);
  --st-danger-bg: rgba(192,57,43,.18);
  --st-info-bg: rgba(0,137,208,.16);
  --glow-blue: 0 8px 30px rgba(0, 137, 208, 0.40);
  --glass: rgba(12, 34, 66, 0.48);
  --glass-strong: rgba(12, 34, 66, 0.74);
  --glass-soft: rgba(134, 180, 221, 0.07);
  --glass-brd: rgba(134, 180, 221, 0.22);
  --glass-hi: linear-gradient(135deg, rgba(134,180,221,.28) 0%, rgba(134,180,221,.07) 26%, rgba(134,180,221,0) 54%);
  --glass-blur: blur(22px) saturate(160%);
  --glass-edge: inset 0 1px 0 rgba(255,255,255,.13), inset 0 0 0 1px rgba(255,255,255,.05), inset 0 -20px 40px rgba(0,0,0,.12);
  --hairline: rgba(134, 180, 221, 0.12);
  --grad-primary: linear-gradient(135deg, #0a96dd 0%, #0089d0 50%, #064a86 110%);
}

/* ----------------------------- Base ------------------------------------ */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--body1);
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background var(--speed) var(--ease), color var(--speed) var(--ease);
}
/* Ambiance futuriste : halos bleu IPD + grille fine, fixés en arrière-plan */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 50% at 12% 0%, rgba(0, 137, 208, 0.10), transparent 60%),
    radial-gradient(50% 45% at 100% 12%, rgba(134, 180, 221, 0.10), transparent 60%),
    radial-gradient(45% 40% at 85% 100%, rgba(5, 42, 98, 0.08), transparent 60%),
    linear-gradient(to right, var(--hairline) 1px, transparent 1px),
    linear-gradient(to bottom, var(--hairline) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 100% 100%, 48px 48px, 48px 48px;
  opacity: .9;
}
[data-theme="dark"] body::before {
  background:
    radial-gradient(60% 50% at 12% 0%, rgba(0, 137, 208, 0.22), transparent 60%),
    radial-gradient(55% 45% at 100% 10%, rgba(134, 180, 221, 0.12), transparent 60%),
    radial-gradient(50% 45% at 85% 100%, rgba(0, 137, 208, 0.12), transparent 60%),
    linear-gradient(to right, var(--hairline) 1px, transparent 1px),
    linear-gradient(to bottom, var(--hairline) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 100% 100%, 48px 48px, 48px 48px;
}
h1, h2, h3, h4, h5 { font-family: var(--font-title); font-weight: 700; margin: 0; line-height: 1.2; color: var(--text); letter-spacing: -0.01em; }
h1 { font-size: var(--t2); font-weight: 900; }
h2 { font-size: var(--t4); }
h3 { font-size: var(--t5); }
a { color: var(--ipd-blue); text-decoration: none; }
button { font-family: var(--font-title); cursor: pointer; }
::selection { background: var(--ipd-sky); color: var(--ipd-navy); }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-sm); }

/* Scrollbar discrète */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }

/* ----------------------------- Boutons --------------------------------- */
.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; gap: var(--sp-2);
  font-size: var(--body2); font-weight: 700;
  padding: 10px 18px; border-radius: var(--r-pill);
  border: 1px solid transparent; background: transparent; color: var(--text);
  transition: all var(--speed) var(--ease); white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 18px; height: 18px; }
/* reflet animé au survol sur les boutons pleins */
.btn-primary::after, .btn-danger::after { content: ""; position: absolute; inset: 0; background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.35) 50%, transparent 70%); transform: translateX(-120%); transition: transform .6s var(--ease); }
.btn-primary:hover::after, .btn-danger:hover::after { transform: translateX(120%); }
.btn-primary { background: var(--grad-primary); color: #fff; box-shadow: var(--glow-blue); }
.btn-primary:hover { box-shadow: 0 12px 30px rgba(0,137,208,.42); filter: brightness(1.05); }
.btn-secondary { background: var(--glass); color: var(--text); border-color: var(--border-strong); backdrop-filter: blur(8px); }
.btn-secondary:hover { border-color: var(--ipd-blue); color: var(--ipd-blue); box-shadow: var(--ring); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--st-danger); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: var(--caption); }
.btn-icon { padding: 9px; border-radius: var(--r-md); }
.btn:disabled { opacity: .5; pointer-events: none; }

/* ----------------------------- Badges ---------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-body); font-weight: 700; font-size: var(--caption);
  padding: 4px 10px; border-radius: var(--r-pill); line-height: 1.4;
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-success { background: var(--st-success-bg); color: var(--st-success); }
.badge-warning { background: var(--st-warning-bg); color: var(--st-warning); }
.badge-danger  { background: var(--st-danger-bg);  color: var(--st-danger); }
.badge-info    { background: var(--st-info-bg);    color: var(--st-info); }
.badge-neutral { background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); }

/* ----------------------------- App shell ------------------------------- */
.app-shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

.sidebar {
  background:
    radial-gradient(120% 40% at 0% 0%, rgba(0,137,208,.18), transparent 60%),
    linear-gradient(180deg, var(--sidebar-bg), var(--sidebar-bg));
  color: var(--sidebar-text); border-right: 1px solid rgba(134,180,221,.12);
  display: flex; flex-direction: column; padding: var(--sp-5) var(--sp-4) var(--sp-3);
  position: sticky; top: 0; height: 100vh; gap: 6px;
}
.sidebar-brand { flex: none; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 4px 8px var(--sp-4); }
/* zone de navigation : défilable, brand + pied toujours visibles */
#nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; gap: 2px; margin: 0 -4px; padding: 0 6px 4px 4px; }
#nav::-webkit-scrollbar { width: 6px; }
#nav::-webkit-scrollbar-thumb { background: rgba(134,180,221,.28); border-radius: 999px; }
#nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-brand .brand-logo { width: 168px; max-width: 100%; height: auto; display: block; }
.sidebar-brand .brand-tag { font-family: var(--font-title); font-weight: 600; font-size: 11px; letter-spacing: 3px; color: var(--ipd-sky); padding-left: 2px; }
.nav-section { font-size: 10.5px; text-transform: uppercase; letter-spacing: 1.2px; color: rgba(255,255,255,.42); padding: var(--sp-3) 10px 4px; }
.nav-section:first-child { padding-top: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px;
  border-radius: var(--r-md); color: var(--sidebar-text); font-family: var(--font-title);
  font-weight: 600; font-size: var(--body2); transition: all var(--speed) var(--ease);
  position: relative; border: none; background: transparent; width: 100%; text-align: left;
}
.nav-item svg { width: 19px; height: 19px; flex: none; opacity: .85; }
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active { background: linear-gradient(90deg, rgba(0,137,208,.95), rgba(0,137,208,.55)); color: #fff; box-shadow: 0 8px 22px rgba(0,137,208,.4), inset 0 0 0 1px rgba(255,255,255,.12); }
.nav-item.active::before { content: ""; position: absolute; left: -4px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: #fff; box-shadow: 0 0 10px rgba(255,255,255,.8); }
.nav-item.active svg { opacity: 1; }
.nav-item .count { margin-left: auto; background: rgba(255,255,255,.18); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; }
.sidebar-foot { flex: none; margin-top: 0; padding-top: var(--sp-3); border-top: 1px solid rgba(255,255,255,.12); }

.main { display: flex; flex-direction: column; min-width: 0; }
/* Gouttière du contenu : espace de respiration entre la sidebar et les écrits */
#view { padding: var(--sp-5) var(--sp-7) var(--sp-7); }

/* Topbar */
.topbar {
  height: var(--topbar-h); display: flex; align-items: center; gap: var(--sp-4);
  padding: 0 var(--sp-7); background-color: var(--glass-strong); background-image: var(--glass-hi); background-repeat: no-repeat; border-bottom: 1px solid var(--glass-brd);
  position: sticky; top: 0; z-index: 20; backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: 0 1px 0 rgba(255,255,255,.4) inset, 0 6px 22px rgba(5,42,98,.08);
}
.topbar .search {
  display: flex; align-items: center; gap: 10px; background: var(--glass-soft);
  border: 1px solid var(--glass-brd); border-radius: var(--r-pill); padding: 9px 16px;
  color: var(--text-faint); min-width: 280px; max-width: 420px; flex: 1;
  backdrop-filter: blur(8px) saturate(140%); -webkit-backdrop-filter: blur(8px) saturate(140%);
}
.topbar .search input { border: none; background: transparent; outline: none; color: var(--text); font-family: var(--font-body); font-size: var(--body2); width: 100%; }
.topbar .spacer { flex: 1; }
.icon-btn {
  width: 42px; height: 42px; border-radius: var(--r-md); border: 1px solid var(--glass-brd);
  background: var(--glass-soft); color: var(--text-muted); display: grid; place-items: center;
  transition: all var(--speed) var(--ease); position: relative;
  backdrop-filter: blur(8px) saturate(140%); -webkit-backdrop-filter: blur(8px) saturate(140%);
}
.icon-btn:hover { color: var(--ipd-blue); border-color: var(--ipd-blue); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn .ping { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; background: var(--st-danger); border-radius: 50%; border: 2px solid var(--surface); }
.lang-toggle { font-family: var(--font-title); font-weight: 700; font-size: 12px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 5px 6px 5px 12px; border-radius: var(--r-pill); border: 1px solid var(--glass-brd); background: var(--glass-soft); backdrop-filter: blur(8px) saturate(140%); -webkit-backdrop-filter: blur(8px) saturate(140%); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--ipd-navy), var(--ipd-blue)); color: #fff; display: grid; place-items: center; font-family: var(--font-title); font-weight: 700; font-size: 13px; }
.user-chip .meta { line-height: 1.1; }
.user-chip .meta .n { font-family: var(--font-title); font-weight: 600; font-size: 13px; }
.user-chip .meta .r { font-size: 11px; color: var(--text-faint); }

/* Page content */
.page { padding: var(--sp-6); max-width: 1440px; width: 100%; margin: 0 auto; animation: fade .35s var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-4); margin-bottom: var(--sp-5); flex-wrap: wrap; }
.page-head .crumb { font-size: var(--caption); color: var(--text-faint); font-weight: 700; text-transform: uppercase; letter-spacing: .8px; }
.page-head h1 { margin-top: 4px; }
.page-head p.lead { color: var(--text-muted); margin: 6px 0 0; max-width: 60ch; }
.head-actions { display: flex; gap: var(--sp-2); align-items: center; }

/* ----------------------------- Cards ----------------------------------- */
.card { position: relative; background-color: var(--glass); background-image: var(--glass-hi); background-repeat: no-repeat; border: 1px solid var(--glass-brd); border-radius: var(--r-lg); box-shadow: var(--shadow-md), var(--glass-edge); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); transition: box-shadow var(--speed) var(--ease), transform var(--speed) var(--ease), border-color var(--speed) var(--ease); }
/* liseré lumineux supérieur subtil */
.card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 1px; border-radius: var(--r-lg) var(--r-lg) 0 0; background: linear-gradient(90deg, transparent, rgba(0,137,208,.45), transparent); opacity: .7; }
.card-pad { padding: var(--sp-5); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--border); }
.card-head h3 { font-size: var(--sub2); }
.card-head .sub { font-size: var(--caption); color: var(--text-faint); }

.grid { display: grid; gap: var(--sp-5); }
.grid-kpi { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: 2fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.cols-2 { grid-template-columns: repeat(2, 1fr); }

/* KPI card */
.kpi { position: relative; overflow: hidden; padding: var(--sp-5); cursor: default; }
.kpi:hover { transform: translateY(-3px); box-shadow: var(--shadow-md), var(--glow-blue); border-color: rgba(0,137,208,.35); }
.kpi::after { content: ""; position: absolute; right: -34px; top: -34px; width: 130px; height: 130px; border-radius: 50%; background: radial-gradient(circle, rgba(0,137,208,.22), transparent 70%); }
.kpi .kpi-ico { width: 46px; height: 46px; border-radius: var(--r-md); display: grid; place-items: center; background: var(--st-info-bg); color: var(--ipd-blue); margin-bottom: var(--sp-3); box-shadow: inset 0 0 0 1px rgba(0,137,208,.18), 0 6px 16px rgba(0,137,208,.18); }
.kpi .kpi-ico svg { width: 22px; height: 22px; }
.kpi .kpi-val { font-family: var(--font-title); font-weight: 900; font-size: 2.05rem; line-height: 1; background: var(--grad-ink); -webkit-background-clip: text; background-clip: text; color: transparent; letter-spacing: -0.02em; }
[data-theme="dark"] .kpi .kpi-val { background: var(--grad-sky); -webkit-background-clip: text; background-clip: text; color: transparent; }
.kpi .kpi-label { color: var(--text-muted); font-size: var(--body2); margin-top: 6px; }
.kpi .kpi-trend { display: inline-flex; align-items: center; gap: 4px; font-size: var(--caption); font-weight: 700; margin-top: 10px; }
.kpi .kpi-trend.up { color: var(--st-success); }
.kpi .kpi-trend.down { color: var(--st-danger); }
.kpi.accent-green .kpi-ico { background: var(--st-success-bg); color: var(--st-success); }
.kpi.accent-amber .kpi-ico { background: var(--st-warning-bg); color: var(--st-warning); }
.kpi.accent-navy .kpi-ico { background: rgba(5,42,98,.1); color: var(--ipd-navy); }
[data-theme="dark"] .kpi.accent-navy .kpi-ico { background: rgba(134,180,221,.16); color: var(--ipd-sky); }

/* ----------------------------- Tables ---------------------------------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: var(--body2); }
table.data thead { background: linear-gradient(180deg, rgba(0,137,208,.06), transparent); }
table.data th { text-align: left; font-family: var(--font-title); font-weight: 600; font-size: var(--caption); text-transform: uppercase; letter-spacing: .5px; color: var(--text-faint); padding: 12px 16px; border-bottom: 1px solid var(--border-strong); white-space: nowrap; }
table.data td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data tbody tr { transition: background var(--speed) var(--ease); }
table.data tbody tr:hover { background: var(--surface-2); }
table.data tbody tr:last-child td { border-bottom: none; }
.cell-user { display: flex; align-items: center; gap: 10px; }
.cell-user .avatar { width: 30px; height: 30px; font-size: 12px; }
.cell-user .n { font-weight: 700; font-family: var(--font-title); font-size: var(--body2); }
.cell-user .s { font-size: 11px; color: var(--text-faint); }

/* ----------------------------- Forms ----------------------------------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--sp-4); }
.field label { font-family: var(--font-title); font-weight: 600; font-size: var(--body2); }
.field .hint { font-size: var(--caption); color: var(--text-faint); }
.input, .select, textarea.input {
  width: 100%; padding: 11px 14px; border: 1px solid var(--border-strong); border-radius: var(--r-md);
  background: var(--surface); color: var(--text); font-family: var(--font-body); font-size: var(--body1);
  transition: border var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}
.input:focus, .select:focus, textarea.input:focus { border-color: var(--ipd-blue); box-shadow: var(--ring); outline: none; }
textarea.input { resize: vertical; min-height: 90px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }

/* ----------------------------- Timeline -------------------------------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 var(--sp-4) 34px; }
.timeline li::before { content: ""; position: absolute; left: 11px; top: 22px; bottom: -2px; width: 2px; background: var(--border-strong); }
.timeline li:last-child::before { display: none; }
.tl-dot { position: absolute; left: 0; top: 2px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 2px solid var(--border-strong); color: var(--text-faint); }
.tl-dot svg { width: 13px; height: 13px; }
.tl-dot.done { background: var(--st-success); border-color: var(--st-success); color: #fff; }
.tl-dot.current { background: var(--ipd-blue); border-color: var(--ipd-blue); color: #fff; box-shadow: 0 0 0 4px rgba(0,137,208,.18); }
.tl-dot.rejected { background: var(--st-danger); border-color: var(--st-danger); color: #fff; }
.tl-title { font-family: var(--font-title); font-weight: 600; font-size: var(--body2); }
.tl-meta { font-size: var(--caption); color: var(--text-faint); }

/* ----------------------------- Planning grid --------------------------- */
.planning { overflow-x: auto; }
.planning table { width: 100%; border-collapse: separate; border-spacing: 4px; min-width: 720px; }
.planning th { font-family: var(--font-title); font-size: var(--caption); color: var(--text-faint); padding: 8px; font-weight: 600; }
.planning td { padding: 0; }
.shift { border-radius: var(--r-sm); padding: 8px 10px; font-size: 11px; font-weight: 700; font-family: var(--font-title); text-align: center; min-height: 46px; display: grid; place-content: center; line-height: 1.25; }
.shift.m { background: var(--st-info-bg); color: var(--ipd-blue); }
.shift.a { background: var(--st-warning-bg); color: var(--st-warning); }
.shift.n { background: rgba(5,42,98,.12); color: var(--ipd-navy); }
[data-theme="dark"] .shift.n { background: rgba(134,180,221,.18); color: var(--ipd-sky); }
.shift.off { background: var(--surface-2); color: var(--text-faint); font-weight: 400; }
.shift .who { display: block; font-weight: 400; color: inherit; opacity: .8; font-size: 10px; }
.cov-cell { display: flex; align-items: center; gap: 8px; }
.cov-bar { flex: 1; height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.cov-bar > i { display: block; height: 100%; border-radius: 999px; }

/* Gauges (qualifications) */
.gauge { display: flex; align-items: center; gap: 12px; }
.gauge-track { flex: 1; height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.gauge-track > i { display: block; height: 100%; }

/* ----------------------------- Map / presence -------------------------- */
.site-card { padding: var(--sp-5); position: relative; overflow: hidden; }
.site-card .site-name { font-family: var(--font-title); font-weight: 700; font-size: var(--sub2); display: flex; align-items: center; gap: 8px; }
.legend { display: flex; flex-wrap: wrap; gap: var(--sp-4); font-size: var(--caption); color: var(--text-muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.bar-stack { display: flex; height: 12px; border-radius: 999px; overflow: hidden; margin: 12px 0 6px; }
.bar-stack > i { height: 100%; }

/* Alerts list */
.alert-row { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.alert-row:last-child { border-bottom: none; }
.alert-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.alert-ico svg { width: 18px; height: 18px; }
.alert-row .a-title { font-family: var(--font-title); font-weight: 600; font-size: var(--body2); }
.alert-row .a-sub { font-size: var(--caption); color: var(--text-faint); }

/* ----------------------------- Modal ----------------------------------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(3, 16, 33, 0.50); backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%); display: grid; place-items: center; padding: var(--sp-4); z-index: 100; animation: fade .2s var(--ease); }
.modal { position: relative; background-color: var(--glass-strong); background-image: var(--glass-hi); background-repeat: no-repeat; backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border: 1px solid var(--glass-brd); border-radius: var(--r-lg); box-shadow: var(--shadow-lg), var(--glass-edge), 0 0 0 1px rgba(0,137,208,.08); width: 100%; max-width: 560px; max-height: 90vh; overflow: auto; animation: pop .25s var(--ease); }
.modal::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; border-radius: var(--r-lg) var(--r-lg) 0 0; background: var(--grad-sky); z-index: 1; }
.modal.lg { max-width: 720px; }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(10px); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: var(--sp-5) var(--sp-5) var(--sp-3); }
.modal-head h2 { font-size: var(--t5); }
.modal-body { padding: 0 var(--sp-5) var(--sp-4); }
.modal-foot { display: flex; justify-content: flex-end; gap: var(--sp-2); padding: var(--sp-4) var(--sp-5); border-top: 1px solid var(--glass-brd); position: sticky; bottom: 0; background: var(--glass-soft); backdrop-filter: blur(12px) saturate(150%); -webkit-backdrop-filter: blur(12px) saturate(150%); }

/* ----------------------------- Toast ----------------------------------- */
#toast-root { position: fixed; right: 24px; bottom: 24px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast { display: flex; align-items: center; gap: 12px; background-color: var(--glass-strong); background-image: var(--glass-hi); background-repeat: no-repeat; backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border: 1px solid var(--glass-brd); border-left: 4px solid var(--ipd-blue); border-radius: var(--r-md); box-shadow: var(--shadow-lg), var(--glass-edge); padding: 14px 18px; min-width: 300px; animation: slidein .3s var(--ease); }
.toast.success { border-left-color: var(--st-success); }
.toast.warning { border-left-color: var(--st-warning); }
.toast.danger { border-left-color: var(--st-danger); }
.toast svg { width: 20px; height: 20px; flex: none; }
.toast .t-msg { font-size: var(--body2); }
.toast .t-msg b { font-family: var(--font-title); }
@keyframes slidein { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }

/* ----------------------------- Login ----------------------------------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-hero { background: radial-gradient(120% 120% at 0% 0%, #0a3a78 0%, #052a62 45%, #021a40 100%); color: #fff; padding: 64px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-hero::before { content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%; right: -160px; top: -120px; background: radial-gradient(circle, rgba(0,137,208,.5), transparent 65%); }
.login-hero::after { content: ""; position: absolute; width: 360px; height: 360px; border-radius: 50%; left: -120px; bottom: -120px; background: radial-gradient(circle, rgba(134,180,221,.35), transparent 65%); }
.login-hero .brand { display: flex; align-items: center; gap: 14px; position: relative; z-index: 1; }
.login-hero .logo { width: 56px; height: 56px; border-radius: 16px; background: linear-gradient(135deg, var(--ipd-blue), var(--ipd-sky)); display: grid; place-items: center; font-family: var(--font-title); font-weight: 900; font-size: 22px; }
.login-hero .brand-logo { height: 56px; width: auto; display: block; }
.login-card .brand-logo { height: 46px; width: auto; display: block; margin-bottom: 26px; }
.login-hero h1 { font-size: 2.6rem; line-height: 1.1; max-width: 14ch; position: relative; z-index: 1; }
.login-hero h1 span { color: var(--ipd-sky); }
.login-hero .values { display: flex; gap: 10px; flex-wrap: wrap; position: relative; z-index: 1; }
.login-hero .values .badge { background: rgba(255,255,255,.12); color: #fff; }
.login-form-side { display: grid; place-items: center; padding: 48px; background: var(--bg); }
.login-card { width: 100%; max-width: 400px; }
.login-card h2 { font-size: var(--t4); }
.login-card .muted { color: var(--text-muted); margin: 6px 0 28px; }
.sso-btn { width: 100%; justify-content: center; padding: 14px; margin-bottom: 14px; }
.divider { display: flex; align-items: center; gap: 14px; color: var(--text-faint); font-size: var(--caption); margin: 22px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.bio-row { display: flex; align-items: center; gap: 12px; justify-content: center; margin-top: 18px; color: var(--text-muted); font-size: var(--body2); }
.bio-btn { width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--ipd-blue); color: var(--ipd-blue); display: grid; place-items: center; background: var(--st-info-bg); }
.bio-btn svg { width: 26px; height: 26px; }

/* ----------------------------- Utilities ------------------------------- */
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.mono-num { font-variant-numeric: tabular-nums; }
.flex { display: flex; }
.between { justify-content: space-between; }
.items-center { align-items: center; }
.gap-2 { gap: var(--sp-2); } .gap-3 { gap: var(--sp-3); } .gap-4 { gap: var(--sp-4); }
.mt-2 { margin-top: var(--sp-2); } .mt-4 { margin-top: var(--sp-4); } .mt-5 { margin-top: var(--sp-5); }
.mb-4 { margin-bottom: var(--sp-4); }
.text-right { text-align: right; }
.w-full { width: 100%; }
.hl-block { background: var(--ipd-overlay); border-left: 3px solid var(--ipd-blue); border-radius: var(--r-sm); padding: 12px 16px; }
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: shimmer 1.4s infinite; border-radius: var(--r-sm); }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.empty { text-align: center; padding: var(--sp-7) var(--sp-4); color: var(--text-faint); }
.empty svg { width: 48px; height: 48px; opacity: .5; margin-bottom: 12px; }

/* ----------------------------- GED / Dossiers -------------------------- */
.ged-list { display: flex; flex-direction: column; gap: 6px; max-height: 520px; overflow-y: auto; }
.ged-agent { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); transition: all var(--speed) var(--ease); }
.ged-agent:hover { border-color: var(--ipd-blue); }
.ged-agent.active { border-color: var(--ipd-blue); background: var(--st-info-bg); }
.ged-agent .n { font-family: var(--font-title); font-weight: 600; font-size: var(--body2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ged-agent .s { font-size: .72rem; }
.ged-folder { margin-bottom: 16px; }
.ged-folder-h { display: flex; align-items: center; gap: 8px; font-family: var(--font-title); font-size: var(--body2); margin-bottom: 8px; color: var(--text); }
.ged-doc { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--r-sm); margin-bottom: 6px; color: var(--text-muted); }
.ged-doc .dn { font-size: var(--body2); color: var(--text); font-weight: 600; font-family: var(--font-title); }
.ged-doc.missing { border-style: dashed; border-color: var(--st-danger); background: var(--st-danger-bg); }

/* ----------------------------- Kanban contrats ------------------------- */
.kanban-wrap { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.kan-col { flex: 0 0 200px; background: var(--surface-2); border-radius: var(--r-md); padding: 10px; min-height: 120px; }
.kan-h { display: flex; align-items: center; gap: 6px; font-family: var(--font-title); font-weight: 600; font-size: .76rem; color: var(--text-muted); margin-bottom: 10px; padding: 2px; }
.kan-h .count { margin-left: auto; background: var(--ipd-blue); color: #fff; font-size: 11px; padding: 0 7px; border-radius: 999px; }
.kan-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 10px; margin-bottom: 8px; box-shadow: var(--shadow-sm); }
.kan-card .kc-n { font-family: var(--font-title); font-weight: 600; font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kc-meta { font-size: .72rem; color: var(--text-muted); margin-top: 8px; display: flex; align-items: center; gap: 5px; }
.kan-actions { margin-top: 10px; }
.kan-actions .btn { width: 100%; justify-content: center; }

/* ----------------------------- Bilan social ---------------------------- */
.bs-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.bs-stat { background: var(--surface-2); border-radius: var(--r-md); padding: 14px; }
.bs-v { font-family: var(--font-title); font-weight: 900; font-size: 1.5rem; color: var(--ipd-blue); line-height: 1; }
.bs-l { font-size: .78rem; color: var(--text-muted); margin-top: 5px; }
.bs-sub { font-family: var(--font-title); font-weight: 600; font-size: .8rem; color: var(--text-muted); text-align: center; margin-bottom: 8px; }
.bs-chap .card-head h3 { color: var(--ipd-navy); }
[data-theme="dark"] .bs-chap .card-head h3 { color: var(--ipd-sky); }
.cert { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 10px 12px; margin-top: 8px; }
.g-edit { cursor: pointer; }
.g-edit:hover .g-dot { box-shadow: 0 0 0 2px var(--ipd-blue); }
.g-lvls { display: flex; gap: 8px; flex-wrap: wrap; }
.g-lvl { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: var(--r-md); background: var(--surface); font-family: var(--font-title); font-weight: 600; font-size: .72rem; color: var(--text-muted); min-width: 78px; transition: all var(--speed) var(--ease); }
.g-lvl:hover { border-color: var(--ipd-blue); transform: translateY(-2px); }
.g-lvl.on { border-color: var(--ipd-blue); box-shadow: var(--ring); color: var(--text); }
/* sélecteur de créneau de planning */
.shift.editable { cursor: pointer; }
.shift.editable:hover { outline: 2px solid var(--ipd-blue); outline-offset: 1px; }
.pl-shift-pick { display: flex; gap: 8px; flex-wrap: wrap; }
.pl-shift-pick button { flex: 1; min-width: 70px; padding: 14px; border-radius: var(--r-md); border: 1px solid var(--border-strong); font-family: var(--font-title); font-weight: 700; font-size: .8rem; background: var(--surface); transition: all var(--speed) var(--ease); }
.pl-shift-pick button:hover { transform: translateY(-2px); border-color: var(--ipd-blue); }

/* ----------------------------- Cartographie ---------------------------- */
.carto-toolbar { display: flex; align-items: center; gap: var(--sp-4); padding: 14px 18px; margin-bottom: var(--sp-3); flex-wrap: wrap; }
.carto-counters { display: flex; gap: 10px; flex-wrap: wrap; flex: 1; }
.carto-counters .cc { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-title); font-weight: 700; font-size: 1.05rem; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-pill); padding: 5px 14px; }
.carto-counters .cc small { font-family: var(--font-body); font-weight: 400; font-size: .7rem; color: var(--text-faint); }
.carto-counters .cc i { width: 9px; height: 9px; border-radius: 50%; }
.carto-counters .cc.total { background: var(--ipd-blue); color: #fff; border-color: var(--ipd-blue); }
.carto-counters .cc.total small { color: rgba(255,255,255,.8); }

.carto-filterbar { display: flex; flex-direction: column; gap: 10px; margin-bottom: var(--sp-4); }
.fgroup { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.flabel { font-family: var(--font-title); font-weight: 600; font-size: .68rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-faint); min-width: 132px; }
.fchip { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-body); font-weight: 700; font-size: .76rem; padding: 5px 13px; border-radius: var(--r-pill); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-muted); transition: all var(--speed) var(--ease); }
.fchip:hover { border-color: var(--ipd-blue); color: var(--text); }
.fchip .fdot { width: 8px; height: 8px; border-radius: 50%; }
.fchip.active { background: var(--ipd-blue); border-color: var(--ipd-blue); color: #fff; box-shadow: 0 4px 12px rgba(0,137,208,.3); }
.fchip.active .fdot { background: #fff !important; }

.carto-grid { display: grid; grid-template-columns: 1fr 340px; gap: var(--sp-4); }
.carto-map-card { padding: 0; overflow: hidden; position: relative; }
.carto-map { width: 100%; height: 560px; background: #020e1f; z-index: 0; }
.carto-legend { position: absolute; left: 16px; bottom: 14px; z-index: 450; display: flex; gap: 10px 14px; flex-wrap: wrap; max-width: 68%; background: rgba(2,14,31,.78); backdrop-filter: blur(4px); border: 1px solid rgba(134,180,221,.2); border-radius: var(--r-lg); padding: 9px 16px; pointer-events: none; }
.carto-legend .lg { display: inline-flex; align-items: center; gap: 6px; font-size: .72rem; color: #cfe0f2; font-weight: 600; font-family: var(--font-title); }
.carto-legend .lg i { width: 10px; height: 10px; border-radius: 50%; }
.carto-legend .lg-n { font-family: var(--font-title); font-weight: 700; font-size: .7rem; color: #fff; background: rgba(255,255,255,.14); border-radius: 999px; padding: 0 6px; margin-left: 2px; }
.fchip.seg { background: var(--surface-2); }
.fchip.seg.active { background: var(--ipd-navy); border-color: var(--ipd-navy); }

/* marqueurs Leaflet */
.carto-map .leaflet-tile-pane { filter: saturate(.92) brightness(1.02); }
.lmk { position: relative; display: grid; place-items: center; border-radius: 50%; background: var(--mc); box-shadow: 0 0 16px var(--mc), 0 0 4px rgba(255,255,255,.6); border: 2px solid rgba(255,255,255,.85); }
.lmk-core { font-family: "Poppins", sans-serif; font-weight: 900; font-size: 14px; color: #fff; z-index: 2; }
.lmk-pulse { position: absolute; inset: -2px; border-radius: 50%; border: 2px solid var(--mc); animation: lmkpulse 2.4s ease-out infinite; }
@keyframes lmkpulse { 0% { transform: scale(1); opacity: .85; } 100% { transform: scale(2.7); opacity: 0; } }
.lmk-label { position: absolute; top: calc(100% + 5px); left: 50%; transform: translateX(-50%); font-family: "Poppins", sans-serif; font-weight: 600; font-size: 11px; color: #eaf2fb; white-space: nowrap; text-shadow: 0 1px 5px rgba(0,0,0,.95); }
.lmk.foc { box-shadow: 0 0 0 3px #fff, 0 0 20px var(--mc); }
.agent-dot { filter: drop-shadow(0 0 3px currentColor); }
.c-border { pointer-events: none; }
.c-border.strong { filter: drop-shadow(0 0 5px rgba(134,180,221,.85)); }
.leaflet-tooltip { background: #07203f; color: #eaf2fb; border: 1px solid rgba(134,180,221,.3); box-shadow: 0 4px 14px rgba(0,0,0,.5); font-family: var(--font-body); font-size: 12px; }
.leaflet-tooltip-top::before { border-top-color: #07203f; }
.carto-region-tip { background: rgba(2,14,31,.9); color: #cfe0f2; border: 1px solid rgba(134,180,221,.4); font-family: var(--font-title); font-weight: 600; font-size: 11px; letter-spacing: .3px; box-shadow: 0 4px 14px rgba(0,0,0,.5); }

/* contrôle hors-site (Télétravail / Congé) */
.carto-offctrl { background: rgba(2,14,31,.85); backdrop-filter: blur(6px); border: 1px solid rgba(134,180,221,.25); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-width: 132px; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.carto-offctrl .offctrl-h { font-family: "Poppins", sans-serif; font-weight: 700; font-size: 10px; letter-spacing: 2px; color: rgba(134,180,221,.7); text-align: center; }
.offhub { display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); border-left: 4px solid var(--c); border-radius: 10px; padding: 8px 12px; color: #eaf2fb; cursor: pointer; transition: all .2s; text-align: left; }
.offhub:hover { background: rgba(255,255,255,.1); }
.offhub.foc { box-shadow: 0 0 0 2px var(--c); }
.offhub .oh-n { font-family: "Poppins", sans-serif; font-weight: 900; font-size: 18px; color: var(--c); min-width: 22px; }
.offhub .oh-l { font-family: "Poppins", sans-serif; font-weight: 600; font-size: 12px; }

/* contrôles Leaflet — thème sombre IPD */
.carto-map .leaflet-bar a { background: #07203f; color: #cfe0f2; border-color: rgba(134,180,221,.2); }
.carto-map .leaflet-bar a:hover { background: #0a2950; }
.carto-map .leaflet-control-attribution { background: rgba(2,14,31,.72); color: #7e98b6; }
.carto-map .leaflet-control-attribution a { color: #86b4dd; }

.carto-side { display: flex; flex-direction: column; max-height: 640px; }
.carto-side-body { overflow-y: auto; padding: 6px 10px 10px; }
.carto-person { display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-bottom: 1px solid var(--border); }
.carto-person:last-child { border-bottom: none; }
.carto-person .cp-n { font-family: var(--font-title); font-weight: 600; font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.carto-person .cp-s { font-size: .7rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.carto-person .badge { font-size: .66rem; padding: 2px 8px; }
.carto-person .fdot { width: 7px; height: 7px; border-radius: 50%; }

@media (max-width: 1100px) { .carto-grid { grid-template-columns: 1fr; } .flabel { min-width: 0; width: 100%; } }

/* ----------------------------- Pointage -------------------------------- */
.pt-tabs { display: flex; gap: 6px; margin-bottom: var(--sp-5); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.pt-tab { display: inline-flex; align-items: center; gap: 8px; padding: 11px 16px; border: none; background: transparent; color: var(--text-muted); font-family: var(--font-title); font-weight: 600; font-size: var(--body2); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.pt-tab:hover { color: var(--text); }
.pt-tab.active { color: var(--ipd-blue); border-bottom-color: var(--ipd-blue); }
.pt-tab svg { width: 17px; height: 17px; }

.pt-phone { overflow: hidden; }
.pt-phone-top { background: linear-gradient(135deg, var(--ipd-navy), var(--ipd-blue)); color: #fff; padding: 16px 20px; font-family: var(--font-title); font-weight: 700; display: flex; align-items: center; gap: 10px; }
.pt-seg { display: flex; background: var(--surface-2); border-radius: var(--r-md); padding: 4px; margin-bottom: var(--sp-4); }
.pt-seg-b { flex: 1; padding: 9px; border: none; background: transparent; border-radius: 9px; font-family: var(--font-title); font-weight: 600; font-size: .8rem; color: var(--text-muted); }
.pt-seg-b.on { background: var(--surface); color: var(--ipd-blue); box-shadow: var(--shadow-sm); }
.pt-seg-type .pt-seg-b { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.pt-seg-type .pt-seg-b svg { opacity: .8; }
.pt-device { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); padding: 9px 12px; margin-bottom: var(--sp-4); }
.pt-device > svg { color: var(--ipd-blue); flex-shrink: 0; }
.pt-device > div { flex: 1; min-width: 0; }
.pt-device .ptd-l { font-size: .68rem; text-transform: uppercase; letter-spacing: .3px; color: var(--text-faint); font-weight: 700; }
.pt-device .ptd-tel { font-family: var(--font-title); font-weight: 700; font-size: .92rem; }
.pt-scan { display: flex; align-items: center; gap: 8px; background: var(--st-info-bg); color: var(--text); border-radius: var(--r-md); padding: 10px 14px; font-size: .82rem; margin-bottom: var(--sp-4); }
.pt-scan b { font-family: var(--font-title); }
.pt-frauds { display: flex; flex-direction: column; gap: 8px; margin-bottom: var(--sp-4); }
.pt-check { display: flex; align-items: center; gap: 8px; font-size: .82rem; color: var(--text-muted); }
.pt-check input { width: 16px; height: 16px; accent-color: var(--ipd-blue); }
.pt-result { display: none; align-items: center; gap: 12px; border-radius: var(--r-md); padding: 14px 16px; margin-top: var(--sp-4); }
.pt-result.show { display: flex; animation: pop .25s var(--ease); }
.pt-result.ok { background: var(--st-success-bg); color: var(--st-success); }
.pt-result.ko { background: var(--st-danger-bg); color: var(--st-danger); }
.pt-result.warn { background: var(--st-warning-bg); color: var(--st-warning); }
.pt-result .pr-t { font-family: var(--font-title); font-weight: 700; }
.pt-result .pr-s { font-size: .82rem; opacity: .9; color: var(--text); }
.pt-privacy { display: flex; align-items: flex-start; gap: 8px; font-size: .74rem; color: var(--text-faint); margin-top: var(--sp-4); }
.pt-mini-map { width: 100%; height: 360px; background: #020e1f; border-radius: 0; }

.pt-borne { background: radial-gradient(120% 120% at 50% 0%, #07203f, #020e1f); }
.pt-borne .field label { color: #aac6e6; }
.pt-borne .select { background: rgba(255,255,255,.06); color: #fff; border-color: rgba(134,180,221,.3); }
.pt-qr-frame { position: relative; width: 248px; height: 248px; margin: 8px auto 0; display: grid; place-items: center; }
.pt-qr-frame #pt-qr { width: 200px; height: 200px; background: #fff; padding: 10px; border-radius: 14px; box-shadow: 0 0 40px rgba(0,137,208,.4); }
.pt-qr-frame #pt-qr img, .pt-qr-frame #pt-qr canvas { display: block; }
.pt-qr-ring { position: absolute; inset: 0; pointer-events: none; }
.pt-qr-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.pt-qr-ring .ring-bg { fill: none; stroke: rgba(134,180,221,.18); stroke-width: 3; }
.pt-qr-ring .ring-fg { fill: none; stroke: var(--ipd-blue); stroke-width: 3; stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.pt-qr-count { color: #cfe0f2; font-family: var(--font-title); margin-top: 18px; }
.pt-qr-count b { color: var(--ipd-sky); font-size: 1.2rem; }
.pt-qr-token { color: #7e98b6; font-size: .72rem; margin-top: 8px; word-break: break-all; }
.pt-howto { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.pt-howto li { display: flex; gap: 12px; align-items: flex-start; font-size: .86rem; color: var(--text-muted); }
.pt-howto li svg { color: var(--ipd-blue); flex: none; margin-top: 2px; }
.pt-howto li b { color: var(--text); font-family: var(--font-title); }
.pt-zone-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.pt-zone-row:last-child { border-bottom: none; }
.pt-radius { display: flex; align-items: center; gap: 10px; }
.pt-radius input[type=range] { width: 130px; accent-color: var(--ipd-blue); }

@media (max-width: 1100px) { .pt-mini-map { height: 300px; } }

/* ----------------------------- GPEC ------------------------------------ */
.g-dico { display: flex; flex-direction: column; gap: 14px; }
.g-dico-grp { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.g-dico-grp .flabel { min-width: 220px; }
.g-legend { display: flex; gap: 12px; flex-wrap: wrap; }
.g-legend .lg { display: inline-flex; align-items: center; gap: 5px; font-size: .72rem; color: var(--text-muted); font-weight: 600; font-family: var(--font-title); }
.g-legend .lg i { width: 12px; height: 12px; border-radius: 3px; }

.g-matrix-wrap { overflow-x: auto; }
table.g-matrix { border-collapse: separate; border-spacing: 0; font-size: .8rem; }
table.g-matrix th { padding: 8px 6px; font-family: var(--font-title); font-weight: 600; font-size: .68rem; color: var(--text-faint); text-align: center; vertical-align: bottom; }
table.g-matrix th span { display: inline-block; white-space: nowrap; }
table.g-matrix td { padding: 6px; text-align: center; }
.g-sticky { position: sticky; left: 0; background: var(--surface); z-index: 2; text-align: left !important; min-width: 210px; box-shadow: 1px 0 0 var(--border); }
table.g-matrix tbody tr:hover .g-sticky { background: var(--surface-2); }
.g-cell { position: relative; }
.g-dot { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; font-family: var(--font-title); font-weight: 700; font-size: .72rem; color: #fff; }
.g-dot[style*="dbeafe"], .g-dot[style*="9cc6e8"] { color: var(--ipd-navy); }
.g-gap { position: absolute; top: 3px; right: 3px; width: 7px; height: 7px; border-radius: 50%; background: var(--st-danger); border: 1.5px solid var(--surface); }

.g-crit { border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px; margin-bottom: 12px; }
.g-succ { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.g-succ-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--surface-2); border-radius: var(--r-sm); padding: 7px 10px; font-size: .82rem; }
.g-succ-row .avatar { width: 24px; height: 24px; font-size: 10px; }

.g-talent-res { margin-top: 8px; max-height: 320px; overflow-y: auto; }
.g-sim-list { max-height: 230px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.g-sim-row { display: flex; align-items: center; gap: 8px; font-size: .82rem; padding: 6px 8px; border-radius: var(--r-sm); }
.g-sim-row:hover { background: var(--surface-2); }
.g-sim-row .avatar { width: 24px; height: 24px; font-size: 10px; }
.g-sim-row input { accent-color: var(--ipd-blue); }
.g-sim-impact { min-height: 20px; }

.g-projet { border: 1px solid var(--border); border-radius: var(--r-md); padding: 16px; }
.g-besoin { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: .82rem; padding: 7px 0; border-bottom: 1px dashed var(--border); }
.g-besoin:last-of-type { border-bottom: none; }

/* ----------------------------- Plaintes -------------------------------- */
.pl-card { padding: 16px; cursor: pointer; transition: all var(--speed) var(--ease); }
.pl-card:hover { border-color: var(--ipd-blue); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.pl-obj { font-family: var(--font-title); font-weight: 700; font-size: .95rem; margin: 10px 0 4px; }
.pl-steps { display: flex; gap: 4px; margin-top: 12px; }
.pl-step { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.pl-step i { width: 100%; height: 4px; border-radius: 2px; background: var(--border-strong); }
.pl-step span { font-size: .6rem; color: var(--text-faint); font-family: var(--font-title); font-weight: 600; }
.pl-step.done i { background: var(--ipd-blue); }
.pl-step.done span { color: var(--ipd-blue); }

.pl-chat { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px; height: 240px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.pl-msg { max-width: 82%; }
.pl-msg.me { align-self: flex-end; text-align: right; }
.pl-msg.them { align-self: flex-start; }
.pl-msg-b { display: inline-block; padding: 8px 12px; border-radius: 12px; font-size: .84rem; text-align: left; }
.pl-msg.me .pl-msg-b { background: var(--ipd-blue); color: #fff; border-bottom-right-radius: 3px; }
.pl-msg.them .pl-msg-b { background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 3px; }
.pl-msg-m { font-size: .66rem; color: var(--text-faint); margin-top: 3px; }

.pl-hot { border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle, rgba(192,57,43,.55), rgba(192,57,43,.15)); border: 2px solid var(--st-danger); color: #fff; font-family: var(--font-title); font-weight: 900; font-size: 13px; box-shadow: 0 0 16px rgba(192,57,43,.7); animation: lmkpulse 2.6s ease-out infinite; }
.pl-hot.high { background: radial-gradient(circle, rgba(192,57,43,.8), rgba(192,57,43,.3)); }

/* ----------------------- Motion / dynamique ---------------------------- */
@keyframes riseIn { from { opacity: 0; transform: translateY(16px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes viewFade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes drift { 0% { transform: translate(0,0) scale(1); } 50% { transform: translate(18vmax,10vmax) scale(1.18); } 100% { transform: translate(6vmax,26vmax) scale(1.08); } }
@keyframes lineShimmer { from { background-position: 0 0; } to { background-position: 200% 0; } }

/* Halo ambiant qui dérive lentement en fond */
body::after { content: ""; position: fixed; z-index: -1; width: 64vmax; height: 64vmax; left: -12vmax; top: -18vmax; border-radius: 50%; pointer-events: none; background: radial-gradient(circle, rgba(0,137,208,.10), transparent 65%); animation: drift 28s ease-in-out infinite alternate; }
[data-theme="dark"] body::after { background: radial-gradient(circle, rgba(0,137,208,.18), transparent 65%); }

/* Transition d'entrée de page + cascade des KPIs */
#view.fx-in { animation: viewFade .42s var(--ease) both; }
.grid-kpi > .card { animation: riseIn .5s var(--ease) both; }
.grid-kpi > .card:nth-child(2) { animation-delay: .07s; }
.grid-kpi > .card:nth-child(3) { animation-delay: .13s; }
.grid-kpi > .card:nth-child(4) { animation-delay: .19s; }

/* Survol des cartes : halo + balayage lumineux du liseré */
.card:hover { border-color: rgba(0,137,208,.30); }
.card::before { background: linear-gradient(90deg, transparent, rgba(0,137,208,.5), transparent); background-size: 200% 100%; }
.card:hover::before { animation: lineShimmer 1.3s linear; }
.kpi .kpi-ico { transition: transform var(--speed) var(--ease), box-shadow var(--speed) var(--ease); }
.kpi:hover .kpi-ico { transform: scale(1.09) rotate(-3deg); }

/* Boutons icône & chips : ressort au survol */
.icon-btn:hover { transform: translateY(-1px) scale(1.04); }
.fchip { transition: all var(--speed) var(--ease), transform 120ms var(--ease); }
.fchip:active { transform: scale(.94); }

/* ----------------------------- Bento dashboard ------------------------- */
.bento { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: minmax(134px, auto); gap: var(--sp-4); }
.bento > * { animation: riseIn .5s var(--ease) both; }
.bento > *:nth-child(2) { animation-delay: .05s; }
.bento > *:nth-child(3) { animation-delay: .10s; }
.bento > *:nth-child(4) { animation-delay: .15s; }
.bento > *:nth-child(5) { animation-delay: .20s; }
.bento > *:nth-child(6) { animation-delay: .25s; }
.bento > *:nth-child(7) { animation-delay: .30s; }
.bento > *:nth-child(8) { animation-delay: .34s; }
.bento > *:nth-child(9) { animation-delay: .38s; }

.b-tile { display: flex; flex-direction: column; overflow: hidden; }
.b-tile .card-head { flex: none; }
.b-tile .b-body { position: relative; flex: 1 1 auto; min-height: 200px; }
.b-tile .b-body canvas { position: absolute; inset: 12px 16px 16px; }
.b-alerts-body { flex: 1; overflow-y: auto; padding: 4px 18px 14px; }

.b-trend { grid-column: span 2; grid-row: span 2; }
.b-donut { grid-row: span 2; }
.b-alerts { grid-row: span 2; }
.b-funders { grid-column: span 2; grid-row: span 2; }
.b-sites { grid-column: span 2; grid-row: span 2; }

/* KPI bento : sparkline animée en pied de tuile */
.b-kpi { display: flex; flex-direction: column; padding: 18px 18px 0; }
.b-kpi .b-kpi-head { display: flex; align-items: flex-start; justify-content: space-between; }
.b-kpi .kpi-ico { margin-bottom: 10px; }
.b-kpi .kpi-trend { position: static; margin: 0; }
.b-kpi .kpi-val { font-size: 1.95rem; }
.b-kpi .kpi-label { margin-bottom: 8px; }
.b-spark { height: 46px; margin-top: auto; position: relative; }
.b-spark canvas { position: absolute; inset: 0; }
/* KPI cliquable (drill-down) */
.kpi[data-kpi] { cursor: pointer; }
.kpi[data-kpi] .kpi-info { position: absolute; top: 14px; right: 14px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; color: var(--ipd-blue); background: var(--st-info-bg); opacity: .55; transform: translateX(2px); transition: opacity var(--speed) var(--ease), transform var(--speed) var(--ease); }
.kpi[data-kpi] .kpi-info svg { width: 14px; height: 14px; }
.kpi[data-kpi]:hover .kpi-info, .kpi[data-kpi]:focus-visible .kpi-info { opacity: 1; transform: none; }
.kpi[data-kpi]:hover { border-color: rgba(0,137,208,.45); }

@media (max-width: 1100px) {
  .bento { grid-template-columns: repeat(2, 1fr); }
  .b-trend, .b-donut, .b-alerts, .b-funders, .b-sites { grid-column: span 2; grid-row: auto; }
  .b-tile .b-body { min-height: 250px; }
}
@media (max-width: 640px) {
  .bento { grid-template-columns: 1fr; }
  .b-trend, .b-donut, .b-alerts, .b-funders, .b-sites { grid-column: span 1; }
}

/* Offline banner */
.offline-banner { display: none; align-items: center; gap: 10px; background: var(--st-warning-bg); color: var(--st-warning); padding: 8px 20px; font-size: var(--body2); font-weight: 700; font-family: var(--font-title); justify-content: center; }
body.is-offline .offline-banner { display: flex; }

/* ----------------- Annuaire & fiche agent ------------------------------ */
.kpi.accent-blue .kpi-ico { background: rgba(0,137,208,.12); color: var(--ipd-blue); }
.kpi.accent-violet .kpi-ico { background: rgba(108,92,231,.14); color: #6c5ce7; }
.modal.xl { max-width: 940px; }

.fiche-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: var(--sp-3); }
.fiche-card { text-align: left; display: flex; align-items: center; gap: 13px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); cursor: pointer; transition: border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease), transform var(--speed) var(--ease); animation: riseIn .45s var(--ease) both; }
.fiche-card:hover { border-color: var(--ipd-blue); box-shadow: 0 8px 24px rgba(0,137,208,.14); transform: translateY(-2px); }
.fiche-card:focus-visible { outline: none; box-shadow: var(--ring); }
.avatar.fc-av { width: 46px; height: 46px; font-size: 15px; background: linear-gradient(135deg, var(--c, var(--ipd-navy)), color-mix(in srgb, var(--c, var(--ipd-blue)) 60%, #000)); flex-shrink: 0; }
.fc-main { flex: 1; min-width: 0; }
.fc-n { font-family: var(--font-title); font-weight: 700; font-size: .96rem; display: flex; align-items: center; gap: 7px; }
.fc-poste { font-size: .8rem; color: var(--text-muted); margin: 1px 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc-tags { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: .72rem; }
.fc-tags .faint { display: inline-flex; align-items: center; gap: 3px; color: var(--text-faint); font-weight: 600; }
.fc-tags .faint svg { opacity: .7; }
.svc-chip { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-title); font-weight: 700; font-size: .68rem; padding: 2px 9px; border-radius: var(--r-pill); background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--c); border: 1px solid color-mix(in srgb, var(--c) 30%, transparent); }
.fc-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.fc-side .badge { white-space: nowrap; }
.fc-mat { font-size: .68rem; color: var(--text-faint); }

/* fiche détaillée (modale) */
.fichem-head { display: flex; gap: 18px; align-items: flex-start; padding-bottom: var(--sp-4); border-bottom: 1px solid var(--border); }
.avatar.xl { width: 72px; height: 72px; font-size: 24px; flex-shrink: 0; background: linear-gradient(135deg, var(--c, var(--ipd-navy)), color-mix(in srgb, var(--c, var(--ipd-blue)) 55%, #000)); box-shadow: var(--shadow-md); }
.fmh-main { flex: 1; min-width: 0; }
.fmh-n { font-size: 1.4rem; margin: 0; display: flex; align-items: center; gap: 9px; }
.fmh-poste { color: var(--text-muted); font-weight: 600; margin: 2px 0 9px; }
.fmh-tags { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.fmh-contact { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; font-size: .82rem; color: var(--text-muted); }
.fmh-contact a, .fmh-contact span { display: inline-flex; align-items: center; gap: 5px; color: inherit; text-decoration: none; }
.fmh-contact a:hover { color: var(--ipd-blue); }
.fmh-contact svg { opacity: .65; }

.fichem-kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: var(--sp-4) 0; }
.fmk { display: flex; align-items: center; gap: 9px; background: var(--surface-2); border-radius: var(--r-md); padding: 11px 12px; }
.fmk-ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: rgba(0,137,208,.12); color: var(--ipd-blue); flex-shrink: 0; }
.fmk-v { font-family: var(--font-title); font-weight: 700; font-size: 1.05rem; line-height: 1.1; }
.fmk-l { font-size: .68rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: .3px; }

.fichem-tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--border); margin-bottom: var(--sp-4); padding-bottom: 1px; }
.ftab { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-family: var(--font-title); font-weight: 600; font-size: .82rem; padding: 9px 13px; border: none; background: none; color: var(--text-muted); border-bottom: 2px solid transparent; cursor: pointer; transition: color var(--speed) var(--ease), border-color var(--speed) var(--ease); }
.ftab svg { opacity: .7; }
.ftab:hover { color: var(--text); }
.ftab.active { color: var(--ipd-blue); border-bottom-color: var(--ipd-blue); }
.ftab.active svg { opacity: 1; }
.ftab .tab-n { font-style: normal; font-size: .66rem; font-weight: 800; background: var(--surface-2); color: var(--text-muted); border-radius: var(--r-pill); padding: 1px 7px; }
.ftab.active .tab-n { background: rgba(0,137,208,.14); color: var(--ipd-blue); }
.fpanel { display: none; animation: fade .3s var(--ease) both; }
.fpanel.active { display: block; }

.def-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--sp-5); }
.dl-row { display: flex; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: .88rem; }
.dl-k { color: var(--text-muted); font-weight: 600; }
.dl-v { text-align: right; font-weight: 600; }
.empty.sm { padding: var(--sp-5) var(--sp-3); }
.empty.sm svg { width: 30px; height: 30px; margin-bottom: 8px; }
.fichem-tbl td, .fichem-tbl th { padding: 10px 12px; }
.fichem-tbl .ta-r { text-align: right; }

/* ----------------------------- ATS (recrutement) ----------------------- */
.ats-toolbar { display: flex; align-items: flex-end; gap: var(--sp-4); padding: 16px 18px; margin-bottom: var(--sp-3); flex-wrap: wrap; }
.ats-toolbar .field label, .ats-slider label { font-size: .72rem; text-transform: uppercase; letter-spacing: .3px; color: var(--text-faint); font-weight: 700; }
.ats-toolbar .search { background: var(--glass-soft); border: 1px solid var(--glass-brd); border-radius: var(--r-pill); padding: 9px 14px; display: flex; align-items: center; gap: 8px; color: var(--text-faint); }
.ats-toolbar .search input { border: none; background: transparent; outline: none; color: var(--text); font-family: var(--font-body); width: 100%; }
.ats-slider { display: flex; flex-direction: column; gap: 4px; min-width: 220px; }
.ats-slider input[type=range] { accent-color: var(--ipd-blue); width: 100%; }
.ats-bulkbar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; margin-bottom: var(--sp-3); border-radius: var(--r-md); background-color: var(--glass-strong); background-image: var(--glass-hi); border: 1px solid var(--ipd-blue); box-shadow: var(--glow-blue); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); font-size: .88rem; }

.ats-kanban { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.ats-col { background: var(--glass-soft); border: 1px solid var(--glass-brd); border-radius: var(--r-lg); display: flex; flex-direction: column; min-height: 120px; backdrop-filter: blur(10px) saturate(140%); -webkit-backdrop-filter: blur(10px) saturate(140%); }
.ats-col-head { display: flex; align-items: center; justify-content: space-between; padding: 11px 13px; font-family: var(--font-title); font-weight: 700; font-size: .82rem; border-bottom: 1px solid var(--border); }
.ats-col-n { background: var(--st-info-bg); color: var(--ipd-blue); border-radius: var(--r-pill); padding: 1px 9px; font-size: .72rem; font-weight: 800; }
.ats-col-body { padding: 10px; display: flex; flex-direction: column; gap: 9px; }
.ats-empty { text-align: center; color: var(--text-faint); padding: 14px 0; font-size: .85rem; }
.ats-card { background-color: var(--glass); background-image: var(--glass-hi); background-repeat: no-repeat; border: 1px solid var(--glass-brd); border-radius: var(--r-md); padding: 10px 11px; cursor: pointer; transition: border-color var(--speed) var(--ease), transform var(--speed) var(--ease), box-shadow var(--speed) var(--ease); box-shadow: var(--shadow-sm); }
.ats-card:hover { border-color: var(--ipd-blue); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.ats-card.is-rejete { opacity: .55; }
.ats-card.is-recrute { border-left: 3px solid var(--st-success); }
.ats-card-top { display: flex; align-items: center; gap: 8px; }
.ats-card-n { font-family: var(--font-title); font-weight: 700; font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ats-card-sub { font-size: .7rem; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ats-match { font-family: var(--font-title); font-weight: 800; font-size: .82rem; color: var(--mc, var(--ipd-blue)); flex-shrink: 0; }
.ats-card-foot { display: flex; align-items: center; gap: 5px; margin-top: 9px; flex-wrap: wrap; }
.ats-check { display: inline-flex; cursor: pointer; }
.ats-check input { width: 15px; height: 15px; accent-color: var(--ipd-blue); }
.ats-move { margin-left: auto; display: inline-flex; gap: 3px; }
.ats-mv { width: 24px; height: 22px; border-radius: 6px; border: 1px solid var(--border-strong); background: var(--glass-soft); color: var(--text-muted); font-size: .7rem; line-height: 1; }
.ats-mv:hover:not(:disabled) { border-color: var(--ipd-blue); color: var(--ipd-blue); }
.ats-mv:disabled { opacity: .35; cursor: not-allowed; }
.ats-bar { display: inline-block; width: 96px; height: 7px; border-radius: 999px; background: var(--surface-2); overflow: hidden; vertical-align: middle; margin-right: 8px; }
.ats-bar i { display: block; height: 100%; border-radius: 999px; }

.ats-fiche-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-5); }
.chip-skill { display: inline-block; font-size: .72rem; font-weight: 600; padding: 3px 10px; margin: 0 5px 5px 0; border-radius: var(--r-pill); background: var(--st-info-bg); color: var(--ipd-blue); }
.ats-score-big { display: flex; align-items: center; gap: 16px; padding: 12px; border-radius: var(--r-md); background: var(--glass-soft); border: 1px solid var(--glass-brd); }
.ats-score-ring { width: 78px; height: 78px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; font-family: var(--font-title); font-weight: 900; font-size: 1.5rem; color: var(--mc); background: conic-gradient(var(--mc) calc(var(--mc-pct, 0) * 1%), var(--surface-2) 0); box-shadow: inset 0 0 0 8px var(--surface); }
.ats-score-ring small { font-size: .7rem; }
.ats-avis-syn { display: flex; gap: 6px; flex-wrap: wrap; }
.ats-ev { padding: 9px 11px; border-radius: var(--r-md); background: var(--glass-soft); border: 1px solid var(--glass-brd); margin-bottom: 8px; }
.ats-addev { margin-top: 12px; }
.ats-addev summary { cursor: pointer; font-weight: 700; font-family: var(--font-title); font-size: .85rem; color: var(--ipd-blue); }
.ats-canaux { display: flex; flex-direction: column; gap: 8px; }
.ats-drop { display: flex; align-items: center; gap: 12px; padding: 18px; border: 1.5px dashed var(--border-strong); border-radius: var(--r-md); background: var(--glass-soft); cursor: pointer; color: var(--text-muted); transition: border-color var(--speed) var(--ease); }
.ats-drop:hover { border-color: var(--ipd-blue); color: var(--ipd-blue); }
.ats-drop svg { color: var(--ipd-blue); }
.imp-list { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; }
.imp-file { display: flex; align-items: center; gap: 8px; padding: 7px 11px; border-radius: var(--r-sm); background: var(--surface-2); font-size: .84rem; }
.imp-parsing { display: flex; align-items: center; gap: 14px; padding: 22px; }
.imp-parsing svg { color: var(--ipd-blue); animation: spin 1.1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.imp-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.imp-card { padding: 11px 13px; border-radius: var(--r-md); background: var(--glass-soft); border: 1px solid var(--glass-brd); }
@media (max-width: 700px) { .imp-cards { grid-template-columns: 1fr; } }

/* ------------------- Bouton de bascule Démo / Production ---------------- */
.mode-switch { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: var(--r-pill); background: var(--glass-soft); border: 1px solid var(--glass-brd); backdrop-filter: blur(8px) saturate(140%); -webkit-backdrop-filter: blur(8px) saturate(140%); }
.ms-seg { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-title); font-weight: 700; font-size: .72rem; padding: 6px 12px; border: none; background: transparent; color: var(--text-muted); border-radius: var(--r-pill); transition: all var(--speed) var(--ease); white-space: nowrap; }
.ms-seg svg { width: 14px; height: 14px; }
.ms-seg:hover { color: var(--text); }
.ms-seg.on { background: var(--grad-primary); color: #fff; box-shadow: 0 3px 10px rgba(0,137,208,.35); }
.ms-seg.ms-prod.on { background: linear-gradient(135deg, #e0a100, #c99700); box-shadow: 0 3px 10px rgba(224,161,0,.4); }
/* Repère discret « mode production » : liseré ambré en haut de l'espace de travail */
body[data-app-mode="prod"] .topbar { box-shadow: 0 2px 0 rgba(224,161,0,.55), 0 6px 22px rgba(5,42,98,.08); }
body[data-app-mode="prod"] #view { position: relative; }

/* ----------------------------- Responsive ------------------------------ */
@media (max-width: 1100px) {
  .grid-kpi { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-3, .cols-2 { grid-template-columns: 1fr; }
  .fichem-kpis { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 860px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 60; transform: translateX(-100%); transition: transform var(--speed) var(--ease); width: 280px; }
  body.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 50; }
  .menu-toggle { display: grid !important; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-hero { display: none; }
  .topbar .search { min-width: 0; }
  .page { padding: var(--sp-4); }
  #view { padding: var(--sp-4); }
  .topbar { padding: 0 var(--sp-4); }
  .fiche-grid { grid-template-columns: 1fr; }
  .fichem-kpis { grid-template-columns: repeat(2, 1fr); }
  .def-grid { grid-template-columns: 1fr; }
  .fichem-head { flex-direction: column; gap: 12px; }
  .ats-fiche-grid { grid-template-columns: 1fr; }
}
@media (max-width: 1100px) { .ats-kanban { grid-template-columns: repeat(5, minmax(200px, 1fr)); } }
.menu-toggle { display: none; }

/* ===================== Liquid glass — renforcement ====================== */
/* Pastilles de filtre dépolies */
.fchip { background: var(--glass-soft); border-color: var(--glass-brd); backdrop-filter: blur(10px) saturate(150%); -webkit-backdrop-filter: blur(10px) saturate(150%); }
.fchip.seg { background: var(--glass-soft); }
/* Contrôles segmentés (pointage) en verre */
.pt-seg { background: var(--glass-soft); border: 1px solid var(--glass-brd); backdrop-filter: blur(10px) saturate(150%); -webkit-backdrop-filter: blur(10px) saturate(150%); }
.pt-seg-b.on { background: var(--glass-strong); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
/* Cartes d'agent (annuaire) en verre + reflet */
.fiche-card { background-color: var(--glass); background-image: var(--glass-hi); background-repeat: no-repeat; border-color: var(--glass-brd); box-shadow: var(--shadow-sm), var(--glass-edge); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); }
/* Blocs internes dépolis */
.pt-device { background: var(--glass-soft); border-color: var(--glass-brd); backdrop-filter: blur(10px) saturate(150%); -webkit-backdrop-filter: blur(10px) saturate(150%); }
.fmk, .bs-stat { background: var(--glass-soft); backdrop-filter: blur(8px) saturate(140%); -webkit-backdrop-filter: blur(8px) saturate(140%); border: 1px solid var(--glass-brd); }
.pt-scan { backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
/* Reflet spéculaire mobile au survol des tuiles KPI (interruptible, sans reflow) */
.kpi { --sheen: -120%; }
.kpi::before { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.30) 50%, transparent 65%); transform: translateX(var(--sheen)); transition: transform .8s var(--ease); border-radius: inherit; }
.kpi:hover { --sheen: 120%; }
.kpi > * { position: relative; z-index: 1; }
[data-theme="dark"] .kpi::before { background: linear-gradient(115deg, transparent 35%, rgba(134,180,221,.18) 50%, transparent 65%); }

/* Repli navigateurs sans backdrop-filter : surfaces opaques (lisibilité garantie) */
@supports not ((backdrop-filter: blur(2px)) or (-webkit-backdrop-filter: blur(2px))) {
  :root { --glass: #ffffff; --glass-strong: #ffffff; --glass-soft: #f7f9fb; }
  [data-theme="dark"] { --glass: #07203f; --glass-strong: #08234a; --glass-soft: #0a2950; }
}

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
