/* ============================================================
   BPA Lead Generation — Design System V2
   Direction: Hybrid Premium Dark + Spatial accents
   Palette: Gradient-first | Glassmorphism V2
   Typography: Plus Jakarta Sans + Fira Code
   Layout: Bento Grid
   ============================================================ */

/* ----------------------------------------------------------
   1. CSS Custom Properties
   ---------------------------------------------------------- */
:root {
  /* Backgrounds */
  --bg: #050012;
  --bg-gradient: linear-gradient(180deg, #050012 0%, #0a0020 100%);
  --surface: #0a0a1a;
  --surface-2: #111827;
  --card: #0d0d20;

  /* Semantic gradients */
  --primary-gradient: linear-gradient(135deg, #6366f1, #a855f7);
  --outbound-gradient: linear-gradient(135deg, #f59e0b, #f97316);
  --inbound-gradient: linear-gradient(135deg, #22d3ee, #3b82f6);
  --synergy-gradient: linear-gradient(135deg, #a855f7, #ec4899);
  --success-gradient: linear-gradient(135deg, #22c55e, #10b981);

  /* Flat colors */
  --primary: #6366f1;
  --outbound: #f59e0b;
  --inbound: #22d3ee;
  --synergy: #a855f7;
  --success: #22c55e;
  --danger: #ef4444;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --subtle: #64748b;

  /* Surfaces */
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);
  --glass: rgba(255, 255, 255, 0.03);
  --glass-hover: rgba(255, 255, 255, 0.06);

  /* Glow */
  --glow-primary: rgba(99, 102, 241, 0.15);
  --glow-outbound: rgba(245, 158, 11, 0.12);
  --glow-inbound: rgba(34, 211, 238, 0.12);
  --glow-synergy: rgba(168, 85, 247, 0.12);

  /* Typography */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Fira Code', 'SF Mono', monospace;

  /* Spacing & Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --sidebar-w: 240px;

  /* Shadows (volumetric) */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.2), 0 4px 10px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.3), 0 8px 20px rgba(0, 0, 0, 0.15);

  /* Z-index scale */
  --z-base: 1;
  --z-sidebar: 100;
  --z-topbar: 50;
  --z-modal: 200;
  --z-toast: 300;
  --z-palette: 400;
  --z-noise: 9999;
}

/* ----------------------------------------------------------
   2. Reset & Base
   ---------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Noise overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: var(--z-noise);
  pointer-events: none;
  opacity: 0.025;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Ambient glow */
body::after {
  content: '';
  position: fixed;
  top: -200px;
  right: -200px;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ----------------------------------------------------------
   3. Sidebar
   ---------------------------------------------------------- */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: var(--z-sidebar);
}

.sidebar-logo {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--primary-gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}

.sidebar-logo-text {
  display: flex;
  flex-direction: column;
}

.sidebar-logo-text .logo-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.sidebar-logo-text .logo-subtitle {
  font-size: 11px;
  color: var(--muted);
}

.sidebar-section {
  padding: 20px 20px 6px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 13.5px;
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.sidebar-link.active {
  color: var(--text);
  background: rgba(99, 102, 241, 0.08);
  border-left: 3px solid var(--primary);
}

.sidebar-link .nav-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sidebar-link .nav-dot.green {
  background: var(--success);
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.4);
}

.sidebar-link .nav-dot.amber {
  background: var(--outbound);
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.4);
}

.sidebar-link .nav-dot.cyan {
  background: var(--inbound);
  box-shadow: 0 0 6px rgba(34, 211, 238, 0.4);
}

.sidebar-link .nav-badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary);
  padding: 2px 8px;
  border-radius: 9999px;
}

.sidebar-user {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

/* ----------------------------------------------------------
   4. Main Content Area
   ---------------------------------------------------------- */
.main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  padding: 0 32px 60px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: var(--z-topbar);
}

.topbar h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s;
}

.kbd:hover {
  color: var(--primary);
}

/* ----------------------------------------------------------
   5. Glassmorphism Card
   ---------------------------------------------------------- */
