/* ══════════════════════════════════════════════
   MAPPERS — Design System v5.0
   Professional B2B Intelligence Platform
   Light Theme
   ══════════════════════════════════════════════ */

/* ── Design Tokens ── */
:root {
  /* Cameroon + professional palette */
  --green-700: #005f22;
  --green-600: #007a2e;
  --green-500: #009639;
  --green-400: #00b847;
  --green-300: #34d058;
  --green-50: #ecfdf5;
  --red-600: #b00f21;
  --red-500: #ce1126;
  --red-400: #e8243a;
  --red-50: #fef2f2;
  --yellow-500: #fcd116;
  --yellow-400: #ffe04a;
  --yellow-50: #fffbeb;
  --blue-500: #3b82f6;
  --blue-400: #60a5fa;
  --purple-500: #8b5cf6;
  --orange-500: #f97316;

  /* Light professional surfaces */
  --bg-body: #fafbfc;
  --bg-sidebar: #ffffff;
  --bg-main: #f5f6f8;
  --bg-card: #ffffff;
  --bg-card-hover: #f8f9fa;
  --bg-elevated: #ffffff;
  --bg-input: #ffffff;
  --bg-glass: rgba(0,0,0,0.02);
  --bg-glass-hover: rgba(0,0,0,0.04);

  /* Text */
  --text-primary: #1a202c;
  --text-secondary: #4a5568;
  --text-muted: #718096;
  --text-accent: var(--green-600);
  --text-dim: #a0aec0;

  /* Borders */
  --border-subtle: #e2e8f0;
  --border-medium: #cbd5e0;
  --border-active: rgba(0,150,57,0.4);

  /* Layout */
  --sidebar-width: 260px;
  --header-height: 56px;

  /* Radius */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.06), 0 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.08);
  --shadow-glow-green: 0 0 30px rgba(0,150,57,0.08);
  --shadow-card: 0 1px 3px rgba(0,0,0,0.06), 0 0 0 1px var(--border-subtle);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --t-fast: 150ms var(--ease);
  --t-base: 250ms var(--ease);
  --t-slow: 400ms var(--ease);
  --t-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Reset ── */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { font-size:16px; scroll-behavior:smooth; -webkit-font-smoothing:antialiased; }
body {
  font-family: var(--font-sans);
  background: var(--bg-body);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Subtle background accent */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 20% 0%, rgba(0,150,57,0.03), transparent),
    radial-gradient(ellipse 40% 40% at 80% 100%, rgba(59,130,246,0.02), transparent);
  pointer-events: none;
  z-index: 0;
}

/* Utility classes */
.container { max-width: 1400px; padding-left: 32px; padding-right: 32px; }
.mx-auto   { margin-left: auto; margin-right: auto; }

/* ══════════════════════════════════════════════
   Auth-Conditional Layout
   ══════════════════════════════════════════════ */

/* Public mode: sidebar hidden, topnav visible, full-width */
body.no-auth .sidebar      { display: none !important; }
body.no-auth .mobile-header { display: none !important; }
body.no-auth .topnav       { display: flex; }
body.no-auth .main-content { margin-left: 0; }
body.no-auth #page-home    { padding: 0; max-width: none; }
#page-company.active       { display: block; }
body.no-auth .public-footer { display: block; }

/* Authenticated mode: sidebar visible, topnav hidden */
body.authenticated .topnav  { display: none !important; }
body.authenticated .sidebar { display: flex !important; }
body.authenticated .public-footer { display: none; }
/* page-company uses same layout as other pages */

/* ══════════════════════════════════════════════
   Public TopNav
   ══════════════════════════════════════════════ */

.topnav {
  display: none; /* shown via body.no-auth */
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 60px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.topnav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1200px;
  padding: 0 24px;
}

.topnav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text-primary);
}

.topnav-brand .brand-flag { font-size: 1.4rem; }
.topnav-brand .brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.topnav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.topnav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--r-md);
  transition: all var(--t-fast);
}
.topnav-link:hover {
  color: var(--text-primary);
  background: var(--bg-glass-hover);
}

.topnav-link-cta {
  background: linear-gradient(135deg, var(--green-500), var(--green-400));
  color: white !important;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--r-full);
  padding: 8px 18px;
}
.topnav-link-cta:hover {
  background: linear-gradient(135deg, var(--green-400), var(--green-300));
  box-shadow: var(--shadow-glow-green);
}

/* ── Hero Search Bar ── */
.hero-search-wrapper {
  margin-top: 32px;
  width: 100%;
  max-width: 680px;
  position: relative;
}

.hero-autocomplete {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 100;
  margin-top: 4px;
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-medium, #e5e7eb);
  border-radius: var(--r-lg, 12px);
  box-shadow: 0 12px 40px rgba(0,0,0,.15);
  overflow: hidden;
  animation: acSlideDown .15s ease;
}

@keyframes acSlideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-search-box {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--r-full);
  padding: 4px 4px 4px 16px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.hero-search-box:focus-within {
  border-color: var(--green-400);
  box-shadow: 0 0 0 3px rgba(0,184,71,0.15);
}

.hero-search-icon {
  color: var(--text-muted);
  flex-shrink: 0;
}

.hero-search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  padding: 10px 12px;
}
.hero-search-input::placeholder { color: var(--text-dim); }

.hero-search-btn {
  background: linear-gradient(135deg, var(--green-500), var(--green-400));
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: var(--r-full);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
}
.hero-search-btn:hover {
  background: linear-gradient(135deg, var(--green-400), var(--green-300));
  box-shadow: var(--shadow-glow-green);
}

.hero-search-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 0.82rem;
  color: var(--text-dim);
}
.stag {
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: var(--r-full);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  cursor: pointer;
  transition: all var(--t-fast);
}
.stag:hover {
  background: var(--bg-glass-hover);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

/* ── Landing page padding top for topnav ── */
body.no-auth .landing-hero { padding-top: 100px; }

/* ── Stat separator ── */
.h-stat-sep {
  width: 1px;
  height: 32px;
  background: var(--border-medium);
}

/* ── Spotlight tag ── */
.spotlight-tag {
  display: inline-block;
  background: rgba(0, 150, 57, 0.12);
  color: var(--green-600);
  padding: 6px 14px;
  border-radius: var(--r-full);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
}

/* ── Price features .pro highlight ── */
.price-features li.pro {
  color: var(--green-400);
  font-weight: 600;
}

/* ── Public Footer ── */
.public-footer {
  display: none; /* shown via body.no-auth */
  background: var(--bg-sidebar);
  border-top: 1px solid var(--border-subtle);
  padding: 40px 24px 24px;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}
.footer-brand .brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
}
.footer-tagline {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-left: 8px;
}
.footer-links {
  display: flex;
  gap: 20px;
}
.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  transition: color var(--t-fast);
}
.footer-links a:hover { color: var(--text-primary); }
.footer-bottom {
  max-width: 1200px;
  margin: 20px auto 0;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
}
.footer-bottom p {
  color: var(--text-dim);
  font-size: 0.78rem;
}

@media (max-width: 768px) {
  .topnav-links { gap: 2px; }
  .topnav-link { font-size: 0.8rem; padding: 6px 10px; }
  .topnav-link-cta { padding: 6px 12px; font-size: 0.8rem; }
  .footer-inner { flex-direction: column; gap: 16px; text-align: center; }
  .hero-search-box { flex-direction: column; border-radius: var(--r-lg); }
  .hero-search-btn { border-radius: var(--r-md); width: 100%; }
  .container { padding-left: 16px; padding-right: 16px; }
  .page { padding: 16px 16px 40px; }
  .landing-hero { padding: 60px 16px 40px; }
  .landing-hero-content { padding: 0; }
  .landing-title { font-size: 1.8rem; }
  .landing-subtitle { font-size: 0.95rem; }
  .hero-search-wrapper { max-width: 100%; }
}

@media (max-width: 480px) {
  .topnav-links { display: none; }
  .container { padding-left: 12px; padding-right: 12px; }
  .landing-title { font-size: 1.4rem; }
  .page { padding: 12px 12px 32px; }
}

/* ══════════════════════════════════════════════
   Sidebar
   ══════════════════════════════════════════════ */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform var(--t-base);
}

.sidebar-header {
  padding: 20px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
}

.sidebar-logo .logo-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--green-500), var(--green-400));
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 0 20px rgba(0,150,57,0.25);
}

.sidebar-logo .logo-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-logo .logo-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: -0.5px;
}

.sidebar-logo .logo-badge {
  font-size: 0.6rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, rgba(0,150,57,0.2), rgba(0,184,71,0.1));
  color: var(--green-600);
  border: 1px solid rgba(0,150,57,0.3);
  letter-spacing: 1px;
}

/* Nav sections */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.nav-section {
  padding: 8px 0;
}

.nav-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 1.2px;
  padding: 12px 20px 6px;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  margin: 1px 8px;
  border-radius: var(--r-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--t-fast);
  position: relative;
}

.nav-item:hover {
  color: var(--text-primary);
  background: var(--bg-glass-hover);
}

.nav-item.active {
  color: var(--green-400);
  background: rgba(0,150,57,0.1);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--green-400);
}

.nav-badge {
  margin-left: auto;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--r-full);
  letter-spacing: 0.5px;
}

.nav-badge.pro {
  background: rgba(0,150,57,0.15);
  color: var(--green-400);
  border: 1px solid rgba(0,150,57,0.25);
}

.nav-count {
  margin-left: auto;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-full);
  background: var(--bg-elevated);
  color: var(--text-secondary);
}

.nav-count.alert {
  background: var(--red-500);
  color: white;
}

/* Sidebar footer */
.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border-subtle);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--r-sm);
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.user-action {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--t-fast);
  flex-shrink: 0;
}

.user-action:hover {
  color: var(--text-primary);
  background: var(--bg-glass-hover);
}

/* ══════════════════════════════════════════════
   Mobile Header
   ══════════════════════════════════════════════ */

.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(12,16,24,0.95);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 90;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

.mobile-menu-btn, .mobile-notif-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--r-sm);
  transition: var(--t-fast);
}

.mobile-menu-btn:hover, .mobile-notif-btn:hover {
  color: var(--text-primary);
  background: var(--bg-glass-hover);
}

.mobile-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.mobile-notif-btn {
  position: relative;
}

