/* ============================================================
   ALPHAVAULT CRM PIPELINE — crm-pipeline.css v1.0
   Light mode default · Dark mode via body.pl-dark-mode
   100% responsive PC/Mobile · Matching Drive design system
   ============================================================ */

/* ════════════════════════════════════════════════════════════
   1. CSS VARIABLES — LIGHT MODE (default)
════════════════════════════════════════════════════════════ */
:root {
  --pl-bg:             #f1f5f9;
  --pl-sidebar-bg:     #ffffff;
  --pl-header-bg:      rgba(255, 255, 255, 0.97);
  --pl-surface:        #ffffff;
  --pl-surface-hover:  #f8fafc;
  --pl-input-bg:       rgba(0, 0, 0, 0.04);
  --pl-card:           #ffffff;

  --pl-border:         rgba(0, 0, 0, 0.08);
  --pl-border-hover:   rgba(0, 0, 0, 0.15);

  --pl-text:           #1e293b;
  --pl-text-muted:     #475569;
  --pl-text-faint:     #94a3b8;

  --pl-primary:        #667eea;
  --pl-primary-dark:   #764ba2;
  --pl-green:          #10b981;
  --pl-amber:          #f59e0b;
  --pl-red:            #ef4444;
  --pl-purple:         #8b5cf6;
  --pl-cyan:           #06b6d4;
  --pl-orange:         #f97316;

  --pl-radius:         10px;
  --pl-radius-lg:      16px;
  --pl-radius-xl:      24px;

  --pl-shadow:         0 4px 24px rgba(0, 0, 0, 0.08);
  --pl-shadow-lg:      0 10px 50px rgba(0, 0, 0, 0.15);
  --pl-shadow-xl:      0 20px 60px rgba(0, 0, 0, 0.18);

  --pl-sidebar-w:      260px;
  --pl-header-h:       58px;
  --pl-panel-w:        420px;

  --pl-transition:     all 0.2s ease;
}

/* ── Dark mode overrides ──────────────────────────────────── */
body.pl-dark-mode {
  --pl-bg:             #0b1120;
  --pl-sidebar-bg:     #0f172a;
  --pl-header-bg:      rgba(11, 17, 32, 0.97);
  --pl-surface:        rgba(30, 41, 59, 0.92);
  --pl-surface-hover:  rgba(51, 65, 85, 0.9);
  --pl-input-bg:       rgba(255, 255, 255, 0.06);
  --pl-card:           rgba(30, 41, 59, 0.92);
  --pl-border:         rgba(255, 255, 255, 0.08);
  --pl-border-hover:   rgba(255, 255, 255, 0.15);
  --pl-text:           #f0f4f8;
  --pl-text-muted:     #cbd5e1;
  --pl-text-faint:     #94a3b8;
  --pl-shadow:         0 4px 24px rgba(0, 0, 0, 0.35);
  --pl-shadow-lg:      0 10px 50px rgba(0, 0, 0, 0.55);
  --pl-shadow-xl:      0 20px 60px rgba(0, 0, 0, 0.7);
}

/* ════════════════════════════════════════════════════════════
   2. RESET & BASE
════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; overflow: hidden; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--pl-bg);
  color: var(--pl-text);
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

.pl-form-select option {
  background: var(--pl-surface);
  color: var(--pl-text);
}

/* ════════════════════════════════════════════════════════════
   3. APP LAYOUT
════════════════════════════════════════════════════════════ */
#plApp {
  display: flex;
  height: 100vh;
  overflow: hidden;
  position: relative;
}

/* ════════════════════════════════════════════════════════════
   4. SIDEBAR
════════════════════════════════════════════════════════════ */
#plSidebar {
  width: var(--pl-sidebar-w);
  flex-shrink: 0;
  background: var(--pl-sidebar-bg);
  border-right: 1px solid var(--pl-border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: visible;
  position: relative;
  z-index: 200;
  transition: width 0.25s ease, transform 0.3s ease;
}

body:not(.pl-dark-mode) #plSidebar {
  box-shadow: 2px 0 20px rgba(0, 0, 0, 0.06);
}

/* ── Collapsed ──────────────────────────────────────────── */
#plSidebar.collapsed { width: 64px; }

#plSidebar.collapsed .pl-nav-item-text,
#plSidebar.collapsed .pl-nav-badge,
#plSidebar.collapsed .pl-nav-label,
#plSidebar.collapsed .pl-new-btn-text,
#plSidebar.collapsed .pl-new-chevron,
#plSidebar.collapsed .pl-platform-section,
#plSidebar.collapsed .pl-nav-divider,
#plSidebar.collapsed .pl-sidebar-user-name,
#plSidebar.collapsed .pl-sidebar-user-email,
#plSidebar.collapsed .pl-sidebar-plan-badge,
#plSidebar.collapsed #plUserChevron { display: none; }

#plSidebar.collapsed .pl-nav-item {
  justify-content: center;
  padding: 10px;
}

#plSidebar.collapsed .pl-nav-item-icon { margin: 0; }

#plSidebar.collapsed .pl-new-btn {
  justify-content: center;
  padding: 10px;
  min-width: 0;
}

#plSidebar.collapsed .pl-nav-tool-link {
  justify-content: center;
  padding: 10px;
}

#plSidebar.collapsed .pl-nav-tool-link .pl-nav-item-text { display: none; }

/* ── Logo ───────────────────────────────────────────────── */
.pl-sidebar-logo-wrap {
  display: flex;
  align-items: center;
  padding: 14px 14px 12px;
  min-height: 62px;
  text-decoration: none;
  flex-shrink: 0;
}

.pl-sidebar-logo-text {
  display: block;
  height: 38px;
  max-width: 180px;
  object-fit: contain;
}

.pl-sidebar-logo-icon { display: none; height: 36px; width: 36px; object-fit: contain; }

#plSidebar.collapsed .pl-sidebar-logo-text { display: none; }
#plSidebar.collapsed .pl-sidebar-logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px 0;
}

/* ── Scroll area ────────────────────────────────────────── */
.pl-sidebar-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; }
.pl-sidebar-scroll::-webkit-scrollbar { width: 3px; }
.pl-sidebar-scroll::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}
body.pl-dark-mode .pl-sidebar-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
}

/* ── Toggle button ──────────────────────────────────────── */
.pl-sidebar-toggle {
  position: absolute;
  right: -14px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--pl-surface);
  border: 1px solid var(--pl-border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--pl-text-muted);
  font-size: 10px;
  z-index: 300;
  transition: var(--pl-transition);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
}

.pl-sidebar-toggle:hover {
  background: var(--pl-primary);
  color: #fff;
  border-color: var(--pl-primary);
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.5);
}

/* ── Mobile close button ────────────────────────────────── */
.pl-mobile-close-btn {
  display: none;
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.06);
  border: 1px solid var(--pl-border);
  color: var(--pl-text-muted);
  font-size: 14px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: var(--pl-transition);
}

body.pl-dark-mode .pl-mobile-close-btn { background: rgba(255, 255, 255, 0.08); }

.pl-mobile-close-btn:hover {
  background: rgba(239, 68, 68, 0.12);
  color: var(--pl-red);
  border-color: rgba(239, 68, 68, 0.3);
}

/* ════════════════════════════════════════════════════════════
   5. MAIN CONTENT
════════════════════════════════════════════════════════════ */
#plMain {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  min-width: 0;
  transition: margin-left 0.25s ease;
}

/* ════════════════════════════════════════════════════════════
   6. HEADER
════════════════════════════════════════════════════════════ */
#plHeader {
  height: var(--pl-header-h);
  background: var(--pl-header-bg);
  border-bottom: 1px solid var(--pl-border);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  flex-shrink: 0;
  backdrop-filter: blur(20px);
  position: relative;
  z-index: 100;
}

/* ── Breadcrumb ──────────────────────────────────────────── */
.pl-breadcrumb { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.pl-breadcrumb-item {
  font-size: 12px;
  font-weight: 700;
  color: var(--pl-text-faint);
  white-space: nowrap;
  transition: color 0.15s;
}

.pl-breadcrumb-item a { color: inherit; text-decoration: none; }
.pl-breadcrumb-item:hover { color: var(--pl-text); }
.pl-breadcrumb-item.active { color: var(--pl-text); }
.pl-breadcrumb-sep { font-size: 9px; color: var(--pl-text-faint); }

/* ── Header Search ───────────────────────────────────────── */
.pl-search-wrap {
  flex: 1;
  max-width: 380px;
  position: relative;
  display: flex;
  align-items: center;
}

.pl-search-icon {
  position: absolute;
  left: 12px;
  color: var(--pl-text-faint);
  font-size: 12px;
  pointer-events: none;
  z-index: 1;
}

.pl-search-input {
  width: 100%;
  background: var(--pl-input-bg);
  border: 1px solid var(--pl-border);
  border-radius: var(--pl-radius);
  padding: 8px 12px 8px 34px;
  font-family: inherit;
  font-size: 12px;
  color: var(--pl-text);
  outline: none;
  transition: var(--pl-transition);
}

.pl-search-input::placeholder { color: var(--pl-text-faint); }

.pl-search-input:focus {
  border-color: var(--pl-primary);
  background: rgba(102, 126, 234, 0.07);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12);
}

.pl-search-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--pl-surface);
  border: 1px solid var(--pl-border);
  border-radius: 14px;
  padding: 6px;
  z-index: 2000;
  box-shadow: var(--pl-shadow-lg);
}

.pl-search-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--pl-transition);
}

.pl-search-result-item:hover { background: var(--pl-input-bg); }

/* ── Header Controls ─────────────────────────────────────── */
.pl-header-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
}

.pl-header-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: var(--pl-input-bg);
  border: 1px solid var(--pl-border);
  border-radius: var(--pl-radius);
  font-family: inherit;
  font-size: 13px;
  color: var(--pl-text-muted);
  cursor: pointer;
  transition: var(--pl-transition);
  flex-shrink: 0;
}

.pl-header-btn:hover {
  background: rgba(0, 0, 0, 0.07);
  color: var(--pl-text);
  border-color: var(--pl-border-hover);
}

body.pl-dark-mode .pl-header-btn:hover { background: rgba(255, 255, 255, 0.08); }

.pl-theme-toggle {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--pl-input-bg);
  border: 1px solid var(--pl-border);
  border-radius: var(--pl-radius);
  cursor: pointer;
  color: var(--pl-text-muted);
  font-size: 14px;
  transition: var(--pl-transition);
  flex-shrink: 0;
}

.pl-theme-toggle:hover {
  background: rgba(102, 126, 234, 0.1);
  color: var(--pl-primary);
  border-color: rgba(102, 126, 234, 0.2);
}

body.pl-dark-mode .pl-theme-toggle:hover {
  background: rgba(245, 158, 11, 0.12);
  color: var(--pl-amber);
  border-color: rgba(245, 158, 11, 0.3);
}

.pl-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pl-green);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
  flex-shrink: 0;
}

.pl-role-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(102, 126, 234, 0.12);
  color: var(--pl-primary);
  border: 1px solid rgba(102, 126, 234, 0.18);
  white-space: nowrap;
}

.pl-header-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pl-primary), var(--pl-primary-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: var(--pl-transition);
  flex-shrink: 0;
  position: relative;
}

.pl-header-avatar:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}