.g-card {
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.3s,
              box-shadow 0.3s;
}

.g-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-xl);
  transform: translateY(-4px);
}

/* ----------------------------------------------------------
   6. Bento Grid
   ---------------------------------------------------------- */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.bento-2x1 { grid-column: span 2; }
.bento-2x2 { grid-column: span 2; grid-row: span 2; }
.bento-1x2 { grid-row: span 2; }
.bento-full { grid-column: 1 / -1; }

/* ----------------------------------------------------------
   7. KPI Cards
   ---------------------------------------------------------- */
.kpi-card {
  position: relative;
  overflow: hidden;
}

.kpi-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
  margin-bottom: 10px;
}

.kpi-value {
  font-size: 52px;
  font-weight: 800;
  letter-spacing: -2px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.kpi-value.gradient-text {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.kpi-change {
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 9999px;
  margin-top: 8px;
}

.kpi-change.up {
  color: var(--success);
  background: rgba(34, 197, 94, 0.1);
}

.kpi-change.down {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

.kpi-sparkline {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 120px;
  height: 50px;
  opacity: 0.4;
}

/* ----------------------------------------------------------
   8. Section
   ---------------------------------------------------------- */
.section {
  margin-bottom: 32px;
}

.section-title {
  font-size: 17px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.2px;
}

/* ----------------------------------------------------------
   9. Table
   ---------------------------------------------------------- */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead th {
  text-align: left;
  padding: 12px 14px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

td {
  padding: 14px;
  font-variant-numeric: tabular-nums;
}

.status-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 9999px;
  display: inline-block;
}

.status-badge.actif {
  color: var(--success);
  background: rgba(34, 197, 94, 0.1);
}

.status-badge.pause {
  color: var(--outbound);
  background: rgba(245, 158, 11, 0.1);
}

.status-badge.brouillon {
  color: var(--muted);
  background: rgba(148, 163, 184, 0.1);
}

.canal-tag {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-block;
}

.canal-tag.email {
  color: var(--outbound);
  background: rgba(245, 158, 11, 0.1);
}

.canal-tag.linkedin {
  color: var(--inbound);
  background: rgba(34, 211, 238, 0.1);
}

.canal-tag.multi {
  color: var(--synergy);
  background: rgba(168, 85, 247, 0.1);
}

/* ----------------------------------------------------------
   10. Funnel
   ---------------------------------------------------------- */
.funnel {
  display: flex;
  gap: 4px;
  height: 120px;
}

.funnel-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.3s, filter 0.3s;
}

.funnel-stage:hover {
  transform: scaleY(1.04);
  filter: brightness(1.15);
}

.funnel-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 4px;
}

.funnel-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
}

.funnel-rate {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

/* ----------------------------------------------------------
   11. Charts
   ---------------------------------------------------------- */
.chart-container {
  position: relative;
  height: 320px;
  overflow: hidden;
}

.chart-container svg {
  width: 100%;
  height: 100%;
}

.chart-legend {
  display: flex;
  gap: 20px;
  padding-top: 16px;
  justify-content: flex-end;
}

.chart-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.donut-section {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
}

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ----------------------------------------------------------
   12. Content Grid
   ---------------------------------------------------------- */
.content-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.content-card {
  cursor: pointer;
}

.content-card:hover .content-title {
  color: var(--primary);
}

.seo-score {
  font-family: var(--font-mono);
  font-weight: 700;
  border-radius: 6px;
  padding: 2px 8px;
  display: inline-block;
}

.seo-score.high {
  color: var(--success);
  background: rgba(34, 197, 94, 0.1);
}

.seo-score.mid {
  color: var(--outbound);
  background: rgba(245, 158, 11, 0.1);
}

/* ----------------------------------------------------------
   13. Intro Panel (collapsible)
   ---------------------------------------------------------- */
.intro-panel {
  background: var(--glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: max-height 0.4s ease, padding 0.3s ease, opacity 0.3s ease;
  overflow: hidden;
}

.intro-panel.collapsed {
  max-height: 0;
  padding: 0 24px;
  opacity: 0;
  pointer-events: none;
}

/* ----------------------------------------------------------
   14. Buttons
   ---------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.2s, transform 0.2s, background 0.2s, border-color 0.2s;
  font-family: var(--font-sans);
  text-decoration: none;
}

.btn-primary {
  background: var(--primary-gradient);
  color: #fff;
  border: none;
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-ghost:hover {
  background: var(--glass-hover);
  border-color: var(--border-hover);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
}

.btn-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

/* ----------------------------------------------------------
   15. Animations & Keyframes
   ---------------------------------------------------------- */

/* Live pulse */
@keyframes pulse-live {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.6); }
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse-live 2s infinite;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.4);
  display: inline-block;
}