.notif-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red-500);
  border: 2px solid var(--bg-sidebar);
}

/* ══════════════════════════════════════════════
   Main Content
   ══════════════════════════════════════════════ */

.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.page {
  display: none;
  padding: 24px 32px 60px;
  max-width: 1400px;
  margin: 0 auto;
  animation: fadeIn 0.3s var(--ease);
}

.page.active {
  display: block;
}

/* Page header */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 28px;
  gap: 16px;
}

.page-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.page-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.page-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════
   Hero (search page only)
   ══════════════════════════════════════════════ */

.page-hero {
  text-align: center;
  padding: 48px 0 32px;
  position: relative;
}

.hero-glow {
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 300px;
  background: radial-gradient(ellipse, rgba(0,150,57,0.1), transparent 70%);
  pointer-events: none;
}

.hero-content {
  position: relative;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: var(--r-full);
  background: rgba(0,150,57,0.08);
  border: 1px solid rgba(0,150,57,0.2);
  color: var(--green-400);
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 20px;
  animation: fadeInDown 0.5s var(--ease);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green-400);
  animation: pulse 2s infinite;
}

.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 14px;
  animation: fadeInUp 0.5s var(--ease) 0.1s both;
}

.text-gradient {
  background: linear-gradient(135deg, var(--green-400), #34d058);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto 28px;
  line-height: 1.6;
  animation: fadeInUp 0.5s var(--ease) 0.2s both;
}

/* ── Search Box ── */
.search-wrapper {
  max-width: 640px;
  margin: 0 auto;
  animation: fadeInUp 0.5s var(--ease) 0.3s both;
}

.search-box {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--r-lg);
  padding: 5px 5px 5px 16px;
  transition: var(--t-base);
  box-shadow: var(--shadow-md), var(--shadow-glow-green);
}

.search-box:focus-within {
  border-color: var(--green-400);
  box-shadow: var(--shadow-lg), 0 0 40px rgba(0,150,57,0.15);
}

.search-box .search-icon {
  color: var(--text-muted);
  flex-shrink: 0;
  transition: var(--t-fast);
}

.search-box:focus-within .search-icon {
  color: var(--green-400);
}

.search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: var(--font-sans);
  padding: 12px;
  min-width: 0;
}

.search-input::placeholder {
  color: var(--text-dim);
}

.search-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-md);
  border: none;
  background: linear-gradient(135deg, var(--green-500), var(--green-400));
  color: white;
  cursor: pointer;
  transition: var(--t-base);
  flex-shrink: 0;
}

.search-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(0,150,57,0.4);
}

.search-tags {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.search-tag {
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 4px 12px;
  border-radius: var(--r-full);
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: var(--t-fast);
  font-family: var(--font-sans);
}

.search-tag:hover {
  color: var(--text-secondary);
  background: var(--bg-glass-hover);
  border-color: var(--border-medium);
}

/* ══════════════════════════════════════════════
   Stats Row
   ══════════════════════════════════════════════ */

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
  animation: fadeInUp 0.5s var(--ease) 0.4s both;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  transition: var(--t-base);
}

.stat-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-medium);
  transform: translateY(-1px);
}

.stat-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon.green { background: rgba(0,150,57,0.12); color: var(--green-400); }
.stat-icon.yellow { background: rgba(252,209,22,0.1); color: var(--yellow-500); }
.stat-icon.blue { background: rgba(59,130,246,0.1); color: var(--blue-400); }
.stat-icon.red { background: rgba(206,17,38,0.1); color: var(--red-400); }

.stat-data { min-width: 0; }

.stat-value {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.2;
}

.stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ══════════════════════════════════════════════
   Filters
   ══════════════════════════════════════════════ */

.filters-bar {
  display: flex;
  flex-direction: column;
  margin-bottom: 20px;
  gap: 10px;
}

.filter-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-group-primary {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-group-advanced {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}

.filter-select {
  appearance: none;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 8px 32px 8px 12px;
  border-radius: var(--r-sm);
  font-size: 0.82rem;
  font-family: var(--font-sans);
  font-weight: 500;
  cursor: pointer;
  transition: var(--t-fast);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  min-width: 0;
  flex: 1 1 auto;
  max-width: 220px;
}

.filter-select:hover, .filter-select:focus {
  border-color: var(--green-400);
  color: var(--text-primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.08);
}

/* Advanced toggle button */
.btn-advanced-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px dashed var(--border-subtle);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-sans);
  white-space: nowrap;
}
.btn-advanced-toggle:hover {
  border-color: var(--green-400);
  color: var(--green-500);
  background: rgba(5, 150, 105, 0.04);
}
.btn-advanced-toggle.active {
  border-color: var(--green-400);
  border-style: solid;
  color: var(--green-500);
  background: rgba(5, 150, 105, 0.06);
}
.btn-advanced-toggle .chevron {
  transition: transform 0.25s ease;
}
.btn-advanced-toggle.active .chevron {
  transform: rotate(180deg);
}

/* Advanced panel */
.filter-advanced-panel {
  padding: 12px 0 4px;
  border-top: 1px solid var(--border-subtle);
  animation: filterSlideIn 0.2s ease-out;
}
@keyframes filterSlideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Active filter pills row */
.filter-active-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 12px;
  background: rgba(5, 150, 105, 0.04);
  border: 1px solid rgba(5, 150, 105, 0.15);
  border-radius: var(--r-sm);
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  font-size: 0.75rem;
  animation: pillFadeIn 0.15s ease;
}
@keyframes pillFadeIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}
.filter-pill-label {
  color: var(--text-muted);
  font-weight: 500;
}
.filter-pill-value {
  color: var(--green-500);
  font-weight: 600;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.filter-pill-remove {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.7rem;
  padding: 0 2px;
  border-radius: 50%;
  line-height: 1;
  transition: all 0.15s;
}
.filter-pill-remove:hover {
  color: var(--red-500, #ef4444);
  background: rgba(239, 68, 68, 0.1);
}

.btn-clear-filters {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: none;
  border-radius: 20px;
  background: rgba(239, 68, 68, 0.08);
  color: var(--red-500, #ef4444);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--font-sans);
  white-space: nowrap;
}
.btn-clear-filters:hover {
  background: rgba(239, 68, 68, 0.15);
}

.results-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  padding-top: 4px;
}

.results-meta strong {
  color: var(--text-primary);
  font-weight: 600;
}

@media (max-width: 768px) {
  .filter-group-primary { flex-direction: column; }
  .filter-select { max-width: 100%; }
  .filter-group-advanced { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════
   Results Grid
   ══════════════════════════════════════════════ */

.results-grid {
  display: grid;
  gap: 8px;
  min-height: 150px;
}

.company-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: var(--t-base);
  position: relative;
  overflow: hidden;
}

.company-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--green-400), var(--green-600));
  opacity: 0;
  transition: var(--t-base);
}

.company-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-active);
  transform: translateX(3px);
}

.company-card:hover::before {
  opacity: 1;
}

.card-main {
  flex: 1;
  min-width: 0;
}

.card-name {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.card-meta span {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-meta svg {
  opacity: 0.5;
}

.card-niu {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--r-xs);
  background: rgba(252,209,22,0.08);
  color: var(--yellow-500);
  font-family: var(--font-mono);
  letter-spacing: 0.5px;
  white-space: nowrap;
  flex-shrink: 0;
}

.card-niu.full {
  background: rgba(0,150,57,0.1);
  color: var(--green-400);
}

.card-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}

.score-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.78rem;
  border: 2px solid;
}

.score-a { border-color: #22c55e; color: #22c55e; background: rgba(34,197,94,0.08); }
.score-b { border-color: #84cc16; color: #84cc16; background: rgba(132,204,22,0.08); }
.score-c { border-color: #eab308; color: #eab308; background: rgba(234,179,8,0.08); }
.score-d { border-color: #f97316; color: #f97316; background: rgba(249,115,22,0.08); }
.score-e { border-color: #ef4444; color: #ef4444; background: rgba(239,68,68,0.08); }

.score-label {
  font-size: 0.6rem;
  color: var(--text-dim);
  margin-top: 2px;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.3px;
}

/* Animation delays */
.company-card { animation: fadeInUp 0.3s var(--ease) both; }
.company-card:nth-child(1) { animation-delay: 0.02s; }
.company-card:nth-child(2) { animation-delay: 0.04s; }
.company-card:nth-child(3) { animation-delay: 0.06s; }
.company-card:nth-child(4) { animation-delay: 0.08s; }
.company-card:nth-child(5) { animation-delay: 0.10s; }
.company-card:nth-child(6) { animation-delay: 0.12s; }
.company-card:nth-child(7) { animation-delay: 0.14s; }
.company-card:nth-child(8) { animation-delay: 0.16s; }
.company-card:nth-child(9) { animation-delay: 0.18s; }
.company-card:nth-child(10) { animation-delay: 0.20s; }

/* ══════════════════════════════════════════════
   Pagination
   ══════════════════════════════════════════════ */

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  margin-top: 24px;
}

.page-btn {
  min-width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--t-fast);
  font-family: var(--font-sans);
  padding: 0 10px;
}

.page-btn:hover:not(:disabled) {
  background: var(--bg-card-hover);
  border-color: var(--border-medium);
  color: var(--text-primary);
}

.page-btn.active {
  background: rgba(0,150,57,0.12);
  border-color: rgba(0,150,57,0.3);
  color: var(--green-400);
  font-weight: 600;
}

.page-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ══════════════════════════════════════════════
   Dashboard
   ══════════════════════════════════════════════ */

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.dash-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.dash-card.span-full {
  grid-column: 1 / -1;
}

.dash-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.dash-card-header h3 {
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
}

.dash-card-header h3 svg { color: var(--text-muted); }

.btn-link {
  font-size: 0.78rem;
  color: var(--green-400);
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 500;
  transition: var(--t-fast);
  font-family: var(--font-sans);
}

.btn-link:hover {
  text-decoration: underline;
}

.dash-stats {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1px;
  background: var(--border-subtle);
}

.dash-stat {
  padding: 20px;
  text-align: center;
  background: var(--bg-card);
}

.dash-stat-value {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.dash-stat-value.green { color: var(--green-400); }
.dash-stat-value.blue { color: var(--blue-400); }
.dash-stat-value.yellow { color: var(--yellow-500); }
.dash-stat-value.red { color: var(--red-400); }

.dash-stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dash-list {
  padding: 8px;
  max-height: 260px;
  overflow-y: auto;
}

.dash-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  transition: var(--t-fast);
}

.dash-list-item:hover {
  background: var(--bg-glass-hover);
}

.dash-list-item .item-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.dash-list-item .item-info {
  flex: 1;
  min-width: 0;
}

.dash-list-item .item-name {
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-list-item .item-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.dash-empty {
  padding: 30px 20px;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
}

.chart-container {
  padding: 20px;
  min-height: 180px;
}

/* Chart bars */
.chart-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
}

.chart-bar-label {
  width: 100px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}

.chart-bar-track {
  flex: 1;
  height: 22px;
  background: var(--bg-elevated);
  border-radius: var(--r-xs);
  overflow: hidden;
  position: relative;
}

.chart-bar-fill {
  height: 100%;
  border-radius: var(--r-xs);
  background: linear-gradient(90deg, var(--green-500), var(--green-400));
  transition: width 0.6s var(--ease);
  display: flex;
  align-items: center;
  padding-left: 8px;
}

.chart-bar-value {
  font-size: 0.68rem;
  font-weight: 600;
  color: white;
  white-space: nowrap;
}

/* ══════════════════════════════════════════════
   Modals
   ══════════════════════════════════════════════ */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(6px);
  z-index: 300;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--r-xl);
  max-width: 640px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.3s var(--t-spring);
}

.modal.modal-sm {
  max-width: 440px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 22px 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
}

.modal-desc {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-top: 2px;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-subtle);
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.2rem;
  transition: var(--t-fast);
  flex-shrink: 0;
}