/* ── Header User Menu ────────────────────────────────────── */
.pl-header-user-menu {
  position: absolute;
  top: calc(var(--pl-header-h) + 4px);
  right: 16px;
  background: var(--pl-surface);
  border: 1px solid var(--pl-border);
  border-radius: 14px;
  padding: 6px;
  min-width: 200px;
  z-index: 2000;
  box-shadow: var(--pl-shadow-lg);
}

.pl-header-user-menu-top {
  padding: 10px 12px;
  border-bottom: 1px solid var(--pl-border);
  margin-bottom: 4px;
}

.pl-header-user-menu-name { font-size: 13px; font-weight: 800; color: var(--pl-text); }
.pl-header-user-menu-email { font-size: 10px; color: var(--pl-text-faint); margin-top: 2px; }

.pl-ctx-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--pl-text-muted);
  cursor: pointer;
  transition: var(--pl-transition);
}

.pl-ctx-item:hover { background: var(--pl-input-bg); color: var(--pl-text); }
.pl-ctx-item.danger { color: var(--pl-red); }
.pl-ctx-item.danger:hover { background: rgba(239, 68, 68, 0.08); }
.pl-ctx-item i { font-size: 12px; width: 14px; text-align: center; }

/* ════════════════════════════════════════════════════════════
   7. SIDEBAR NAV
════════════════════════════════════════════════════════════ */
.pl-nav { padding: 4px 8px; }

.pl-nav-label {
  padding: 10px 10px 5px;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--pl-text-faint);
}

.pl-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--pl-radius);
  cursor: pointer;
  transition: var(--pl-transition);
  color: var(--pl-text-muted);
  text-decoration: none;
  position: relative;
  margin-bottom: 2px;
}

.pl-nav-item:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--pl-text);
}

body.pl-dark-mode .pl-nav-item:hover { background: rgba(255, 255, 255, 0.05); }

.pl-nav-item.active {
  background: rgba(102, 126, 234, 0.12);
  color: var(--pl-primary);
}

.pl-nav-item-icon {
  width: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

.pl-nav-item-text {
  flex: 1;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pl-nav-badge {
  font-size: 9px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 20px;
  background: rgba(102, 126, 234, 0.15);
  color: var(--pl-primary);
  min-width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.pl-badge-deal {
  background: rgba(239, 68, 68, 0.12);
  color: var(--pl-red);
}

.pl-nav-divider {
  border: none;
  border-top: 1px solid var(--pl-border);
  margin: 8px 10px;
}

/* ════════════════════════════════════════════════════════════
   8. PLATFORM NAV
════════════════════════════════════════════════════════════ */
.pl-platform-section { margin-bottom: 1px; }

.pl-platform-folder {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--pl-text-muted);
  cursor: pointer;
  border-radius: var(--pl-radius);
  margin: 0 2px;
  transition: var(--pl-transition);
  position: relative;
  background: none;
  border: none;
  width: calc(100% - 4px);
  text-align: left;
}

.pl-platform-folder:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--pl-text);
}

body.pl-dark-mode .pl-platform-folder:hover { background: rgba(255, 255, 255, 0.05); }

.pl-platform-folder i:first-child { font-size: 13px; width: 16px; text-align: center; }

.pl-arrow {
  margin-left: auto;
  font-size: 9px;
  transition: transform 0.2s;
}

.pl-platform-folder.open .pl-arrow { transform: rotate(180deg); }

.pl-platform-submenu { display: none; padding: 2px 0; }
.pl-platform-submenu.open { display: block; }

.pl-platform-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 32px;
  font-size: 11px;
  font-weight: 600;
  color: var(--pl-text-faint);
  text-decoration: none;
  border-radius: 8px;
  margin: 0 2px;
  transition: var(--pl-transition);
}

.pl-platform-link:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--pl-text-muted);
}

body.pl-dark-mode .pl-platform-link:hover { background: rgba(255, 255, 255, 0.04); }
.pl-platform-link i { font-size: 11px; width: 14px; text-align: center; }

/* ════════════════════════════════════════════════════════════
   9. NAV TOOL LINKS (Drive, Teams)
════════════════════════════════════════════════════════════ */
.pl-nav-tool-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--pl-radius);
  margin: 1px 2px;
  text-decoration: none;
  color: var(--pl-text-muted);
  font-size: 12px;
  font-weight: 600;
  transition: var(--pl-transition);
}

.pl-nav-tool-link:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--pl-text);
}

body.pl-dark-mode .pl-nav-tool-link:hover { background: rgba(255, 255, 255, 0.05); }

.pl-nav-tool-icon {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  flex-shrink: 0;
}

.pl-nav-tool-icon.drive { background: rgba(16, 185, 129, 0.12); color: var(--pl-green); }
.pl-nav-tool-icon.teams { background: rgba(102, 126, 234, 0.12); color: var(--pl-primary); }

/* ════════════════════════════════════════════════════════════
   10. NEW BUTTON & DROPDOWN
════════════════════════════════════════════════════════════ */
.pl-new-wrap {
  padding: 10px 10px 6px;
  position: relative;
}

.pl-new-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: linear-gradient(135deg, var(--pl-primary), var(--pl-primary-dark));
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  cursor: pointer;
  transition: var(--pl-transition);
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.35);
}

.pl-new-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(102, 126, 234, 0.5);
}

.pl-new-btn-text { flex: 1; text-align: left; }

.pl-new-dropdown {
  display: none;
  position: absolute;
  top: calc(100% - 4px);
  left: 10px;
  right: 10px;
  background: var(--pl-surface);
  border: 1px solid var(--pl-border);
  border-radius: 16px;
  padding: 8px;
  z-index: 600;
  box-shadow: var(--pl-shadow-lg);
  animation: plFadeIn 0.15s ease;
}

.pl-new-dropdown.open { display: block; }

.pl-new-drop-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--pl-radius);
  cursor: pointer;
  transition: var(--pl-transition);
}

.pl-new-drop-item:hover { background: var(--pl-input-bg); }

.pl-new-drop-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
}

.pl-new-drop-icon.deal   { background: rgba(16, 185, 129, 0.12); color: var(--pl-green); }
.pl-new-drop-icon.import { background: rgba(102, 126, 234, 0.12); color: var(--pl-primary); }

.pl-new-drop-title { font-size: 12px; font-weight: 700; color: var(--pl-text); }
.pl-new-drop-sub   { font-size: 10px; color: var(--pl-text-faint); margin-top: 1px; }

.pl-new-drop-divider {
  border: none;
  border-top: 1px solid var(--pl-border);
  margin: 4px 0;
}

/* ════════════════════════════════════════════════════════════
   11. SIDEBAR FOOTER
════════════════════════════════════════════════════════════ */
.pl-sidebar-footer {
  border-top: 1px solid var(--pl-border);
  position: relative;
  flex-shrink: 0;
}

.pl-sidebar-user-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  transition: var(--pl-transition);
}

.pl-sidebar-user-trigger:hover { background: var(--pl-input-bg); }

.pl-sidebar-user-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--pl-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pl-sidebar-user-email {
  font-size: 10px;
  color: var(--pl-text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pl-sidebar-plan-badge {
  font-size: 9px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 20px;
  background: rgba(102, 126, 234, 0.12);
  color: var(--pl-primary);
  flex-shrink: 0;
}

/* Sidebar User Dropdown */
.pl-sidebar-user-dropdown {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  background: var(--pl-surface);
  border: 1px solid var(--pl-border);
  border-radius: 14px;
  padding: 8px;
  margin: 0 8px 6px;
  box-shadow: var(--pl-shadow-lg);
  z-index: 1000;
}

.pl-sidebar-user-dropdown.open { display: block; }

.pl-sidebar-dropdown-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--pl-border);
  margin-bottom: 6px;
}

.pl-dropdown-name  { font-size: 12px; font-weight: 700; color: var(--pl-text); }
.pl-dropdown-email { font-size: 10px; color: var(--pl-text-faint); margin-top: 1px; }

.pl-sidebar-dropdown-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  color: var(--pl-text-muted);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  transition: var(--pl-transition);
}

.pl-sidebar-dropdown-link:hover { background: var(--pl-input-bg); color: var(--pl-text); }
.pl-sidebar-dropdown-link i { font-size: 13px; width: 16px; text-align: center; }

.pl-sidebar-dropdown-logout {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  color: var(--pl-red);
  font-size: 12px;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--pl-transition);
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  margin-top: 4px;
  border-top: 1px solid var(--pl-border);
}

.pl-sidebar-dropdown-logout:hover { background: rgba(239, 68, 68, 0.08); }

/* ════════════════════════════════════════════════════════════
   12. CONTENT AREA
════════════════════════════════════════════════════════════ */
#plContent {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 22px 26px;
}

#plContent::-webkit-scrollbar { width: 5px; }
#plContent::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}
body.pl-dark-mode #plContent::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
}

/* ════════════════════════════════════════════════════════════
   13. HERO SECTION
════════════════════════════════════════════════════════════ */
.pl-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.pl-hero-left { flex: 1; min-width: 0; }

.pl-hero-title {
  font-size: 22px;
  font-weight: 900;
  color: var(--pl-text);
  margin-bottom: 4px;
  line-height: 1.3;
}

.pl-hero-sub {
  font-size: 12px;
  color: var(--pl-text-muted);
  font-weight: 500;
}

.pl-hero-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.pl-hero-date {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--pl-text-muted);
  font-weight: 600;
}

.pl-sync-dot {
  color: var(--pl-green);
  font-size: 10px;
  animation: plPulse 2s ease-in-out infinite;
}

/* ════════════════════════════════════════════════════════════
   14. BUTTONS
════════════════════════════════════════════════════════════ */
.pl-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--pl-radius);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--pl-transition);
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}

.pl-btn-primary {
  background: linear-gradient(135deg, var(--pl-primary), var(--pl-primary-dark));
  color: #fff;
  box-shadow: 0 4px 14px rgba(102, 126, 234, 0.35);
}

.pl-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(102, 126, 234, 0.5);
}

.pl-btn-secondary {
  background: var(--pl-input-bg);
  border-color: var(--pl-border);
  color: var(--pl-text-muted);
}

.pl-btn-secondary:hover {
  background: rgba(0, 0, 0, 0.07);
  color: var(--pl-text);
}

body.pl-dark-mode .pl-btn-secondary:hover { background: rgba(255, 255, 255, 0.1); }

.pl-btn-danger {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.2);
  color: var(--pl-red);
}

.pl-btn-danger:hover { background: rgba(239, 68, 68, 0.2); }

.pl-btn-sm { padding: 5px 12px; font-size: 11px; }

/* ════════════════════════════════════════════════════════════
   15. STATS BAR
════════════════════════════════════════════════════════════ */
#plStatsBar {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.pl-stat-card {
  background: var(--pl-surface);
  border: 1px solid var(--pl-border);
  border-radius: var(--pl-radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: var(--pl-transition);
}

.pl-stat-card:hover {
  border-color: var(--pl-border-hover);
  transform: translateY(-2px);
  box-shadow: var(--pl-shadow);
}

.pl-stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.pl-stat-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: #fff;
  flex-shrink: 0;
}

.pl-stat-value {
  font-size: 20px;
  font-weight: 900;
  color: var(--pl-text);
  line-height: 1.2;
}

.pl-stat-label { font-size: 11px; font-weight: 700; color: var(--pl-text-muted); }
.pl-stat-sub   { font-size: 10px; color: var(--pl-text-faint); }

