/* ============================================================================
   Overseer GTM Dashboard - Styles
   A dark, refined aesthetic with blue accents
   ============================================================================ */

/* CSS Variables */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #111118;
    --bg-card: #16161f;
    --bg-hover: #1e1e2a;
    
    --text-primary: #e8e8ed;
    --text-secondary: #9898a8;
    --text-muted: #6b6b7a;
    
    --accent-primary: #3b82f6;
    --accent-secondary: #60a5fa;
    --accent-glow: rgba(59, 130, 246, 0.15);
    
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #06b6d4;
    
    --border-color: #2a2a3a;
    --border-focus: #3b82f6;
    
    --font-sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'IBM Plex Mono', 'Consolas', monospace;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
    
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    
    --transition: 150ms ease;
}

/* Import fonts */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* ============================================================================
   Navbar
   ============================================================================ */

.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 2rem;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.brand-icon {
    font-size: 1.5rem;
    color: var(--accent-primary);
}

.brand-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    height: 36px;
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

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

.nav-link.active {
    color: var(--accent-secondary);
    background: var(--accent-glow);
}

.nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.nav-icon svg {
    width: 16px;
    height: 16px;
}

/* Nav Dropdown */
.nav-dropdown-wrapper {
    position: relative;
}

.nav-dropdown-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    height: 36px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
}

.nav-dropdown-arrow {
    opacity: 0.6;
    transition: transform var(--transition);
}

.nav-dropdown-menu.visible + .nav-dropdown-trigger .nav-dropdown-arrow,
.nav-dropdown-wrapper:has(.nav-dropdown-menu.visible) .nav-dropdown-arrow {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 180px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 150ms ease;
    z-index: 150;
    padding: 0.5rem 0;
}

.nav-dropdown-menu.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition);
}

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

.nav-dropdown-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
}

.nav-dropdown-icon svg {
    width: 14px;
    height: 14px;
}

.nav-dropdown-item:hover .nav-dropdown-icon {
    opacity: 1;
}

.nav-dropdown-label {
    flex: 1;
}

.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--accent-primary);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 9px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.status-indicator {
    color: var(--success);
}

.status-indicator.error {
    color: var(--error);
}

/* Agent Queue Indicators */
.agent-queue-indicators {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-right: 1rem;
    padding-right: 1rem;
    border-right: 1px solid var(--border);
}

.agent-queue-badge {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s;
}

.agent-queue-badge:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.agent-queue-badge.has-items {
    color: var(--accent-blue);
}

.agent-queue-badge svg {
    width: 16px;
    height: 16px;
}

.agent-queue-badge .badge-icon {
    font-size: 16px;
    line-height: 1;
}

.agent-queue-badge .badge-count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    font-size: 10px;
    font-weight: 600;
    line-height: 16px;
    text-align: center;
    color: #fff;
    background: var(--text-muted);
    border-radius: 8px;
}

.agent-queue-badge.has-items .badge-count {
    background: var(--accent-blue);
}

/* User Navigation */
.nav-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: 1rem;
    padding-left: 1rem;
    border-left: 1px solid var(--border-color);
}

.user-badge {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.1rem;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.user-role {
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent-secondary);
    background: rgba(96, 165, 250, 0.1);
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
}

.btn-logout {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.75rem;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
}

.btn-logout:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Profile Dropdown */
.profile-dropdown {
    position: relative;
}

.profile-trigger {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-md);
    transition: background var(--transition);
}

.profile-trigger:hover {
    background: var(--bg-hover);
}

.profile-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), #a855f7);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.dropdown-arrow {
    color: var(--text-muted);
    transition: transform var(--transition);
}

.profile-trigger:hover .dropdown-arrow {
    color: var(--text-secondary);
}

.profile-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 150ms ease;
    z-index: 200;
}