.modal-close:hover {
  background: var(--bg-glass-hover);
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
}

/* Detail grid */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.detail-item {
  padding: 12px;
  background: var(--bg-glass);
  border-radius: var(--r-sm);
  border: 1px solid var(--border-subtle);
}

.detail-item.full-width { grid-column: 1 / -1; }

.detail-item.pro-field {
  border-color: rgba(0,150,57,0.2);
  background: rgba(0,150,57,0.04);
}

.detail-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
  margin-bottom: 3px;
}

.detail-value {
  font-size: 0.88rem;
  font-weight: 500;
}

.detail-value.mono {
  font-family: var(--font-mono);
  color: var(--yellow-500);
  font-size: 0.82rem;
}

.detail-value.empty {
  color: var(--text-dim);
  font-style: italic;
}
/* ── Company Page ── */
#page-company {
  background: var(--bg-body);
}

.company-header-hero {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: 24px;
  margin-bottom: 20px;
}

.company-header-hero::before {
  content: ''; position: absolute; top: -80px; left: 50%; transform: translateX(-50%);
  width: 600px; height: 200px; background: var(--green-500);
  opacity: 0.03; filter: blur(60px); border-radius: 50%; pointer-events: none;
}

.header-inner { position: relative; z-index: 2; }

.back-btn {
  margin-bottom: 12px;
  border: none !important; background: transparent !important;
  color: var(--text-muted) !important; padding: 2px 4px !important;
  cursor: pointer; font-size: .82rem;
}
.back-btn:hover { color: var(--text-primary) !important; text-decoration: underline; }

.cp-header-profile {
  display: flex; gap: 16px; align-items: flex-start;
}

.cp-title {
  font-size: 1.5rem; font-weight: 800; color: var(--text-primary);
  margin-bottom: 4px; letter-spacing: -0.02em; line-height: 1.2;
}
.cp-title-suffix {
  font-size: .85rem; color: var(--text-muted); font-weight: 400;
}

.cp-tags {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 4px;
}