.pl-stat-badge {
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 20px;
  white-space: nowrap;
}

/* ════════════════════════════════════════════════════════════
   16. TOOLBAR
════════════════════════════════════════════════════════════ */
.pl-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
  background: var(--pl-surface);
  border: 1px solid var(--pl-border);
  border-radius: var(--pl-radius-lg);
  padding: 10px 14px;
}

/* View Switcher */
.pl-view-switcher {
  display: flex;
  gap: 2px;
  background: var(--pl-input-bg);
  border: 1px solid var(--pl-border);
  border-radius: var(--pl-radius);
  padding: 3px;
  flex-shrink: 0;
}

.pl-view-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 700;
  color: var(--pl-text-muted);
  border-radius: 7px;
  cursor: pointer;
  transition: var(--pl-transition);
  border: none;
  background: transparent;
  font-family: inherit;
  white-space: nowrap;
}

.pl-view-btn.active { background: var(--pl-primary); color: #fff; }

.pl-view-btn:not(.active):hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--pl-text);
}

body.pl-dark-mode .pl-view-btn:not(.active):hover { background: rgba(255, 255, 255, 0.06); }

/* Filter Group */
.pl-filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  flex-wrap: wrap;
}

.pl-search-filter-wrap {
  display: flex;
  align-items: center;
  background: var(--pl-input-bg);
  border: 1px solid var(--pl-border);
  border-radius: var(--pl-radius);
  padding: 0 10px;
  min-width: 150px;
}

.pl-search-filter-icon { font-size: 11px; color: var(--pl-text-faint); flex-shrink: 0; }

.pl-search-filter {
  background: transparent;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 11px;
  color: var(--pl-text);
  padding: 7px 6px;
  width: 120px;
}

.pl-search-filter::placeholder { color: var(--pl-text-faint); }

.pl-filter-select {
  background: var(--pl-input-bg);
  border: 1px solid var(--pl-border);
  border-radius: var(--pl-radius);
  padding: 7px 10px;
  font-family: inherit;
  font-size: 11px;
  color: var(--pl-text);
  outline: none;
  cursor: pointer;
  transition: var(--pl-transition);
}

.pl-filter-select:focus { border-color: var(--pl-primary); }

.pl-filter-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: var(--pl-input-bg);
  border: 1px solid var(--pl-border);
  border-radius: var(--pl-radius);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  color: var(--pl-text-muted);
  cursor: pointer;
  transition: var(--pl-transition);
  white-space: nowrap;
}

.pl-filter-btn:hover { background: rgba(0, 0, 0, 0.06); color: var(--pl-text); }

.pl-filter-btn.active {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.3);
  color: var(--pl-amber);
}

.pl-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
}

/* ════════════════════════════════════════════════════════════
   17. WIDGETS
════════════════════════════════════════════════════════════ */
.pl-widget {
  background: var(--pl-surface);
  border: 1px solid var(--pl-border);
  border-radius: var(--pl-radius-lg);
  padding: 18px;
  margin-bottom: 18px;
}

.pl-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.pl-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 800;
  color: var(--pl-text);
}

.pl-widgets-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 18px;
}

.pl-widgets-row .pl-widget { margin-bottom: 0; }

.pl-ai-preset-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: var(--pl-input-bg);
  border: 1px solid var(--pl-border);
  border-radius: 20px;
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  color: var(--pl-text-muted);
  cursor: pointer;
  transition: var(--pl-transition);
}

.pl-ai-preset-chip:hover {
  background: rgba(102, 126, 234, 0.1);
  border-color: rgba(102, 126, 234, 0.25);
  color: var(--pl-primary);
}

.pl-refresh-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  background: var(--pl-input-bg);
  border: 1px solid var(--pl-border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  color: var(--pl-text-muted);
  cursor: pointer;
  transition: var(--pl-transition);
}

.pl-refresh-btn:hover { background: rgba(102, 126, 234, 0.1); color: var(--pl-primary); }

/* Narrative Loading */
.pl-narrative-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  color: var(--pl-text-faint);
  font-size: 12px;
  font-weight: 600;
}

.pl-ai-dots { display: flex; gap: 4px; }

.pl-ai-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pl-purple);
  animation: plPulse 0.8s ease-in-out infinite;
}

.pl-ai-dots span:nth-child(2) { animation-delay: 0.15s; }
.pl-ai-dots span:nth-child(3) { animation-delay: 0.3s; }

/* Narrative Content */
.pl-narrative-content {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.pl-narrative-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(139, 92, 246, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pl-narrative-text {
  flex: 1;
  font-size: 12px;
  color: var(--pl-text-muted);
  line-height: 1.7;
  white-space: pre-wrap;
}

.pl-narrative-footer {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  font-size: 10px;
  color: var(--pl-text-faint);
}

/* Empty State */
.pl-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
}

/* ════════════════════════════════════════════════════════════
   18. KANBAN BOARD
════════════════════════════════════════════════════════════ */
#pipelineKanban { margin-bottom: 18px; }

.pl-kanban-board {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 12px;
  min-height: 480px;
  align-items: flex-start;
}

.pl-kanban-board::-webkit-scrollbar { height: 5px; }
.pl-kanban-board::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 4px;
}
body.pl-dark-mode .pl-kanban-board::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
}

/* Kanban Column */
.pl-kanban-col {
  flex: 0 0 280px;
  min-width: 280px;
  max-width: 280px;
  background: var(--pl-surface);
  border: 1px solid var(--pl-border);
  border-radius: var(--pl-radius-lg);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 290px);
  min-height: 280px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.pl-kanban-col.drag-over {
  border-color: rgba(102, 126, 234, 0.5) !important;
  background: rgba(102, 126, 234, 0.04);
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

/* Column Header */
.pl-kanban-col-header {
  padding: 12px 14px;
  border-radius: var(--pl-radius-lg) var(--pl-radius-lg) 0 0;
  flex-shrink: 0;
  position: relative;
}

.pl-kanban-col-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 8px;
}

.pl-kanban-col-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.pl-kanban-col-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}

.pl-kanban-col-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--pl-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pl-kanban-col-prob {
  font-size: 9px;
  font-weight: 700;
  margin-top: 1px;
}

.pl-kanban-col-badges {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.pl-kanban-count-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
}

.pl-wip-badge {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 20px;
  background: rgba(239, 68, 68, 0.12);
  color: var(--pl-red);
}

.pl-wip-ok-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 20px;
  background: rgba(100, 116, 139, 0.1);
  color: var(--pl-text-faint);
}

.pl-stagnant-badge {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 20px;
  background: rgba(245, 158, 11, 0.12);
  color: var(--pl-amber);
}

.pl-kanban-col-value {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pl-kanban-col-value-num  { font-size: 13px; font-weight: 800; color: var(--pl-text); }
.pl-kanban-col-value-label { font-size: 10px; color: var(--pl-text-faint); }

.pl-kanban-col-avg-score {
  font-size: 10px;
  font-weight: 700;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}

.pl-kanban-add-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid var(--pl-border);
  background: var(--pl-input-bg);
  color: var(--pl-text-faint);
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--pl-transition);
  opacity: 0;
}

.pl-kanban-col:hover .pl-kanban-add-btn { opacity: 1; }

.pl-kanban-add-btn:hover {
  background: rgba(102, 126, 234, 0.1);
  color: var(--pl-primary);
  border-color: rgba(102, 126, 234, 0.25);
}

/* Column Body */
.pl-kanban-col-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pl-kanban-col-body::-webkit-scrollbar { width: 3px; }
.pl-kanban-col-body::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.08);
  border-radius: 4px;
}
body.pl-dark-mode .pl-kanban-col-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.07);
}

.pl-kanban-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.pl-kanban-empty-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 12px;
  text-align: center;
  border: 2px dashed var(--pl-border);
  border-radius: var(--pl-radius);
  flex: 1;
  min-height: 120px;
}

.pl-kanban-empty-add {
  margin-top: 10px;
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid var(--pl-border);
  background: var(--pl-input-bg);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  color: var(--pl-text-muted);
  cursor: pointer;
  transition: var(--pl-transition);
  display: flex;
  align-items: center;
  gap: 5px;
}

.pl-kanban-empty-add:hover {
  background: rgba(102, 126, 234, 0.1);
  color: var(--pl-primary);
  border-color: rgba(102, 126, 234, 0.25);
}

/* ════════════════════════════════════════════════════════════
   19. DEAL CARDS
════════════════════════════════════════════════════════════ */
.pl-deal-card {
  background: var(--pl-surface);
  border: 1px solid var(--pl-border);
  border-radius: var(--pl-radius-lg);
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  user-select: none;
}

.pl-deal-card:hover {
  border-color: rgba(102, 126, 234, 0.3);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

body.pl-dark-mode .pl-deal-card:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.pl-deal-card.pl-card-stagnant {
  border-left: 3px solid var(--pl-amber);
  background: rgba(245, 158, 11, 0.025);
}

.pl-deal-card.dragging {
  opacity: 0.5;
  transform: scale(0.97) rotate(1deg);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

/* Card Top */
.pl-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 8px;
}

.pl-card-source {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.pl-card-badges-right { display: flex; align-items: center; gap: 4px; }

.pl-card-stagnant-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 20px;
  background: rgba(245, 158, 11, 0.12);
  color: var(--pl-amber);
}

.pl-card-score-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 20px;
}

.pl-card-score-badge.scoring {
  background: rgba(139, 92, 246, 0.1);
  color: var(--pl-purple);
}

.pl-card-score-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border-radius: 20px;
  border: 1px solid rgba(139, 92, 246, 0.25);
  background: rgba(139, 92, 246, 0.08);
  color: var(--pl-purple);
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--pl-transition);
}

.pl-card-score-btn:hover { background: rgba(139, 92, 246, 0.15); }

/* Card Name */
.pl-card-name {
  font-size: 13px;
  font-weight: 800;
  color: var(--pl-text);
  margin-bottom: 6px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Card Meta */
.pl-card-meta { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }

.pl-card-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(100, 116, 139, 0.1);
  color: var(--pl-text-faint);
}

.pl-card-tag.sector { background: rgba(102, 126, 234, 0.1); color: var(--pl-primary); }
.pl-card-tag.geo    { background: rgba(16, 185, 129, 0.1);  color: var(--pl-green); }

/* Card Financials */
.pl-card-financials {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  background: var(--pl-input-bg);
  border-radius: 8px;
  padding: 6px 10px;
}

.pl-card-financial-item { flex: 1; text-align: center; }

.pl-card-financial-sep {
  width: 1px;
  height: 22px;
  background: var(--pl-border);
  margin: 0 6px;
}

.pl-card-fin-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--pl-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.pl-card-fin-value { font-size: 11px; font-weight: 800; color: var(--pl-text); }

/* Probability Bar */
.pl-card-prob-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.pl-card-prob-bar {
  flex: 1;
  height: 3px;
  background: var(--pl-input-bg);
  border-radius: 3px;
  overflow: hidden;
}

.pl-card-prob-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}

.pl-card-prob-label {
  font-size: 10px;
  font-weight: 800;
  min-width: 28px;
  text-align: right;
}

/* Card Contacts */
.pl-card-contacts {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.pl-card-contact-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 800;
  color: #fff;
  border: 2px solid var(--pl-surface);
  margin-left: -4px;
  flex-shrink: 0;
}

