/* ICP Matrix - Two-panel layout: sidebar list + grid */

.icp-layout {
  display: flex;
  height: 100%;
  overflow: hidden;
}
.icp-sidebar {
  width: 300px;
  min-width: 300px;
  border-right: 1px solid var(--border);
  overflow-y: auto;
  background: var(--bg-primary, #12121a);
  transition: width 0.2s, min-width 0.2s;
  display: flex;
  flex-direction: column;
}
.icp-sidebar-header {
  padding: 14px 16px 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.icp-fold-btn {
  font-size: 16px;
  line-height: 1;
  padding: 2px 6px;
  opacity: 0.6;
  transition: opacity 0.15s, transform 0.2s;
}
.icp-fold-btn:hover { opacity: 1; }

/* Filter tabs */
.icp-sidebar-filters {
  display: flex;
  gap: 2px;
  padding: 0 12px 8px;
  flex-shrink: 0;
}
.icp-sidebar-filter-btn {
  flex: 1;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}
.icp-sidebar-filter-btn:hover {
  color: var(--text-primary);
  background: var(--bg-secondary);
}
.icp-sidebar-filter-btn.active {
  color: var(--text-primary);
  background: var(--bg-tertiary, rgba(255,255,255,0.08));
  border-color: var(--accent, #3b82f6);
}

/* Scrollable list */
.icp-sidebar-list {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

/* Folded sidebar */
.icp-sidebar-folded {
  width: 44px !important;
  min-width: 44px !important;
  overflow: hidden;
}
.icp-sidebar-folded .icp-sidebar-header span { display: none; }
.icp-sidebar-folded .icp-fold-btn { transform: rotate(180deg); }
.icp-sidebar-folded .icp-sidebar-filters { display: none; }
.icp-sidebar-folded .icp-sidebar-item { padding: 8px 10px; }
.icp-sidebar-folded .icp-sidebar-title,
.icp-sidebar-folded .icp-sidebar-item-header,
.icp-sidebar-folded .icp-sidebar-date,
.icp-sidebar-folded .icp-sidebar-sub,
.icp-sidebar-folded .icp-sidebar-stats,
.icp-sidebar-folded .icp-sidebar-ago,
.icp-sidebar-folded .icp-sidebar-sep { display: none; }
/* Colored dot indicator when folded */
.icp-sidebar-folded .icp-sidebar-item::before {
  content: '';
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  margin: 0 auto;
}
.icp-sidebar-folded .icp-sidebar-active::before {
  background: var(--accent, #3b82f6);
}
.icp-sidebar-sep {
  height: 1px;
  background: var(--border);
  margin: 4px 16px;
}
.icp-sidebar-item {
  padding: 10px 14px;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background 0.15s, border-color 0.15s;
}
.icp-sidebar-item:hover {
  background: var(--bg-secondary);
}
.icp-sidebar-active {
  background: var(--bg-secondary);
  border-left-color: var(--accent, #3b82f6);
}

/* Header row: brand + countdown */
.icp-sidebar-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 4px;
}
.icp-sidebar-brand {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--accent, #3b82f6);
  background: rgba(59, 130, 246, 0.1);
  padding: 1px 6px;
  border-radius: 3px;
  white-space: nowrap;
}
.icp-sidebar-countdown {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 3px;
  white-space: nowrap;
}
.icp-sidebar-countdown.future {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.1);
}
.icp-sidebar-countdown.urgent {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
}
.icp-sidebar-countdown.past {
  color: var(--text-muted);
  background: rgba(255,255,255,0.04);
}

/* Title - allow wrapping */
.icp-sidebar-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.3;
  /* Allow 2 lines max */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Date line */
.icp-sidebar-date {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.icp-sidebar-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.icp-sidebar-stats {
  margin-top: 6px;
}
.icp-sidebar-bar {
  height: 4px;
  background: var(--bg-tertiary, rgba(255,255,255,0.06));
  border-radius: 2px;
  overflow: hidden;
}
.icp-sidebar-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--accent, #3b82f6);
  transition: width 0.3s;
}
.icp-sidebar-bar-fill.icp-bar-high { background: #22c55e; }
.icp-sidebar-bar-fill.icp-bar-mid { background: #f59e0b; }
.icp-sidebar-nums {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}
/* Email status row */
.icp-sidebar-emails {
  font-size: 10px;
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
}
.icp-sidebar-emails .email-valid { color: #22c55e; }
.icp-sidebar-emails .email-invalid { color: #ef4444; }
.icp-sidebar-emails .email-missing { color: var(--text-muted); opacity: 0.7; }

.icp-sidebar-ago {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
  opacity: 0.6;
}
.icp-main {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0;
}

/* ICP Matrix - Company × Role grid */

.icp-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg-primary, #12121a);
}
.icp-filter-select {
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 13px;
}
.icp-search {
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 13px;
  width: 200px;
  transition: background 0.3s, border-color 0.3s;
}
/* Yellow highlight when search was restored from URL on page refresh */
.icp-search-active {
  background: rgba(250, 204, 21, 0.15);
  border-color: rgba(250, 204, 21, 0.5);
}
.icp-toggle-label {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.icp-actions {
  display: flex;
  gap: 6px;
  margin-left: auto;
}
.icp-summary {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Matrix table - single horizontal scroll only, vertical scroll is handled by parent */
.icp-matrix-wrapper {
  overflow-x: auto;
  overflow-y: auto;
  max-height: calc(100vh - 200px);
}
.icp-matrix {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.icp-matrix thead {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg-primary);
}
.icp-matrix th {
  padding: 8px 10px;
  text-align: center;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.icp-th-company {
  text-align: left !important;
  min-width: 180px;
  position: sticky;
  left: 0;
  background: var(--bg-primary);
  z-index: 3;
}
.icp-th-cat {
  min-width: 80px;
}
.icp-th-role {
  min-width: 100px;
  position: relative;
  white-space: normal;
  line-height: 1.3;
  vertical-align: bottom;
}
.icp-role-label {
  white-space: normal;
  word-break: break-word;
  line-height: 1.3;
}
.icp-role-badges {
  display: flex;
  gap: 3px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 4px;
}
.icp-role-campaign-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 4px;
  border-radius: 4px;
  background: var(--accent-bg, rgba(59,130,246,0.15));
  color: var(--accent, #3b82f6);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}
.icp-role-campaign-badge:hover {
  background: var(--accent-bg-hover, rgba(59,130,246,0.3));
}
.icp-role-campaign-badge svg {
  display: block;
}
.icp-role-campaign-add {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
  padding: 2px 4px;
  border-radius: 4px;
  background: transparent;
  border: 1px dashed var(--text-muted, #666);
  color: var(--text-muted, #666);
  cursor: pointer;
  vertical-align: middle;
  transition: all 0.15s;
  opacity: 0.4;
}
.icp-th-role:hover .icp-role-campaign-add {
  opacity: 1;
}
.icp-role-campaign-add:hover {
  background: var(--accent-bg, rgba(59,130,246,0.15));
  border-color: var(--accent, #3b82f6);
  color: var(--accent, #3b82f6);
  opacity: 1;
}
.icp-role-campaign-add svg {
  display: block;
}
.icp-role-list-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
  padding: 2px 4px;
  border-radius: 4px;
  background: transparent;
  border: 1px solid var(--text-muted, #666);
  color: var(--text-muted, #666);
  cursor: pointer;
  vertical-align: middle;
  transition: all 0.15s;
  opacity: 0.4;
}
.icp-th-role:hover .icp-role-list-badge { opacity: 1; }
.icp-role-list-badge:hover {
  background: var(--accent-bg, rgba(99,102,241,0.15));
  border-color: #6366f1;
  color: #6366f1;
  opacity: 1;
}
.icp-role-list-badge svg { display: block; }

.icp-matrix tbody tr {
  border-bottom: 1px solid var(--border-light, var(--border));
}
.icp-matrix tbody tr:hover {
  background: var(--bg-hover, rgba(255,255,255,0.03));
}

.icp-td-company {
  padding: 6px 10px;
  font-weight: 500;
  white-space: nowrap;
  position: sticky;
  left: 0;
  background: var(--bg-primary);
  z-index: 1;
}
.icp-matrix tbody tr:hover .icp-td-company {
  background: var(--bg-hover, rgba(255,255,255,0.03));
}
.icp-td-cat {
  padding: 4px 6px;
  text-align: center;
}

/* Category badges - soft pastel pills */
.icp-cat-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.icp-cat-retailer { background: rgba(59,130,246,0.1); color: #60a5fa; }
.icp-cat-brand { background: rgba(168,85,247,0.1); color: #c084fc; }
.icp-cat-eretailer { background: rgba(34,197,94,0.1); color: #4ade80; }
.icp-cat-marketplace { background: rgba(251,146,60,0.1); color: #fb923c; }
.icp-cat-media { background: rgba(236,72,153,0.1); color: #f472b6; }
.icp-cat-agency { background: rgba(163,230,53,0.1); color: #a3e635; }

/* Cells */
.icp-cell {
  padding: 6px 4px;
  text-align: center;
  position: relative;
  cursor: pointer;
  min-height: 40px;
  min-width: 70px;
  vertical-align: middle;
  transition: background 0.1s;
}
.icp-cell:hover {
  background: var(--bg-hover, rgba(255,255,255,0.06));
}
.icp-cell-focus {
  outline: 2px solid var(--accent, #3b82f6);
  outline-offset: -2px;
  border-radius: 4px;
}

/* Empty dot */
.icp-empty-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text-muted, #666);
  opacity: 0.18;
}

/* Absent mark */
.icp-absent { opacity: 0.4; }
.icp-absent-mark {
  color: var(--text-muted);
  font-size: 14px;
}

/* Not found - searched but no match */
.icp-not-found { opacity: 0.6; }
.icp-not-found-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(239,68,68,0.1);
  color: rgba(248,113,113,0.6);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

/* Multi-contact stacked bubbles */
.icp-multi-dots {
  display: flex;
  justify-content: center;
  gap: 0;
}
.icp-multi-dots .icp-contact-dot {
  margin-left: -6px;
}
.icp-multi-dots .icp-contact-dot:first-child {
  margin-left: 0;
}
.icp-multi-dots .icp-avatar,
.icp-multi-dots .icp-initials {
  width: 24px;
  height: 24px;
  font-size: 9px;
  border: 2px solid var(--bg-primary, #111);
}

/* Contact dot */
.icp-contact-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.icp-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}
.icp-initials {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent, #3b82f6);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
/* Multi-contact stacked bubbles */
.icp-multi-dots {
  display: flex;
  justify-content: center;
  gap: 0;
}
.icp-multi-dots .icp-contact-dot {
  margin-left: -6px;
}
.icp-multi-dots .icp-contact-dot:first-child {
  margin-left: 0;
}
.icp-multi-dots .icp-avatar,
.icp-multi-dots .icp-initials {
  border: 2px solid var(--bg-primary, #12121a);
}

.icp-initials-lg {
  width: 40px;
  height: 40px;
  font-size: 14px;
}

/* Email status warning dot on contact avatar */
.icp-email-warn {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--bg-primary, #12121a);
  z-index: 1;
}
.icp-email-missing { background: #f59e0b; } /* orange - no email */
.icp-email-invalid { background: #ef4444; } /* red - invalid email */
.icp-multi-dots .icp-email-warn {
  width: 8px;
  height: 8px;
  bottom: -2px;
  right: -2px;
}

/* Rich mini-profile card - positioned via JS to avoid overflow clipping */
.icp-minicard {
  display: none;
  position: fixed;
  background: var(--bg-secondary, #1a1a2e);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px 12px;
  width: 280px;
  z-index: 9999;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  text-align: left;
}

/* Card header: avatar + name */
.icp-mc-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.icp-mc-avatar {
  flex-shrink: 0;
}
.icp-mc-avatar img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}
.icp-mc-info {
  min-width: 0;
}
.icp-mc-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.icp-mc-position {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

/* Headline */
.icp-mc-headline {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light, rgba(255,255,255,0.06));
}

/* Meta row */
.icp-mc-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.icp-mc-email {
  font-size: 11px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.icp-mc-status {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.icp-mc-status-valid { background: #22c55e; }
.icp-mc-status-risky { background: #f59e0b; }
.icp-mc-status-invalid { background: #ef4444; }
.icp-mc-status-unknown, .icp-mc-status-catch_all { background: #6b7280; }

/* Tags row */
.icp-mc-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.icp-mc-tag {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255,255,255,0.06);
  color: var(--text-secondary);
  white-space: nowrap;
}
.icp-mc-tag-connected {
  background: rgba(34,197,94,0.15);
  color: #22c55e;
}
.icp-mc-tag-li {
  background: rgba(59,130,246,0.12);
  color: #60a5fa;
  text-decoration: none;
  cursor: pointer;
}
.icp-mc-tag-li:hover {
  background: rgba(59,130,246,0.25);
}

/* Campaign count badge */
.icp-campaign-count {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--accent, #3b82f6);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.icp-campaign-warn {
  background: #ef4444;
}
/* Campaign sent badge (green) */
.icp-campaign-sent {
  background: #22c55e;
}
/* Row highlight animation (from preview panel link) */
.icp-row-highlight td {
  background: rgba(59, 130, 246, 0.15) !important;
  transition: background 0.3s;
}
@keyframes icp-highlight-fade {
  0% { background: rgba(59, 130, 246, 0.25); }
  100% { background: transparent; }
}
.icp-row-highlight td {
  animation: icp-highlight-fade 3s ease-out forwards;
}

/* Cell action trigger - single "⋯" button, opens dropdown */
.icp-cell-trigger {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: none;
  background: rgba(255,255,255,0.06);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  letter-spacing: 1px;
  transition: background 0.15s, color 0.15s;
  z-index: 10;
}
.icp-cell-trigger:hover {
  background: var(--accent, #3b82f6);
  color: #fff;
}

/* Cell dropdown menu - appears below trigger */
.icp-cell-dropdown {
  position: fixed;
  z-index: 10001;
  background: var(--bg-secondary, #1a1a2e);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  padding: 4px 0;
  min-width: 180px;
  animation: icpDdIn 0.1s ease-out;
}
@keyframes icpDdIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.icp-dd-item {
  display: block;
  width: 100%;
  padding: 7px 14px;
  border: none;
  background: none;
  color: var(--text-secondary);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}
.icp-dd-item:hover { background: var(--accent, #3b82f6); color: #fff; }
.icp-dd-muted { color: var(--text-muted); }
.icp-dd-danger { color: #ef4444; }
.icp-dd-danger:hover { background: #ef4444; color: #fff; }
.icp-dd-sep {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* Add contact modal rows */
.icp-add-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 6px;
  transition: background 0.1s;
}
.icp-add-row:hover { background: rgba(255,255,255,0.03); }

/* ICP Search Modal */
.icp-search-modal {
  background: var(--bg-primary, #12121a);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 520px;
  max-width: 90vw;
  overflow: hidden;
}
.icp-sm-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.icp-sm-header h3 { font-size: 14px; font-weight: 600; margin: 0; }
.icp-sm-steps { padding: 16px 20px; display: flex; flex-direction: column; gap: 10px; }
.icp-sm-step {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-secondary); cursor: pointer;
}
.icp-sm-step.pending .icp-sm-icon { color: var(--text-muted); opacity: 0.4; }
.icp-sm-step.pending .icp-sm-name { opacity: 0.5; }
.icp-sm-step.active { color: var(--text-primary); font-weight: 600; }
.icp-sm-step.active .icp-sm-icon { color: var(--accent, #3b82f6); }
.icp-sm-step.active .icp-sm-detail { color: var(--text-secondary); font-weight: 400; }
.icp-sm-step.done { color: var(--text-secondary); }
.icp-sm-step.done .icp-sm-icon { color: #6b7280; }
.icp-sm-step.found { color: #22c55e; font-weight: 500; }
.icp-sm-step.found .icp-sm-icon { color: #22c55e; }
.icp-sm-step.skipped { color: var(--text-muted); opacity: 0.5; }
.icp-sm-icon { width: 20px; text-align: center; flex-shrink: 0; font-size: 14px; }
.icp-sm-name { flex-shrink: 0; min-width: 180px; }
.icp-sm-detail { margin-left: auto; font-size: 11px; color: var(--text-muted); text-align: right; }
/* Expandable drawer inside each step */
.icp-sm-drawer {
  width: 100%; margin-top: 6px; padding: 8px 10px;
  background: rgba(0,0,0,0.15); border-radius: 6px;
  font-size: 11px; line-height: 1.5; max-height: 300px; overflow-y: auto;
}
.icp-sm-candidates { margin-bottom: 8px; }
.icp-sm-cand { padding: 2px 0; display: flex; align-items: baseline; gap: 6px; }
.icp-sm-cand-pos { color: var(--text-muted); font-size: 10px; flex: 1; }
.icp-sm-cand-score { color: var(--accent); font-size: 10px; white-space: nowrap; }
.icp-sm-payload { margin-top: 6px; }
.icp-sm-payload pre {
  margin: 4px 0 0; padding: 6px 8px; background: rgba(0,0,0,0.2); border-radius: 4px;
  font-size: 10px; white-space: pre-wrap; word-break: break-all; max-height: 150px; overflow-y: auto;
}
.icp-sm-result { padding: 12px 20px 16px; border-top: 1px solid var(--border); }
/* Candidate pick list in result */
.icp-sm-pick-header { font-size: 12px; color: var(--text-secondary); margin-bottom: 8px; }
.icp-sm-pick-list { display: flex; flex-direction: column; gap: 6px; }
.icp-sm-pick-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border);
  transition: background 0.1s;
}
.icp-sm-pick-item:hover { background: rgba(255,255,255,0.03); }
.icp-sm-pick-selected { border-color: #22c55e; background: rgba(34,197,94,0.06); }
.icp-sm-pick-info { flex: 1; min-width: 0; font-size: 13px; }
.icp-sm-pick-pos { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.icp-sm-pick-badge { font-size: 10px; color: #22c55e; background: rgba(34,197,94,0.12); padding: 1px 5px; border-radius: 3px; }
.icp-sm-pick-actions { display: flex; gap: 4px; flex-shrink: 0; }
.icp-sm-success { color: #22c55e; font-size: 13px; }
.icp-sm-notfound { color: var(--text-muted); font-size: 13px; }

/* Empty state */
.icp-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

/* "Autres" column - unassigned contacts */
.icp-th-others { min-width: 100px; }
.icp-others-cell { min-width: 100px; }
.icp-others-bubbles {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}
.icp-others-bubbles > * { margin-left: -4px; }
.icp-others-bubbles > *:first-child { margin-left: 0; }
.icp-avatar-sm { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; border: 2px solid var(--bg-primary, #111); }
.icp-initials-sm { width: 22px; height: 22px; font-size: 8px; border: 2px solid var(--bg-primary, #111); }
.icp-others-more {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(255,255,255,0.08); color: var(--text-muted);
  font-size: 9px; font-weight: 600; border: 2px solid var(--bg-primary, #111);
}

/* Unassigned panel (slide-in right) - same width as contact preview (460px) */
.icp-unassigned-panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: 460px; max-width: 90vw;
  background: var(--bg-secondary, #1a1a2e); border-left: 1px solid var(--border);
  z-index: 400; overflow-y: auto; box-shadow: -8px 0 24px rgba(0,0,0,0.4);
  animation: slideInRight 0.2s ease-out;
}
@keyframes slideInRight { from { transform: translateX(100%); } to { transform: translateX(0); } }
.icp-up-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  font-size: 14px; position: sticky; top: 0;
  background: var(--bg-secondary, #1a1a2e); z-index: 1;
}
.icp-up-list { padding: 8px 0; }
.icp-up-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px; transition: background 0.1s;
}
.icp-up-item:hover { background: rgba(255,255,255,0.03); }
.icp-up-avatar { flex-shrink: 0; }
.icp-up-avatar img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.icp-up-info { flex: 1; min-width: 0; }
.icp-up-name { font-size: 13px; font-weight: 500; }
.icp-up-position { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icp-up-meta { display: flex; gap: 6px; align-items: center; font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
/* Role assignment hover dropdown */
.icp-assign-wrap {
  position: relative; flex-shrink: 0;
}
.icp-assign-btn {
  font-size: 11px !important; padding: 4px 10px !important;
  white-space: nowrap;
}
.icp-assign-menu {
  display: none; position: absolute; right: 0; top: 100%; margin-top: 2px;
  background: var(--bg-primary, #12121a); border: 1px solid var(--border);
  border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 50; min-width: 180px; padding: 4px 0;
}
.icp-assign-wrap:hover .icp-assign-menu { display: block; }
.icp-assign-opt {
  padding: 7px 14px; font-size: 12px; cursor: pointer;
  color: var(--text-secondary); transition: background 0.1s, color 0.1s;
}
.icp-assign-opt:hover {
  background: var(--accent, #3b82f6); color: #fff;
}

/* Company preview panel - same width as contact preview (460px), stacks UNDER it */
.icp-company-panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: 460px; max-width: 90vw;
  background: var(--bg-secondary, #1a1a2e); border-left: 1px solid var(--border);
  z-index: 400; overflow-y: auto; box-shadow: -8px 0 24px rgba(0,0,0,0.4);
  animation: slideInRight 0.2s ease-out;
}
.icp-cp-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 20px 12px; position: sticky; top: 0;
  background: var(--bg-secondary, #1a1a2e); z-index: 1;
  border-bottom: 1px solid var(--border);
}
.icp-cp-title { font-size: 16px; font-weight: 600; }
.icp-cp-info {
  padding: 16px 20px; display: flex; flex-wrap: wrap; gap: 8px 16px;
  border-bottom: 1px solid var(--border);
}
.icp-cp-field { font-size: 12px; }
.icp-cp-label { color: var(--text-muted); }
.icp-cp-value { color: var(--text-primary); font-weight: 500; }
.icp-cp-section-title {
  padding: 12px 20px 8px; font-size: 12px; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em;
}
.icp-cp-contacts { padding: 0 0 16px; }
.icp-cp-contact {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 20px; transition: background 0.1s;
}
.icp-cp-contact:hover { background: rgba(255,255,255,0.03); }
.icp-cp-ct-info { flex: 1; min-width: 0; }

/* Company name hover effect in matrix */
.icp-td-company:hover { color: var(--accent, #3b82f6); text-decoration: underline; }

/* Replace warning inline */
.icp-up-warn {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 6px; padding: 8px 10px; border-radius: 8px;
  background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.3);
  font-size: 12px; color: var(--text-secondary);
}
.icp-up-warn span { flex: 1; min-width: 120px; }

/* Roles management modal */
.icp-roles-modal {
  background: var(--bg-primary, #12121a);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 640px;
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
}
.icp-rm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.icp-rm-header h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
}
.icp-rm-list {
  padding: 8px 0;
}
.icp-rm-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px;
  border-bottom: 1px solid var(--border-light, rgba(255,255,255,0.04));
  transition: background 0.1s;
}
.icp-rm-row:hover {
  background: rgba(255,255,255,0.02);
}
.icp-rm-order {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0;
}
.icp-rm-info {
  flex: 1;
  min-width: 0;
}
.icp-rm-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}
.icp-rm-slug {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono, monospace);
}
.icp-rm-max {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.icp-rm-max-label {
  font-size: 11px;
  color: var(--text-muted);
}
.icp-rm-max-select {
  padding: 3px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 12px;
  width: 44px;
  text-align: center;
}
.icp-rm-add {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
}

/* Add company bar (below the table) */
.icp-add-bar {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px dashed var(--border-light, rgba(255,255,255,0.06));
}
.icp-add-bar .btn {
  font-size: 12px;
  color: var(--text-muted);
}
.icp-add-bar .btn:hover {
  color: var(--accent, #3b82f6);
}

/* Pagination */
.icp-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-secondary);
}

/* Cell searching/loading state - hourglass icon */
.icp-cell-loading {
  position: relative;
}
.icp-cell-loading::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 24px; height: 24px;
  margin: -12px 0 0 -12px;
  border-radius: 50%;
  border: 2.5px solid rgba(59,130,246,0.15);
  border-top-color: var(--accent, #3b82f6);
  animation: icpSpin 0.8s linear infinite;
}
@keyframes icpSpin {
  to { transform: rotate(360deg); }
}
@keyframes icpFlash {
  0% { background: rgba(59,130,246,0.2); }
  100% { background: transparent; }
}