.cp-badge {
  display: inline-block; padding: 2px 10px; border-radius: var(--r-full);
  font-size: .72rem; font-weight: 700;
}
.cp-badge.green { background: #05966915; color: #059669; border: 1px solid #05966930; }
.cp-badge.red { background: #ef444415; color: #ef4444; border: 1px solid #ef444430; }

.cp-meta-line {
  font-size: .82rem; color: var(--text-secondary); line-height: 1.4;
}

/* Company body */
.company-body {
  display: flex; gap: 20px; padding: 0; align-items: flex-start;
}

.company-main-cols {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0;
}

/* ─ GRID LAYOUT (Pappers-style 2-col) ─ */
.cp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ─ BLOCKS ─ */
.cp-block {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--r-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.cp-block-full {
  grid-column: 1 / -1;
}

.cp-block-header {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px;
  font-size: .88rem; font-weight: 700; color: var(--text-primary);
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255,255,255,0.015);
}

.cp-block-icon {
  font-size: 1rem; line-height: 1;
}

.cp-block-body { padding: 0; flex: 1; }

@media (max-width: 768px) {
  .cp-grid { grid-template-columns: 1fr; }
  .company-body { flex-direction: column; }
  .company-side-col { width: 100%; position: static; }
}

/* ─ TABLE ROWS ─ */
.cpr {
  display: flex; align-items: baseline; gap: 16px;
  padding: 8px 16px; border-bottom: 1px solid var(--border-subtle);
  font-size: .87rem;
}
.cpr:last-child { border-bottom: none; }
.cpr:nth-child(even) { background: rgba(255,255,255,0.012); }

.cpr-l {
  width: 160px; flex-shrink: 0; font-size: .76rem;
  font-weight: 600; color: var(--text-muted);
}

.cpr-v {
  flex: 1; min-width: 0; font-weight: 500;
  color: var(--text-primary); word-break: break-word;
}

.cpv { font-weight: 500; color: var(--text-primary); }
.cpv.mono { font-family: var(--font-mono); font-size: .84rem; }
.cpv.pro { color: #059669; font-weight: 600; }
.cpv.empty { color: var(--text-dim, #555); font-style: italic; font-weight: 400; opacity: .6; }

/* ── PRO Badge ── */
.cp-pro-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #92400e;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 1px solid #f59e0b;
  border-radius: 4px;
  margin-left: 6px;
  vertical-align: middle;
  position: relative;
  overflow: hidden;
}
.cp-pro-badge::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.5) 50%, transparent 60%);
  animation: proShimmer 3s ease-in-out infinite;
}
@keyframes proShimmer {
  0%, 100% { transform: translateX(-100%); }
  50% { transform: translateX(100%); }
}

/* ── Pro Contact Block ── */
.cp-block-pro {
  background: var(--card-bg, #fff);
  border-radius: 12px;
  border: 1px solid rgba(5, 150, 105, 0.2);
  border-top: 3px solid transparent;
  border-image: linear-gradient(135deg, #059669, #10b981, #34d399) 1;
  border-image-slice: 1;
  overflow: hidden;
  animation: cpBlockFadeIn 0.4s ease-out both;
  animation-delay: 0.3s;
  position: relative;
}
.cp-block-pro::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(135deg, #059669, #10b981, #34d399);
}
.cp-block-pro .cp-block-header {
  background: linear-gradient(135deg, rgba(5,150,105,0.06), rgba(16,185,129,0.03));
  border-bottom: 1px solid rgba(5,150,105,0.1);
  padding: 14px 20px;
  font-weight: 600;
  font-size: .92rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── Contact Card ── */
.cp-contact-card {
  padding: 4px 0;
}
.cp-contact-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  transition: background 0.2s;
  border-radius: 8px;
  margin: 4px 12px;
}
.cp-contact-item:hover {
  background: rgba(5,150,105,0.04);
}
.cp-contact-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(5,150,105,0.1), rgba(16,185,129,0.05));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.cp-contact-info {
  flex: 1;
  min-width: 0;
}
.cp-contact-label {
  font-size: .75rem;
  color: var(--text-secondary, #64748b);
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 600;
  margin-bottom: 2px;
}
.cp-contact-value {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cp-contact-phone,
.cp-contact-email {
  font-size: 1rem;
  font-weight: 600;
  color: #059669;
  text-decoration: none;
  font-family: var(--font-mono);
  letter-spacing: .02em;
}
.cp-contact-phone:hover,
.cp-contact-email:hover {
  color: #047857;
  text-decoration: underline;
}

.cpv-link { color: var(--green-500); text-decoration: none; font-weight: 600; }
.cpv-link:hover { opacity: .8; text-decoration: underline; }

/* ─ DIRIGEANT ─ */
.cp-dirigeant {
  display: flex; align-items: center; gap: 14px; padding: 16px;
}
.cp-dirigeant-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, var(--green-500), var(--green-600));
  color: white; display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; font-weight: 800; flex-shrink: 0;
}
.cp-dirigeant-name { font-weight: 700; font-size: .95rem; }
.cp-dirigeant-role { font-size: .8rem; color: var(--text-muted); margin-bottom: 4px; }

.cp-empty-msg {
  text-align: center; color: var(--text-muted);
  font-size: .85rem; font-style: italic; padding: 24px 16px;
}

/* ─ COPY BUTTON ─ */
.cp-copy-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: var(--r-xs);
  border: 1px solid var(--border-subtle); background: transparent;
  cursor: pointer; font-size: .72rem; color: var(--text-muted);
  margin-left: 6px; vertical-align: middle;
  transition: all 0.2s;
}
.cp-copy-btn:hover { background: var(--bg-glass-hover); border-color: var(--border-medium); color: var(--text-primary); }
.cp-copy-btn.copied { color: var(--green-500); border-color: var(--green-400); background: rgba(0,150,57,0.06); }

/* ─ SOURCE TAG ─ */
.cp-source-tag {
  display: inline-block; font-size: .6rem; font-weight: 600;
  padding: 1px 6px; border-radius: var(--r-xs);
  background: rgba(37,99,235,0.08); color: #2563eb;
  border: 1px solid rgba(37,99,235,0.15);
  margin-left: 6px; vertical-align: middle;
  text-transform: uppercase; letter-spacing: .5px;
}

/* ─ ÉTAT DGI BADGE ─ */
.cp-etat-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-weight: 700; font-size: .85rem;
}
.cp-etat-badge.active { color: #059669; }
.cp-etat-badge.inactive { color: #ef4444; }

/* ─ BLOCK ANIMATIONS ─ */
.cp-block-anim {
  animation: cpBlockFadeIn 0.4s ease-out both;
}
.cp-block-anim:nth-child(5) { animation-delay: 0.05s; }
.cp-block-anim:nth-child(6) { animation-delay: 0.1s; }
.cp-block-anim:nth-child(7) { animation-delay: 0.15s; }
.cp-block-anim:nth-child(8) { animation-delay: 0.2s; }
.cp-block-anim:nth-child(9) { animation-delay: 0.25s; }

@keyframes cpBlockFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─ SIDEBAR ─ */
.company-side-col {
  width: 260px; flex-shrink: 0;
  display: flex; flex-direction: column; gap: 12px;
  position: sticky; top: 72px;
}

.cp-side-card {
  background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: var(--r-md); padding: 16px;
}

.cp-sidebar-score {
  display: flex; flex-direction: column; align-items: center;
  padding: 4px 0;
}

.cp-gauge {
  position: relative; width: 80px; height: 80px;
}
.cp-gauge svg { width: 100%; height: 100%; }

.cp-gauge-value {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.cp-gauge-num { font-size: 1.4rem; font-weight: 800; line-height: 1; }
.cp-gauge-label { font-size: .55rem; color: var(--text-muted); }
.cp-gauge-status { font-weight: 700; font-size: .82rem; margin-top: 4px; }

.cp-kv {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 0; font-size: .82rem;
  border-bottom: 1px solid var(--border-subtle);
}
.cp-kv:last-child { border-bottom: none; }
.cp-kv span:first-child { color: var(--text-muted); }
.cp-kv span:last-child { font-weight: 600; }
.cp-kv-small { font-size: .72rem; text-align: right; max-width: 55%; }

.cp-btn-hint {
  font-size: .68rem; color: var(--text-dim);
  text-align: center; margin-top: 4px;
}

/* ─ UPSELL ─ */
.cp-upsell {
  background: var(--green-500); color: white; border-radius: var(--r-md);
  padding: 14px 20px; display: flex; align-items: center;
  gap: 16px; font-size: .85rem; margin-top: 8px;
}
.cp-upsell-btn {
  background: #fff; color: var(--green-600); font-weight: 700;
  padding: 8px 16px; font-size: .82rem; border-radius: var(--r-md);
  border: none; cursor: pointer; white-space: nowrap;
}
.cp-upsell-btn:hover { background: #f0fdf4; }

.cp-btn-block {
  display: flex; width: 100%; justify-content: center; gap: 8px;
  padding: 12px; border-radius: var(--r-sm);
  font-weight: 600; cursor: pointer; transition: all 0.2s;
  border: 1px solid transparent; margin-bottom: 10px;
}

.cp-btn-primary {
  background: var(--green-500); color: white;
}
.cp-btn-primary:hover { background: var(--green-600); }

.cp-btn-outline {
  background: transparent; border-color: var(--border-color); color: var(--text-primary);
}
.cp-btn-outline:hover { background: var(--bg-card-hover); border-color: var(--border-hover); }

.cp-btn-kyc {
  background: linear-gradient(135deg, #1e3a5f, #2563eb);
  color: white;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}
.cp-btn-kyc:hover {
  background: linear-gradient(135deg, #1e3a5f, #1d4ed8);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}
.cp-btn-kyc.loading {
  opacity: 0.8;
  pointer-events: none;
}
.cp-btn-kyc.loading::after {
  content: '';
  position: absolute;
  top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  animation: kycShimmer 1.2s infinite;
}
@keyframes kycShimmer {
  to { left: 100%; }
}

.cp-timeline-item {
  position: relative; padding-left: 30px; margin-bottom: 20px;
}
.cp-timeline-item::before {
  content: ''; position: absolute; left: 5px; top: 8px; bottom: -28px;
  width: 2px; background: var(--border-subtle);
}
.cp-timeline-item:last-child::before { display: none; }
.cp-timeline-item::after {
  content: ''; position: absolute; left: 0; top: 8px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg-card); border: 2px solid var(--text-muted);
}
.cp-timeline-item.latest::after {
  border-color: var(--green-500); background: var(--green-500);
}

.cp-rel-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; border: 1px solid var(--border-subtle);
  border-radius: var(--r-md); margin-bottom: 8px;
  cursor: pointer; transition: var(--t-fast);
}
.cp-rel-row:hover {
  background: var(--bg-card-hover); border-color: var(--green-400); transform: translateX(4px);
}

/* ── Responsive: Tablet (≤1024px) ── */
@media (max-width: 1024px) {
  .company-body { gap: 20px; padding: 20px 24px; }
  .company-side-col { width: 280px; }
  .cp-title { font-size: 1.6rem; }
  .cp-avatar-lg { width: 60px; height: 60px; font-size: 1.5rem; }
  .company-header-hero { padding: 70px 0 24px; }
}

/* ── Responsive: Mobile landscape / small tablet (≤900px) ── */
@media (max-width: 900px) {
  .company-body {
    flex-direction: column;
    padding: 16px;
  }
  .company-side-col {
    width: 100%;
    order: -1;
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .company-side-col .side-card { flex: 1; min-width: 200px; }
  .cp-header-profile { flex-direction: column; align-items: center; text-align: center; }
  .cp-tags { justify-content: center; }
  .cp-meta-loc { justify-content: center; }
}

/* ── Responsive: Mobile (≤768px) ── */
@media (max-width: 768px) {
  .company-header-hero { padding: 60px 0 20px; }
  .cp-title { font-size: 1.3rem; }
  .cp-avatar-lg { width: 52px; height: 52px; font-size: 1.3rem; }
  .cp-header-profile { gap: 16px; }
  .cp-data-grid { grid-template-columns: 1fr; gap: 16px; }
  .company-body { padding: 12px; gap: 16px; }
  .cp-card { padding: 16px; }
  .company-side-col { flex-direction: column; }
  .company-side-col .side-card { min-width: auto; }
}

/* ── Responsive: Small mobile (≤480px) ── */
@media (max-width: 480px) {
  .company-header-hero { padding: 50px 0 16px; }
  .cp-title { font-size: 1.1rem; }
  .cp-card { padding: 14px; }
  .company-body { padding: 8px; gap: 12px; }
  .back-btn { font-size: 0.8rem; }
}

/* ══════════════════════════════════════════════
   Forms & Buttons
   ══════════════════════════════════════════════ */

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-medium);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.88rem;
  font-family: var(--font-sans);
  transition: var(--t-fast);
}

.form-input:focus {
  outline: none;
  border-color: var(--green-400);
  box-shadow: 0 0 0 3px rgba(0,150,57,0.15);
}

.form-input::placeholder {
  color: var(--text-dim);
}

.form-error {
  color: var(--red-400);
  font-size: 0.8rem;
  margin-bottom: 12px;
  min-height: 20px;
}

.radio-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.radio-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-medium);
  background: var(--bg-input);
  cursor: pointer;
  transition: var(--t-fast);
  text-align: center;
}

.radio-card:has(input:checked) {
  border-color: var(--green-400);
  background: rgba(0,150,57,0.06);
}

.radio-card input { display: none; }

.radio-label {
  font-weight: 600;
  font-size: 0.9rem;
}

.radio-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--r-sm);
  font-size: 0.82rem;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: var(--t-fast);
  border: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--green-500), var(--green-400));
  color: white;
}

.btn-primary:hover {
  box-shadow: 0 4px 16px rgba(0,150,57,0.35);
  transform: translateY(-1px);
}

.btn-outline {
  background: none;
  border: 1px solid var(--border-medium);
  color: var(--text-secondary);
}

.btn-outline:hover {
  border-color: var(--border-active);
  color: var(--text-primary);
  background: var(--bg-glass-hover);
}

.btn-block {
  width: 100%;
  justify-content: center;
  padding: 12px;
}

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

.btn-text {
  display: inline;
}

.btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* ══════════════════════════════════════════════
   Login Shortcuts
   ══════════════════════════════════════════════ */

.login-shortcuts {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.shortcuts-title {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-align: center;
  margin-bottom: 10px;
  font-weight: 500;
}

.shortcuts-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.shortcut-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 6px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-glass);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: var(--t-fast);
  color: var(--text-secondary);
  font-family: var(--font-sans);
}

.shortcut-btn:hover {
  background: var(--bg-glass-hover);
  border-color: var(--border-medium);
  transform: translateY(-1px);
}

.shortcut-btn.shortcut-admin {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.06);
}

.shortcut-btn.shortcut-admin:hover {
  border-color: rgba(245, 158, 11, 0.7);
  background: rgba(245, 158, 11, 0.12);
}

.shortcut-btn.shortcut-owner {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.06);
}

.shortcut-btn.shortcut-owner:hover {
  border-color: rgba(239, 68, 68, 0.7);
  background: rgba(239, 68, 68, 0.12);
}

.shortcut-icon {
  font-size: 1.2rem;
}

.shortcut-label {
  font-size: 0.72rem;
  font-weight: 600;
}

.shortcut-desc {
  font-size: 0.6rem;
  color: var(--text-dim);
  opacity: 0.7;
}

/* ══════════════════════════════════════════════
   Login Required Wall
   ══════════════════════════════════════════════ */

.login-required {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.login-required .lock-icon {
  margin-bottom: 16px;
  color: var(--text-dim);
}

.login-required h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin-bottom: 6px;
}

.login-required p {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 20px;
}

/* ══════════════════════════════════════════════
   Notifications List
   ══════════════════════════════════════════════ */

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  margin-bottom: 8px;
  transition: var(--t-fast);
}

.notif-item.unread {
  background: rgba(0,150,57,0.04);
  border-color: rgba(0,150,57,0.15);
}

.notif-item .notif-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  background: var(--bg-elevated);
}

.notif-item .notif-body {
  flex: 1;
  min-width: 0;
}

.notif-item .notif-title {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.notif-item .notif-message {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.notif-item .notif-time {
  font-size: 0.68rem;
  color: var(--text-dim);
  margin-top: 4px;
}

/* ══════════════════════════════════════════════
   Watchlist — Tabs + Items + Events
   ══════════════════════════════════════════════ */

/* Capacity indicator */
.wl-capacity {
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 5px 12px;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-full);
}

/* Tabs */
.wl-tabs {
  display: flex;
  gap: 2px;
  background: var(--bg-elevated);
  border-radius: var(--r-md);
  padding: 3px;
  margin-bottom: 20px;
}

.wl-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  font-family: var(--font-sans);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: var(--t-fast);
}