.pl-card-contact-avatar:first-child { margin-left: 0; }

.pl-card-contact-more {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(100, 116, 139, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 800;
  color: var(--pl-text-faint);
  border: 2px solid var(--pl-surface);
  margin-left: -4px;
}

/* Card Footer */
.pl-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 6px;
}

.pl-card-assignee { display: flex; align-items: center; gap: 5px; min-width: 0; }

.pl-card-assignee-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
}

.pl-card-assignee-name {
  font-size: 10px;
  font-weight: 600;
  color: var(--pl-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pl-card-footer-right { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }

.pl-card-date {
  font-size: 9px;
  color: var(--pl-text-faint);
  display: flex;
  align-items: center;
  gap: 3px;
}

.pl-card-date.stagnant { color: var(--pl-amber); }

/* Card Quick Actions */
.pl-card-actions { display: flex; gap: 2px; opacity: 0; transition: opacity 0.15s; }
.pl-deal-card:hover .pl-card-actions { opacity: 1; }

.pl-card-action-btn {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  border: 1px solid var(--pl-border);
  background: var(--pl-input-bg);
  color: var(--pl-text-faint);
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--pl-transition);
}

.pl-card-action-btn:hover { background: rgba(102, 126, 234, 0.1); color: var(--pl-primary); }
.pl-card-action-btn.danger:hover { background: rgba(239, 68, 68, 0.1); color: var(--pl-red); }

/* ════════════════════════════════════════════════════════════
   20. DEAL PANEL (Side Overlay)
════════════════════════════════════════════════════════════ */
#plPanelOverlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  z-index: 499;
  transition: opacity 0.3s ease;
}

#plDealPanel {
  display: none;
  position: fixed;
  right: 0;
  top: 0;
  height: 100vh;
  width: var(--pl-panel-w);
  background: var(--pl-sidebar-bg);
  border-left: 1px solid var(--pl-border);
  z-index: 500;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

#plDealPanel.open,
#plDealPanel.pl-slide-in { transform: translateX(0); display: flex !important; }

body:not(.pl-dark-mode) #plDealPanel { box-shadow: -8px 0 40px rgba(0, 0, 0, 0.1); }
body.pl-dark-mode #plDealPanel      { box-shadow: -8px 0 40px rgba(0, 0, 0, 0.5); }

#plDealPanelContent {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* Panel Header */
.pl-panel-header {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--pl-border);
  flex-shrink: 0;
}

.pl-panel-header-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

.pl-panel-stage-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 800;
  flex-shrink: 0;
}

.pl-panel-header-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  flex-shrink: 0;
}

.pl-panel-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--pl-border);
  background: var(--pl-input-bg);
  color: var(--pl-text-muted);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--pl-transition);
}

.pl-panel-btn:hover { background: rgba(0, 0, 0, 0.06); color: var(--pl-text); }
body.pl-dark-mode .pl-panel-btn:hover { background: rgba(255, 255, 255, 0.08); }

.pl-panel-btn.success {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.2);
  color: var(--pl-green);
}

.pl-panel-btn.success:hover { background: rgba(16, 185, 129, 0.2); }

.pl-panel-title {
  font-size: 16px;
  font-weight: 900;
  color: var(--pl-text);
  line-height: 1.3;
  margin-bottom: 6px;
}

.pl-panel-subtitle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pl-panel-source-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
}

.pl-panel-website {
  font-size: 11px;
  font-weight: 600;
  color: var(--pl-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
}

.pl-panel-website:hover { text-decoration: underline; }

/* ════════════════════════════════════════════════════════════
   21. PANEL TABS & SECTIONS
════════════════════════════════════════════════════════════ */
.pl-panel-tabs {
  display: flex;
  border-bottom: 1px solid var(--pl-border);
  flex-shrink: 0;
  overflow-x: auto;
}

.pl-panel-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px 6px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  color: var(--pl-text-faint);
  cursor: pointer;
  transition: var(--pl-transition);
  border: none;
  background: transparent;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.pl-panel-tab:hover { color: var(--pl-text-muted); }
.pl-panel-tab.active { color: var(--pl-primary); border-bottom-color: var(--pl-primary); }

.pl-tab-score-badge {
  font-size: 9px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 10px;
}

.pl-tab-count {
  font-size: 9px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 10px;
  background: rgba(102, 126, 234, 0.12);
  color: var(--pl-primary);
}

/* Panel Body */
.pl-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px;
  transition: opacity 0.15s;
}

.pl-panel-body::-webkit-scrollbar { width: 3px; }
.pl-panel-body::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}
body.pl-dark-mode .pl-panel-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.07);
}

/* Panel Footer */
.pl-panel-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--pl-border);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.pl-panel-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--pl-border);
  background: var(--pl-input-bg);
  color: var(--pl-text-muted);
  cursor: pointer;
  transition: var(--pl-transition);
  font-size: 12px;
}

.pl-panel-close-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--pl-red);
  border-color: rgba(239, 68, 68, 0.2);
}

/* Panel Sections */
.pl-panel-section {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--pl-border);
}

.pl-panel-section:last-child { border-bottom: none; margin-bottom: 0; }

.pl-panel-section-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--pl-text-faint);
  margin-bottom: 12px;
}

/* Stage Progress */
.pl-stage-progress {
  display: flex;
  align-items: flex-start;
  overflow-x: auto;
  padding-bottom: 4px;
}

.pl-stage-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 50px;
  cursor: pointer;
  position: relative;
}

.pl-stage-step-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--pl-border);
  background: var(--pl-surface);
  transition: var(--pl-transition);
  position: relative;
  z-index: 1;
}

.pl-stage-step.done .pl-stage-step-dot    { background: var(--pl-green); border-color: var(--pl-green); }
.pl-stage-step.past .pl-stage-step-dot    { background: var(--pl-green); border-color: var(--pl-green); }

.pl-stage-step.active .pl-stage-step-dot,
.pl-stage-step.current .pl-stage-step-dot {
  border-color: var(--pl-step-color, var(--pl-primary));
  background: var(--pl-step-color, var(--pl-primary));
  transform: scale(1.3);
  box-shadow: 0 0 8px var(--pl-step-color, rgba(102, 126, 234, 0.6));
}

.pl-stage-step-label {
  font-size: 9px;
  font-weight: 600;
  color: var(--pl-text-faint);
  text-align: center;
  white-space: nowrap;
}

.pl-stage-step.active .pl-stage-step-label,
.pl-stage-step.current .pl-stage-step-label {
  color: var(--pl-step-color, var(--pl-primary));
  font-weight: 800;
}

.pl-stage-connector {
  flex: 1;
  height: 2px;
  background: var(--pl-border);
  margin-top: 5px;
}

/* Metrics Grid */
.pl-panel-metrics-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

.pl-metric-card {
  background: var(--pl-input-bg);
  border: 1px solid var(--pl-border);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pl-metric-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}

.pl-metric-label { font-size: 9px; font-weight: 700; color: var(--pl-text-faint); text-transform: uppercase; letter-spacing: 0.5px; }
.pl-metric-value { font-size: 13px; font-weight: 800; color: var(--pl-text); margin-top: 1px; }

/* Probability Section */
.pl-panel-prob-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }

.pl-panel-prob-bar {
  height: 6px;
  background: var(--pl-input-bg);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 10px;
}

.pl-panel-prob-fill { height: 100%; border-radius: 6px; transition: width 0.5s ease; }

.pl-panel-prob-actions { margin-top: 8px; }
.pl-prob-slider { width: 100%; accent-color: var(--pl-primary); cursor: pointer; }

/* Details Grid */
.pl-panel-details-grid,
.pl-panel-detail-row { display: flex; flex-direction: column; gap: 0; }

.pl-panel-detail-row,
.pl-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--pl-border);
  gap: 10px;
}

.pl-panel-detail-row:last-child,
.pl-detail-row:last-child { border-bottom: none; }

.pl-detail-label,
.pl-pd-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--pl-text-muted);
  flex-shrink: 0;
}

.pl-detail-value,
.pl-pd-value { font-size: 11px; font-weight: 700; color: var(--pl-text); text-align: right; }

/* Description */
.pl-panel-description {
  font-size: 12px;
  color: var(--pl-text-muted);
  line-height: 1.7;
  white-space: pre-wrap;
  background: var(--pl-input-bg);
  border-radius: 8px;
  padding: 12px;
}

/* Stagnant Alert */
.pl-panel-stagnant-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 10px;
  margin-bottom: 16px;
}

/* Quick Actions */
.pl-panel-quick-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.pl-panel-action-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid var(--pl-border);
  background: var(--pl-input-bg);
  color: var(--pl-text-muted);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--pl-transition);
}

.pl-panel-action-btn:hover { background: rgba(0, 0, 0, 0.06); color: var(--pl-text); }

.pl-panel-action-btn.advance {
  background: rgba(102, 126, 234, 0.1);
  border-color: rgba(102, 126, 234, 0.2);
  color: var(--pl-primary);
}

.pl-panel-action-btn.advance:hover { background: rgba(102, 126, 234, 0.18); }

.pl-panel-action-btn.danger {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.15);
  color: var(--pl-red);
}

.pl-panel-action-btn.danger:hover { background: rgba(239, 68, 68, 0.15); }

/* Small panel buttons */
.pl-panel-small-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--pl-border);
  background: var(--pl-input-bg);
  color: var(--pl-text-muted);
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--pl-transition);
  margin-left: auto;
}

.pl-panel-small-btn:hover { background: rgba(102, 126, 234, 0.1); color: var(--pl-primary); }

.pl-panel-icon-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid var(--pl-border);
  background: var(--pl-input-bg);
  color: var(--pl-text-muted);
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--pl-transition);
  text-decoration: none;
}

.pl-panel-icon-btn:hover       { background: rgba(102, 126, 234, 0.1); color: var(--pl-primary); }
.pl-panel-icon-btn.danger:hover { background: rgba(239, 68, 68, 0.1); color: var(--pl-red); }

.pl-panel-empty-sub {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 16px;
  text-align: center;
  color: var(--pl-text-faint);
  font-size: 12px;
}

/* Stage Pill */
.pl-stage-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

/* KPIs grid (from HTML §6 inline panel) */
.pl-panel-kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }

.pl-panel-kpi {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--pl-input-bg);
  border: 1px solid var(--pl-border);
  border-radius: 10px;
  padding: 10px 12px;
}

.pl-panel-kpi-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(102, 126, 234, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--pl-primary);
  flex-shrink: 0;
}

.pl-panel-kpi-label { font-size: 9px; font-weight: 700; color: var(--pl-text-faint); text-transform: uppercase; letter-spacing: 0.5px; }
.pl-panel-kpi-value { font-size: 13px; font-weight: 800; color: var(--pl-text); }

/* Stage step from inline §6 */
.pl-panel-stage-progress { display: flex; align-items: center; overflow-x: auto; padding: 12px 0 6px; }

.pl-panel-deal-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  flex-shrink: 0;
}

.pl-panel-deal-title { flex: 1; min-width: 0; }

.pl-panel-deal-name {
  font-size: 16px;
  font-weight: 900;
  color: var(--pl-text);
  margin-bottom: 6px;
  line-height: 1.3;
}

.pl-panel-deal-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Stage buttons */
.pl-panel-stage-btns { display: flex; flex-wrap: wrap; gap: 5px; }