/* Row stagger */
@keyframes row-in {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(0); }
}

tbody tr.animated {
  animation: row-in 0.4s ease forwards;
}

/* Shimmer (skeleton loading) */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
}

.skeleton-title {
  height: 24px;
  width: 60%;
  margin-bottom: 12px;
}

.skeleton-chart {
  height: 200px;
}

.skeleton-card {
  height: 100px;
}

.skeleton-container {
  transition: opacity 0.4s;
}

.skeleton-container.skeleton-fade-out {
  opacity: 0;
  pointer-events: none;
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal[data-direction="left"] {
  transform: translateX(-24px);
}

.reveal[data-direction="left"].visible {
  transform: translateX(0);
}

.reveal[data-direction="right"] {
  transform: translateX(24px);
}

.reveal[data-direction="right"].visible {
  transform: translateX(0);
}

/* Page transitions */
.main.page-enter {
  animation: pageEnter 0.3s ease forwards;
}

.main.page-exit {
  animation: pageExit 0.3s ease forwards;
}

@keyframes pageEnter {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes pageExit {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(-20px); }
}

/* Chart draw-in */
@keyframes drawLine {
  to { stroke-dashoffset: 0; }
}

.chart-line {
  stroke-dasharray: var(--line-length, 1000);
  stroke-dashoffset: var(--line-length, 1000);
}

.chart-line.animate {
  animation: drawLine 1.2s ease-out forwards;
}

.chart-area {
  opacity: 0;
  transition: opacity 0.8s ease 0.4s;
}

.chart-area.animate {
  opacity: 0.3;
}

.funnel-bar {
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.funnel-bar.animate {
  transform: scaleX(1);
}

.donut-segment {
  stroke-dashoffset: var(--segment-length, 100);
  transition: stroke-dashoffset 0.8s ease;
}

.donut-segment.animate {
  stroke-dashoffset: 0;
}

/* Counter spring */
@keyframes counterReveal {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ----------------------------------------------------------
   16. Toast Container
   ---------------------------------------------------------- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-lg);
  min-width: 320px;
  max-width: 420px;
  position: relative;
  animation: toastIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toast.toast-exit {
  animation: toastOut 0.2s ease forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(60px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateX(60px); }
}

.toast-icon {
  font-size: 20px;
  flex-shrink: 0;
  line-height: 1;
}

.toast-body {
  flex: 1;
  font-size: 13px;
}

.toast-close {
  cursor: pointer;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  transition: color 0.2s;
}

.toast-close:hover {
  color: var(--text);
}

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.toast.success .toast-progress { background: var(--success); }
.toast.info .toast-progress    { background: var(--primary); }
.toast.warning .toast-progress { background: var(--outbound); }
.toast.error .toast-progress   { background: var(--danger); }

/* ----------------------------------------------------------
   17. Command Palette
   ---------------------------------------------------------- */
.cmd-palette-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: var(--z-palette);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.cmd-palette-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.cmd-palette {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 640px;
  max-height: 480px;
  box-shadow: var(--shadow-xl);
  transform: scale(0.95);
  transition: transform 0.2s;
  overflow: hidden;
}

.cmd-palette-overlay.open .cmd-palette {
  transform: scale(1);
}

.cmd-palette-input {
  padding: 16px 20px;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 15px;
  width: 100%;
  outline: none;
  font-family: var(--font-sans);
}

.cmd-palette-input::placeholder {
  color: var(--subtle);
}

.cmd-palette-results {
  overflow-y: auto;
  max-height: 380px;
  padding: 8px;
}

.cmd-palette-group {
  padding: 8px 12px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
}

.cmd-palette-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.15s;
}

.cmd-palette-item:hover,
.cmd-palette-item.selected {
  background: rgba(255, 255, 255, 0.04);
}

.cmd-palette-item .item-icon {
  font-size: 18px;
  color: var(--muted);
}

.cmd-palette-item .item-title {
  font-size: 14px;
  font-weight: 500;
}

.cmd-palette-item .item-subtitle {
  font-size: 12px;
  color: var(--muted);
}

.cmd-palette-item .item-shortcut {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}

/* ----------------------------------------------------------
   18. Prefers Reduced Motion
   ---------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ----------------------------------------------------------
   19. Utility Classes
   ---------------------------------------------------------- */
.gradient-text {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-primary  { color: var(--primary); }
.text-outbound { color: var(--outbound); }
.text-inbound  { color: var(--inbound); }
.text-synergy  { color: var(--synergy); }
.text-success  { color: var(--success); }
.text-danger   { color: var(--danger); }

.bg-primary-glow  { background: var(--glow-primary); }
.bg-outbound-glow { background: var(--glow-outbound); }
.bg-inbound-glow  { background: var(--glow-inbound); }
.bg-synergy-glow  { background: var(--glow-synergy); }

.mono         { font-family: var(--font-mono); }
.tabular-nums { font-variant-numeric: tabular-nums; }

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ----------------------------------------------------------
   9. Centralized Structural Components
   ---------------------------------------------------------- */
.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.period-selector {
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}
.period-selector:hover {
  background: var(--glass-hover);
  border-color: rgba(255,255,255,0.15);
}
.live-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--success);
  animation: pulse 2s infinite;
}