.wl-tab:hover { color: var(--text-secondary); }

.wl-tab.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.wl-tab-count {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--r-full);
  background: var(--bg-glass);
  color: var(--text-dim);
  min-width: 18px;
  text-align: center;
}

.wl-tab.active .wl-tab-count {
  background: rgba(0,150,57,0.15);
  color: var(--green-400);
}

.wl-tab-count.unread {
  background: rgba(239,68,68,0.15);
  color: #ef4444;
}

/* Tab panels */
.wl-tab-panel {
  display: none;
  animation: fadeIn 0.25s ease;
}

.wl-tab-panel.active { display: block; }

/* Watchlist items (enhanced) */
.watchlist-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  margin-bottom: 8px;
  transition: var(--t-fast);
}

.watchlist-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-medium);
}

.watchlist-item .wl-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--r-sm);
  background: linear-gradient(135deg, rgba(0,150,57,0.12), rgba(0,150,57,0.04));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  color: var(--green-400);
}

.watchlist-item .wl-company {
  flex: 1;
  min-width: 0;
}

.watchlist-item .wl-name {
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.watchlist-item .wl-detail {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 3px;
}

.watchlist-item .wl-detail span {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 3px;
}

.watchlist-item .wl-meta {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 2px;
}

.watchlist-item .wl-badges {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

.wl-event-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--r-full);
  background: rgba(0,150,57,0.1);
  color: var(--green-400);
}

.wl-event-badge.unread {
  background: rgba(252,209,22,0.12);
  color: var(--yellow-500);
}

.watchlist-item .wl-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* Events toolbar */
.wl-events-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.wl-events-toolbar .filter-select {
  padding: 7px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-medium);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.8rem;
  font-family: var(--font-sans);
  cursor: pointer;
}

/* Event items */
.wl-event-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 18px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  margin-bottom: 8px;
  transition: var(--t-fast);
  border-left: 3px solid var(--border-subtle);
}

.wl-event-item.unread {
  background: rgba(0,150,57,0.03);
  border-color: rgba(0,150,57,0.12);
}

.wl-event-item.type-activite_change { border-left-color: var(--blue-400); }
.wl-event-item.type-regime_change { border-left-color: var(--yellow-500); }
.wl-event-item.type-localisation_change { border-left-color: var(--green-400); }
.wl-event-item.type-identifiant_change { border-left-color: var(--purple-500); }

.wl-event-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  background: var(--bg-elevated);
}

.wl-event-body {
  flex: 1;
  min-width: 0;
}

.wl-event-company {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.wl-event-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.wl-event-change {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 0.72rem;
  padding: 4px 10px;
  background: var(--bg-elevated);
  border-radius: var(--r-xs);
  color: var(--text-secondary);
}

.wl-event-change .old-val {
  text-decoration: line-through;
  color: var(--red-400);
  opacity: 0.8;
}

.wl-event-change .arrow {
  color: var(--text-dim);
}

.wl-event-change .new-val {
  color: var(--green-400);
  font-weight: 600;
}

.wl-event-time {
  font-size: 0.68rem;
  color: var(--text-dim);
  flex-shrink: 0;
  text-align: right;
}

/* ══════════════════════════════════════════════
   Organization Settings
   ══════════════════════════════════════════════ */

.org-profile-card {
  padding: 24px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  margin-bottom: 20px;
}

.org-profile-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.org-profile-avatar {
  width: 52px;
  height: 52px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--green-500), var(--green-400));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: white;
  font-weight: 700;
  flex-shrink: 0;
}

.org-profile-info h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
}

.org-profile-info p {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-top: 2px;
}

.org-profile-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}

.org-profile-stat {
  padding: 12px;
  background: var(--bg-glass);
  border-radius: var(--r-sm);
  border: 1px solid var(--border-subtle);
  text-align: center;
}

.org-profile-stat .stat-val {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--green-400);
}

.org-profile-stat .stat-lbl {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

/* Settings sections */
.settings-section {
  border-radius: var(--r-lg);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  margin-bottom: 20px;
  overflow: hidden;
}

.settings-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.settings-section-header h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
}

.settings-section-header p {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 3px;
}

.settings-section-body {
  padding: 20px 24px;
}

/* Webhook input */
.webhook-input-row {
  display: flex;
  gap: 10px;
}

.webhook-input-row .form-input { flex: 1; }

.form-hint {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 6px;
}

.form-hint.success { color: var(--green-400); }
.form-hint.error { color: var(--red-400); }

/* Webhook event toggles */
.webhook-events-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.webhook-event-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-glass);
  cursor: pointer;
  transition: var(--t-fast);
}

.webhook-event-toggle:hover {
  background: var(--bg-glass-hover);
  border-color: var(--border-medium);
}

.webhook-event-toggle:has(input:checked) {
  border-color: rgba(0,150,57,0.3);
  background: rgba(0,150,57,0.04);
}

.webhook-event-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--green-400);
  cursor: pointer;
}

.toggle-icon { font-size: 1.1rem; }

.toggle-label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Code preview */
.webhook-payload-preview {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.code-preview {
  margin-top: 8px;
  padding: 16px;
  background: var(--bg-elevated);
  border-radius: var(--r-sm);
  border: 1px solid var(--border-subtle);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Empty state enhancements */
.wl-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.wl-empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.4;
}

.wl-empty-state h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin-bottom: 6px;
}

.wl-empty-state p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 16px;
  max-width: 360px;
}

@media (max-width: 768px) {
  .webhook-events-grid { grid-template-columns: 1fr; }
  .webhook-input-row { flex-direction: column; }
  .wl-events-toolbar { flex-direction: column; align-items: stretch; }
}

/* ══════════════════════════════════════════════
   Exports List
   ══════════════════════════════════════════════ */

.export-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  margin-bottom: 8px;
}

.export-item .export-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.export-item .export-icon.csv { background: rgba(34,197,94,0.1); color: var(--green-400); }
.export-item .export-icon.json { background: rgba(59,130,246,0.1); color: var(--blue-400); }

.export-item .export-info {
  flex: 1;
  min-width: 0;
}

.export-item .export-name {
  font-size: 0.85rem;
  font-weight: 600;
}

.export-item .export-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.export-status {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--r-full);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.export-status.completed { background: rgba(34,197,94,0.1); color: #22c55e; }
.export-status.pending { background: rgba(252,209,22,0.1); color: var(--yellow-500); }
.export-status.processing { background: rgba(59,130,246,0.1); color: var(--blue-400); }
.export-status.failed { background: rgba(239,68,68,0.1); color: #ef4444; }

/* ══════════════════════════════════════════════
   Analytics Grid
   ══════════════════════════════════════════════ */

.analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ══════════════════════════════════════════════
   Toast Notifications
   ══════════════════════════════════════════════ */

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: var(--r-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-medium);
  box-shadow: var(--shadow-lg);
  font-size: 0.85rem;
  color: var(--text-primary);
  animation: slideInRight 0.3s var(--ease), fadeOut 0.3s var(--ease) 2.7s forwards;
  max-width: 360px;
}

.toast.success { border-left: 3px solid var(--green-400); }
.toast.error { border-left: 3px solid var(--red-400); }
.toast.info { border-left: 3px solid var(--blue-400); }

/* ══════════════════════════════════════════════
   Empty / Loading / Placeholder
   ══════════════════════════════════════════════ */

.empty-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  color: var(--text-dim);
}

.empty-placeholder .empty-icon {
  margin-bottom: 16px;
}

.empty-placeholder p {
  font-size: 0.9rem;
}

.loading-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border-subtle);
  border-top-color: var(--green-400);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ══════════════════════════════════════════════
   Animations
   ══════════════════════════════════════════════ */

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes modalIn { from { opacity: 0; transform: scale(0.95) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════════
   Responsive
   ══════════════════════════════════════════════ */

@media (max-width: 1024px) {
  .dashboard-grid, .analytics-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .mobile-header {
    display: flex;
  }
  .main-content {
    margin-left: 0;
    padding-top: var(--header-height);
  }
  .page {
    padding: 16px 16px 40px;
  }
  .page-hero { padding-top: 24px; }
  .page-hero h1 { font-size: 1.6rem; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; }
  .dash-stats { grid-template-columns: 1fr 1fr; }
  .filter-group { width: 100%; }
  .filter-select { flex: 1; }
  .shortcuts-grid { grid-template-columns: repeat(3, 1fr); }
  .company-card { flex-wrap: wrap; }
}

@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr; }
  .radio-group { grid-template-columns: 1fr; }
}

/* Sidebar overlay for mobile */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}

.sidebar-backdrop.active {
  display: block;
}

/* ── Pro Teaser & Upgrade CTA ── */

.pro-teaser {
  position: relative;
  overflow: hidden;
  min-height: 160px;
}

.teaser-blur {
  filter: blur(6px);
  opacity: 0.4;
  pointer-events: none;
  user-select: none;
}

.teaser-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(6,8,13,0.5);
  z-index: 1;
}

.teaser-lock {
  font-size: 2rem;
  margin-bottom: 4px;
}

.teaser-overlay p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-align: center;
}

.pro-upgrade-cta {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, rgba(0,150,57,0.08), rgba(0,150,57,0.02));
  border: 1px solid rgba(0,150,57,0.15);
}

.cta-icon {
  font-size: 2.5rem;
  flex-shrink: 0;
}

.cta-text h4 {
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.cta-text p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.5;
}

.pro-upgrade-cta .btn {
  flex-shrink: 0;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .pro-upgrade-cta {
    flex-direction: column;
    text-align: center;
  }
}

/* ══════════════════════════════════════════════
   Chat IA Interface
   ══════════════════════════════════════════════ */
.chat-content {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 120px);
  background: var(--bg-card);
  border-radius: var(--r-xl);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
}