.pl-panel-stage-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid;
  background: transparent;
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--pl-transition);
}

.pl-panel-stage-btn:hover { opacity: 0.7; }
.pl-panel-stage-btn.pass  { border-color: rgba(239, 68, 68, 0.3); color: var(--pl-red); }

/* Panel contacts */
.pl-panel-contacts { display: flex; flex-direction: column; gap: 8px; }

.pl-panel-contact-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 8px;
  background: var(--pl-input-bg);
  cursor: pointer;
  transition: var(--pl-transition);
}

.pl-panel-contact-item:hover { background: rgba(102, 126, 234, 0.06); }

.pl-panel-contact-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

/* ════════════════════════════════════════════════════════════
   22. AI SCORE COMPONENTS
════════════════════════════════════════════════════════════ */
.pl-ai-score-wrap { padding: 4px 0; }

.pl-ai-score-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-radius: var(--pl-radius-lg);
  margin-bottom: 16px;
}

.pl-ai-score-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: conic-gradient(
    var(--score-color, #667eea) calc(var(--score-pct, 0) * 3.6deg),
    rgba(0, 0, 0, 0.06) 0deg
  );
}

body.pl-dark-mode .pl-ai-score-circle {
  background: conic-gradient(
    var(--score-color, #667eea) calc(var(--score-pct, 0) * 3.6deg),
    rgba(255, 255, 255, 0.05) 0deg
  );
}

.pl-ai-score-inner {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--pl-sidebar-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.pl-ai-score-num  { font-size: 20px; font-weight: 900; line-height: 1; }
.pl-ai-score-max,
.pl-ai-score-denom { font-size: 10px; color: var(--pl-text-faint); font-weight: 600; }

.pl-ai-score-meta { flex: 1; min-width: 0; }
.pl-ai-score-info { flex: 1; min-width: 0; }

.pl-ai-score-label,
.pl-ai-reco { font-size: 15px; font-weight: 900; margin-bottom: 4px; }

.pl-ai-score-rec,
.pl-ai-summary {
  font-size: 12px;
  color: var(--pl-text-muted);
  line-height: 1.5;
}

.pl-ai-summary {
  background: var(--pl-input-bg);
  border-radius: 8px;
  padding: 12px;
  line-height: 1.7;
}

.pl-ai-rescore-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid var(--pl-border);
  background: var(--pl-input-bg);
  color: var(--pl-text-muted);
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--pl-transition);
}

.pl-ai-rescore-btn:hover { background: rgba(139, 92, 246, 0.1); color: var(--pl-purple); }

/* Criteria List */
.pl-ai-criteria-list,
.pl-criteria-list { display: flex; flex-direction: column; gap: 10px; }

.pl-ai-criterion,
.pl-criterion-row {
  background: var(--pl-input-bg);
  border-radius: 10px;
  padding: 10px 12px;
}

.pl-ai-criterion-header,
.pl-criterion-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.pl-ai-criterion-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  flex-shrink: 0;
}

.pl-ai-criterion-info { flex: 1; min-width: 0; }
.pl-ai-criterion-name,
.pl-criterion-label { font-size: 11px; font-weight: 700; color: var(--pl-text); display: flex; align-items: center; gap: 6px; flex: 1; }

.pl-ai-criterion-weight,
.pl-criterion-weight {
  font-size: 9px;
  color: var(--pl-text-faint);
  font-weight: 600;
  background: rgba(100, 116, 139, 0.1);
  padding: 1px 5px;
  border-radius: 10px;
}

.pl-ai-criterion-score,
.pl-criterion-score { font-size: 15px; font-weight: 900; flex-shrink: 0; }

.pl-ai-criterion-bar,
.pl-criterion-bar-wrap {
  height: 3px;
  background: var(--pl-border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}

.pl-ai-criterion-fill,
.pl-criterion-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pl-ai-criterion-comment,
.pl-criterion-comment {
  font-size: 10px;
  color: var(--pl-text-muted);
  line-height: 1.5;
  font-style: italic;
}

/* AI Points */
.pl-ai-point {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 11px;
  color: var(--pl-text-muted);
  line-height: 1.5;
  margin-bottom: 6px;
}

.pl-ai-point.strength { background: rgba(16, 185, 129, 0.06); border-left: 2px solid var(--pl-green); }
.pl-ai-point.risk     { background: rgba(245, 158, 11, 0.06); border-left: 2px solid var(--pl-amber); }

.pl-ai-footer {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  color: var(--pl-text-faint);
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--pl-border);
}

.pl-panel-ai-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.pl-ai-thinking { text-align: center; }

.pl-panel-ai-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px;
  text-align: center;
}

/* Score badge (score-up animation) */
.pl-card-score-badge.pl-score-up,
.pl-score-badge.pl-score-up { animation: plScoreUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }

/* ════════════════════════════════════════════════════════════
   23. LINKED CONTACTS (Panel)
════════════════════════════════════════════════════════════ */
.pl-linked-contact {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--pl-border);
  cursor: pointer;
  transition: var(--pl-transition);
}

.pl-linked-contact:last-child { border-bottom: none; }
.pl-linked-contact:hover { opacity: 0.8; }

.pl-linked-contact-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

.pl-linked-contact-info { flex: 1; min-width: 0; }

.pl-linked-contact-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--pl-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pl-linked-contact-title { font-size: 10px; color: var(--pl-text-faint); margin-top: 1px; }
.pl-linked-contact-actions { display: flex; gap: 4px; flex-shrink: 0; }

/* Contact Search */
.pl-contact-search-results {
  margin-top: 8px;
  border: 1px solid var(--pl-border);
  border-radius: var(--pl-radius);
  overflow: hidden;
}

.pl-contact-result {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  transition: var(--pl-transition);
  border-bottom: 1px solid var(--pl-border);
}

.pl-contact-result:last-child { border-bottom: none; }
.pl-contact-result:hover { background: var(--pl-input-bg); }

.pl-contact-result-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

/* ════════════════════════════════════════════════════════════
   24. PANEL TIMELINE (History Tab)
════════════════════════════════════════════════════════════ */
.pl-panel-timeline { display: flex; flex-direction: column; gap: 0; }

.pl-timeline-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--pl-border);
}

.pl-timeline-item:last-child { border-bottom: none; }

.pl-timeline-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pl-timeline-body { flex: 1; min-width: 0; }

.pl-timeline-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 2px;
}

.pl-timeline-type  { font-size: 11px; font-weight: 700; text-transform: capitalize; }
.pl-timeline-date  { font-size: 10px; color: var(--pl-text-faint); }
.pl-timeline-author { font-size: 10px; color: var(--pl-text-faint); margin-bottom: 4px; }

.pl-timeline-note {
  font-size: 11px;
  color: var(--pl-text-muted);
  line-height: 1.5;
  background: var(--pl-input-bg);
  border-radius: 6px;
  padding: 6px 10px;
}

/* Activity List (from HTML §6) */
.pl-activity-list { display: flex; flex-direction: column; gap: 0; }

.pl-activity-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 9px;
  border-radius: 8px;
  border: 1px dashed var(--pl-border);
  background: transparent;
  color: var(--pl-text-faint);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--pl-transition);
  margin-bottom: 12px;
}

.pl-activity-add-btn:hover {
  border-color: var(--pl-primary);
  color: var(--pl-primary);
  background: rgba(102, 126, 234, 0.05);
}

.pl-activity-item {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--pl-border);
}

.pl-activity-item:last-child { border-bottom: none; }

.pl-activity-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pl-activity-body { flex: 1; min-width: 0; }

.pl-activity-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 2px;
}

.pl-activity-type   { font-size: 11px; font-weight: 700; text-transform: capitalize; }
.pl-activity-time   { font-size: 10px; color: var(--pl-text-faint); }
.pl-activity-author { font-size: 10px; color: var(--pl-text-faint); margin-bottom: 4px; }

.pl-activity-notes {
  font-size: 11px;
  color: var(--pl-text-muted);
  line-height: 1.5;
  white-space: pre-wrap;
}

.pl-activity-next {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  color: var(--pl-primary);
  margin-top: 4px;
  font-weight: 600;
}

/* ════════════════════════════════════════════════════════════
   25. GANTT VIEW
════════════════════════════════════════════════════════════ */
#pipelineGantt { margin-bottom: 18px; }

.pl-gantt-wrap { overflow: hidden; }

.pl-gantt-header-row {
  display: grid;
  grid-template-columns: 220px 1fr 100px;
  height: 36px;
  border-bottom: 1px solid var(--pl-border);
  margin-bottom: 4px;
}

.pl-gantt-label-col {
  padding: 0 12px;
  font-size: 10px;
  font-weight: 800;
  color: var(--pl-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  display: flex;
  align-items: center;
  border-right: 1px solid var(--pl-border);
  flex-shrink: 0;
  gap: 8px;
  overflow: hidden;
}

.pl-gantt-timeline-col {
  position: relative;
  overflow: hidden;
  flex: 1;
  display: flex;
  align-items: center;
}

.pl-gantt-meta-col {
  padding: 0 12px;
  font-size: 10px;
  font-weight: 800;
  color: var(--pl-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  display: flex;
  align-items: center;
  border-left: 1px solid var(--pl-border);
  flex-shrink: 0;
}

/* Month Markers */
.pl-gantt-month-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  border-left: 1px dashed var(--pl-border);
}

.pl-gantt-month-label {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 9px;
  font-weight: 700;
  color: var(--pl-text-faint);
  white-space: nowrap;
  background: var(--pl-surface);
  padding: 0 3px;
}

/* Today Line */
.pl-gantt-today-line {
  position: absolute;
  top: -4px;
  bottom: -4px;
  border-left: 2px solid var(--pl-red);
  z-index: 2;
}

.pl-gantt-today-label {
  position: absolute;
  top: 0;
  left: 4px;
  font-size: 9px;
  font-weight: 800;
  color: var(--pl-red);
  white-space: nowrap;
}

/* Gantt Rows */
.pl-gantt-rows { max-height: 480px; overflow-y: auto; }

.pl-gantt-row {
  display: grid;
  grid-template-columns: 220px 1fr 100px;
  height: 52px;
  cursor: pointer;
  border-bottom: 1px solid var(--pl-border);
  transition: background 0.15s;
}

.pl-gantt-row:last-child { border-bottom: none; }
.pl-gantt-row:hover { background: var(--pl-input-bg); }

.pl-gantt-deal-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.pl-gantt-deal-info { min-width: 0; }

.pl-gantt-deal-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--pl-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pl-gantt-deal-stage { font-size: 9px; font-weight: 700; }

/* Gantt Bar */
.pl-gantt-bar-wrap { position: relative; width: 100%; height: 26px; }

.pl-gantt-bar {
  position: absolute;
  height: 22px;
  top: 2px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  overflow: hidden;
  min-width: 6px;
  transition: opacity 0.2s;
}

.pl-gantt-bar:hover { opacity: 0.85; }
.pl-gantt-bar.late    { opacity: 0.8; }
.pl-gantt-bar.stagnant { border: 2px solid var(--pl-amber); }

.pl-gantt-bar-progress {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  border-radius: 4px;
  pointer-events: none;
}

.pl-gantt-bar-label {
  position: absolute;
  left: 6px;
  font-size: 10px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  right: 4px;
}

.pl-gantt-milestone {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
}

.pl-gantt-milestone.start { background: var(--pl-primary); border: 2px solid var(--pl-surface); }
.pl-gantt-milestone.end   { background: var(--pl-green);   border: 2px solid var(--pl-surface); }
.pl-gantt-milestone.end.late { background: var(--pl-red); }

.pl-gantt-score {
  font-size: 13px;
  font-weight: 800;
}

.pl-gantt-prob { font-size: 10px; font-weight: 700; }

/* Gantt meta col row */
.pl-gantt-row .pl-gantt-meta-col {
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
}

/* ════════════════════════════════════════════════════════════
   26. TABLE VIEW
════════════════════════════════════════════════════════════ */
#pipelineTable { margin-bottom: 18px; overflow: hidden; }

.pl-table-wrap { overflow-x: auto; }

.pl-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

.pl-table thead th {
  padding: 10px 12px;
  font-size: 10px;
  font-weight: 800;
  color: var(--pl-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  text-align: left;
  background: var(--pl-input-bg);
  border-bottom: 1px solid var(--pl-border);
  white-space: nowrap;
}

.pl-th-sortable { cursor: pointer; user-select: none; }
.pl-th-sortable:hover { color: var(--pl-primary); }

.pl-table-row {
  border-bottom: 1px solid var(--pl-border);
  cursor: pointer;
  transition: background 0.1s;
}

.pl-table-row:hover { background: var(--pl-input-bg); }
.pl-table-row:last-child { border-bottom: none; }
.pl-table-row.stagnant { background: rgba(245, 158, 11, 0.04); }

.pl-table td { padding: 10px 12px; vertical-align: middle; }

.pl-td-name { max-width: 200px; }

.pl-table-deal-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--pl-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.pl-table-deal-source {
  font-size: 10px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: 2px;
}

/* Score in table */
.pl-score-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 20px;
}

.pl-score-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 20px;
  border: 1px solid rgba(139, 92, 246, 0.25);
  background: rgba(139, 92, 246, 0.08);
  color: var(--pl-purple);
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--pl-transition);
}

