:root {
  --primary: #4F46E5; --primary-hover: #4338CA; --primary-light: #EEF2FF;
  --success: #10B981; --success-light: #D1FAE5;
  --warning: #F59E0B; --warning-light: #FEF3C7;
  --danger: #EF4444; --danger-light: #FEE2E2;
  --info: #3B82F6; --info-light: #DBEAFE;
  --purple: #8B5CF6; --purple-light: #EDE9FE;
  --emerald: #059669; --emerald-light: #D1FAE5;
  --orange: #EA580C; --orange-light: #FFEDD5;
  --bg: #F3F4F6; --white: #FFFFFF; --text: #1F2937; --text-muted: #6B7280;
  --border: #E5E7EB; --sidebar-bg: #1E1B4B; --sidebar-text: #C7D2FE;
  --sidebar-w: 260px; --topbar-h: 60px;
  --radius: 12px; --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 25px rgba(0,0,0,.1);
}
* { margin:0; padding:0; box-sizing:border-box; }
body { font-family:'Inter',system-ui,-apple-system,sans-serif; background:var(--bg); color:var(--text); font-size:14px; line-height:1.5; }
a { color:var(--primary); text-decoration:none; }
a:hover { text-decoration:underline; }

/* === LAYOUT === */
.app { display:flex; min-height:100vh; }
.sidebar { width:var(--sidebar-w); background:var(--sidebar-bg); color:var(--sidebar-text); position:fixed; top:0; left:0; bottom:0; z-index:100; display:flex; flex-direction:column; transition:transform .3s; overflow-y:auto; }
.sidebar-header { padding:1.25rem 1rem; display:flex; align-items:center; gap:.75rem; border-bottom:1px solid rgba(255,255,255,.1); }
.sidebar-header .logo { display:flex; align-items:center; gap:.6rem; font-size:1.1rem; font-weight:700; color:#fff; }
.sidebar-header .logo i { font-size:1.4rem; color:#818CF8; }
.sidebar-nav { flex:1; padding:.75rem 0; }
.nav-item { display:flex; align-items:center; gap:.75rem; padding:.65rem 1.25rem; color:var(--sidebar-text); cursor:pointer; border-left:3px solid transparent; transition:all .15s; font-size:.875rem; }
.nav-item:hover { background:rgba(255,255,255,.08); color:#fff; text-decoration:none; }
.nav-item.active { background:rgba(255,255,255,.12); color:#fff; border-left-color:#818CF8; font-weight:500; }
.nav-item i { width:20px; text-align:center; font-size:.9rem; }
.nav-section { padding:.75rem 1.25rem .35rem; font-size:.7rem; text-transform:uppercase; letter-spacing:.08em; color:rgba(199,210,254,.5); font-weight:600; margin-top:.5rem; }
.sidebar-footer { padding:1rem; border-top:1px solid rgba(255,255,255,.1); display:flex; align-items:center; gap:.65rem; }
.user-avatar { width:36px; height:36px; border-radius:50%; background:#818CF8; display:flex; align-items:center; justify-content:center; color:#fff; font-weight:600; font-size:.8rem; flex-shrink:0; }
.user-details { flex:1; min-width:0; }
.user-name { display:block; font-size:.8rem; font-weight:600; color:#fff; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.user-role { display:block; font-size:.7rem; color:var(--sidebar-text); }
.logout-btn { background:none; border:none; color:var(--sidebar-text); cursor:pointer; padding:.4rem; border-radius:6px; }
.logout-btn:hover { background:rgba(255,255,255,.12); color:#fff; }

.main { flex:1; margin-left:var(--sidebar-w); display:flex; flex-direction:column; }
.topbar { height:var(--topbar-h); background:var(--white); border-bottom:1px solid var(--border); display:flex; align-items:center; padding:0 1.5rem; position:sticky; top:0; z-index:50; gap:1rem; }
.topbar .page-title { font-size:1.1rem; font-weight:600; flex:1; }
.topbar .mobile-toggle { display:none; background:none; border:none; font-size:1.2rem; cursor:pointer; color:var(--text); }
.notif-wrap { position:relative; cursor:pointer; }
.notif-wrap i { font-size:1.1rem; color:var(--text-muted); }
.notif-badge { position:absolute; top:-6px; right:-8px; background:var(--danger); color:#fff; font-size:.65rem; font-weight:700; width:18px; height:18px; border-radius:50%; display:flex; align-items:center; justify-content:center; }
.content { padding:1.5rem; flex:1; }

/* === CARDS === */
.card { background:var(--white); border:1px solid var(--border); border-radius:var(--radius); box-shadow:var(--shadow); margin-bottom:1.25rem; }
.card-header { padding:.85rem 1.15rem; border-bottom:1px solid var(--border); display:flex; align-items:center; justify-content:space-between; }
.card-header h3 { font-size:.95rem; font-weight:600; display:flex; align-items:center; gap:.5rem; }
.card-header h3 i { color:var(--primary); font-size:.85rem; }
.card-body { padding:1.15rem; }
.card-footer { padding:.75rem 1.15rem; border-top:1px solid var(--border); background:#FAFAFA; border-radius:0 0 var(--radius) var(--radius); }

/* === STATS GRID === */
.stats-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:1rem; margin-bottom:1.5rem; }
.stat-card { background:var(--white); border:1px solid var(--border); border-radius:var(--radius); padding:1.15rem; display:flex; align-items:center; gap:1rem; box-shadow:var(--shadow); border-left:4px solid transparent; }
.stat-icon { width:48px; height:48px; border-radius:12px; display:flex; align-items:center; justify-content:center; font-size:1.2rem; }
.stat-value { font-size:1.5rem; font-weight:700; display:block; line-height:1.2; }
.stat-label { font-size:.78rem; color:var(--text-muted); }
.stat-blue { border-left-color:var(--info); }
.stat-blue .stat-icon { background:var(--info-light); color:var(--info); }
.stat-green { border-left-color:var(--success); }
.stat-green .stat-icon { background:var(--success-light); color:var(--success); }
.stat-yellow { border-left-color:var(--warning); }
.stat-yellow .stat-icon { background:var(--warning-light); color:var(--warning); }
.stat-orange { border-left-color:var(--orange); }
.stat-orange .stat-icon { background:var(--orange-light); color:var(--orange); }
.stat-emerald { border-left-color:var(--emerald); }
.stat-emerald .stat-icon { background:var(--emerald-light); color:var(--emerald); }
.stat-purple { border-left-color:var(--purple); }
.stat-purple .stat-icon { background:var(--purple-light); color:var(--purple); }
.stat-red { border-left-color:var(--danger); }
.stat-red .stat-icon { background:var(--danger-light); color:var(--danger); }

/* === DASHBOARD GRID === */
.dash-grid { display:grid; grid-template-columns:1fr 1fr; gap:1.25rem; }

/* === TABLE === */
.table-wrap { overflow-x:auto; }
/* Permet aux popovers .contrats-pop d'échapper au scroll horizontal du tableau */
.table-wrap:has(.contrats-pop:hover) { overflow: visible; }

.contrats-pop { position:relative; cursor:help; text-decoration:underline dotted; }
.contrats-pop:hover { z-index:200; }
.contrats-pop-content {
  position:absolute; top:100%; right:50%; transform:translateX(50%);
  z-index:200; min-width:260px; max-width:380px; max-height:340px; overflow-y:auto;
  background:var(--card-bg,#fff); color:var(--text,#1e293b);
  border:1px solid var(--border,#e2e8f0); border-radius:10px;
  box-shadow:0 10px 30px rgba(0,0,0,.18);
  /* Respiration visuelle au-dessus, MAIS la zone de hover reste continue avec la cellule
     (pas de gap externe). Évite le tremblement quand la souris passe de la cellule au popover. */
  padding:calc(.55rem + 6px) .7rem .55rem; font-size:.72rem; font-weight:400;
  text-align:left; line-height:1.3;
  visibility:hidden; opacity:0; transition:opacity .15s, visibility 0s linear .15s;
  /* pointer-events activés : le popover capture la souris, le :hover ne se perd pas
     quand on bouge sur le popover pour lire / scroller. */
  pointer-events:auto;
}
.contrats-pop:hover .contrats-pop-content { visibility:visible; opacity:1; transition-delay:0s; }
.contrats-pop-content::before {
  content:''; position:absolute; bottom:100%; right:50%; transform:translateX(50%);
  border:6px solid transparent; border-bottom-color:var(--border,#e2e8f0);
}
.contrats-pop-group { font-weight:700; color:var(--primary,#6366F1); margin:.45rem 0 .2rem; padding-bottom:.15rem; border-bottom:1px solid var(--border,#e2e8f0); font-size:.74rem; }
.contrats-pop-group:first-child { margin-top:0; }
.contrats-pop-item { padding:.15rem 0; display:flex; justify-content:space-between; gap:.6rem; font-size:.7rem; }
.contrats-pop-item .client { flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.contrats-pop-item .date { color:var(--text-muted,#64748b); font-size:.68rem; white-space:nowrap; }
table { width:100%; border-collapse:collapse; }
thead { background:#F9FAFB; }
th { padding:.65rem .85rem; text-align:left; font-size:.75rem; font-weight:600; text-transform:uppercase; letter-spacing:.04em; color:var(--text-muted); border-bottom:2px solid var(--border); white-space:nowrap; }
td { padding:.7rem .85rem; border-bottom:1px solid var(--border); font-size:.85rem; vertical-align:middle; }
tr:hover td { background:#F9FAFB; }
.font-medium { font-weight:500; }

/* === BADGES === */
.badge { display:inline-flex; align-items:center; padding:.15rem .55rem; border-radius:99px; font-size:.72rem; font-weight:600; white-space:nowrap; }
.badge-blue { background:var(--info-light); color:#1D4ED8; }
.badge-green { background:var(--success-light); color:#065F46; }
.badge-yellow { background:var(--warning-light); color:#92400E; }
.badge-orange { background:var(--orange-light); color:#9A3412; }
.badge-red { background:var(--danger-light); color:#991B1B; }
.badge-gray { background:#F3F4F6; color:#374151; }
.badge-emerald { background:var(--emerald-light); color:#065F46; }
.badge-purple { background:var(--purple-light); color:#5B21B6; }
.badge-lg { padding:.25rem .7rem; font-size:.8rem; }

/* === BUTTONS === */
.btn { display:inline-flex; align-items:center; gap:.4rem; padding:.5rem 1rem; border:none; border-radius:var(--radius-sm); font-size:.85rem; font-weight:500; cursor:pointer; transition:all .15s; font-family:inherit; text-decoration:none; }
.btn:hover { text-decoration:none; }
.btn-primary { background:var(--primary); color:#fff; }
.btn-primary:hover { background:var(--primary-hover); }
.btn-success { background:var(--success); color:#fff; }
.btn-success:hover { background:#059669; }
.btn-warning { background:var(--warning); color:#fff; }
.btn-outline { background:transparent; border:1px solid var(--border); color:var(--text); }
.btn-outline:hover { background:var(--bg); border-color:#D1D5DB; }
.btn-sm { padding:.35rem .7rem; font-size:.8rem; }
.btn-xs { padding:.2rem .5rem; font-size:.72rem; }
.btn-group { display:flex; gap:.35rem; }
.btn-block { width:100%; justify-content:center; }

/* === ALERTS === */
.alert { padding:.75rem 1rem; border-radius:var(--radius-sm); margin-bottom:1rem; display:flex; align-items:center; gap:.6rem; font-size:.85rem; position:relative; }
.alert-success { background:var(--success-light); color:#065F46; border:1px solid #A7F3D0; }
.alert-error { background:var(--danger-light); color:#991B1B; border:1px solid #FECACA; }
.alert-warning { background:var(--warning-light); color:#92400E; border:1px solid #FDE68A; }
.alert-info { background:var(--info-light); color:#1E40AF; border:1px solid #BFDBFE; }
.alert-close { position:absolute; right:.75rem; top:50%; transform:translateY(-50%); background:none; border:none; font-size:1.1rem; cursor:pointer; opacity:.5; }

/* === FORMS === */
.form-group { margin-bottom:1rem; }
.form-group label { display:block; font-size:.8rem; font-weight:500; margin-bottom:.3rem; color:var(--text); }
.form-input { width:100%; padding:.5rem .75rem; border:1px solid var(--border); border-radius:var(--radius-sm); font-size:.85rem; font-family:inherit; background:var(--white); transition:border-color .15s; }
.form-input:focus { outline:none; border-color:var(--primary); box-shadow:0 0 0 3px rgba(79,70,229,.1); }
.form-grid { display:grid; grid-template-columns:1fr 1fr; gap:0 1.25rem; }
.form-full { grid-column:1/-1; }
.form-inline { display:flex; align-items:center; gap:.6rem; flex-wrap:wrap; }
.filters-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); gap:.6rem 1rem; }
.required { color:var(--danger); }

/* === LIST ITEMS === */
.list-item { display:flex; align-items:center; gap:.75rem; padding:.6rem 0; border-bottom:1px solid #F3F4F6; }
.list-item:last-child { border-bottom:none; }
.list-item-time { font-size:.8rem; font-weight:600; color:var(--primary); min-width:55px; }
.list-item-content { flex:1; min-width:0; }
.list-item-content a { font-weight:500; }
.list-item-content span { display:block; }
.text-muted { color:var(--text-muted); font-size:.8rem; }
.text-center { text-align:center; }
.text-green { color:var(--success); }

/* === DETAIL === */
.detail-grid { display:grid; grid-template-columns:1fr 1fr; gap:1.25rem; }
.detail-row { display:flex; justify-content:space-between; padding:.45rem 0; border-bottom:1px solid #F9FAFB; }
.detail-label { font-size:.8rem; color:var(--text-muted); }
.detail-value { font-size:.85rem; font-weight:500; text-align:right; }
.page-actions { display:flex; gap:.6rem; margin-bottom:1.25rem; flex-wrap:wrap; }

/* === TIMELINE === */
.timeline { position:relative; padding-left:2rem; }
.timeline::before { content:''; position:absolute; left:.55rem; top:0; bottom:0; width:2px; background:var(--border); }
.timeline-item { position:relative; margin-bottom:1.25rem; }
.timeline-icon { position:absolute; left:-2rem; top:.15rem; width:24px; height:24px; border-radius:50%; background:var(--primary-light); color:var(--primary); display:flex; align-items:center; justify-content:center; font-size:.65rem; border:2px solid var(--white); }
.timeline-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:.15rem; }
.timeline-header strong { font-size:.82rem; }
.timeline-content p { font-size:.82rem; color:var(--text-muted); margin-top:.2rem; }

/* === TABS === */
.tabs { display:flex; border-bottom:2px solid var(--border); margin-bottom:1.25rem; gap:0; }
.tab { padding:.6rem 1.25rem; cursor:pointer; font-size:.85rem; font-weight:500; color:var(--text-muted); border-bottom:2px solid transparent; margin-bottom:-2px; transition:all .15s; }
.tab:hover { color:var(--text); }
.tab.active { color:var(--primary); border-bottom-color:var(--primary); }

/* === LOGIN === */
.login-page { display:flex; align-items:center; justify-content:center; min-height:100vh; background:linear-gradient(135deg,#1E1B4B 0%,#312E81 50%,#4F46E5 100%); }
.login-card { background:var(--white); border-radius:var(--radius); padding:2.5rem; width:100%; max-width:400px; box-shadow:var(--shadow-lg); }
.login-logo { text-align:center; margin-bottom:2rem; }
.login-logo h1 { font-size:1.5rem; margin-top:.5rem; }
.login-logo p { color:var(--text-muted); font-size:.9rem; }
.login-logo i { font-size:2.5rem; color:var(--primary); }

/* === RESPONSIVE === */
@media(max-width:1024px) {
  .dash-grid, .detail-grid { grid-template-columns:1fr; }
  .stats-grid { grid-template-columns:repeat(2,1fr); }
}
@media(max-width:768px) {
  .sidebar { transform:translateX(-100%); }
  .sidebar.open { transform:translateX(0); }
  .main { margin-left:0; }
  .topbar .mobile-toggle { display:block; }
  .stats-grid { grid-template-columns:1fr 1fr; }
  .form-grid { grid-template-columns:1fr; }
  .filters-grid { grid-template-columns:1fr 1fr; }
}

/* Fix chart container */
.chart-container { position:relative; height:250px; }

/* User role selector */
.role-selector { display:flex; gap:.5rem; margin-bottom:1rem; }
.role-btn { padding:.4rem .8rem; border:2px solid var(--border); border-radius:99px; font-size:.78rem; font-weight:600; cursor:pointer; background:var(--white); transition:all .15s; }
.role-btn:hover { border-color:var(--primary); }
.role-btn.active { background:var(--primary); color:#fff; border-color:var(--primary); }

/* === CALENDAR STYLES === */
.calendar-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:1px; background:var(--border); padding:1px; border-radius:var(--radius); overflow:hidden; }
.calendar-header { background:var(--primary); color:#fff; padding:.75rem .5rem; text-align:center; font-weight:600; font-size:.85rem; }
.calendar-day { background:var(--white); padding:.5rem; min-height:80px; border:1px solid var(--border); }
.calendar-day.other-month { background:#F9FAFB; color:var(--text-muted); }
.calendar-day.today { border-left:4px solid var(--primary); background:#F0F9FF; }
.calendar-day-number { font-weight:600; margin-bottom:.35rem; font-size:.9rem; }
.calendar-event { background:var(--primary); color:#fff; padding:.2rem .3rem; margin:.1rem 0; border-radius:4px; font-size:.7rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; cursor:pointer; }
.calendar-event:hover { opacity:.85; }
.calendar-event.small { font-size:.65rem; padding:.15rem .25rem; }

/* === DARK MODE === */
body.dark { --bg:#111827; --white:#1F2937; --text:#F9FAFB; --text-muted:#9CA3AF; --border:#374151; --sidebar-bg:#0F172A; --sidebar-text:#94A3B8; }
body.dark .card { background:#1F2937; }
body.dark thead { background:#111827; }
body.dark th { color:#9CA3AF; border-bottom-color:#374151; }
body.dark td { border-bottom-color:#374151; }
body.dark tr:hover td { background:#111827; }
body.dark .topbar { background:#1F2937; border-bottom-color:#374151; }
body.dark .login-page { background:linear-gradient(135deg,#0F172A 0%,#1E293B 50%,#334155 100%); }
body.dark .login-card { background:#1F2937; color:#F9FAFB; }
body.dark .form-input { background:#111827; border-color:#374151; color:#F9FAFB; }
body.dark .btn-outline { background:#111827; border-color:#374151; color:#F9FAFB; }
body.dark .card-footer { background:#111827; }
body.dark .stat-card { background:#1F2937; }
body.dark .badge-gray { background:#374151; color:#D1D5DB; }
body.dark .calendar-day { background:#1F2937; border-color:#374151; }
body.dark .calendar-day.other-month { background:#111827; }
body.dark .calendar-day.today { background:#1E293B; }
body.dark .nav-item:hover { background:rgba(255,255,255,.06); }
body.dark .timeline::before { background:#374151; }
body.dark .alert-info { background:#1E3A5F; color:#93C5FD; border-color:#2563EB; }
body.dark .alert-warning { background:#422006; color:#FCD34D; border-color:#D97706; }
body.dark .alert-success { background:#052e16; color:#86efac; border-color:#16a34a; }
.dark-toggle { background:none; border:none; cursor:pointer; font-size:1.1rem; color:var(--text-muted); padding:.4rem; border-radius:6px; transition:all .15s; }
.dark-toggle:hover { color:var(--text); background:rgba(0,0,0,.05); }

/* === SEARCH MODAL === */
.search-overlay { position:fixed; inset:0; background:rgba(0,0,0,.5); z-index:9999; display:flex; align-items:flex-start; justify-content:center; padding-top:12vh; backdrop-filter:blur(2px); }
.search-modal { background:var(--white); border-radius:16px; width:95%; max-width:640px; box-shadow:0 25px 60px rgba(0,0,0,.3); overflow:hidden; }
.search-modal input { width:100%; padding:1rem 1.25rem 1rem 3rem; border:none; font-size:1.1rem; background:transparent; color:var(--text); outline:none; }
.search-results { max-height:420px; overflow-y:auto; border-top:1px solid var(--border); }
.search-result-group { padding:.5rem 1rem; font-size:.72rem; font-weight:600; text-transform:uppercase; color:var(--text-muted); background:var(--bg); }
.search-result-item { padding:.65rem 1rem; cursor:pointer; display:flex; align-items:center; gap:.75rem; border-bottom:1px solid var(--border); transition:background .1s; }
.search-result-item:hover { background:var(--primary-light); }
.search-result-item .sri-icon { width:32px; height:32px; border-radius:8px; display:flex; align-items:center; justify-content:center; font-size:.8rem; }
.search-result-item .sri-main { flex:1; }
.search-result-item .sri-title { font-weight:500; font-size:.9rem; }
.search-result-item .sri-sub { font-size:.78rem; color:var(--text-muted); }
.search-kbd { display:inline-flex; align-items:center; padding:.15rem .45rem; border-radius:4px; font-size:.7rem; font-weight:600; background:var(--bg); border:1px solid var(--border); color:var(--text-muted); font-family:inherit; }

/* === NOTIFICATIONS PANEL === */
.notif-panel { position:fixed; top:var(--topbar-h); right:0; width:380px; max-height:calc(100vh - var(--topbar-h)); background:var(--white); border-left:1px solid var(--border); box-shadow:-4px 0 25px rgba(0,0,0,.1); z-index:200; display:flex; flex-direction:column; overflow:hidden; animation:slideInRight .2s ease; }
@keyframes slideInRight { from { transform:translateX(100%); } to { transform:translateX(0); } }
.notif-panel-header { padding:.85rem 1rem; border-bottom:1px solid var(--border); display:flex; align-items:center; justify-content:space-between; }
.notif-panel-body { flex:1; overflow-y:auto; }
.notif-item { padding:.75rem 1rem; border-bottom:1px solid var(--border); cursor:pointer; transition:background .1s; display:flex; gap:.65rem; }
.notif-item:hover { background:var(--bg); }
.notif-item.unread { background:#F0F4FF; }
body.dark .notif-item.unread { background:#1E293B; }
.notif-item .ni-icon { width:36px; height:36px; border-radius:10px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.notif-item .ni-body { flex:1; }
.notif-item .ni-title { font-size:.85rem; font-weight:500; }
.notif-item .ni-desc { font-size:.78rem; color:var(--text-muted); margin-top:.15rem; }
.notif-item .ni-time { font-size:.7rem; color:var(--text-muted); margin-top:.3rem; }

/* === SCORING BADGE === */
.score-badge { display:inline-flex; align-items:center; gap:.3rem; padding:.2rem .6rem; border-radius:99px; font-size:.78rem; font-weight:700; }
.score-high { background:#D1FAE5; color:#065F46; }
.score-mid { background:#FEF3C7; color:#92400E; }
.score-low { background:#FEE2E2; color:#991B1B; }

/* === TIMELINE V2 === */
.timeline-v2 { position:relative; padding-left:2.5rem; }
.timeline-v2::before { content:''; position:absolute; left:1rem; top:0; bottom:0; width:2px; background:var(--border); }
.timeline-v2-item { position:relative; margin-bottom:1rem; padding:.65rem .85rem; background:var(--white); border:1px solid var(--border); border-radius:var(--radius-sm); }
.timeline-v2-icon { position:absolute; left:-2.5rem; top:.7rem; width:28px; height:28px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:.7rem; border:2px solid var(--white); }
.timeline-v2-header { display:flex; justify-content:space-between; align-items:center; }
.timeline-v2-title { font-weight:600; font-size:.82rem; }
.timeline-v2-time { font-size:.72rem; color:var(--text-muted); }
.timeline-v2-desc { font-size:.82rem; color:var(--text-muted); margin-top:.25rem; }
.timeline-filter { display:flex; gap:.35rem; margin-bottom:.75rem; flex-wrap:wrap; }
.timeline-filter .tf-btn { padding:.2rem .6rem; border:1px solid var(--border); border-radius:99px; font-size:.72rem; cursor:pointer; background:var(--white); transition:all .1s; }
.timeline-filter .tf-btn:hover { border-color:var(--primary); }
.timeline-filter .tf-btn.active { background:var(--primary); color:#fff; border-color:var(--primary); }


/* === PIPELINE === */
.pipeline-card { border:1px solid var(--border); border-radius:var(--radius-sm); padding:.75rem; margin-bottom:.5rem; background:var(--white); transition:box-shadow .15s; }
.pipeline-card:hover { box-shadow:var(--shadow-lg); }
.pipeline-actions { display:flex; gap:.25rem; flex-wrap:wrap; margin-top:.5rem; }

/* === AUDIT === */
.audit-change { display:inline-flex; align-items:center; gap:.25rem; font-size:.78rem; }
.audit-old { background:#FEE2E2; color:#991B1B; padding:.1rem .3rem; border-radius:4px; text-decoration:line-through; }
.audit-new { background:#D1FAE5; color:#065F46; padding:.1rem .3rem; border-radius:4px; }
.audit-arrow { color:var(--text-muted); }

/* === TEAM HEATMAP === */
.heatmap-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:2px; }
.heatmap-cell { aspect-ratio:1; border-radius:4px; display:flex; align-items:center; justify-content:center; font-size:.65rem; font-weight:600; position:relative; cursor:pointer; transition:transform .15s; }
.heatmap-cell:hover { transform:scale(1.2); z-index:2; }
.heatmap-cell .hm-tooltip { display:none; position:absolute; bottom:calc(100% + 6px); left:50%; transform:translateX(-50%); background:var(--card-bg,#fff); color:var(--text,#1e293b); border:1px solid var(--border,#e2e8f0); border-radius:8px; padding:.5rem .7rem; font-size:.7rem; font-weight:400; white-space:nowrap; box-shadow:0 4px 12px rgba(0,0,0,.15); z-index:10; pointer-events:none; }
.heatmap-cell .hm-tooltip::after { content:''; position:absolute; top:100%; left:50%; transform:translateX(-50%); border:5px solid transparent; border-top-color:var(--border,#e2e8f0); }
.heatmap-cell:hover .hm-tooltip { display:block; }