.chat-interface {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.chat-thread {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chat-message {
  display: flex;
  gap: 12px;
  max-width: 80%;
  animation: fadeInUp 0.3s ease both;
}

.chat-message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-message.system .chat-bubble {
  background: var(--bg-glass);
  border: 1px solid var(--border-medium);
  border-bottom-left-radius: 4px;
}

.chat-message.user .chat-bubble {
  background: rgba(0,150,57,0.1);
  border: 1px solid rgba(0,150,57,0.2);
  border-bottom-right-radius: 4px;
  color: var(--green-400);
}

.chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.chat-bubble {
  padding: 14px 18px;
  border-radius: 18px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.chat-bubble p { margin: 0 0 8px 0; }
.chat-bubble p:last-child { margin-bottom: 0; }

.chat-results-widget {
  margin-top: 12px;
  padding: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  font-size: 0.82rem;
}

.chat-input-area {
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-card);
}

.chat-input-wrapper {
  display: flex;
  gap: 12px;
  background: var(--bg-input);
  padding: 6px;
  border-radius: var(--r-full);
  border: 1px solid var(--border-medium);
  transition: all 0.2s ease;
}

.chat-input-wrapper:focus-within {
  border-color: var(--green-400);
  box-shadow: 0 0 0 3px rgba(0,150,57,0.15);
}

#chat-input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 8px 16px;
  color: var(--text-primary);
  font-size: 0.95rem;
}

#chat-input:focus {
  outline: none;
  box-shadow: none;
}

#chat-submit-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}


/* ══════════════════════════════════════════════
   Coffre-fort Documentaire (Vault)
   ══════════════════════════════════════════════ */

.vault-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.vault-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 18px;
  text-align: center;
}

.vault-stat-value {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--blue-400);
}

.vault-stat-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.vault-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.vault-doc-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 20px;
  transition: border-color 0.2s, box-shadow 0.2s;
  position: relative;
}

.vault-doc-card:hover {
  border-color: var(--blue-400);
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.08);
}

.vault-doc-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.vault-doc-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.vault-doc-icon.pdf { background: rgba(239, 68, 68, 0.12); }
.vault-doc-icon.contract { background: rgba(59, 130, 246, 0.12); }
.vault-doc-icon.report { background: rgba(16, 185, 129, 0.12); }
.vault-doc-icon.other { background: rgba(139, 92, 246, 0.12); }

.vault-doc-info {
  flex: 1;
  min-width: 0;
}

.vault-doc-name {
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vault-doc-meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.vault-doc-status {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 6px;
}

.vault-doc-status.approved {
  background: rgba(16, 185, 129, 0.15);
  color: var(--green-400);
}

.vault-doc-status.pending {
  background: rgba(245, 158, 11, 0.15);
  color: var(--yellow-500);
}

.vault-doc-status.rejected {
  background: rgba(239, 68, 68, 0.15);
  color: var(--red-400);
}

.vault-doc-actions {
  margin-top: 14px;
  display: flex;
  gap: 8px;
}


/* ══════════════════════════════════════════════
   Facturation & Abonnement
   ══════════════════════════════════════════════ */

.billing-plan-card {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(139, 92, 246, 0.08));
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}

.billing-plan-card::before {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-400), var(--green-400));
  opacity: 0.06;
}

.billing-plan-name {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.billing-plan-status {
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 600;
  margin-bottom: 16px;
}

.billing-plan-status.active {
  background: rgba(16, 185, 129, 0.15);
  color: var(--green-400);
}

.billing-plan-status.canceled {
  background: rgba(239, 68, 68, 0.15);
  color: var(--red-400);
}

.billing-plan-period {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.billing-section-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.billing-invoices-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
}

.billing-invoice-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 100px 100px;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg-card);
  font-size: 0.85rem;
  transition: background 0.15s;
}

.billing-invoice-row:hover {
  background: var(--bg-hover);
}

.billing-invoice-row.header {
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  background: var(--bg-card);
}

.invoice-status-pill {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 3px 10px;
  border-radius: 12px;
  text-align: center;
}

.invoice-status-pill.paid {
  background: rgba(16, 185, 129, 0.15);
  color: var(--green-400);
}

.invoice-status-pill.draft {
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
}

.invoice-status-pill.open {
  background: rgba(59, 130, 246, 0.15);
  color: var(--blue-400);
}

.invoice-status-pill.void,
.invoice-status-pill.uncollectible {
  background: rgba(239, 68, 68, 0.12);
  color: var(--red-400);
}

.billing-empty, .vault-empty {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Billing usage bars */
.billing-usage-item {
  margin-bottom: 14px;
}

.billing-usage-label {
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.billing-usage-bar {
  width: 100%;
  height: 8px;
  background: rgba(0,0,0,0.04);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 4px;
}

.billing-usage-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}

.billing-usage-text {
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* Billing plans grid */
.billing-plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.billing-plan-option {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.2s, transform 0.2s;
}

.billing-plan-option:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.billing-plan-option.current {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.06), rgba(59, 130, 246, 0.06));
}

.billing-plan-option-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
}

.billing-plan-option-price {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--accent);
}

.billing-plan-option-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.billing-plan-features {
  list-style: none;
  padding: 0;
  margin: 8px 0;
  font-size: 0.78rem;
}

.billing-plan-features li {
  padding: 2px 0;
  color: var(--text-secondary);
}

.btn-outline-danger {
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
}

.btn-outline-danger:hover {
  background: rgba(239, 68, 68, 0.1);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: white;
  border: none;
}

.btn-accent:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

@media (max-width: 768px) {
  .vault-stats { grid-template-columns: 1fr; }
  .vault-list { grid-template-columns: 1fr; }
  .billing-invoice-row { grid-template-columns: 1fr 1fr; gap: 6px; font-size: 0.78rem; }
}


/* ══════════════════════════════════════════════
   Platform Admin (Super Admin Only)
   ══════════════════════════════════════════════ */

.nav-superadmin {
  border-top: 1px solid rgba(239, 68, 68, 0.15);
  margin-top: 8px;
  padding-top: 8px;
}

.nav-badge {
  font-size: 0.6rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: auto;
}

.platform-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  padding: 20px;
  text-align: center;
  transition: var(--t-fast);
}

.stat-card:hover {
  border-color: var(--border-medium);
  transform: translateY(-2px);
}

.stat-card.stat-primary { border-left: 3px solid var(--accent); }
.stat-card.stat-success { border-left: 3px solid var(--success); }
.stat-card.stat-info { border-left: 3px solid #60a5fa; }
.stat-card.stat-revenue { border-left: 3px solid #f59e0b; }
.stat-card.stat-neutral { border-left: 3px solid var(--text-dim); }

.stat-icon { font-size: 1.6rem; margin-bottom: 8px; }
.stat-value { font-size: 1.8rem; font-weight: 700; color: var(--text-primary); }
.stat-label { font-size: 0.72rem; color: var(--text-dim); margin-top: 4px; font-weight: 500; }

.admin-section {
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  padding: 24px;
  margin-bottom: 24px;
}

.admin-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.admin-section-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.admin-filters {
  display: flex;
  gap: 8px;
  align-items: center;
}

.form-input-sm {
  padding: 6px 12px;
  font-size: 0.78rem;
  max-width: 180px;
}

.btn-sm {
  padding: 6px 16px;
  font-size: 0.78rem;
}

.plans-table-wrapper,
.orgs-table-wrapper {
  overflow-x: auto;
}

.plans-table,
.orgs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.plans-table th,
.plans-table td,
.orgs-table th,
.orgs-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.plans-table th,
.orgs-table th {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  font-weight: 600;
}

.plans-table tbody tr:hover,
.orgs-table tbody tr:hover {
  background: rgba(0,0,0,0.02);
}

.plan-code {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 2px 8px;
  background: rgba(0,0,0,0.04);
  border-radius: 4px;
}

.plan-price {
  font-weight: 600;
  color: var(--accent);
}

.plan-limit {
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.plan-limit-unlimited {
  color: var(--success);
  font-weight: 600;
}

.status-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
}

.status-pill.active {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.status-pill.inactive {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.org-name {
  font-weight: 600;
  color: var(--text-primary);
}

.org-type-badge {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(96, 165, 250, 0.12);
  color: #93bbfc;
}

.table-actions {
  display: flex;
  gap: 6px;
}

.btn-table {
  padding: 4px 10px;
  font-size: 0.7rem;
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-secondary);
  border-radius: 4px;
  cursor: pointer;
  transition: var(--t-fast);
  font-family: var(--font-sans);
}

.btn-table:hover {
  background: var(--bg-glass-hover);
  border-color: var(--border-medium);
}

.btn-table.btn-danger {
  border-color: rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.btn-table.btn-danger:hover {
  background: rgba(239, 68, 68, 0.1);
}

.plan-change-select {
  padding: 4px 8px;
  font-size: 0.72rem;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--text-primary);
  font-family: var(--font-sans);
}

@media (max-width: 1024px) {
  .platform-stats { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .platform-stats { grid-template-columns: repeat(2, 1fr); }
  .admin-section-header { flex-direction: column; gap: 12px; align-items: flex-start; }
  .admin-filters { width: 100%; }
}

/* Audit action badges */
.audit-action {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(0,0,0,0.03);
}

/* Role color indicators on select */
.plan-change-select:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3);
}

/* Config grid */
.config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  padding: 16px 0;
}

.config-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  transition: border-color 0.2s;
}

.config-card:hover {
  border-color: var(--accent);
}

.config-card-info {
  flex: 1;
}

.config-card-key {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 4px;
}

.config-card-desc {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.config-toggle {
  position: relative;
  width: 48px;
  height: 26px;
  cursor: pointer;
}

.config-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.config-toggle .slider {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.04);
  border-radius: 13px;
  transition: 0.3s;
}

.config-toggle .slider:before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  left: 3px;
  bottom: 3px;
  background: white;
  transition: 0.3s;
}

.config-toggle input:checked + .slider {
  background: var(--green);
}

.config-toggle input:checked + .slider:before {
  transform: translateX(22px);
}

.config-input-value {
  width: 120px;
  padding: 4px 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--bg-surface);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

/* Confidence bar */
.confidence-bar {
  width: 60px;
  height: 8px;
  background: rgba(0,0,0,0.04);
  border-radius: 4px;
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
  margin-right: 6px;
}

.confidence-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--green);
  transition: width 0.3s;
}

/* Relation type badge */
.relation-type-badge {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent);
}