.pl-score-btn:hover { background: rgba(139, 92, 246, 0.15); }

/* Probability in table */
.pl-prob-bar-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 6px;
  min-width: 80px;
}

.pl-prob-bar {
  height: 4px;
  border-radius: 4px;
  min-width: 2px;
}

.pl-prob-label {
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  min-width: 28px;
}

/* Table Avatar */
.pl-table-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 800;
  color: #fff;
}

/* Table Actions */
.pl-table-actions { display: flex; gap: 3px; opacity: 0; transition: opacity 0.15s; }
.pl-table-row:hover .pl-table-actions { opacity: 1; }

.pl-table-action-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid var(--pl-border);
  background: var(--pl-input-bg);
  color: var(--pl-text-muted);
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--pl-transition);
}

.pl-table-action-btn:hover       { background: rgba(102, 126, 234, 0.1); color: var(--pl-primary); }
.pl-table-action-btn.danger:hover { background: rgba(239, 68, 68, 0.1); color: var(--pl-red); }

/* Table Footer / Pagination */
.pl-table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid var(--pl-border);
  gap: 10px;
  flex-wrap: wrap;
}

.pl-table-info { font-size: 11px; color: var(--pl-text-faint); font-weight: 600; }

.pl-pagination { display: flex; gap: 3px; }

.pl-page-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--pl-border);
  background: var(--pl-input-bg);
  color: var(--pl-text-muted);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--pl-transition);
}

.pl-page-btn:hover:not(:disabled) { background: rgba(102, 126, 234, 0.1); color: var(--pl-primary); }
.pl-page-btn.active               { background: var(--pl-primary); color: #fff; border-color: var(--pl-primary); }
.pl-page-btn:disabled             { opacity: 0.4; cursor: not-allowed; }

/* ════════════════════════════════════════════════════════════
   27. ALERTS WIDGET
════════════════════════════════════════════════════════════ */
.pl-alerts-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px;
  text-align: center;
}

.pl-alert-count-badge {
  font-size: 9px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 20px;
  background: rgba(239, 68, 68, 0.12);
  color: var(--pl-red);
  margin-left: 6px;
}

.pl-alerts-list { display: flex; flex-direction: column; gap: 6px; }

.pl-alert-item {
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--pl-input-bg);
  cursor: pointer;
  transition: var(--pl-transition);
}

.pl-alert-item:hover { background: rgba(245, 158, 11, 0.04); }
.pl-alert-item.critical { background: rgba(239, 68, 68, 0.04); }

.pl-alert-top { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.pl-alert-stage-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.pl-alert-body { flex: 1; min-width: 0; }

.pl-alert-deal-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--pl-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pl-alert-meta   { font-size: 10px; font-weight: 600; margin-top: 1px; }
.pl-alert-value  { font-size: 11px; font-weight: 700; color: var(--pl-text-muted); flex-shrink: 0; }

.pl-alert-ai-action {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  color: var(--pl-purple);
  background: rgba(139, 92, 246, 0.06);
  border-radius: 6px;
  padding: 4px 8px;
  margin-top: 6px;
}

.pl-alert-quick-actions { display: flex; gap: 4px; margin-top: 6px; }

.pl-alert-action-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--pl-border);
  background: var(--pl-input-bg);
  color: var(--pl-text-muted);
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--pl-transition);
}

.pl-alert-action-btn:hover { background: rgba(102, 126, 234, 0.1); color: var(--pl-primary); }

/* ════════════════════════════════════════════════════════════
   28. MODALS
════════════════════════════════════════════════════════════ */
.pl-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.pl-modal {
  background: var(--pl-surface);
  border: 1px solid var(--pl-border);
  border-radius: var(--pl-radius-xl);
  max-width: 520px;
  width: 100%;
  box-shadow: var(--pl-shadow-xl);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pl-modal-wide { max-width: 720px; }

.pl-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--pl-border);
  flex-shrink: 0;
}

.pl-modal-title-wrap { display: flex; align-items: center; gap: 12px; }

.pl-modal-title-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: #fff;
  flex-shrink: 0;
}

.pl-modal-close {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--pl-border);
  background: var(--pl-input-bg);
  color: var(--pl-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: var(--pl-transition);
}

.pl-modal-close:hover { background: rgba(239, 68, 68, 0.1); color: var(--pl-red); }

.pl-modal-body {
  padding: 20px 22px;
  overflow-y: auto;
  flex: 1;
}

/* ════════════════════════════════════════════════════════════
   29. FORMS
════════════════════════════════════════════════════════════ */
.pl-form-group { margin-bottom: 14px; }

.pl-form-group.required .pl-form-label::after {
  content: ' *';
  color: var(--pl-red);
}

.pl-form-label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  color: var(--pl-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 6px;
}

.pl-form-input,
.pl-form-select,
.pl-form-textarea {
  width: 100%;
  background: var(--pl-input-bg);
  border: 1px solid var(--pl-border);
  border-radius: var(--pl-radius);
  padding: 9px 12px;
  font-family: inherit;
  font-size: 12px;
  color: var(--pl-text);
  outline: none;
  transition: var(--pl-transition);
}

.pl-form-input::placeholder,
.pl-form-textarea::placeholder { color: var(--pl-text-faint); }

.pl-form-input:focus,
.pl-form-select:focus,
.pl-form-textarea:focus {
  border-color: var(--pl-primary);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12);
}

.pl-form-textarea { resize: vertical; min-height: 80px; line-height: 1.5; }

.pl-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.pl-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--pl-border);
}

/* ════════════════════════════════════════════════════════════
   30. IMPORT CSV
════════════════════════════════════════════════════════════ */
.pl-import-drop-zone {
  border: 2px dashed rgba(102, 126, 234, 0.3);
  border-radius: 14px;
  padding: 36px 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--pl-transition);
  background: rgba(102, 126, 234, 0.04);
  margin-bottom: 16px;
}

.pl-import-drop-zone:hover,
.pl-import-drop-zone.drag-active {
  border-color: var(--pl-primary);
  background: rgba(102, 126, 234, 0.08);
}

.pl-import-tips { display: flex; flex-direction: column; gap: 6px; }

.pl-import-tip {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--pl-text-muted);
  padding: 6px 10px;
  background: var(--pl-input-bg);
  border-radius: 8px;
}

.pl-import-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--pl-text);
}

.pl-source-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 800;
  background: rgba(102, 126, 234, 0.12);
  color: var(--pl-primary);
  margin-left: 8px;
}

.pl-import-table-wrap {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--pl-border);
  border-radius: var(--pl-radius);
}

.pl-import-progress { margin-top: 16px; }

.pl-progress-bar-wrap {
  height: 6px;
  background: var(--pl-input-bg);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 6px;
}

.pl-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--pl-primary), var(--pl-primary-dark));
  border-radius: 6px;
  transition: width 0.3s ease;
}

.pl-progress-label { font-size: 11px; color: var(--pl-text-muted); font-weight: 600; text-align: center; }

/* ════════════════════════════════════════════════════════════
   31. AI CHAT FAB & PANEL
════════════════════════════════════════════════════════════ */
.pl-ai-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: linear-gradient(135deg, var(--pl-purple), #6d28d9);
  border: none;
  border-radius: 50px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  cursor: pointer;
  z-index: 1000;
  box-shadow: 0 6px 24px rgba(139, 92, 246, 0.5);
  transition: var(--pl-transition);
}

.pl-ai-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 36px rgba(139, 92, 246, 0.65);
}

.pl-ai-fab-pulse {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--pl-green);
  border: 2px solid #fff;
  animation: plPulse 2s ease-in-out infinite;
}

/* AI Chat Panel */
.pl-ai-chat-panel {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 380px;
  max-height: 580px;
  background: var(--pl-sidebar-bg);
  border: 1px solid var(--pl-border);
  border-radius: 20px;
  z-index: 1001;
  flex-direction: column;
  box-shadow: var(--pl-shadow-xl);
  overflow: hidden;
}

.pl-ai-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--pl-border);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.08), rgba(109, 40, 217, 0.05));
  flex-shrink: 0;
}

.pl-ai-chat-header-left { display: flex; align-items: center; gap: 10px; }

.pl-ai-chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--pl-purple), #6d28d9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: #fff;
  flex-shrink: 0;
}

.pl-ai-chat-title { font-size: 13px; font-weight: 800; color: var(--pl-text); }
.pl-ai-chat-sub   { font-size: 10px; color: var(--pl-text-faint); margin-top: 1px; }

.pl-ai-chat-header-btn {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 1px solid var(--pl-border);
  background: var(--pl-input-bg);
  color: var(--pl-text-muted);
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--pl-transition);
}

.pl-ai-chat-header-btn:hover { background: rgba(239, 68, 68, 0.1); color: var(--pl-red); }

/* Presets */
.pl-ai-chat-presets {
  display: flex;
  gap: 5px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--pl-border);
  overflow-x: auto;
  flex-shrink: 0;
}

.pl-ai-chat-presets::-webkit-scrollbar { height: 0; }

.pl-ai-chat-preset {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 20px;
  border: 1px solid var(--pl-border);
  background: var(--pl-input-bg);
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  color: var(--pl-text-muted);
  cursor: pointer;
  transition: var(--pl-transition);
  white-space: nowrap;
  flex-shrink: 0;
}

.pl-ai-chat-preset:hover {
  background: rgba(139, 92, 246, 0.1);
  border-color: rgba(139, 92, 246, 0.25);
  color: var(--pl-purple);
}