.profile-menu.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.profile-header {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.profile-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.profile-email {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.profile-role-badge {
    display: inline-block;
    width: fit-content;
    margin-top: 0.35rem;
    padding: 0.15rem 0.5rem;
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 4px;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0;
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    text-align: left;
    color: var(--text-secondary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

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

.dropdown-item-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

/* ============================================================================
   Dashboard Layout
   ============================================================================ */

.dashboard {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.dashboard-header {
    margin-bottom: 2rem;
}

.dashboard-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.dashboard-header .subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* ============================================================================
   Metrics Grid
   ============================================================================ */

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.metric-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition);
}

.metric-card:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 0 20px var(--accent-glow);
}

.metric-card.highlight {
    background: linear-gradient(135deg, var(--accent-glow), transparent);
    border-color: var(--accent-primary);
}

a.metric-card.metric-link {
    text-decoration: none;
    cursor: pointer;
}

a.metric-card.metric-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px var(--accent-glow);
}

.metric-icon {
    font-size: 1.5rem;
}

.metric-content {
    display: flex;
    flex-direction: column;
}

.metric-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-mono);
}

.metric-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ============================================================================
   Content Grid
   ============================================================================ */

.content-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

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

/* ============================================================================
   Cards
   ============================================================================ */

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

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.card-header h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.header-select {
    font-size: 0.8rem;
    padding: 0.35rem 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color var(--transition);
    min-width: 140px;
    flex-shrink: 0;
}

.header-select:hover {
    border-color: var(--accent-secondary);
}

.header-select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.card-link {
    font-size: 0.75rem;
    color: var(--accent-secondary);
    text-decoration: none;
    transition: color var(--transition);
}

.card-link:hover {
    color: var(--accent-primary);
}

.card-body {
    padding: 1.25rem;
}

/* ============================================================================
   Todo List
   ============================================================================ */

.todo-list {
    list-style: none;
    max-height: 200px;
    overflow-y: auto;
}

.todo-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
    transition: all var(--transition);
}

.todo-item:last-child {
    margin-bottom: 0;
}