/* ETL status pills */
.etl-status { font-size: 0.8rem; }
.etl-status.success { color: var(--green); }
.etl-status.failed { color: var(--red, #ef4444); }
.etl-status.running { color: var(--accent); }
.etl-status.pending { color: var(--text-dim); }

/* ═══ Feature Gating ═══ */

/* Locked nav items */
.nav-item.nav-locked {
  opacity: 0.4;
  pointer-events: none;
  position: relative;
}

.nav-item.nav-locked:hover {
  opacity: 0.5;
  cursor: not-allowed;
}

.nav-badge-upgrade {
  font-size: 0.65rem;
  margin-left: auto;
  opacity: 0.7;
}

/* Plan indicator badge */
.plan-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.plan-badge.plan-free {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
}

.plan-badge.plan-starter {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.plan-badge.plan-business {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
}

.plan-badge.plan-enterprise {
  background: rgba(234, 179, 8, 0.15);
  color: #fbbf24;
}

/* Upgrade prompt in locked pages */
.feature-upgrade-prompt {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
}

.feature-upgrade-prompt .upgrade-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.feature-upgrade-prompt h3 {
  color: var(--text-primary);
  margin-bottom: 8px;
}

.feature-upgrade-prompt .btn-upgrade {
  margin-top: 16px;
  padding: 10px 24px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.feature-upgrade-prompt .btn-upgrade:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* ══════════════════════════════════════════════
   Landing Page (Home)
   ══════════════════════════════════════════════ */

.landing-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 40px 80px;
  text-align: center;
  overflow: hidden;
}

.landing-hero-bg {
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(circle at 10% 20%, rgba(0, 184, 71, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(59, 130, 246, 0.08) 0%, transparent 40%);
  z-index: -1;
}

.landing-hero-content {
  max-width: 900px;
  z-index: 1;
}

.hero-tag {
  display: inline-block;
  background: rgba(0, 184, 71, 0.1);
  color: var(--green-400);
  padding: 6px 14px;
  border-radius: var(--r-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 24px;
  border: 1px solid rgba(0, 184, 71, 0.2);
}

.landing-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4.2rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 24px;
  letter-spacing: -1px;
}

.landing-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 700px;
  margin: 0 auto 40px;
  line-height: 1.6;
}

.landing-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-bottom: 60px;
}

.hero-stats {
  display: flex;
  gap: 48px;
  justify-content: center;
  border-top: 1px solid var(--border-subtle);
  padding-top: 40px;
}

.h-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.h-stat-num {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
}

.h-stat-label {
  font-size: 0.8rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Sections */
.landing-section {
  padding: 100px 40px;
  max-width: 1200px;
  margin: 0 auto;
}

.landing-section.bg-alt {
  background: rgba(0,0,0,0.01);
  max-width: 100%;
  border-block: 1px solid var(--border-subtle);
}

.section-center-title {
  font-family: var(--font-display);
  font-size: 2.2rem;
  text-align: center;
  margin-bottom: 12px;
}

.section-center-desc {
  text-align: center;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 60px;
}

/* ── Hero Stats Panel (Premium Dashboard) ── */
.hero-stats-panel {
  display: grid;
  grid-template-columns: 1.2fr 2fr;
  gap: 24px;
  background: linear-gradient(145deg, var(--bg-card) 0%, #0a1118 100%);
  border: 1px solid var(--border-medium);
  border-radius: var(--r-lg);
  padding: 32px;
  color: var(--text-primary);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.hero-stats-panel::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--green-500), var(--blue-400), var(--yellow-500));
}

.hero-stats-main h2 {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
  background: linear-gradient(90deg, #fff, #a0aec0);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-stats-main p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 32px;
  max-width: 90%;
}

.hero-stats-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--green-400);
  margin-bottom: 16px;
  letter-spacing: 1px;
}

.live-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--green-500);
  box-shadow: 0 0 8px var(--green-500);
  animation: pulse-glow 2s infinite ease-in-out;
}

@keyframes pulse-glow {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 150, 57, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(0, 150, 57, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 150, 57, 0); }
}

.health-index-display {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--r-md);
  padding: 20px;
}

.health-index-score {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
  color: var(--green-400);
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 8px;
  text-shadow: 0 0 20px rgba(0,150,57,0.3);
}

.health-index-score .score-max {
  font-size: 1.2rem;
  color: var(--text-muted);
  font-weight: 500;
}

.health-index-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 12px;
}

.health-index-bar {
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  overflow: hidden;
}

.health-index-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--yellow-500), var(--green-400));
  border-radius: 3px;
  transition: width 1.5s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 0 10px rgba(0,150,57,0.5);
}

.hero-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  align-content: center;
}

.hero-stat-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--r-md);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--t-base);
}

.hero-stat-card:hover {
  background: rgba(255, 255, 255, 0.04);
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.1);
}

.hero-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hero-stat-val {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.hero-stat-lbl {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

@media (max-width: 992px) {
  .hero-stats-panel {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 576px) {
  .hero-stats-grid {
    grid-template-columns: 1fr;
  }
}

/* ── 8-Feature Grid ── */
.features-grid-8 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.feat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: 28px 24px;
  cursor: pointer;
  transition: all var(--t-base);
  display: flex;
  flex-direction: column;
}

.feat-card:hover {
  transform: translateY(-6px);
  border-color: var(--green-400);
  background: var(--bg-card-hover);
  box-shadow: 0 12px 30px rgba(0,0,0,0.3);
}

.feat-icon {
  font-size: 2rem;
  margin-bottom: 16px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-glass);
  border-radius: var(--r-md);
}

.feat-icon-ai {
  background: rgba(0, 150, 57, 0.12);
}

.feat-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.feat-card p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.5;
  flex: 1;
}

.feat-cta {
  display: inline-block;
  margin-top: 16px;
  color: var(--green-400);
  font-size: 0.82rem;
  font-weight: 600;
  transition: color var(--t-fast);
}

.feat-cta-new {
  color: var(--green-300);
  position: relative;
}

.feat-cta-new::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--green-400);
  border-radius: 50%;
  margin-right: 6px;
  animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.4); }
}

.feat-card:hover .feat-cta { color: var(--green-300); }

/* ── Use Cases Grid ── */
.usecases-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.usecase-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: 36px 28px;
  text-align: center;
  transition: all var(--t-base);
}

.usecase-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-medium);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.usecase-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
}

.usecase-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.usecase-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 16px;
}

.usecase-tags {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.usecase-tags span {
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── Trust Banner ── */
.trust-banner {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 32px;
  padding: 32px 0;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
}

.trust-icon {
  font-size: 1.4rem;
}

.trust-sep {
  width: 1px;
  height: 28px;
  background: var(--border-medium);
}

/* ── Soft CTA Block (Pappers-style, no prices) ── */
.cta-soft-block {
  text-align: center;
  padding: 60px 40px;
  background: linear-gradient(135deg, rgba(0,150,57,0.06), rgba(59,130,246,0.04));
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-xl);
}

.cta-soft-title {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 16px;
}

.cta-soft-desc {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 600px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

.cta-soft-buttons {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-bottom: 24px;
}

.btn-lg {
  padding: 14px 32px !important;
  font-size: 1rem !important;
}

.cta-soft-note {
  display: flex;
  justify-content: center;
  gap: 24px;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.cta-soft-note span {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── Keep pillars-grid/pricing-grid for backward compat ── */
.pillars-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 1000px;
  margin: 0 auto;
}

/* Sectors banner */
.sectors-banner {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 30px;
  opacity: 0.5;
  filter: grayscale(1);
}

.sector-item {
  font-weight: 600;
  font-size: 0.9rem;
}

@media (max-width: 1024px) {
  .features-grid-8 { grid-template-columns: repeat(2, 1fr); }
  .usecases-grid { grid-template-columns: 1fr; }
  .pillars-grid, .pricing-grid { grid-template-columns: 1fr; }
  .hero-stats { flex-wrap: wrap; gap: 24px; }
  .trust-banner { flex-wrap: wrap; gap: 20px; }
  .cta-soft-buttons { flex-direction: column; align-items: center; }
}

@media (max-width: 600px) {
  .features-grid-8 { grid-template-columns: 1fr; }
  .trust-banner { flex-direction: column; gap: 16px; }
  .trust-sep { display: none; }
  .cta-soft-note { flex-direction: column; gap: 8px; align-items: center; }
}

/* Feature Split & Mockups */
.feature-split {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 60px;
  align-items: center;
}

.landing-title-sm {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 20px;
}

.landing-subtitle-sm {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 30px;
}

.feature-list {
  list-style: none;
  margin-bottom: 40px;
}

.feature-list li {
  padding: 8px 0;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
}

.mockup-container {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-medium);
}

.app-mockup {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.6s var(--ease);
}

.mockup-container:hover .app-mockup {
  transform: scale(1.02);
}

.mockup-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(0, 150, 57, 0.1), transparent 70%);
  pointer-events: none;
}

@media (max-width: 800px) {
  .feature-split { grid-template-columns: 1fr; gap: 40px; text-align: center; }
  .feature-list li { justify-content: center; }
}

/* ══════════════════════════════════════════════
   PAGE: Nos Offres (Style Pappers)
   ══════════════════════════════════════════════ */

#page-offers {
  padding: 0 !important;
  max-width: 100% !important;
}

.offers-hero {
  position: relative;
  padding: 100px 24px 48px;
  text-align: center;
  overflow: hidden;
}

.offers-hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(170deg, #f0faf3 0%, #fafbfc 50%, #fff 100%);
  z-index: 0;
}

.offers-hero-content {
  position: relative;
  z-index: 1;
  max-width: 680px;
  margin: 0 auto;
}

.offers-hero-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.025em;
  margin-bottom: 12px;
}

.offers-hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.offers-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* ── Offers Grid ── */

.offers-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 40px;
}