/* Messages */
.pl-ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 200px;
}

.pl-ai-chat-messages::-webkit-scrollbar { width: 3px; }
.pl-ai-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.2);
  border-radius: 3px;
}

.pl-chat-msg {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  animation: plFadeIn 0.2s ease;
}

.pl-chat-msg-user { flex-direction: row-reverse; }

.pl-chat-ai-avatar {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--pl-purple), #6d28d9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #fff;
  flex-shrink: 0;
}

.pl-chat-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 12px;
  line-height: 1.6;
}

.pl-chat-bubble.ai {
  background: var(--pl-input-bg);
  color: var(--pl-text);
  border-radius: 4px 14px 14px 14px;
  border: 1px solid var(--pl-border);
}

.pl-chat-bubble.user {
  background: linear-gradient(135deg, var(--pl-primary), var(--pl-primary-dark));
  color: #fff;
  border-radius: 14px 4px 14px 14px;
}

/* Chat Input */
.pl-ai-chat-input-wrap {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--pl-border);
  background: var(--pl-input-bg);
  flex-shrink: 0;
}

.pl-ai-chat-input {
  flex: 1;
  background: var(--pl-surface);
  border: 1px solid var(--pl-border);
  border-radius: 10px;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 12px;
  color: var(--pl-text);
  outline: none;
  resize: none;
  max-height: 100px;
  line-height: 1.5;
  transition: var(--pl-transition);
}

.pl-ai-chat-input::placeholder { color: var(--pl-text-faint); }
.pl-ai-chat-input:focus { border-color: var(--pl-purple); box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12); }

.pl-ai-chat-send {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, var(--pl-purple), #6d28d9);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--pl-transition);
  box-shadow: 0 3px 10px rgba(139, 92, 246, 0.4);
}

.pl-ai-chat-send:hover { transform: scale(1.08); box-shadow: 0 5px 16px rgba(139, 92, 246, 0.55); }

.pl-ai-chat-footer {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  font-size: 9px;
  color: var(--pl-text-faint);
  border-top: 1px solid var(--pl-border);
  flex-shrink: 0;
}

/* ════════════════════════════════════════════════════════════
   32. SCROLLBARS (global)
════════════════════════════════════════════════════════════ */
* { scrollbar-width: thin; scrollbar-color: rgba(0, 0, 0, 0.1) transparent; }
body.pl-dark-mode * { scrollbar-color: rgba(255, 255, 255, 0.08) transparent; }

*::-webkit-scrollbar { width: 4px; height: 4px; }
*::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.12); border-radius: 4px; }
body.pl-dark-mode *::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); }

/* ════════════════════════════════════════════════════════════
   33. ANIMATIONS
════════════════════════════════════════════════════════════ */
@keyframes plSpin    { to { transform: rotate(360deg); } }
@keyframes plFadeIn  { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes plSlideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes plPulse   { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
@keyframes plScoreUp { from { opacity: 0; transform: scale(0.7); } to { opacity: 1; transform: scale(1); } }

.pl-fade-in  { animation: plFadeIn  0.3s ease forwards; }
.pl-slide-in { animation: plSlideIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
.pl-pulse    { animation: plPulse   2s ease-in-out infinite; }

/* ════════════════════════════════════════════════════════════
   34. RESPONSIVE — LARGE (≤ 1400px)
════════════════════════════════════════════════════════════ */
@media (max-width: 1400px) {
  #plStatsBar { grid-template-columns: repeat(3, 1fr); }
  .pl-kanban-col { flex: 0 0 260px; min-width: 260px; max-width: 260px; }
}

/* ════════════════════════════════════════════════════════════
   35. RESPONSIVE — TABLET (≤ 1200px)
════════════════════════════════════════════════════════════ */
@media (max-width: 1200px) {
  :root { --pl-panel-w: 380px; --pl-sidebar-w: 240px; }

  .pl-widgets-row { grid-template-columns: 1fr 1fr; }
  .pl-widgets-row .pl-widget:last-child { grid-column: 1 / -1; }

  .pl-kanban-col { flex: 0 0 245px; min-width: 245px; max-width: 245px; }
}

/* ════════════════════════════════════════════════════════════
   36. RESPONSIVE — MOBILE (≤ 768px)
════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  html, body { overflow: hidden; }

  #plApp { flex-direction: row; }

  /* Sidebar → fixed overlay */
  #plSidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 1000;
    transform: translateX(-100%);
    width: var(--pl-sidebar-w) !important;
    overflow-y: auto;
    overflow-x: hidden;
  }

  #plSidebar.mobile-open {
    transform: translateX(0);
    box-shadow: 4px 0 40px rgba(0, 0, 0, 0.25);
  }

  .pl-sidebar-toggle { display: none !important; }
  .pl-mobile-close-btn { display: flex; }

  #plMain { flex: 1; }

  /* Deal panel → full width */
  #plDealPanel { width: 100vw !important; }

  /* Header */
  #plHeader { padding: 0 12px; gap: 8px; }
  .pl-breadcrumb { display: none; }
  .pl-search-wrap { max-width: none; flex: 1; }

  /* Content */
  #plContent { padding: 14px; }

  /* Stats Bar */
  #plStatsBar { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .pl-stat-card { padding: 12px; }
  .pl-stat-value { font-size: 18px; }
  .pl-stat-icon { width: 32px; height: 32px; font-size: 13px; }

  /* Hero */
  .pl-hero { flex-direction: column; align-items: flex-start; gap: 12px; }
  .pl-hero-right { width: 100%; flex-wrap: wrap; }
  .pl-hero-title { font-size: 18px; }
  .pl-hero-sub { font-size: 11px; }

  /* Toolbar */
  .pl-toolbar { flex-wrap: wrap; gap: 8px; padding: 8px 10px; }
  .pl-view-switcher { width: 100%; }
  .pl-view-btn { flex: 1; justify-content: center; }
  .pl-filter-group { width: 100%; flex-wrap: wrap; }
  .pl-search-filter-wrap { flex: 1; min-width: 120px; }
  .pl-toolbar-actions { width: 100%; justify-content: flex-end; }

  /* Kanban */
  .pl-kanban-board { gap: 10px; padding-bottom: 16px; }
  .pl-kanban-col {
    flex: 0 0 235px;
    min-width: 235px;
    max-width: 235px;
    max-height: calc(100vh - 350px);
  }

  /* Widgets */
  .pl-widgets-row { grid-template-columns: 1fr; gap: 10px; }
  .pl-widgets-row .pl-widget:last-child { grid-column: auto; }

  /* Panel */
  .pl-panel-metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .pl-panel-kpis { grid-template-columns: repeat(2, 1fr); }

  /* Gantt */
  .pl-gantt-header-row,
  .pl-gantt-row { grid-template-columns: 150px 1fr 70px; }
  .pl-gantt-deal-name { font-size: 11px; }

  /* Table */
  .pl-table { min-width: 700px; }

  /* AI Chat */
  .pl-ai-chat-panel { left: 10px; right: 10px; bottom: 80px; width: auto; max-height: 70vh; }
  .pl-ai-fab { bottom: 20px; right: 20px; }
  .pl-ai-fab-text { display: none; }
  .pl-ai-fab { padding: 14px; border-radius: 50%; }

  /* Modals */
  .pl-modal-overlay { padding: 10px; align-items: flex-end; }
  .pl-modal { border-radius: var(--pl-radius-lg); max-height: 95vh; }
  .pl-modal-wide { max-width: 100%; }

  /* Forms */
  .pl-form-row { grid-template-columns: 1fr; }
}