.todo-type {
    padding: 0.25rem 0.5rem;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

.todo-type.outreach { background: var(--accent-glow); color: var(--accent-secondary); }
.todo-type.follow_up { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.todo-type.call_prep { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.todo-type.call_action { background: rgba(6, 182, 212, 0.15); color: var(--info); }
.todo-type.research_individual { background: rgba(139, 92, 246, 0.15); color: #a78bfa; }

.todo-content {
    flex: 1;
}

.todo-description {
    font-size: 0.875rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.todo-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.todo-due {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.todo-loading {
    color: var(--text-muted);
    font-style: italic;
    padding: 1rem 0;
}

/* ============================================================================
   Pipeline Chart
   ============================================================================ */

.pipeline-chart {
    display: flex;
    height: 24px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-secondary);
    margin-bottom: 1rem;
}

.pipeline-segment {
    height: 100%;
    transition: all var(--transition);
    position: relative;
    cursor: pointer;
    text-decoration: none;
}

.pipeline-segment:hover {
    filter: brightness(1.2);
    transform: scaleY(1.15);
}

.pipeline-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
}

.legend-item.clickable {
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    margin: -0.25rem -0.5rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

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

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

/* Pipeline colors */
.status-not_started { background: #374151; }
.status-research_in_progress { background: #8b5cf6; }
.status-research_complete { background: #3b82f6; }
.status-outreach_started { background: #06b6d4; }
.status-trying_to_contact { background: #f97316; }
.status-in_contact { background: #ec4899; }
.status-outreach_paused { background: #f59e0b; }
.status-qualified_out { background: #6b7280; }
.status-prospect { background: #10b981; }
.status-opportunity { background: #22c55e; }
.status-customer { background: #84cc16; }

/* ============================================================================
   Region Bars
   ============================================================================ */

.chart-subtitle {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.region-bars,
.segment-bars {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.region-bar-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: inherit;
}

.region-bar-item.clickable {
    cursor: pointer;
    border-radius: var(--radius-sm);
    padding: 0.25rem;
    margin: -0.25rem;
    transition: all var(--transition);
}

.region-bar-item.clickable:hover {
    background: var(--bg-hover);
}

.region-name {
    width: 120px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.region-bar-container {
    flex: 1;
    height: 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.region-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: var(--radius-sm);
    transition: width 0.5s ease;
}

/* Region-specific bar colors */
.region-fill-europe {
    background: linear-gradient(90deg, #22c55e, #16a34a);
}

.region-fill-north-america {
    background: linear-gradient(90deg, #06b6d4, #0891b2);
}

.region-fill-asia-pacific {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

.region-fill-middle-east-africa {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

.region-fill-latin-america {
    background: linear-gradient(90deg, #8b5cf6, #7c3aed);
}

/* Segment-specific bar colors */
.segment-fill-research-accelerators {
    background: linear-gradient(90deg, #3b82f6, #2563eb);
}

.segment-fill-asset-creators {
    background: linear-gradient(90deg, #a855f7, #9333ea);
}

.segment-fill-insight-hunters {
    background: linear-gradient(90deg, #ec4899, #db2777);
}

.segment-fill-velocity-seekers {
    background: linear-gradient(90deg, #f97316, #ea580c);
}

.region-count {
    width: 30px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
    font-family: var(--font-mono);
}

/* ============================================================================
   Activity Feed
   ============================================================================ */

.activity-feed {
    list-style: none;
    max-height: 300px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: 50%;
    font-size: 0.875rem;
}

.activity-content {
    flex: 1;
}

.activity-action {
    font-size: 0.875rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.activity-action strong {
    color: var(--accent-secondary);
}

.activity-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.activity-user-badge {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
    font-size: 0.65rem;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.assigned-user-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    background: rgba(96, 165, 250, 0.15);
    color: var(--accent-secondary);
    font-size: 0.7rem;
    font-weight: 500;
    border-radius: 4px;
    margin-right: 0.5rem;
}

.activity-org {
    color: var(--text-muted);
    font-size: 0.875em;
}

.activity-loading {
    color: var(--text-muted);
    font-style: italic;
    padding: 1rem 0;
}

/* ============================================================================
   Targets Card
   ============================================================================ */

.targets-card {
    margin-bottom: 1.5rem;
}

.targets-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.target-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.target-progress {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: visible;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 4px;
    transition: width 0.5s ease;
}

.progress-expected-marker {
    position: absolute;
    top: -2px;
    bottom: -2px;
    width: 2px;
    background: var(--text-muted);
    border-radius: 1px;
    transition: left 0.3s ease;
}

.progress-expected-marker::after {
    content: '';
    position: absolute;
    top: -3px;
    left: -2px;
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
}

.progress-text {
    font-size: 0.875rem;
    font-weight: 600;
    font-family: var(--font-mono);
    color: var(--text-primary);
    white-space: nowrap;
}

.target-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ============================================================================
   Footer
   ============================================================================ */

.footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    border-top: 1px solid var(--border-color);
    margin-top: 2rem;
}

/* ============================================================================
   Prospects Page
   ============================================================================ */

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
}

/* Filters */
.filters-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.filter-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-select {
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    min-width: 150px;
}

.filter-select:focus {
    outline: none;
    border-color: var(--border-focus);
}

.filter-input {
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    min-width: 200px;
}

.filter-input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.filter-input::placeholder {
    color: var(--text-muted);
}

.search-group {
    flex: 1;
    min-width: 200px;
    max-width: 350px;
}

.search-group .filter-input {
    width: 100%;
}

/* Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--bg-secondary);
}

.data-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: color var(--transition);
}

.data-table th.sortable:hover {
    color: var(--accent-secondary);
}

.data-table th.sortable .sort-indicator {
    display: inline-block;
    width: 1em;
    margin-left: 0.25rem;
    opacity: 0.3;
}

.data-table th.sortable .sort-indicator::after {
    content: '⇅';
    font-size: 0.8em;
}

.data-table th.sortable.sort-asc .sort-indicator::after {
    content: '↑';
    opacity: 1;
}

.data-table th.sortable.sort-desc .sort-indicator::after {
    content: '↓';
    opacity: 1;
}

.data-table th.sortable.sort-asc .sort-indicator,
.data-table th.sortable.sort-desc .sort-indicator {
    opacity: 1;
    color: var(--accent-primary);
}

.data-table tr:hover {
    background: var(--bg-hover);
}

.data-table td {
    font-size: 0.875rem;
}

.data-table a {
    color: var(--accent-secondary);
    text-decoration: none;
}

.data-table a:hover {
    text-decoration: underline;
}

/* Status Badge */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

.status-badge.not_started { background: #374151; color: #9ca3af; }
.status-badge.research_in_progress { background: rgba(139, 92, 246, 0.2); color: #a78bfa; }
.status-badge.research_complete { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.status-badge.awaiting_individual_research { background: rgba(139, 92, 246, 0.2); color: #a78bfa; }
.status-badge.contact_queued { background: rgba(6, 182, 212, 0.2); color: #22d3ee; }
.status-badge.outreach_started { background: rgba(6, 182, 212, 0.2); color: #22d3ee; }
.status-badge.outreach_paused { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.status-badge.exhausted { background: #374151; color: #6b7280; }
.status-badge.qualified_out { background: #374151; color: #6b7280; }
.status-badge.prospect { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.status-badge.opportunity { background: rgba(34, 197, 94, 0.2); color: #4ade80; }
.status-badge.customer { background: rgba(132, 204, 22, 0.2); color: #a3e635; }

.status-badge.stub { background: #374151; color: #9ca3af; }
.status-badge.not_contacted { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.status-badge.queued { background: rgba(139, 92, 246, 0.2); color: #a78bfa; }
.status-badge.trying_to_contact { background: rgba(6, 182, 212, 0.2); color: #22d3ee; }
.status-badge.no_response { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.status-badge.responded { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.status-badge.in_contact { background: rgba(34, 197, 94, 0.2); color: #4ade80; }
.status-badge.call_scheduled { background: rgba(132, 204, 22, 0.2); color: #a3e635; }
.status-badge.call_completed { background: rgba(132, 204, 22, 0.2); color: #a3e635; }
.status-badge.qualified { background: rgba(132, 204, 22, 0.3); color: #bef264; }
.status-badge.nurturing { background: rgba(6, 182, 212, 0.2); color: #22d3ee; }
.status-badge.disqualified { background: #374151; color: #6b7280; }
.status-badge.not_now { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.status-badge.not_interested { background: #374151; color: #6b7280; }
.status-badge.bounced { background: rgba(239, 68, 68, 0.2); color: #f87171; }

/* Tier Badge */
.tier-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 50%;
    font-family: var(--font-mono);
}

.tier-badge.tier-1 { background: rgba(132, 204, 22, 0.2); color: #a3e635; }
.tier-badge.tier-2 { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.tier-badge.tier-3 { background: rgba(107, 114, 128, 0.2); color: #9ca3af; }

/* ============================================================================
   Individual Page
   ============================================================================ */

.individual-header {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
}

.individual-info {
    flex: 1;
}

.individual-name {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.individual-org {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.individual-org a {
    color: var(--accent-secondary);
    text-decoration: none;
}

.individual-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.meta-item strong {
    color: var(--text-primary);
}

.individual-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.action-btn {
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all var(--transition);
}

.action-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
}

.action-btn.primary {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.action-btn.primary:hover {
    background: var(--accent-secondary);
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.625rem;
    top: 0.25rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent-primary);
    border: 2px solid var(--bg-card);
}

.timeline-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.timeline-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
}

.timeline-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.timeline-body {
    font-size: 0.875rem;
    color: var(--text-secondary);
    white-space: pre-wrap;
}

/* Clickable timeline items */
.timeline-item-link {
    cursor: pointer;
    transition: transform 0.15s ease;
}

.timeline-item-link:hover .timeline-content {
    border-color: var(--accent-primary);
    background: var(--bg-primary);
}

.timeline-item-link:hover {
    transform: translateX(4px);
}

/* Markdown content styling */
.markdown-content {
    line-height: 1.7;
    color: var(--text-primary);
}

.markdown-content h1 {
    font-size: 1.5rem;
    margin: 1.5rem 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.markdown-content h2 {
    font-size: 1.25rem;
    margin: 1.25rem 0 0.75rem 0;
    color: var(--accent-primary);
}

.markdown-content h3 {
    font-size: 1.1rem;
    margin: 1rem 0 0.5rem 0;
    color: var(--text-secondary);
}

.markdown-content p {
    margin: 0.75rem 0;
}

.markdown-content ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.markdown-content li {
    margin: 0.25rem 0;
}

.markdown-content strong {
    color: var(--text-primary);
}

.markdown-content hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 1.5rem 0;
}

/* Call preview in timeline */
.call-preview {
    border-left: 2px solid var(--border-color);
    padding-left: 0.75rem;
    font-style: italic;
}

/* Message Thread */
.message-thread {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    padding: 1rem;
    border-radius: var(--radius-md);
    max-width: 80%;
}

.message.outbound {
    background: var(--accent-glow);
    border: 1px solid var(--accent-primary);
    margin-left: auto;
}

.message.inbound {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

.message-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.message-subject {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.message-body {
    font-size: 0.875rem;
    color: var(--text-secondary);
    white-space: pre-wrap;
}

.message-body-truncated {
    font-size: 0.875rem;
    color: var(--text-secondary);
    white-space: pre-wrap;
    max-height: 100px;
    overflow: hidden;
    position: relative;
}

.message-body-truncated::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(transparent, var(--bg-card));
}

.message-view-full {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--accent-secondary);
    text-decoration: none;
}

.message-view-full:hover {
    text-decoration: underline;
}

/* Bounce indicator */
.message.bounced {
    border-left: 3px solid var(--error);
}

.message-bounce-banner {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid var(--error);
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--error);
}

.message-bounce-banner .bounce-icon {
    font-size: 1rem;
}

.bounce-tag {
    display: inline-block;
    background: rgba(239, 68, 68, 0.2);
    color: var(--error);
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    text-transform: uppercase;
    font-weight: 600;
    margin-left: 0.5rem;
}

/* ============================================================================
   Scrollbar
   ============================================================================ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ============================================================================
   Tracking Section
   ============================================================================ */

.tracking-card {
    margin-top: 1.5rem;
}

.tracking-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
}

.tracking-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none;
    color: inherit;
}

.tracking-item.clickable {
    cursor: pointer;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    transition: all var(--transition);
}

.tracking-item.clickable:hover {
    background: var(--bg-hover);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.tracking-value {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
}

.tracking-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}

/* ============================================================================
   Actions List
   ============================================================================ */

.actions-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.action-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.action-card:hover {
    border-color: var(--accent-primary);
    background: var(--bg-hover);
}

.action-card.overdue {
    border-left: 3px solid var(--error);
}

.action-card.due-today {
    border-left: 3px solid var(--warning);
}

.action-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

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

.action-title {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.action-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.action-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.action-due {
    font-weight: 500;
}

.action-due.overdue {
    color: var(--error);
}

.action-due.due-today {
    color: var(--warning);
}

/* Task Cards (unified task view) */
.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.task-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.task-card:hover {
    border-color: var(--accent-primary);
    background: var(--bg-hover);
}

.task-card.overdue {
    border-left: 3px solid var(--error);
}

.task-card.due-today {
    border-left: 3px solid var(--warning);
}

.task-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

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

.task-title {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.task-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    align-items: center;
}

.task-due {
    font-weight: 500;
}

.task-due.overdue {
    color: var(--error);
}

.task-due.due-today {
    color: var(--warning);
}

.task-status {
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 600;
}

.task-status.status-pending {
    background: var(--warning-bg, rgba(255, 193, 7, 0.2));
    color: var(--warning);
}

.task-status.status-completed {
    background: var(--success-bg, rgba(40, 167, 69, 0.2));
    color: var(--success);
}

.task-status.status-cancelled {
    background: var(--text-muted);
    color: var(--bg-primary);
}

.task-status.status-resolved {
    background: var(--success-bg, rgba(40, 167, 69, 0.2));
    color: var(--success);
}

/* ============================================================================
   Decisions Page
   ============================================================================ */

.decision-card.pending {
    border-left: 3px solid var(--warning);
}

.decision-card.resolved {
    border-left: 3px solid var(--success);
    opacity: 0.7;
}

.decision-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.option-pill {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background: var(--bg-tertiary, var(--bg-secondary));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.decision-context {
    margin: 0.5rem 0;
    padding: 0.5rem;
    background: var(--bg-tertiary, var(--bg-secondary));
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: pre-wrap;
    max-height: 100px;
    overflow: hidden;
}

/* ============================================================================
   Activity List (Full Page)
   ============================================================================ */

.activity-list-full {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.activity-item-full {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    transition: all var(--transition);
}

.activity-item-full:hover {
    background: var(--bg-hover);
}

.activity-item-full.clickable {
    cursor: pointer;
}

.activity-date-group {
    margin-bottom: 0.5rem;
}

.activity-date-header {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0.5rem;
}

.activity-full-content {
    flex: 1;
}

.activity-full-title {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.activity-full-detail {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.activity-full-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* ============================================================================
   Context Cards (for action/activity details)
   ============================================================================ */

.context-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1rem;
}

.context-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.context-card-title {
    font-weight: 600;
    color: var(--text-primary);
}

.context-card-link {
    font-size: 0.75rem;
    color: var(--accent-secondary);
    text-decoration: none;
}

.context-card-link:hover {
    text-decoration: underline;
}

.person-summary {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.person-avatar {
    width: 48px;
    height: 48px;
    background: var(--accent-glow);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--accent-primary);
    flex-shrink: 0;
}

.person-info {
    flex: 1;
}

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

.person-role {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.person-org {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Message thread display */
.message-display {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-top: 0.5rem;
}

.message-display-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.message-display-subject {
    font-weight: 500;
    color: var(--accent-secondary);
    margin-bottom: 0.5rem;
}

.message-display-body {
    color: var(--text-secondary);
    font-size: 0.875rem;
    white-space: pre-wrap;
    line-height: 1.6;
}

/* Multiple Recipients Display */
.recipient-count {
    font-size: 0.75rem;
    color: var(--accent-color);
    font-weight: 500;
    margin-left: 0.25rem;
}

.recipients-header {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.recipients-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.recipient-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.recipient-item:hover {
    background: var(--hover-color);
    border-color: var(--accent-color);
}

.recipient-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.recipient-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.recipient-name {
    font-weight: 500;
    color: var(--text-primary);
}

.recipient-role,
.recipient-org {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.primary-recipient-badge {
    display: inline-block;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    margin-left: 0.5rem;
}

.loading-placeholder {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    border: none;
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
}

.btn-primary {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

.btn-primary:hover {
    background: var(--accent-secondary);
}

/* Page Header */
.page-header {
    margin-bottom: 1rem;
}

.back-link {
    color: var(--accent-secondary);
    text-decoration: none;
    font-size: 0.875rem;
}

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

/* Action Detail */
.action-detail-description {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.action-links {
    display: flex;
    gap: 0.5rem;
}

.text-accent {
    color: var(--accent-primary);
}

/* Clickable items */
.todo-item.clickable {
    cursor: pointer;
}

.todo-item.clickable:hover {
    border-color: var(--accent-primary);
    background: var(--bg-hover);
}

.todo-item.overdue {
    border-left: 3px solid var(--error);
}

.todo-item.overdue .todo-date {
    color: var(--error);
    font-weight: 600;
}

.todo-item.due-today {
    border-left: 3px solid var(--warning);
}

.todo-item.due-today .todo-date {
    color: var(--warning);
    font-weight: 600;
}

.due-indicator {
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.2rem 0.4rem;
    border-radius: var(--radius-sm);
    margin-left: 0.5rem;
}

.due-indicator.overdue {
    background: var(--error);
    color: white;
}

.due-indicator.due-today {
    background: var(--warning);
    color: var(--bg-primary);
}

.todo-due-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.activity-item.clickable {
    cursor: pointer;
}

.activity-item.clickable:hover {
    background: var(--bg-hover);
}

.activity-link {
    color: var(--accent-secondary);
    text-decoration: none;
    font-weight: 600;
}

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

/* Email links */
.email-link {
    color: var(--accent-secondary);
    text-decoration: none;
}

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

/* Message type tags */
.msg-type-tag {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.msg-type-tag.initial_outreach {
    background: var(--accent-glow);
    color: var(--accent-primary);
}

.msg-type-tag.follow_up_1 {
    background: rgba(255, 193, 7, 0.15);
    color: #f0ad4e;
}

/* follow_up_2 removed - only one follow-up now */

.msg-type-tag.inbound {
    background: rgba(40, 167, 69, 0.15);
    color: #28a745;
}

.msg-type-tag.other {
    background: var(--bg-secondary);
    color: var(--text-muted);
}

/* Messages Page */
.messages-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.messages-date-group {
    margin-bottom: 1rem;
}

.messages-date-header {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0.5rem;
}

.message-row {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
}

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

.message-row.bounced {
    border-left: 3px solid var(--error);
    background: rgba(239, 68, 68, 0.05);
}

.message-row.bounced:hover {
    background: rgba(239, 68, 68, 0.1);
}

.message-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

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

.message-row-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.25rem;
}

.message-contact {
    font-size: 0.875rem;
}

.message-row-subject {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.message-row-preview {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.message-row-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.filter-search {
    flex: 1;
}

.text-muted {
    color: var(--text-muted);
}

/* Tags for multi-value fields */
.tag {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    margin: 0.1rem;
    white-space: nowrap;
}

/* Segment colors - each segment has a distinct color */
.tag-segment {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-primary);
}

.tag-segment-research-accelerators {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.tag-segment-asset-creators {
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
}

.tag-segment-insight-hunters {
    background: rgba(236, 72, 153, 0.15);
    color: #ec4899;
}

.tag-segment-velocity-seekers {
    background: rgba(249, 115, 22, 0.15);
    color: #f97316;
}

/* Region colors - each region has a distinct color */
.tag-region {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.tag-region-europe {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.tag-region-north-america {
    background: rgba(6, 182, 212, 0.15);
    color: #06b6d4;
}

.tag-region-asia-pacific {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.tag-region-middle-east-africa {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.tag-region-latin-america {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
}

/* Organisation Detail Page */
.org-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.org-info {
    flex: 1;
}

.org-name {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.5rem;
}

.org-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.org-actions {
    display: flex;
    gap: 0.5rem;
}

.org-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    text-align: center;
}

.org-stat {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.org-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-primary);
}

.org-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Individuals List */
.individuals-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.individual-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: inherit;
    transition: all var(--transition);
}

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

.ind-name {
    flex: 1;
    font-weight: 500;
    color: var(--text-primary);
}

.ind-role {
    flex: 1;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.ind-status {
    font-size: 0.75rem;
}

/* Compact Activity List */
.activity-item-compact {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.activity-item-compact:last-child {
    border-bottom: none;
}

.activity-desc {
    flex: 1;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.activity-desc strong {
    color: var(--text-primary);
}

/* ============================================================================
   Global Search Bar
   ============================================================================ */

.global-search-wrapper {
    position: relative;
    margin-right: 1rem;
}

.global-search-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition);
}

.global-search-trigger:hover {
    border-color: var(--accent-primary);
    color: var(--text-secondary);
}

.global-search-trigger svg {
    flex-shrink: 0;
}

.global-search-shortcut {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    background: var(--bg-hover);
    border-radius: 3px;
    font-family: var(--font-mono);
}

.global-search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10vh;
}

.global-search-overlay.visible {
    display: flex;
}

.global-search-modal {
    width: 90%;
    max-width: 640px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: searchModalIn 0.15s ease-out;
}

@keyframes searchModalIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.global-search-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.global-search-header svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.global-search-input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: var(--font-sans);
    outline: none;
}

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

.global-search-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all var(--transition);
}

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

.global-search-results {
    max-height: 400px;
    overflow-y: auto;
}

.global-search-empty {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
}

.global-search-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem;
    color: var(--text-muted);
}

.global-search-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.global-search-section {
    padding: 0.5rem;
}

.global-search-section-title {
    padding: 0.5rem 0.75rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.global-search-result {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: background var(--transition);
}

.global-search-result:hover,
.global-search-result.selected {
    background: var(--bg-hover);
}

.global-search-result-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    flex-shrink: 0;
}

.global-search-result-content {
    flex: 1;
    min-width: 0;
}

.global-search-result-title {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.15rem;
}

.global-search-result-title mark {
    background: rgba(59, 130, 246, 0.3);
    color: inherit;
    padding: 0.05rem 0.1rem;
    border-radius: 2px;
}

.global-search-result-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.global-search-result-type {
    font-size: 0.7rem;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    text-transform: uppercase;
}

.global-search-result-type.organisation { background: rgba(99, 102, 241, 0.2); color: #818cf8; }
.global-search-result-type.individual { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.global-search-result-type.knowledgebase { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }

.global-search-result-snippet {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.global-search-result-snippet mark {
    background: rgba(59, 130, 246, 0.3);
    color: inherit;
    padding: 0.05rem 0.1rem;
    border-radius: 2px;
}

.global-search-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.global-search-footer-hint {
    display: flex;
    gap: 1rem;
}

.global-search-footer-hint span {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.global-search-footer-hint kbd {
    padding: 0.1rem 0.3rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
}

/* ============================================================================
   Workflows Page
   ============================================================================ */

.workflows-list {
    margin-top: 1rem;
}

.workflow-kpis {
    margin-bottom: 1.5rem;
}

.kpi-summary-cards {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.kpi-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    text-align: center;
    min-width: 100px;
    flex: 1;
}

.kpi-card.active {
    border-color: var(--success-color);
    background: rgba(34, 197, 94, 0.05);
}

.kpi-card.completed {
    border-color: var(--accent-color);
    background: rgba(59, 130, 246, 0.05);
}

.kpi-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.kpi-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}

.workflow-type-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.workflow-type-badge.initial_outreach {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
}

.workflow-type-badge.org_research {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.status-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.active {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.status-badge.completed {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.status-badge.cancelled {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.outcome-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
    background: var(--surface-color);
    color: var(--text-secondary);
}

.outcome-badge.qualified {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.outcome-badge.not_qualified,
.outcome-badge.no_response {
    background: rgba(239, 68, 68, 0.1);
    color: var(--text-muted);
}

.clickable-row {
    cursor: pointer;
    transition: background 0.15s ease;
}

.clickable-row:hover {
    background: var(--hover-color);
}

/* Workflow Detail Page */
.breadcrumb {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.breadcrumb a {
    color: var(--accent-color);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb .separator {
    margin: 0 0.5rem;
}

.workflow-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.workflow-header-content h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
}

.workflow-target-link {
    color: var(--accent-color);
    text-decoration: none;
}

.workflow-target-link:hover {
    text-decoration: underline;
}

.workflow-header-meta {
    display: flex;
    gap: 0.5rem;
}

.workflow-detail-header {
    flex-wrap: wrap;
    gap: 1rem;
}

.workflow-header-left h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin: 0;
}

.workflow-current-state {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
    padding: 0.5rem 1rem;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid var(--accent-color);
    border-radius: 8px;
}

.workflow-current-state .state-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.workflow-current-state .state-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-color);
}

.workflow-detail-kpis {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.workflow-milestones h3 {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.milestones-timeline {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    position: relative;
    padding-left: 1.5rem;
}

.milestones-timeline::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--border-color);
}

.milestone-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    position: relative;
}

.milestone-marker {
    position: absolute;
    left: -1.5rem;
    width: 14px;
    height: 14px;
    background: var(--accent-color);
    border-radius: 50%;
    border: 2px solid var(--bg-color);
    z-index: 1;
}

.milestone-content {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.milestone-name {
    font-weight: 500;
    color: var(--text-primary);
}

.milestone-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.workflow-messages,
.workflow-actions,
.workflow-activity {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.workflow-message-item,
.activity-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.workflow-action-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.workflow-action-item .action-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
}

.workflow-action-item .action-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.workflow-action-item .action-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.workflow-action-item .action-assignee {
    color: var(--text-secondary);
}

.workflow-message-item:hover,
.workflow-action-item:hover {
    background: var(--hover-color);
}

.message-direction {
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 80px;
}

.message-direction.inbound {
    color: var(--success-color);
}

.message-direction.outbound {
    color: var(--accent-color);
}

.message-subject {
    flex: 1;
    color: var(--text-primary);
}

.message-channel {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.message-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.action-type {
    font-weight: 600;
    text-transform: capitalize;
    min-width: 100px;
    color: var(--text-primary);
}

.action-status {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.action-status.pending {
    background: rgba(251, 191, 36, 0.15);
    color: #f59e0b;
}

.action-status.completed {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.action-due {
    flex: 1;
    color: var(--text-secondary);
}

.action-priority {
    font-size: 0.75rem;
    font-weight: 600;
}

.action-priority.priority-1 {
    color: #ef4444;
}

.action-priority.priority-2 {
    color: #f59e0b;
}

.action-priority.priority-3 {
    color: var(--text-muted);
}

.activity-item {
    cursor: default;
}

.activity-action {
    font-weight: 500;
    min-width: 120px;
}

.activity-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.activity-value {
    flex: 1;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ============================================================================
   Responsive
   ============================================================================ */

@media (max-width: 768px) {
    .navbar {
        padding: 0.75rem 1rem;
    }
    
    .dashboard {
        padding: 1rem;
    }
    
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .individual-header {
        flex-direction: column;
    }
    
    .tracking-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