.offer-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--r-lg, 14px);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.offer-card:hover {
  border-color: var(--green-400, #00b847);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  transform: translateY(-2px);
}

.offer-card:hover .offer-arrow {
  transform: translateX(4px);
  color: var(--green-600, #007a2e);
}

.offer-card-soon {
  opacity: 0.72;
  cursor: default;
}

.offer-card-soon:hover {
  border-color: var(--border-color) !important;
  box-shadow: none !important;
  transform: none !important;
}

.offer-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: rgba(0,150,57,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.offer-icon-ai {
  background: linear-gradient(135deg, rgba(0,150,57,0.06) 0%, rgba(252,209,22,0.08) 100%);
}

.offer-content {
  flex: 1;
  min-width: 0;
}

.offer-title {
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.offer-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.offer-status {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 4px 12px;
  border-radius: 9999px;
  white-space: nowrap;
  flex-shrink: 0;
}

.offer-status-free {
  background: rgba(0,150,57,0.06);
  color: #007a2e;
  border: 1px solid rgba(0,150,57,0.15);
}

.offer-status-soon {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid rgba(252,209,22,0.3);
}

.offer-status-new {
  background: linear-gradient(135deg, rgba(0,150,57,0.06) 0%, rgba(59,130,246,0.06) 100%);
  color: #1d4ed8;
  border: 1px solid rgba(29,78,216,0.15);
  animation: pulseNew 2s ease-in-out infinite;
}

@keyframes pulseNew {
  0%, 100% { box-shadow: 0 0 0 0 rgba(29,78,216,0.15); }
  50% { box-shadow: 0 0 0 6px rgba(29,78,216,0); }
}

.offer-arrow {
  color: var(--text-secondary);
  flex-shrink: 0;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 0.4;
}

/* ── Institution CTA ── */

.offers-institution-cta {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 32px;
  background: linear-gradient(135deg, rgba(0,150,57,0.04) 0%, rgba(59,130,246,0.04) 100%);
  border: 1px solid rgba(0,150,57,0.12);
  border-radius: 20px;
  margin-bottom: 32px;
}

.offers-institution-icon {
  font-size: 2.4rem;
  flex-shrink: 0;
}

.offers-institution-content h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.offers-institution-content p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.offers-institution-btn {
  flex-shrink: 0;
  white-space: nowrap;
}

/* ── Notification / Newsletter ── */

.offers-notify {
  text-align: center;
  padding: 40px 32px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.offers-notify h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.offers-notify > p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.offers-notify-form {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  max-width: 460px;
  margin: 0 auto;
}

.offers-notify-input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid var(--border-color);
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-body);
  transition: border-color 0.2s;
  outline: none;
}

.offers-notify-input:focus {
  border-color: var(--green-400, #00b847);
  box-shadow: 0 0 0 3px rgba(0,150,57,0.08);
}

/* ── Offers Responsive ── */

@media (max-width: 768px) {
  .offers-grid {
    grid-template-columns: 1fr;
  }
  .offers-institution-cta {
    flex-direction: column;
    text-align: center;
  }
  .offers-notify-form {
    flex-direction: column;
  }
  .offers-notify-input {
    width: 100%;
  }
}

/* ══════════════════════════════════════════════
   PAGE: Annuaire (Directory)
   ══════════════════════════════════════════════ */

#page-directory {
  padding: 0 !important;
  max-width: 100% !important;
}

.directory-hero {
  position: relative;
  padding: 100px 24px 48px;
  text-align: center;
  overflow: hidden;
}

.directory-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* Stats bar */
.directory-stats-bar {
  display: flex;
  justify-content: center;
  gap: 40px;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  margin-bottom: 40px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.directory-stat {
  text-align: center;
}

.directory-stat strong {
  display: block;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: #007a2e;
}

.directory-stat span {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Sections */
.directory-section {
  margin-bottom: 40px;
}

.directory-section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 2px solid rgba(0,150,57,0.1);
}

.directory-section-count {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(0,0,0,0.04);
  padding: 3px 10px;
  border-radius: 9999px;
}

/* ── Ranking Row System (used for regions, cities, sectors) ── */
.dir-ranking-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 8px 0;
  overflow: hidden;
}

.rank-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 22px;
  cursor: pointer;
  transition: background 0.15s;
}

.rank-row:hover {
  background: rgba(0, 150, 57, 0.03);
}

.rank-row + .rank-row {
  border-top: 1px solid var(--border-subtle, rgba(0,0,0,0.04));
}

.rank-row-sm {
  padding: 10px 20px;
  gap: 12px;
}

.rank-pos {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(0, 150, 57, 0.06);
  color: #007a2e;
  font-weight: 800;
  font-size: 0.78rem;
  flex-shrink: 0;
  font-family: 'Space Grotesk', sans-serif;
}

.rank-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  width: 28px;
  text-align: center;
}

.rank-info {
  flex: 1;
  min-width: 0;
}

.rank-name {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-name-sm {
  font-size: 0.84rem;
}

.rank-bar-track {
  width: 100%;
  height: 6px;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 3px;
  margin-top: 6px;
  overflow: hidden;
}

.rank-bar-sm {
  height: 4px;
  margin-top: 4px;
}

.rank-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.rank-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
  min-width: 70px;
}

.rank-count {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-primary);
  font-family: 'Space Grotesk', sans-serif;
}

.rank-count-sm {
  font-size: 0.8rem;
}

.rank-pct {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ── 2-column ranking grid ── */
.rank-grid-2col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
}

.rank-grid-2col .rank-row {
  border-top: none;
}

.rank-grid-2col .rank-row:nth-child(n+3) {
  border-top: 1px solid var(--border-subtle, rgba(0,0,0,0.04));
}

/* ── City search box ── */
.dir-city-search-box {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-subtle, rgba(0,0,0,0.06));
}

.dir-city-search-input {
  width: 100%;
  padding: 10px 16px;
  border: 2px solid var(--border-color);
  border-radius: 10px;
  font-size: 0.88rem;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-body);
  outline: none;
  transition: border-color 0.2s;
}

.dir-city-search-input:focus {
  border-color: #00b847;
  box-shadow: 0 0 0 3px rgba(0, 150, 57, 0.08);
}

/* Responsive */
@media (max-width: 768px) {
  .rank-grid-2col {
    grid-template-columns: 1fr;
  }
  .rank-grid-2col .rank-row:nth-child(n+2) {
    border-top: 1px solid var(--border-subtle, rgba(0,0,0,0.04));
  }
}

/* ══════════════════════════════════════════════
   SECTION: Comment ça marche (3 steps)
   ══════════════════════════════════════════════ */

.how-steps {
  display: flex;
  justify-content: center;
  gap: 0;
  max-width: 900px;
  margin: 0 auto;
  position: relative;
}

.how-step {
  flex: 1;
  text-align: center;
  padding: 24px 20px;
  position: relative;
}

.how-step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #009639, #00b847);
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  box-shadow: 0 4px 12px rgba(0,150,57,0.25);
}

.how-step-connector {
  position: absolute;
  top: 42px;
  left: calc(50% + 30px);
  width: calc(100% - 60px);
  height: 2px;
  background: linear-gradient(90deg, rgba(0,150,57,0.3), rgba(0,150,57,0.08));
}

.how-step:last-child .how-step-connector {
  display: none;
}

.how-step-icon {
  font-size: 2.4rem;
  margin-bottom: 12px;
}

.how-step h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.how-step p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 260px;
  margin: 0 auto;
}

/* ══════════════════════════════════════════════
   SECTION: Chiffres-clés (Key Numbers)
   ══════════════════════════════════════════════ */

.numbers-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  max-width: 900px;
  margin: 0 auto;
}

.number-card {
  text-align: center;
  padding: 36px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.number-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
  border-color: rgba(0,150,57,0.2);
}

.number-card.highlight {
  background: linear-gradient(135deg, rgba(0,150,57,0.06) 0%, rgba(59,130,246,0.04) 100%);
  border-color: rgba(0,150,57,0.15);
}

.number-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2.4rem;
  font-weight: 800;
  color: #007a2e;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}

.number-label {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.number-sub {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
  .how-steps {
    flex-direction: column;
    gap: 16px;
  }
  .how-step-connector {
    display: none;
  }
  .numbers-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .numbers-grid {
    grid-template-columns: 1fr;
  }
}

/* ══════════════════════════════════════════════
   MAP: Carte Interactive Leaflet
   ══════════════════════════════════════════════ */

/* Toggle buttons */
.map-view-toggle {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

.map-toggle-btn {
  padding: 6px 16px;
  border-radius: 9999px;
  border: 1px solid var(--border-color);
  background: var(--bg-body);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}

.map-toggle-btn.active {
  background: rgba(0, 150, 57, 0.08);
  color: #007a2e;
  border-color: rgba(0, 150, 57, 0.25);
}

.map-toggle-btn:hover:not(.active) {
  border-color: var(--border-medium);
  background: rgba(0, 0, 0, 0.02);
}

/* Legend */
.map-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 12px 20px;
  margin-top: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.map-legend-title {
  font-weight: 700;
  color: var(--text-primary);
}

.map-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.map-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

/* Leaflet popup overrides */
.map-popup {
  text-align: center;
  min-width: 160px;
}

.map-popup-title {
  font-weight: 800;
  font-size: 1rem;
  color: #1f2937;
  margin-bottom: 4px;
  font-family: 'Space Grotesk', sans-serif;
}

.map-popup-region {
  font-size: 0.78rem;
  color: #6b7280;
  margin-bottom: 8px;
}

.map-popup-count {
  font-size: 1.2rem;
  font-weight: 700;
  color: #007a2e;
  margin-bottom: 10px;
  font-family: 'Space Grotesk', sans-serif;
}

.map-popup-btn {
  display: inline-block;
  padding: 6px 16px;
  background: #009639;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
}

.map-popup-btn:hover {
  background: #007a2e;
}

/* City label tooltip */
.map-city-label {
  background: rgba(255, 255, 255, 0.92) !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  border-radius: 6px !important;
  padding: 3px 8px !important;
  font-size: 0.72rem !important;
  font-weight: 600 !important;
  color: #374151 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08) !important;
  font-family: 'Inter', sans-serif !important;
}

.map-city-label::before {
  border-top-color: rgba(255, 255, 255, 0.92) !important;
}

/* Pulsing animation for major cities */
@keyframes mapPulse {
  0% { opacity: 0.2; transform: scale(1); }
  50% { opacity: 0.05; transform: scale(1.3); }
  100% { opacity: 0.2; transform: scale(1); }
}

.map-pulse {
  animation: mapPulse 3s ease-in-out infinite;
}

/* Responsive */
@media (max-width: 768px) {
  .map-view-toggle {
    margin-left: 0;
  }
  .directory-section-title {
    flex-wrap: wrap;
  }
  .map-legend {
    flex-wrap: wrap;
    gap: 10px;
  }
  #directory-map {
    height: 380px !important;
  }
}