/* ════════════════════════════════════════════════════════════
   37. RESPONSIVE — SMALL MOBILE (≤ 480px)
════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  :root { --pl-header-h: 52px; }

  #plHeader { padding: 0 10px; gap: 6px; }

  #plStatsBar { grid-template-columns: 1fr 1fr; gap: 6px; }
  .pl-stat-card { padding: 10px 12px; }
  .pl-stat-value { font-size: 16px; }

  .pl-kanban-col {
    flex: 0 0 215px;
    min-width: 215px;
    max-width: 215px;
  }

  .pl-hero-title { font-size: 16px; }

  .pl-panel-metrics-grid { grid-template-columns: 1fr 1fr; }
  .pl-panel-kpis { grid-template-columns: 1fr; }

  .pl-widgets-row { gap: 8px; }

  .pl-ai-chat-panel { left: 6px; right: 6px; }

  .pl-gantt-header-row,
  .pl-gantt-row { grid-template-columns: 130px 1fr 60px; }

  .pl-toolbar { padding: 8px; }
  .pl-filter-select { font-size: 10px; padding: 6px 8px; }
}

/* ════════════════════════════════════════════════════════════
   38. TOAST NOTIFICATIONS
════════════════════════════════════════════════════════════ */
#pipelineToastContainer {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
  }
  
  /* ════════════════════════════════════════════════════════════
     39. DARK MODE — ADJUSTMENTS FINAUX
  ════════════════════════════════════════════════════════════ */
  body.pl-dark-mode .pl-stat-card              { background: rgba(30, 41, 59, 0.85); }
  body.pl-dark-mode .pl-toolbar                { background: rgba(15, 23, 42, 0.6); }
  body.pl-dark-mode .pl-widget                 { background: rgba(30, 41, 59, 0.85); }
  body.pl-dark-mode .pl-deal-card              { background: rgba(30, 41, 59, 0.85); }
  body.pl-dark-mode .pl-kanban-col             { background: rgba(15, 23, 42, 0.7); }
  body.pl-dark-mode .pl-metric-card            { background: rgba(255, 255, 255, 0.04); }
  body.pl-dark-mode .pl-panel-kpi              { background: rgba(255, 255, 255, 0.04); }
  body.pl-dark-mode .pl-ai-criterion           { background: rgba(255, 255, 255, 0.04); }
  body.pl-dark-mode .pl-criterion-row          { background: rgba(255, 255, 255, 0.04); }
  body.pl-dark-mode .pl-panel-contact-item     { background: rgba(255, 255, 255, 0.04); }
  body.pl-dark-mode .pl-alert-item             { background: rgba(255, 255, 255, 0.04); }
  body.pl-dark-mode .pl-timeline-note          { background: rgba(255, 255, 255, 0.04); }
  body.pl-dark-mode .pl-card-financials        { background: rgba(255, 255, 255, 0.04); }
  body.pl-dark-mode .pl-import-tip             { background: rgba(255, 255, 255, 0.04); }
  body.pl-dark-mode .pl-panel-description      { background: rgba(255, 255, 255, 0.04); }
  body.pl-dark-mode .pl-ai-summary             { background: rgba(255, 255, 255, 0.04); }
  body.pl-dark-mode .pl-search-filter-wrap     { background: rgba(255, 255, 255, 0.06); }
  
  body.pl-dark-mode .pl-form-input,
  body.pl-dark-mode .pl-form-select,
  body.pl-dark-mode .pl-form-textarea          { background: rgba(255, 255, 255, 0.06); }
  
  body.pl-dark-mode .pl-modal                  { background: #1a2235; border-color: rgba(255, 255, 255, 0.1); }
  body.pl-dark-mode .pl-new-dropdown           { background: #1a2235; }
  body.pl-dark-mode .pl-search-dropdown        { background: #1e293b; }
  body.pl-dark-mode .pl-header-user-menu       { background: #1e293b; }
  body.pl-dark-mode .pl-sidebar-user-dropdown  { background: #1e293b; }
  
  body.pl-dark-mode .pl-filter-btn:hover       { background: rgba(255, 255, 255, 0.08); }
  body.pl-dark-mode .pl-panel-action-btn:hover { background: rgba(255, 255, 255, 0.06); }
  
  body.pl-dark-mode .pl-table thead th         { background: rgba(255, 255, 255, 0.03); }
  body.pl-dark-mode .pl-table-row:hover        { background: rgba(255, 255, 255, 0.03); }
  body.pl-dark-mode .pl-table-row.stagnant     { background: rgba(245, 158, 11, 0.06); }
  
  body.pl-dark-mode .pl-gantt-row:hover        { background: rgba(255, 255, 255, 0.03); }
  body.pl-dark-mode .pl-gantt-month-label      { background: rgba(15, 23, 42, 0.9); }
  
  body.pl-dark-mode .pl-ai-fab-pulse           { border-color: var(--pl-sidebar-bg); }
  
  body.pl-dark-mode .pl-page-btn               { background: rgba(255, 255, 255, 0.06); }
  body.pl-dark-mode .pl-page-btn:hover:not(:disabled) { background: rgba(102, 126, 234, 0.15); }
  
  body.pl-dark-mode .pl-kanban-empty-col       { border-color: rgba(255, 255, 255, 0.08); }
  
  body.pl-dark-mode .pl-ai-chat-input-wrap     { background: rgba(15, 23, 42, 0.6); }
  body.pl-dark-mode .pl-ai-chat-input          { background: rgba(30, 41, 59, 0.9); }
  
  /* ════════════════════════════════════════════════════════════
     40. LIGHT MODE — POLISSAGES FINAUX
  ════════════════════════════════════════════════════════════ */
  body:not(.pl-dark-mode) .pl-deal-card:hover  { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1); }
  body:not(.pl-dark-mode) .pl-kanban-col       { box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04); }
  body:not(.pl-dark-mode) .pl-stat-card        { box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04); }
  body:not(.pl-dark-mode) .pl-widget           { box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04); }
  body:not(.pl-dark-mode) .pl-header-user-menu { box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12); }
  body:not(.pl-dark-mode) .pl-new-dropdown     { box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15); }
  body:not(.pl-dark-mode) .pl-search-dropdown  { box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12); }
  body:not(.pl-dark-mode) .pl-sidebar-user-dropdown { box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.1); }
  body:not(.pl-dark-mode) .pl-modal            { box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15); }
  body:not(.pl-dark-mode) #plDealPanel         { background: #ffffff; }
  body:not(.pl-dark-mode) .pl-table-wrap       { box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04); }
  body:not(.pl-dark-mode) .pl-filter-select    { background: rgba(0, 0, 0, 0.03); }
  
  /* ════════════════════════════════════════════════════════════
     41. UTILITIES & MICRO-HELPERS
  ════════════════════════════════════════════════════════════ */
  
  /* Spinner (utilisé partout dans le JS) */
  .pl-spinner-ring {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(102, 126, 234, 0.15);
    border-top-color: var(--pl-primary);
    border-radius: 50%;
    animation: plSpin 0.7s linear infinite;
    vertical-align: middle;
    flex-shrink: 0;
  }
  
  /* Glow pulsant sur les stat cards urgentes */
  .pl-stat-card.pl-glow {
    animation: plGlow 2s ease-in-out infinite;
  }
  
  @keyframes plGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.3); }
    50%       { box-shadow: 0 0 0 8px rgba(245, 158, 11, 0); }
  }
  
  /* Drag & Drop — animations dans le JS inline */
  .pl-deal-card.drag-over-card { border-top: 2px solid var(--pl-primary) !important; }
  
  /* Focus visible pour l'accessibilité */
  .pl-btn:focus-visible,
  .pl-header-btn:focus-visible,
  .pl-panel-btn:focus-visible,
  .pl-view-btn:focus-visible,
  .pl-page-btn:focus-visible,
  .pl-filter-btn:focus-visible {
    outline: 2px solid var(--pl-primary);
    outline-offset: 2px;
  }
  
  /* Truncate utility */
  .pl-truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  /* Visually hidden (a11y) */
  .pl-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  
  /* Disable pointer events quand readonly */
  [data-requires-write][style*="display: none"] { pointer-events: none; }
  
  /* ════════════════════════════════════════════════════════════
     42. KANBAN REFRESH COUNTER (update partiel sans re-render)
  ════════════════════════════════════════════════════════════ */
  .pl-kanban-col-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 20px;
    transition: var(--pl-transition);
    white-space: nowrap;
  }
  
  .pl-kanban-col-count.updated {
    animation: plScoreUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  }
  
  /* ════════════════════════════════════════════════════════════
     43. IMPORT PREVIEW TABLE (styles spécifiques)
  ════════════════════════════════════════════════════════════ */
  .pl-import-table-wrap .pl-table {
    min-width: 500px;
    font-size: 11px;
  }
  
  .pl-import-table-wrap .pl-table thead th {
    font-size: 9px;
    padding: 8px 10px;
  }
  
  .pl-import-table-wrap .pl-table td {
    padding: 7px 10px;
    font-size: 11px;
    color: var(--pl-text-muted);
  }
  
  .pl-import-table-wrap .pl-table td:first-child {
    font-weight: 700;
    color: var(--pl-text);
  }
  
  /* ════════════════════════════════════════════════════════════
     44. DEAL PANEL — Inline §6 HTML compatibility
          (classes générées par le script inline du HTML)
  ════════════════════════════════════════════════════════════ */
  
  /* Scoring animation dots */
  .pl-card-scoring {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: var(--pl-purple);
  }
  
  /* Stage step connector (§6 inline) */
  .pl-stage-connector { display: block; }
  
  /* Panel AI dots (§6 rendering) */
  .pl-panel-ai-dots {
    display: flex;
    gap: 5px;
    justify-content: center;
    margin-bottom: 12px;
  }
  
  .pl-panel-ai-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--pl-purple);
    animation: plPulse 0.8s ease-in-out infinite;
  }
  
  .pl-panel-ai-dots span:nth-child(2) { animation-delay: 0.15s; }
  .pl-panel-ai-dots span:nth-child(3) { animation-delay: 0.30s; }
  
  /* Panel header-top alignment (§6) */
  .pl-panel-header-top .pl-panel-deal-icon + .pl-panel-deal-title {
    min-width: 0;
  }
  
  /* Stage progress from §6 */
  .pl-panel-stage-progress .pl-stage-step { min-width: 44px; }
  
  .pl-panel-stage-progress .pl-stage-step-dot {
    width: 14px;
    height: 14px;
  }
  
  .pl-panel-stage-progress .pl-stage-connector {
    height: 2px;
    flex: 1;
    background: var(--pl-border);
    margin-top: 6px;
    flex-shrink: 0;
  }
  
  /* ════════════════════════════════════════════════════════════
     45. GANTT — Ligne de today (surimpression sur les rows)
  ════════════════════════════════════════════════════════════ */
  .pl-gantt-rows { position: relative; }
  
  /* ════════════════════════════════════════════════════════════
     46. MODAL OVERLAY — flex display fix
     (Le JS met display:flex via style inline)
  ════════════════════════════════════════════════════════════ */
  .pl-modal-overlay[style*="flex"] { display: flex !important; }
  
  /* ════════════════════════════════════════════════════════════
     47. PRINT (export PDF basique)
  ════════════════════════════════════════════════════════════ */
  @media print {
    #plSidebar,
    #plHeader,
    .pl-toolbar,
    .pl-hero-right,
    .pl-ai-fab,
    .pl-ai-chat-panel,
    .pl-sidebar-toggle,
    [data-requires-write] { display: none !important; }
  
    #plApp    { display: block; }
    #plMain   { width: 100%; }
    #plContent { padding: 0; overflow: visible; }
  
    .pl-kanban-board {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      overflow: visible;
      gap: 8px;
    }
  
    .pl-kanban-col { max-height: none; page-break-inside: avoid; }
    .pl-deal-card  { page-break-inside: avoid; }
  
    .pl-widget { page-break-inside: avoid; }
  
    body { background: #fff !important; color: #000 !important; }
  }
  
  /* ════════════════════════════════════════════════════════════
     48. RESPONSIVE — ULTRA WIDE (≥ 1600px)
  ════════════════════════════════════════════════════════════ */
  @media (min-width: 1600px) {
    :root { --pl-sidebar-w: 280px; }
  
    #plStatsBar { grid-template-columns: repeat(6, 1fr); }
  
    .pl-kanban-col { flex: 0 0 300px; min-width: 300px; max-width: 300px; }
  
    .pl-widgets-row { grid-template-columns: repeat(3, 1fr); }
  
    #plContent { padding: 26px 32px; }
  }
  
  /* ════════════════════════════════════════════════════════════
     49. RESPONSIVE — LANDSCAPE MOBILE (≤ 768px landscape)
  ════════════════════════════════════════════════════════════ */
  @media (max-width: 768px) and (orientation: landscape) {
    #plContent { padding: 10px 14px; }
  
    .pl-hero { margin-bottom: 10px; }
    .pl-hero-title { font-size: 16px; }
  
    #plStatsBar {
      grid-template-columns: repeat(3, 1fr);
      gap: 6px;
      margin-bottom: 10px;
    }
  
    .pl-kanban-col { max-height: calc(100vh - 220px); }
  
    .pl-toolbar { padding: 6px 10px; gap: 6px; }
  }
  
  /* ════════════════════════════════════════════════════════════
     50. VARIABLES CSS SUPPLÉMENTAIRES — Fixes IE/Safari
  ════════════════════════════════════════════════════════════ */
  
  /* Safari scrollbar fix */
  .pl-kanban-board,
  .pl-kanban-col-body,
  .pl-panel-body,
  .pl-ai-chat-messages,
  #plContent {
    -webkit-overflow-scrolling: touch;
  }
  
  /* Prevent zoom on input focus (iOS) */
  @media (max-width: 768px) {
    .pl-form-input,
    .pl-form-select,
    .pl-form-textarea,
    .pl-search-filter,
    .pl-ai-chat-input,
    .pl-search-input {
      font-size: 16px; /* prevent iOS auto-zoom */
    }
  
    /* Re-override font-size back to normal after focus prevention */
    .pl-form-input:not(:focus),
    .pl-form-select:not(:focus),
    .pl-form-textarea:not(:focus),
    .pl-search-filter:not(:focus),
    .pl-ai-chat-input:not(:focus),
    .pl-search-input:not(:focus) {
      font-size: 12px;
    }
  }
  
  /* GPU acceleration pour les animations lourdes */
  .pl-deal-card,
  .pl-kanban-col,
  .pl-stat-card,
  .pl-ai-fab,
  .pl-ai-chat-panel,
  #plDealPanel {
    will-change: transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
  }
  
  /* Reduce motion pour l'accessibilité */
  @media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
    }
  
    .pl-sync-dot    { animation: none; }
    .pl-ai-fab-pulse { animation: none; }
    .pl-ai-dots span { animation: none; }
    .pl-status-dot  { animation: none; }
  }
  
  /* ════════════════════════════════════════════════════════════
     END — crm-pipeline.css v1.0
     © AlphaVault AI — All rights reserved
  ════════════════════════════════════════════════════════════ */