/* Base Bento Spacing Override for Pixel Perfection */
.bento-grid {
  gap: 20px !important; /* Forces luxury 20px spacing */
}
.g-card {
  padding: 24px !important;
}

/* Card Header Consistency */
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.card-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text);
  margin: 0;
}
.card-subtitle {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

/* KPI Architecture */
.kpi-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
}
.kpi-label {
  font-size: 13.5px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 12px;
}
.kpi-value {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1.1;
  color: var(--text);
}
.kpi-change.up {
  color: var(--success);
}
.kpi-change.down {
  color: var(--danger);
}

/* Tables (Universal) */
.table-wrap {
  overflow-x: auto;
  margin: 0 -24px -24px -24px; /* full bleed on cards */
  padding: 0 24px 24px 24px;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th {
  text-align: left;
  padding: 12px 16px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--text);
}
tbody tr {
  transition: background 0.2s;
  cursor: pointer;
}
tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

/* Badges */
.status-badge {
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
}
.status-badge.actif, .status-badge.active { background: rgba(34, 197, 94, 0.15); color: var(--success); border: 1px solid rgba(34, 197, 94, 0.2); }
.status-badge.pause, .status-badge.inactive { background: rgba(245, 158, 11, 0.15); color: var(--outbound); border: 1px solid rgba(245, 158, 11, 0.2); }
.status-badge.brouillon, .status-badge.draft { background: rgba(148, 163, 184, 0.15); color: var(--muted); border: 1px solid rgba(148, 163, 184, 0.2); }

.canal-tag {
  font-size: 11px;
  font-family: var(--font-mono);
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
}

/* ----------------------------------------------------------
   10. UX Micro-Animations & Polish
   ---------------------------------------------------------- */
.g-card {
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
.g-card:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 12px 30px -10px rgba(99, 102, 241, 0.15) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Base score bar animation fill */
.score-bar {
    transform-origin: left !important;
    animation: fillBar 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards !important;
}

@keyframes fillBar {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

/* Button Ghost Animated Arrow */
.btn-ghost {
    transition: all 0.2s;
}
.btn-ghost:hover {
    background: rgba(255,255,255,0.05);
}
