/* Import Google Font - MUST be first */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

/**
 * Pipeline Dashboard Styles
 * Design: Clean Industrial - Professional B2B Sales Pipeline
 * Color Palette: Warm neutrals with forest green accents
 */

/* ============ HIDE WP PAGE TITLE ============ */
.page-id-5038 .entry-title,
.page-id-5038 .et_pb_title_container {
    display: none !important;
}

/* Force full-width past Divi/theme containers */
.page-id-5038 .container,
.page-id-5038 .entry-content,
.page-id-5038 .et_pb_section,
.page-id-5038 .et_pb_row,
.page-id-5038 .et_pb_column,
.page-id-5038 #main-content .container {
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* ============ HIDE SCROLLBARS (still scrollable) ============ */
#pipeline-dashboard * {
    scrollbar-width: none;
    -ms-overflow-style: none;
}
#pipeline-dashboard *::-webkit-scrollbar {
    display: none;
}

/* ============ COLLAPSIBLE OVERVIEW PANEL ============ */
.overview-panel {
    position: relative;
}

.overview-panel .overview-content {
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.35s ease, opacity 0.25s ease;
    opacity: 1;
}

.overview-panel.collapsed .overview-content {
    max-height: 0;
    opacity: 0;
}

.overview-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 6px 0;
    border: none;
    background: transparent;
    color: var(--pipeline-slate-light, #94a3b8);
    font-size: 12px;
    cursor: pointer;
    transition: color 0.15s;
    font-family: inherit;
    border-bottom: 1px solid var(--pipeline-border, #e2e8f0);
    margin-bottom: 8px;
}

.overview-toggle:hover {
    color: var(--pipeline-slate, #475569);
}

.overview-toggle-icon {
    font-size: 10px;
}

/* ============ VARIABLES ============ */
:root {
    /* Brand Colors - Refined forest green with richer depth */
    --pipeline-green: #2e6b4a;
    --pipeline-green-light: #4a9268;
    --pipeline-green-dark: #1e4d35;
    --pipeline-green-bg: #eef6f1;
    --pipeline-green-subtle: rgba(46, 107, 74, 0.06);

    /* Neutral Palette - Warmer, more refined */
    --pipeline-slate: #2d3748;
    --pipeline-slate-light: #64748b;
    --pipeline-warm-gray: #f8f7f4;
    --pipeline-cream: #fbfaf8;
    --pipeline-border: #e5e2dc;
    --pipeline-border-dark: #ccc8bf;
    --pipeline-bg: #f4f3f0;

    /* Status Colors - More saturated, professional */
    --status-open: #2563eb;
    --status-open-bg: #eff6ff;
    --status-won: #16a34a;
    --status-won-bg: #f0fdf4;
    --status-lost: #94a3b8;
    --status-lost-bg: #f8fafc;
    --status-pending: #ca8a04;
    --status-pending-bg: #fefce8;
    --status-warning: #ea580c;
    --status-warning-bg: #fff7ed;

    /* Typography - Premium font pairing */
    --font-display: 'Plus Jakarta Sans', 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', 'Cascadia Code', monospace;

    /* Spacing - Slightly more generous */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;

    /* Shadows - Layered depth system */
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.03);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -2px rgba(0,0,0,0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.06), 0 4px 6px -4px rgba(0,0,0,0.03);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.07), 0 8px 10px -6px rgba(0,0,0,0.03);
    --shadow-focus: 0 0 0 2px #fff, 0 0 0 4px rgba(46, 107, 74, 0.25);
    --shadow-card: 0 1px 3px rgba(0,0,0,0.04), 0 0 0 1px rgba(0,0,0,0.02);
    --shadow-card-hover: 0 8px 16px -4px rgba(0,0,0,0.08), 0 0 0 1px rgba(0,0,0,0.03);

    /* Transitions - Refined easing */
    --transition-fast: 120ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Border Radius - Slightly more rounded for modern feel */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
}

/* ============ BASE CONTAINER ============ */
#pipeline-dashboard {
    font-family: var(--font-body);
    max-width: 1440px;
    margin: 0 auto;
    padding: var(--space-md) var(--space-lg);
    color: var(--pipeline-slate);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ============ LOADING STATE ============ */
.pipeline-loading {
    text-align: center;
    padding: 80px var(--space-lg);
    color: var(--pipeline-slate-light);
}

.pipeline-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--pipeline-border);
    border-top-color: var(--pipeline-green);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin: 0 auto var(--space-lg);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.pipeline-error {
    background: #fef2f2;
    color: #991b1b;
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    text-align: center;
    border: 1px solid #fecaca;
}

.pipeline-empty {
    text-align: center;
    padding: 60px var(--space-lg);
    color: var(--pipeline-slate-light);
    font-size: 15px;
}

/* ============ HEADER & STATS ============ */
.pipeline-header {
    margin-bottom: var(--space-lg);
}

.pipeline-header h2 {
    margin: 0 0 var(--space-md) 0;
    color: var(--pipeline-slate);
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.02em;
    display: flex;
    align-items: baseline;
    gap: var(--space-md);
}

.pipeline-subtitle {
    font-size: 14px;
    font-weight: 400;
    color: var(--pipeline-slate-light);
    letter-spacing: 0;
}

.pipeline-stats {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.pipeline-stats .stat {
    background: var(--pipeline-cream);
    border-radius: var(--radius-md);
    padding: var(--space-md) var(--space-lg);
    text-align: center;
    min-width: 100px;
    border: 1px solid var(--pipeline-border);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.pipeline-stats .stat:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.pipeline-stats .stat.warning {
    background: var(--status-warning-bg);
    border-color: #fbd38d;
}

.pipeline-stats .stat.success {
    background: var(--status-won-bg);
    border-color: #9ae6b4;
}

.pipeline-stats .stat-value {
    display: block;
    font-size: 22px;
    font-weight: 700;
    color: var(--pipeline-slate);
    font-feature-settings: 'tnum' 1;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.pipeline-stats .stat-label {
    display: block;
    font-size: 11px;
    color: var(--pipeline-slate-light);
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    font-weight: 500;
}

/* ============ TREND CHART ============ */
.pipeline-trend-chart {
    background: #fff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--pipeline-border);
    padding: var(--space-md);
    margin-bottom: var(--space-lg);
    min-height: 280px;
}

.pipeline-trend-chart canvas {
    max-height: 220px;
}

/* Chart Mode Toggle */
.chart-mode-toggle {
    display: flex;
    gap: 2px;
    padding: 2px;
    background: var(--pipeline-border);
    border-radius: var(--radius-md);
    width: fit-content;
    margin-bottom: var(--space-sm);
}

.chart-mode-btn {
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 500;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: calc(var(--radius-md) - 2px);
    transition: all 0.15s ease;
}

.chart-mode-btn:hover {
    color: var(--text-primary);
}

.chart-mode-btn.active {
    background: #fff;
    color: var(--text-primary);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* ============ VIEW TOGGLE TABS ============ */
/* Toolbar: toggle + add button side by side */
.pipeline-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
    gap: var(--space-md);
    flex-wrap: wrap;
}

.est-badge {
    display: inline-block;
    font-size: 9px;
    padding: 1px 4px;
    background: #dbeafe;
    color: #1e40af;
    border-radius: 3px;
    vertical-align: middle;
    cursor: help;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.pipeline-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pipeline-view-toggle {
    display: flex;
    gap: 2px;
    padding: 3px;
    background: var(--pipeline-border);
    border-radius: var(--radius-lg);
    width: fit-content;
}

.view-btn {
    padding: 10px 18px;
    border: none;
    background: transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--pipeline-slate-light);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-body);
}

.view-btn:hover {
    color: var(--pipeline-slate);
    background: rgba(255,255,255,0.5);
}

.view-btn.active {
    background: #fff;
    color: var(--pipeline-green);
    box-shadow: var(--shadow-sm);
}

/* ============ ADD ENTRY BUTTON ============ */
.add-entry-btn {
    padding: 10px 20px;
    background: var(--pipeline-green);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.add-entry-btn:hover {
    background: var(--pipeline-green-dark);
    box-shadow: var(--shadow-md);
}

/* ============ MODAL ============ */
.pipeline-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: var(--space-lg);
    backdrop-filter: blur(2px);
}

.pipeline-modal {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    font-family: var(--font-body);
}

.pipeline-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg) var(--space-lg) var(--space-md);
    border-bottom: 1px solid var(--pipeline-border);
}

.pipeline-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--pipeline-slate);
}

.pipeline-modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    font-size: 22px;
    color: var(--pipeline-slate-light);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.pipeline-modal-close:hover {
    background: var(--pipeline-warm-gray);
    color: var(--pipeline-slate);
}

.pipeline-modal-body {
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.modal-form-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.modal-form-row label {
    font-size: 12px;
    font-weight: 600;
    color: var(--pipeline-slate);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-form-row label .required {
    color: #e53e3e;
}

.modal-form-row input,
.modal-form-row select,
.modal-form-row textarea {
    padding: 10px 12px;
    border: 1px solid var(--pipeline-border);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: var(--font-body);
    color: var(--pipeline-slate);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    background: #fff;
}

.modal-form-row input:focus,
.modal-form-row select:focus,
.modal-form-row textarea:focus {
    outline: none;
    border-color: var(--pipeline-green);
    box-shadow: var(--shadow-focus);
}

.modal-form-row textarea {
    resize: vertical;
    min-height: 60px;
}

.modal-form-row-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.modal-form-error {
    background: #fff5f5;
    color: #c53030;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 13px;
    border: 1px solid #fed7d7;
}

.pipeline-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg) var(--space-lg);
    border-top: 1px solid var(--pipeline-border);
}

.modal-cancel-btn {
    padding: 10px 20px;
    background: transparent;
    border: 1px solid var(--pipeline-border);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font-body);
    color: var(--pipeline-slate-light);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.modal-cancel-btn:hover {
    background: var(--pipeline-warm-gray);
    color: var(--pipeline-slate);
}

.modal-submit-btn {
    padding: 10px 24px;
    background: var(--pipeline-green);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.modal-submit-btn:hover {
    background: var(--pipeline-green-dark);
}

.modal-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.view-icon {
    font-size: 14px;
}

/* ============ FILTER PILLS ============ */
.pipeline-filters {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    flex-wrap: wrap;
}

.filter-btn {
    padding: 7px 14px;
    border: 1px solid var(--pipeline-border);
    background: #fff;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--pipeline-slate-light);
    transition: all var(--transition-fast);
    font-family: var(--font-body);
}

.filter-btn:hover {
    border-color: var(--pipeline-green-light);
    color: var(--pipeline-green);
}

.filter-btn.active {
    background: var(--pipeline-green);
    color: #fff;
    border-color: var(--pipeline-green);
}

.pipeline-time-note {
    font-size: 12px;
    color: var(--pipeline-slate-light);
    margin-bottom: var(--space-md);
    font-style: italic;
}

/* ============ CARD BASE STYLES ============ */
.person-card,
.job-card,
.project-card {
    background: #fff;
    border: 1px solid var(--pipeline-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-base);
    margin-bottom: var(--space-sm);
}

.person-card:hover,
.job-card:hover,
.project-card:hover {
    border-color: var(--pipeline-border-dark);
    box-shadow: var(--shadow-md);
}

.person-card.needs-info,
.job-card.needs-info,
.project-card.needs-info {
    border-left: 3px solid var(--status-warning);
}

.person-card.has-won,
.job-card.success,
.project-card.success {
    border-left: 3px solid var(--status-won);
}

.job-card.lost,
.project-card.lost {
    border-left: 3px solid var(--status-lost);
    opacity: 0.75;
}

.person-card.expanded,
.job-card.expanded,
.project-card.expanded {
    border-color: var(--pipeline-green-light);
    box-shadow: var(--shadow-md);
}

/* ============ CARD HEADERS ============ */
.person-header,
.job-card-header,
.project-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px var(--space-md);
    cursor: pointer;
    user-select: none;
    transition: background var(--transition-fast);
}

.person-header:hover,
.job-card-header:hover,
.project-card-header:hover {
    background: var(--pipeline-warm-gray);
}

.person-header-left,
.job-card-left,
.project-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.person-header-right,
.job-card-right,
.project-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Card header text elements */
.person-name,
.job-service,
.project-service {
    font-weight: 600;
    color: var(--pipeline-slate);
    font-size: 14px;
}

.person-jobs-count,
.job-contact,
.person-date,
.job-date {
    color: var(--pipeline-slate-light);
    font-size: 13px;
}

.person-attribution {
    font-size: 12px;
    color: var(--pipeline-green);
    background: var(--pipeline-green-bg);
    padding: 2px 8px;
    border-radius: 10px;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Auto-detected from call transcript */
.person-attribution.auto-detected {
    color: #3182ce;
    background: #ebf8ff;
    font-style: italic;
}

/* CallRail tracking source */
.person-attribution.callrail-source {
    color: var(--pipeline-slate);
    background: var(--pipeline-warm-gray);
}

/* Value display */
.person-value,
.job-value,
.project-value {
    font-weight: 600;
    color: var(--pipeline-green);
    font-size: 13px;
    font-feature-settings: 'tnum' 1;
}

/* Category tags */
.job-category-tag {
    background: var(--pipeline-warm-gray);
    color: var(--pipeline-slate);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

/* Status badges */
.deal-badge {
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-weight: 600;
}

.deal-badge.warning {
    background: var(--status-warning-bg);
    color: #c05621;
}

.job-status,
.job-row-status,
.project-status-quick {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    text-transform: capitalize;
    font-weight: 500;
}

.job-status.open,
.job-row-status.open,
.project-status-quick.open {
    background: var(--status-open-bg);
    color: var(--status-open);
}

.job-status.won,
.job-row-status.won,
.project-status-quick.won {
    background: var(--status-won-bg);
    color: var(--status-won);
}

.job-status.lost,
.job-row-status.lost,
.project-status-quick.lost {
    background: var(--status-lost-bg);
    color: var(--status-lost);
}

.job-status.pending,
.job-row-status.pending,
.project-status-quick.pending {
    background: var(--status-pending-bg);
    color: var(--status-pending);
}

/* Expand icons */
.person-expand-icon,
.job-card-expand-icon,
.project-expand-icon,
.job-expand-icon {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--pipeline-warm-gray);
    border-radius: 50%;
    font-size: 14px;
    color: var(--pipeline-slate-light);
    transition: all var(--transition-fast);
}

.person-card.expanded .person-expand-icon,
.job-card.expanded .job-card-expand-icon {
    background: var(--pipeline-green-bg);
    color: var(--pipeline-green);
}

/* Status summary in person cards */
.person-status-summary {
    display: flex;
    gap: 4px;
}

.status-count {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
}

.status-count.won {
    background: var(--status-won-bg);
    color: var(--status-won);
}

.status-count.pending {
    background: var(--status-pending-bg);
    color: var(--status-pending);
}

.status-count.open {
    background: var(--status-open-bg);
    color: var(--status-open);
}

/* ============ CARD DETAILS CONTAINER ============ */
.person-details,
.job-card-details,
.project-details {
    border-top: 1px solid var(--pipeline-border);
    padding: var(--space-lg);
    background: linear-gradient(180deg, var(--pipeline-warm-gray) 0%, #f3f2ef 100%);
    position: relative;
    /* Smooth expand animation */
    animation: slideReveal 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: top;
}

/* Inset shadow for depth */
.person-details::before,
.job-card-details::before,
.project-details::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: linear-gradient(180deg, rgba(0,0,0,0.04) 0%, transparent 100%);
    pointer-events: none;
}

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

/* ============ DATA SECTIONS (Client vs Job level) ============ */
.data-section {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-md);
    border: 1px solid var(--pipeline-border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);
    position: relative;
    overflow: hidden;
    transition: box-shadow var(--transition-base), transform var(--transition-base);
}

.data-section:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.03);
}

.data-section:last-child {
    margin-bottom: 0;
}

/* Client level section - slate accent */
.data-section.client-level {
    border-left: none;
    border-top: 3px solid var(--pipeline-slate-light);
}

.data-section.client-level::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(180deg, rgba(113, 128, 150, 0.04) 0%, transparent 100%);
    pointer-events: none;
}

/* Job level section - green accent */
.data-section.job-level {
    border-left: none;
    border-top: 3px solid var(--pipeline-green);
}

.data-section.job-level::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(180deg, rgba(61, 107, 79, 0.04) 0%, transparent 100%);
    pointer-events: none;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--pipeline-border);
    position: relative;
}

/* Section icon indicators */
.section-header::before {
    content: '';
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.data-section.client-level .section-header::before {
    content: '👤';
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.data-section.job-level .section-header::before {
    content: '📋';
    background: linear-gradient(135deg, var(--pipeline-green-bg) 0%, #d4e7db 100%);
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.section-label {
    font-weight: 600;
    font-size: 13px;
    color: var(--pipeline-slate);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.section-hint {
    font-size: 12px;
    color: var(--pipeline-slate-light);
    font-style: normal;
    background: var(--pipeline-warm-gray);
    padding: 4px 10px;
    border-radius: 12px;
    margin-left: auto;
}

.client-info-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: var(--space-sm);
    font-size: 13px;
    color: var(--pipeline-slate);
}

.client-info-row span strong {
    color: var(--pipeline-slate);
    font-weight: 500;
}

/* ============ FORMS ============ */
.attribution-form-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}

.attribution-form-inline .form-row {
    flex: 1;
    min-width: 180px;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-row label {
    font-size: 11px;
    font-weight: 600;
    color: var(--pipeline-slate);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-row-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
}

/* Input base styles */
.attribution-form-inline input,
.attribution-form-inline select,
.job-form input,
.job-form select,
.job-form textarea,
.job-row-form input,
.job-row-form select,
.job-row-form textarea,
.client-contact-form input,
.client-contact-form select {
    padding: 11px 14px;
    border: 1px solid var(--pipeline-border);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: var(--font-body);
    width: 100%;
    box-sizing: border-box;
    background: linear-gradient(180deg, #fff 0%, #fafaf9 100%);
    color: var(--pipeline-slate);
    transition: all var(--transition-fast);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.04);
}

.attribution-form-inline input:hover,
.attribution-form-inline select:hover,
.job-form input:hover,
.job-form select:hover,
.job-form textarea:hover,
.job-row-form input:hover,
.job-row-form select:hover,
.job-row-form textarea:hover,
.client-contact-form input:hover,
.client-contact-form select:hover {
    border-color: var(--pipeline-border-dark);
    background: #fff;
}

.attribution-form-inline input:focus,
.attribution-form-inline select:focus,
.job-form input:focus,
.job-form select:focus,
.job-form textarea:focus,
.job-row-form input:focus,
.job-row-form select:focus,
.job-row-form textarea:focus,
.client-contact-form input:focus,
.client-contact-form select:focus {
    outline: none;
    border-color: var(--pipeline-green);
    box-shadow: var(--shadow-focus), inset 0 1px 2px rgba(0,0,0,0.02);
    background: #fff;
}

/* Placeholder styling */
.attribution-form-inline input::placeholder,
.job-form input::placeholder,
.job-form textarea::placeholder,
.job-row-form input::placeholder,
.job-row-form textarea::placeholder,
.client-contact-form input::placeholder {
    color: var(--pipeline-slate-light);
    opacity: 0.6;
}

.job-form textarea,
.job-row-form textarea {
    min-height: 70px;
    resize: vertical;
    line-height: 1.5;
}

.job-form,
.job-row-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.form-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-top: var(--space-sm);
    padding-top: var(--space-md);
    border-top: 1px solid var(--pipeline-border);
}

/* ============ BUTTONS ============ */
.client-save-btn,
.job-save-btn,
.row-save-btn {
    padding: 11px 22px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    font-family: var(--font-body);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Subtle shine effect on buttons */
.client-save-btn::before,
.job-save-btn::before,
.row-save-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, transparent 100%);
    pointer-events: none;
}

.client-save-btn {
    background: linear-gradient(180deg, var(--pipeline-slate) 0%, #3d4a5c 100%);
    color: #fff;
}

.client-save-btn:hover {
    background: linear-gradient(180deg, var(--pipeline-slate-light) 0%, var(--pipeline-slate) 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.client-save-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.job-save-btn,
.row-save-btn {
    background: linear-gradient(180deg, var(--pipeline-green) 0%, var(--pipeline-green-dark) 100%);
    color: #fff;
}

.job-save-btn:hover,
.row-save-btn:hover {
    background: linear-gradient(180deg, var(--pipeline-green-light) 0%, var(--pipeline-green) 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(61, 107, 79, 0.25);
}

.job-save-btn:active,
.row-save-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.client-save-btn:disabled,
.job-save-btn:disabled,
.row-save-btn:disabled {
    background: var(--pipeline-border-dark);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.client-save-btn.success,
.job-save-btn.success,
.row-save-btn.success {
    background: linear-gradient(180deg, var(--status-won) 0%, #2f855a 100%);
    animation: successPulse 0.4s ease;
}

@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.03); }
    100% { transform: scale(1); }
}

.client-save-btn.error,
.job-save-btn.error,
.row-save-btn.error {
    background: linear-gradient(180deg, #e53e3e 0%, #c53030 100%);
    animation: errorShake 0.4s ease;
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}

.last-updated {
    font-size: 11px;
    color: var(--pipeline-slate-light);
    display: flex;
    align-items: center;
    gap: 4px;
}

.last-updated::before {
    content: '✓';
    color: var(--status-won);
    font-size: 12px;
}

/* ============ JOBS LIST WITHIN PERSON CARD ============ */
.jobs-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.job-row {
    background: #fff;
    border: 1px solid var(--pipeline-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-base);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.job-row:hover {
    border-color: var(--pipeline-border-dark);
    box-shadow: 0 3px 8px rgba(0,0,0,0.06);
}

.job-row.expanded {
    border-color: var(--pipeline-green-light);
    box-shadow: 0 4px 12px rgba(61, 107, 79, 0.1);
}

.job-row.won {
    border-left: 4px solid var(--status-won);
    background: linear-gradient(90deg, rgba(56, 161, 105, 0.03) 0%, transparent 20%);
}

.job-row.pending {
    border-left: 4px solid var(--status-pending);
    background: linear-gradient(90deg, rgba(214, 158, 46, 0.03) 0%, transparent 20%);
}

.job-row.lost {
    border-left: 4px solid var(--status-lost);
    opacity: 0.7;
}

.job-row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.job-row-header:hover {
    background: linear-gradient(180deg, var(--pipeline-warm-gray) 0%, transparent 100%);
}

.job-row-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.job-row-service {
    font-weight: 600;
    color: var(--pipeline-slate);
    font-size: 14px;
}

.job-row-category {
    background: linear-gradient(135deg, var(--pipeline-warm-gray) 0%, #f0efec 100%);
    color: var(--pipeline-slate-light);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.job-row-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.job-row-value {
    color: var(--pipeline-green);
    font-weight: 600;
    font-size: 13px;
    font-feature-settings: 'tnum' 1;
}

.job-row-expand,
.job-expand-icon {
    font-size: 12px;
    color: var(--pipeline-slate-light);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--pipeline-warm-gray);
    border-radius: 50%;
    transition: all var(--transition-fast);
}

.job-row.expanded .job-row-expand,
.job-row.expanded .job-expand-icon {
    background: var(--pipeline-green-bg);
    color: var(--pipeline-green);
    transform: rotate(90deg);
}

.job-row-details {
    border-top: 1px solid var(--pipeline-border);
    padding: var(--space-lg);
    background: linear-gradient(180deg, #fafaf9 0%, #f5f4f2 100%);
    animation: slideReveal 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.job-row-details::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(180deg, rgba(0,0,0,0.03) 0%, transparent 100%);
    pointer-events: none;
}

.job-row-form .form-row-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
}

/* Visual grouping for related fields */
.job-row-form .form-row-group + .form-row-group {
    padding-top: var(--space-md);
    border-top: 1px dashed var(--pipeline-border);
    margin-top: var(--space-sm);
}

/* ============ CATEGORY VIEW ============ */
.category-summary {
    display: flex;
    gap: var(--space-xl);
    margin-bottom: var(--space-lg);
    padding: var(--space-md) var(--space-lg);
    background: var(--pipeline-cream);
    border-radius: var(--radius-lg);
    border: 1px solid var(--pipeline-border);
}

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

.summary-value {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: var(--pipeline-slate);
    font-feature-settings: 'tnum' 1;
}

.summary-label {
    font-size: 11px;
    color: var(--pipeline-slate-light);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: var(--space-md);
}

.category-card {
    background: #fff;
    border: 1px solid var(--pipeline-border);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    cursor: pointer;
    transition: all var(--transition-base);
}

.category-card:hover {
    border-color: var(--pipeline-green-light);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xs);
}

.category-name {
    font-weight: 600;
    color: var(--pipeline-slate);
    font-size: 14px;
}

.category-count {
    font-size: 12px;
    color: var(--pipeline-slate-light);
}

.category-value {
    font-size: 17px;
    font-weight: 700;
    color: var(--pipeline-green);
    margin-bottom: var(--space-sm);
    font-feature-settings: 'tnum' 1;
}

.category-bar {
    height: 5px;
    background: var(--pipeline-border);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: var(--space-sm);
}

.category-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--pipeline-green), var(--pipeline-green-light));
    border-radius: 3px;
    transition: width var(--transition-slow);
}

.category-meta {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--pipeline-slate-light);
}

/* ============ DRILLDOWN LIST ============ */
.project-list-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--pipeline-border);
}

.project-list-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: var(--pipeline-slate);
    flex: 1;
}

.project-count {
    font-size: 13px;
    color: var(--pipeline-slate-light);
}

.back-btn {
    padding: 8px 14px;
    border: 1px solid var(--pipeline-border);
    background: #fff;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    color: var(--pipeline-slate);
    transition: all var(--transition-fast);
    font-family: var(--font-body);
    font-weight: 500;
}

.back-btn:hover {
    border-color: var(--pipeline-green);
    color: var(--pipeline-green);
    background: var(--pipeline-green-bg);
}

.project-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

/* ============ PEOPLE & JOBS CONTAINERS ============ */
.pipeline-people,
.pipeline-jobs {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

/* ============ MOBILE RESPONSIVE ============ */
@media (max-width: 768px) {
    #pipeline-dashboard {
        padding: var(--space-md);
    }

    .pipeline-stats {
        gap: var(--space-xs);
    }

    .pipeline-stats .stat {
        padding: var(--space-sm) var(--space-md);
        min-width: 80px;
    }

    .pipeline-stats .stat-value {
        font-size: 18px;
    }

    .pipeline-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-sm);
    }

    .pipeline-view-toggle {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .add-entry-btn {
        width: 100%;
        text-align: center;
    }

    .view-btn {
        padding: 8px 14px;
        font-size: 12px;
    }

    /* Modal responsive */
    .pipeline-modal-overlay {
        padding: var(--space-md);
    }

    .modal-form-row-group {
        grid-template-columns: 1fr;
    }

    /* Card headers */
    .person-header,
    .job-card-header,
    .project-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-sm);
    }

    .person-header-right,
    .job-card-right,
    .project-header-right {
        width: 100%;
        justify-content: space-between;
    }

    /* Forms */
    .form-row-group,
    .job-row-form .form-row-group {
        grid-template-columns: 1fr;
    }

    .attribution-form-inline {
        flex-direction: column;
    }

    .attribution-form-inline .form-row {
        width: 100%;
    }

    .attribution-form-inline .client-save-btn {
        width: 100%;
    }

    .client-info-row {
        flex-direction: column;
        gap: var(--space-xs);
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    /* Job rows */
    .job-row-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-xs);
    }

    .job-row-right {
        width: 100%;
        justify-content: space-between;
    }

    /* Category grid */
    .category-grid {
        grid-template-columns: 1fr;
    }

    .category-summary {
        flex-direction: column;
        gap: var(--space-md);
    }

    /* Drilldown */
    .project-list-header {
        flex-wrap: wrap;
        gap: var(--space-sm);
    }

    .project-list-header h3 {
        width: 100%;
        order: 2;
    }

    .back-btn {
        order: 1;
    }

    .project-count {
        order: 3;
    }
}

/* ============ ANIMATIONS ============ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.person-card,
.job-card,
.category-card {
    animation: fadeIn var(--transition-slow) ease-out;
}

/* Staggered animation for cards */
.pipeline-people .person-card:nth-child(1),
.pipeline-jobs .job-card:nth-child(1),
.category-grid .category-card:nth-child(1) { animation-delay: 0ms; }
.pipeline-people .person-card:nth-child(2),
.pipeline-jobs .job-card:nth-child(2),
.category-grid .category-card:nth-child(2) { animation-delay: 30ms; }
.pipeline-people .person-card:nth-child(3),
.pipeline-jobs .job-card:nth-child(3),
.category-grid .category-card:nth-child(3) { animation-delay: 60ms; }
.pipeline-people .person-card:nth-child(4),
.pipeline-jobs .job-card:nth-child(4),
.category-grid .category-card:nth-child(4) { animation-delay: 90ms; }
.pipeline-people .person-card:nth-child(5),
.pipeline-jobs .job-card:nth-child(5),
.category-grid .category-card:nth-child(5) { animation-delay: 120ms; }

/* ============ CLIENT CONTACT FORM ============ */
.client-contact-form {
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-lg);
    border-bottom: 1px dashed var(--pipeline-border);
    position: relative;
}

.client-contact-form .form-row-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
}

.from-callrail {
    font-size: 10px;
    font-weight: 500;
    color: var(--pipeline-slate-light);
    background: var(--pipeline-warm-gray);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 4px;
}

.readonly-info {
    padding-top: var(--space-md);
    color: var(--pipeline-slate-light);
    font-size: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    background: var(--pipeline-warm-gray);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    margin-top: var(--space-md);
}

.readonly-info span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.readonly-info span strong {
    font-weight: 600;
    color: var(--pipeline-slate);
}

/* Mobile adjustments for contact form */
@media (max-width: 768px) {
    .client-contact-form .form-row-group {
        grid-template-columns: 1fr;
    }
}

/* ============ EXPANDED CARD POLISH ============ */
/* Add subtle animation for section icons */
.data-section.client-level .section-header::before,
.data-section.job-level .section-header::before {
    animation: iconBounce 0.4s ease 0.2s;
}

@keyframes iconBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Stagger animation for nested job rows */
.jobs-list .job-row:nth-child(1) { animation-delay: 0ms; }
.jobs-list .job-row:nth-child(2) { animation-delay: 50ms; }
.jobs-list .job-row:nth-child(3) { animation-delay: 100ms; }
.jobs-list .job-row:nth-child(4) { animation-delay: 150ms; }
.jobs-list .job-row:nth-child(5) { animation-delay: 200ms; }

/* Add fadeIn animation to job rows */
.jobs-list .job-row {
    animation: fadeIn var(--transition-slow) ease-out backwards;
}

/* ============ CALLS VIEW ============ */

.calls-stats-bar {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.calls-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 20px;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 8px;
    min-width: 100px;
    flex: 1;
}

.calls-stat.success { border-color: var(--success, #22c55e); }
.calls-stat.warning { border-color: var(--warning, #f59e0b); }

.calls-stat-value {
    font-size: 1.5em;
    font-weight: 700;
    color: var(--text-primary, #111);
}

.calls-stat-label {
    font-size: 0.8em;
    color: var(--text-secondary, #6b7280);
    margin-top: 2px;
}

.calls-filters {
    margin-bottom: 16px;
}

.calls-filter-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.calls-dropdown {
    padding: 8px 12px;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 6px;
    font-size: 0.9em;
    background: var(--card-bg, #fff);
    color: var(--text-primary, #111);
    cursor: pointer;
    min-width: 120px;
}

.calls-date-range {
    display: flex;
    align-items: center;
    gap: 8px;
}

.calls-custom-dates {
    display: flex;
    align-items: center;
    gap: 4px;
}

.calls-date-input {
    padding: 7px 10px;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 6px;
    font-size: 0.85em;
    background: var(--card-bg, #fff);
    color: var(--text-primary, #111);
    width: 130px;
}

.calls-date-input:focus {
    outline: none;
    border-color: var(--accent, #3b82f6);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.calls-date-sep {
    color: var(--text-tertiary, #9ca3af);
    font-size: 0.85em;
}

.calls-dropdown:focus {
    outline: none;
    border-color: var(--accent, #3b82f6);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.calls-search {
    flex: 1;
    min-width: 200px;
}

.calls-search input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 6px;
    font-size: 0.9em;
    background: var(--card-bg, #fff);
    color: var(--text-primary, #111);
}

.calls-search input:focus {
    outline: none;
    border-color: var(--accent, #3b82f6);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.calls-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.call-card {
    padding: 12px 16px;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    animation: fadeIn 0.2s ease-out backwards;
}

.call-card:hover {
    border-color: var(--accent, #3b82f6);
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.call-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.call-card-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.call-card-right {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85em;
    color: var(--text-secondary, #6b7280);
    flex-shrink: 0;
}

.call-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.call-status-answered { background: #dcfce7; color: #166534; }
.call-status-ai-answered { background: #dbeafe; color: #1e40af; }
.call-status-missed { background: #fee2e2; color: #991b1b; }
.call-status-voicemail { background: #fef3c7; color: #92400e; }

.call-name {
    font-weight: 600;
    color: var(--text-primary, #111);
}

.call-phone {
    color: var(--text-secondary, #6b7280);
    font-size: 0.9em;
}

.call-location {
    color: var(--text-tertiary, #9ca3af);
    font-size: 0.85em;
}

.call-has-recording {
    color: var(--accent, #3b82f6);
    font-size: 0.9em;
}

.call-first {
    display: inline-block;
    padding: 1px 6px;
    background: #dbeafe;
    color: #1e40af;
    border-radius: 3px;
    font-size: 0.7em;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.call-duration {
    font-variant-numeric: tabular-nums;
}

.call-time {
    white-space: nowrap;
}

.call-card-details {
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: baseline;
}

.call-source {
    display: inline-block;
    padding: 2px 8px;
    background: var(--bg-secondary, #f3f4f6);
    border-radius: 4px;
    font-size: 0.8em;
    color: var(--text-secondary, #6b7280);
}

.call-purpose {
    font-size: 0.8em;
    color: var(--text-secondary, #6b7280);
    font-style: italic;
}

.call-summary-preview {
    width: 100%;
    margin: 4px 0 0;
    font-size: 0.85em;
    color: var(--text-secondary, #6b7280);
    line-height: 1.4;
}

/* Pagination */
.calls-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding: 12px 0;
}

.calls-page-info {
    font-size: 0.85em;
    color: var(--text-secondary, #6b7280);
}

.calls-page-btns {
    display: flex;
    gap: 8px;
}

.page-btn {
    padding: 6px 16px;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 6px;
    background: var(--card-bg, #fff);
    color: var(--text-primary, #111);
    cursor: pointer;
    font-size: 0.85em;
}

.page-btn:hover {
    border-color: var(--accent, #3b82f6);
    color: var(--accent, #3b82f6);
}

/* Call Detail Modal */
.call-detail-modal {
    max-width: 700px;
    max-height: 85vh;
    overflow-y: auto;
}

.call-detail-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.call-detail-info {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.9em;
    color: var(--text-secondary, #6b7280);
}

.call-detail-info span {
    padding: 2px 8px;
    background: var(--bg-secondary, #f3f4f6);
    border-radius: 4px;
}

.call-detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.call-tag {
    padding: 2px 8px;
    background: #e0e7ff;
    color: #3730a3;
    border-radius: 4px;
    font-size: 0.8em;
}

.call-detail-section {
    margin-top: 16px;
}

.call-detail-section h4 {
    font-size: 0.9em;
    font-weight: 600;
    color: var(--text-primary, #111);
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.call-detail-section p {
    font-size: 0.9em;
    line-height: 1.5;
    color: var(--text-primary, #111);
    margin: 0;
}

.call-audio-player {
    width: 100%;
    height: 40px;
}

.call-transcript {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 8px;
    padding: 12px;
}

.transcript-line {
    padding: 4px 0;
    font-size: 0.9em;
    line-height: 1.5;
}

.transcript-agent { }
.transcript-caller { }

.transcript-speaker {
    font-weight: 600;
    margin-right: 6px;
    font-size: 0.85em;
    text-transform: uppercase;
}

.transcript-agent .transcript-speaker { color: var(--accent, #3b82f6); }
.transcript-caller .transcript-speaker { color: #059669; }

.transcript-text {
    color: var(--text-primary, #111);
}

/* AI Filter Button */
.ai-filter.active {
    background: #7c3aed;
    color: #fff;
    border-color: #7c3aed;
}

/* Caller Link */
.caller-link {
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
}

.caller-link:hover {
    color: var(--accent, #3b82f6);
}

/* Caller History Modal */
.caller-history-modal {
    max-width: 750px;
}

.caller-history-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 8px 0 16px;
    font-size: 0.9em;
    color: var(--text-secondary, #6b7280);
    border-bottom: 1px solid var(--border-color, #e5e7eb);
    margin-bottom: 16px;
}

.caller-history-summary span {
    padding: 2px 8px;
    background: var(--bg-secondary, #f3f4f6);
    border-radius: 4px;
}

/* Timeline */
.caller-timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.timeline-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
}

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

.timeline-icon {
    font-size: 1.2em;
    flex-shrink: 0;
    width: 28px;
    text-align: center;
    padding-top: 2px;
}

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

.timeline-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.timeline-type {
    font-weight: 600;
    font-size: 0.9em;
    color: var(--text-primary, #111);
}

.timeline-time {
    font-size: 0.8em;
    color: var(--text-tertiary, #9ca3af);
    margin-left: auto;
}

.timeline-page {
    font-size: 0.8em;
    color: var(--text-tertiary, #9ca3af);
    margin-top: 2px;
}

.timeline-audio {
    margin-top: 6px;
    height: 32px;
}

.timeline-form-fields {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 4px;
    font-size: 0.85em;
}

.form-field {
    color: var(--text-secondary, #6b7280);
}

.form-field strong {
    color: var(--text-primary, #111);
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    .calls-stats-bar {
        gap: 8px;
    }
    .calls-stat {
        min-width: 70px;
        padding: 8px 12px;
    }
    .calls-stat-value {
        font-size: 1.2em;
    }
    .call-card-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .call-card-right {
        width: 100%;
        justify-content: flex-start;
    }
    .calls-filter-row {
        flex-direction: column;
    }
    .call-detail-modal {
        max-width: 95vw;
        max-height: 90vh;
    }
}

/* ============ FAQ TAB STYLES ============ */

.faq-view-container {
    padding: 0;
}

/* FAQ Sub-navigation (By Page / Search All) */
.faq-sub-nav {
    display: flex;
    gap: 4px;
    padding: 8px 0 16px;
    border-bottom: 1px solid var(--pipeline-border);
    margin-bottom: 16px;
}

.faq-sub-tab {
    padding: 8px 16px;
    border: 1px solid var(--pipeline-border);
    background: transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--pipeline-slate-light);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-body);
}

.faq-sub-tab:hover {
    color: var(--pipeline-slate);
    background: rgba(255,255,255,0.5);
}

.faq-sub-tab.active {
    background: #fff;
    color: var(--pipeline-green);
    border-color: var(--pipeline-green);
    box-shadow: var(--shadow-sm);
}

/* FAQ Summary */
.faq-summary {
    color: var(--pipeline-slate-light);
    font-size: 13px;
    margin: 0 0 16px;
}

/* FAQ Service Group */
.faq-service-group {
    margin-bottom: 8px;
    border: 1px solid var(--pipeline-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #fff;
}

.faq-service-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px;
    background: var(--pipeline-bg);
    cursor: pointer;
    user-select: none;
    transition: background var(--transition-fast);
}

.faq-service-header:hover {
    background: #e8eef4;
}

.faq-service-name {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--pipeline-slate);
    flex: 1;
}

.faq-service-count {
    font-size: 12px;
    color: var(--pipeline-slate-light);
    background: #e2e8f0;
    padding: 2px 8px;
    border-radius: 12px;
}

.faq-service-toggle {
    font-size: 12px;
    color: var(--pipeline-slate-light);
    transition: transform var(--transition-fast);
}

.faq-service-items {
    padding: 0;
}

/* FAQ Card */
.faq-card {
    padding: 16px;
    border-top: 1px solid var(--pipeline-border);
}

.faq-card:first-child {
    border-top: 1px solid var(--pipeline-border);
}

.faq-question {
    font-size: 15px;
    font-weight: 600;
    color: var(--pipeline-slate);
    margin-bottom: 8px;
    line-height: 1.4;
}

.faq-answer {
    font-size: 14px;
    color: #475569;
    line-height: 1.6;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0;
}

.faq-answer p {
    margin: 0 0 8px;
}

.faq-answer p:last-child {
    margin-bottom: 0;
}

.faq-card .faq-meta {
    display: none;
}

.faq-card.expanded .faq-meta {
    display: flex;
}

.faq-card.expanded .faq-answer {
    max-height: none;
    overflow: visible;
    padding: 0 0 4px;
}

.faq-question {
    cursor: pointer;
}

.faq-question::before {
    content: "▸ ";
    font-size: 12px;
    color: var(--pipeline-slate-light);
    transition: transform 0.2s;
    display: inline-block;
}

.faq-card.expanded .faq-question::before {
    content: "▾ ";
}

.faq-meta {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    align-items: center;
}

.faq-times-asked {
    font-size: 12px;
    color: var(--pipeline-slate-light);
}

.faq-edited-badge,
.faq-wiki-badge,
.faq-service-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.faq-edited-badge {
    background: #fef3c7;
    color: #92400e;
}

.faq-wiki-badge {
    background: #dbeafe;
    color: #1e40af;
}

.faq-service-badge {
    background: #e2e8f0;
    color: #475569;
}

/* FAQ Search */
.faq-search-container {
    padding: 0;
}

.faq-search-box {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.faq-search-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--pipeline-border);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: var(--font-body);
    outline: none;
    transition: border-color var(--transition-fast);
}

.faq-search-input:focus {
    border-color: var(--pipeline-green);
    box-shadow: 0 0 0 3px rgba(0, 113, 64, 0.1);
}

.faq-search-btn {
    padding: 12px 24px;
    background: var(--pipeline-green);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition-fast);
    font-family: var(--font-body);
}

.faq-search-btn:hover {
    background: #005a33;
}

/* FAQ Services List */
.faq-services-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Mobile responsive */
@media (max-width: 640px) {
    .faq-sub-nav {
        flex-wrap: wrap;
    }

    .faq-search-box {
        flex-direction: column;
    }

    .faq-search-btn {
        width: 100%;
    }
}

/* ============ TRENDS TAB STYLES ============ */

.trends-container {
    padding: 0;
}

.trends-header {
    margin-bottom: 16px;
}

.trends-title {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 600;
    color: var(--pipeline-slate);
}

.trends-subtitle {
    margin: 0;
    font-size: 13px;
    color: var(--pipeline-slate-light);
}

/* Controls row */
.trends-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.trends-keyword-toggles {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.trends-keyword-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 13px;
    color: var(--pipeline-slate);
}

.trends-keyword-toggle input[type="checkbox"] {
    accent-color: var(--kw-color, var(--pipeline-green));
    width: 14px;
    height: 14px;
}

.trends-keyword-label {
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 500;
    border-left: 3px solid var(--kw-color, var(--pipeline-green));
    background: rgba(0, 0, 0, 0.02);
}

.trends-year-select select {
    padding: 8px 12px;
    border: 1px solid var(--pipeline-border);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-family: var(--font-body);
    color: var(--pipeline-slate);
    background: #fff;
    cursor: pointer;
}

/* Chart wrapper */
.trends-chart-wrapper {
    position: relative;
    height: 400px;
    background: #fff;
    border: 1px solid var(--pipeline-border);
    border-radius: var(--radius-lg);
    padding: 16px;
}

/* Insight card */
.trends-insight {
    margin-top: 16px;
}

.trends-insight-card {
    background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
    border: 1px solid #bbf7d0;
    border-radius: var(--radius-lg);
    padding: 16px 20px;
}

.trends-insight-card p {
    margin: 0 0 6px;
    font-size: 13px;
    color: #166534;
    line-height: 1.5;
}

.trends-insight-card p:last-child {
    margin-bottom: 0;
}

/* Mobile responsive */
@media (max-width: 640px) {
    .trends-controls {
        flex-direction: column;
        align-items: flex-start;
    }

    .trends-chart-wrapper {
        height: 300px;
        padding: 8px;
    }
}

/* ============ SMS TAB ============ */

.sms-layout {
    display: flex;
    height: calc(100vh - 280px);
    min-height: 500px;
    border: 1px solid #e0ddd8;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.sms-sidebar {
    width: 360px;
    min-width: 300px;
    border-right: 1px solid #e0ddd8;
    display: flex;
    flex-direction: column;
    background: #faf9f7;
}

.sms-search-bar {
    padding: 12px;
    border-bottom: 1px solid #e0ddd8;
}

.sms-search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d4d0ca;
    border-radius: 6px;
    font-size: 14px;
    font-family: 'DM Sans', sans-serif;
    background: #fff;
    outline: none;
}

.sms-search-input:focus {
    border-color: #3d6b4f;
    box-shadow: 0 0 0 2px rgba(61, 107, 79, 0.15);
}

.sms-conversation-list {
    flex: 1;
    overflow-y: auto;
}

.sms-conv-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #eeebe6;
    transition: background 0.15s;
}

.sms-conv-item:hover {
    background: #f0eeea;
}

.sms-conv-item.selected {
    background: #e8f5ee;
    border-left: 3px solid #3d6b4f;
}

.sms-conv-item.unread .sms-conv-name {
    font-weight: 700;
}

.sms-conv-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
}

.sms-conv-name {
    font-weight: 600;
    font-size: 14px;
    color: #1a1a1a;
}

.sms-conv-time {
    font-size: 12px;
    color: #8a8580;
    flex-shrink: 0;
    margin-left: 8px;
}

.sms-conv-preview {
    font-size: 13px;
    color: #6b6560;
    line-height: 1.3;
    max-height: 2.6em;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sms-conv-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.sms-conv-count {
    font-size: 11px;
    color: #a09a94;
}

.sms-unread-badge {
    background: #3d6b4f;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* SMS Main Panel */
.sms-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
}

.sms-thread-header {
    padding: 14px 20px;
    border-bottom: 1px solid #e0ddd8;
    background: #faf9f7;
}

.sms-thread-header h3 {
    margin: 0 0 2px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
}

.sms-thread-number {
    font-size: 13px;
    color: #8a8580;
    margin-right: 12px;
}

.sms-thread-count {
    font-size: 12px;
    color: #a09a94;
}

.sms-thread-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Date separator */
.sms-date-separator {
    text-align: center;
    margin: 16px 0 8px 0;
}

.sms-date-separator span {
    background: #f0eeea;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    color: #8a8580;
}

/* Chat bubbles */
.sms-bubble {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
    position: relative;
}

.sms-bubble-inbound {
    align-self: flex-start;
    background: #f0eeea;
    color: #1a1a1a;
    border-bottom-left-radius: 4px;
}

.sms-bubble-outbound {
    align-self: flex-end;
    background: #3d6b4f;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.sms-bubble-text {
    white-space: pre-wrap;
}

.sms-bubble-time {
    font-size: 11px;
    margin-top: 4px;
    opacity: 0.6;
}

.sms-bubble-outbound .sms-bubble-time {
    text-align: right;
}

.sms-media-img {
    max-width: 250px;
    max-height: 250px;
    border-radius: 8px;
    margin-bottom: 6px;
    cursor: pointer;
}

/* Empty state */
.sms-empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #a09a94;
    font-size: 15px;
}

/* SMS compose bar */
.sms-compose {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid #e0ddd8;
    background: #faf9f7;
}

.sms-compose-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #d4d0ca;
    border-radius: 20px;
    font-size: 14px;
    font-family: 'DM Sans', sans-serif;
    outline: none;
    background: #fff;
}

.sms-compose-input:focus {
    border-color: #3d6b4f;
    box-shadow: 0 0 0 2px rgba(61, 107, 79, 0.15);
}

.sms-compose-send {
    padding: 8px 20px;
    background: #3d6b4f;
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    transition: background 0.15s;
}

.sms-compose-send:hover {
    background: #2d5a3f;
}

.sms-compose-send:disabled {
    background: #a0aec0;
    cursor: not-allowed;
}

.sms-media-link {
    display: inline-block;
    padding: 4px 8px;
    background: rgba(0,0,0,0.05);
    border-radius: 4px;
    color: #3d6b4f;
    text-decoration: none;
    font-size: 13px;
    margin-bottom: 4px;
}

/* SMS in caller timeline */
.timeline-sms .timeline-icon {
    font-size: 18px;
}

.timeline-sms .timeline-type {
    color: #3d6b4f;
    font-weight: 600;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .sms-layout {
        flex-direction: column;
        height: calc(100vh - 200px);
    }
    .sms-sidebar {
        width: 100%;
        max-height: 40vh;
        border-right: none;
        border-bottom: 1px solid #e0ddd8;
    }
    .sms-bubble {
        max-width: 90%;
    }
}

/* ============ CALLER HISTORY LINKS ============ */
.caller-link-header {
    cursor: pointer;
    transition: color 0.15s;
}

.caller-link-header:hover {
    color: var(--pipeline-green) !important;
    text-decoration: underline;
}

.pipeline-modal-header .caller-link-header {
    cursor: pointer;
}

.view-history-link {
    display: inline-block;
    margin: 8px 0 12px;
    color: var(--pipeline-green);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: opacity 0.15s;
}

.view-history-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* ============ EXPANDABLE TIMELINE ============ */
.timeline-item.timeline-call .timeline-header {
    cursor: pointer;
}

.timeline-item.timeline-call:hover {
    background: rgba(0, 113, 64, 0.02);
}

.timeline-item.expanded {
    background: rgba(0, 113, 64, 0.03);
    border-left: 3px solid var(--pipeline-green);
}

.timeline-expand-icon {
    font-size: 10px;
    color: var(--pipeline-slate-light);
    margin-left: auto;
}

.timeline-expand {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--pipeline-border);
}

.timeline-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 12px;
    color: var(--pipeline-slate-light);
}

.timeline-detail-meta span {
    background: var(--pipeline-bg);
    padding: 2px 8px;
    border-radius: 4px;
}

.timeline-expand .call-detail-section {
    margin-top: 12px;
}

.timeline-expand .call-detail-section h4 {
    font-size: 12px;
    font-weight: 600;
    color: var(--pipeline-slate-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 6px;
}

.timeline-expand .call-detail-section p {
    font-size: 13px;
    line-height: 1.5;
    color: var(--pipeline-slate);
    margin: 0;
}

.timeline-expand .call-audio-player {
    width: 100%;
    height: 32px;
    margin-top: 4px;
}

.timeline-expand .call-transcript {
    font-size: 13px;
    line-height: 1.6;
    background: var(--pipeline-bg);
    border-radius: var(--radius-md);
    padding: 12px;
    max-height: none;
    overflow: visible;
}

.timeline-expand .call-detail-tags {
    margin-bottom: 8px;
}

/* ============ PEOPLE SEARCH BAR ============ */
.people-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.people-toolbar .pipeline-filters {
    margin-bottom: 0;
}

.people-search-bar {
    min-width: 200px;
    flex: 0 0 auto;
}

.people-search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--pipeline-border);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-family: var(--font-body);
    outline: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
    background: #fff;
    color: var(--pipeline-slate);
}

.people-search-input:focus {
    border-color: var(--pipeline-green);
    box-shadow: 0 0 0 2px rgba(0, 113, 64, 0.1);
}

/* ============ ACTIVITY TWO-PANE LAYOUT ============ */
.activity-layout {
    display: flex;
    gap: 0;
    height: calc(100vh - 280px);
    min-height: 400px;
    border: 1px solid var(--pipeline-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #fff;
}

.activity-sidebar {
    width: 320px;
    min-width: 280px;
    border-right: 1px solid var(--pipeline-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
}

.activity-toolbar {
    display: flex;
    gap: 6px;
    padding: 10px;
    border-bottom: 1px solid var(--pipeline-border);
    background: var(--pipeline-bg);
    flex-wrap: wrap;
}

.activity-search {
    flex: 1;
    min-width: 100px;
    padding: 6px 10px;
    border: 1px solid var(--pipeline-border);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-family: var(--font-body);
    outline: none;
}

.activity-search:focus {
    border-color: var(--pipeline-green);
}

.activity-type-filter,
.activity-status-filter {
    padding: 6px 8px;
    border: 1px solid var(--pipeline-border);
    border-radius: var(--radius-md);
    font-size: 12px;
    font-family: var(--font-body);
    background: #fff;
    cursor: pointer;
}

.activity-list {
    flex: 1;
    overflow-y: auto;
}

.activity-row {
    display: flex;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--pipeline-border);
    cursor: pointer;
    transition: background 0.1s;
    align-items: flex-start;
}

.activity-row:hover {
    background: rgba(0, 113, 64, 0.03);
}

.activity-row.selected {
    background: rgba(0, 113, 64, 0.06);
    border-left: 3px solid var(--pipeline-green);
}

.activity-row-icon {
    font-size: 16px;
    line-height: 1;
    padding-top: 2px;
}

.activity-row-content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.activity-row-header {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.activity-row-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--pipeline-slate);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-row-time {
    font-size: 11px;
    color: var(--pipeline-slate-light);
    margin-left: auto;
    white-space: nowrap;
}

.activity-row-dur {
    font-size: 11px;
    color: var(--pipeline-slate-light);
}

.activity-row-preview,
.activity-row-purpose {
    font-size: 12px;
    color: var(--pipeline-slate-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.activity-badge {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 3px;
    font-weight: 600;
    white-space: nowrap;
}

.activity-badge.answered { background: #dcfce7; color: #166534; }
.activity-badge.ai-answered { background: #dbeafe; color: #1e40af; }
.activity-badge.missed { background: #fee2e2; color: #991b1b; }
.activity-badge.voicemail { background: #fef3c7; color: #92400e; }

/* Right pane */
.activity-detail {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.activity-detail-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--pipeline-border);
}

.activity-detail-header h3 {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 600;
    color: var(--pipeline-slate);
}

.activity-empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--pipeline-slate-light);
    font-size: 14px;
}

/* Mobile: stack vertically */
@media (max-width: 768px) {
    .activity-layout {
        flex-direction: column;
        min-height: auto;
    }
    .activity-sidebar {
        width: 100%;
        max-height: 300px;
        border-right: none;
        border-bottom: 1px solid var(--pipeline-border);
    }
}

/* ============ SALES TAB STYLES ============ */
.sales-attribution {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.sales-contact-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 10px 14px 6px;
    border-bottom: 1px solid var(--pipeline-border);
    margin-bottom: 8px;
}

.sales-contact-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--pipeline-text);
}

.sales-project-count {
    font-size: 13px;
    color: var(--pipeline-muted);
}

.sales-deals-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sales-deal-card {
    border: 1px solid var(--pipeline-border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    background: #fff;
}

.sales-deal-card.active {
    border-color: var(--pipeline-green);
    background: rgba(0, 113, 64, 0.02);
}

.sales-deal-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sales-deal-service {
    font-weight: 600;
    font-size: 14px;
    color: var(--pipeline-slate);
}

.sales-deal-value {
    margin-left: auto;
    font-weight: 600;
    font-size: 14px;
    color: var(--pipeline-green);
}

.sales-deal-meta {
    display: flex;
    gap: 12px;
    margin-top: 6px;
    font-size: 12px;
    color: var(--pipeline-slate-light);
}

.sales-deal-notes {
    margin: 8px 0 0;
    font-size: 13px;
    color: var(--pipeline-slate);
    line-height: 1.5;
}

.activity-badge.open { background: #dbeafe; color: #1e40af; }
.activity-badge.won { background: #dcfce7; color: #166534; }
.activity-badge.lost { background: #fee2e2; color: #991b1b; }
.activity-badge.pending { background: #fef3c7; color: #92400e; }

/* ============ THIRD PANE: CONTACT CARD ============ */
.activity-contact-pane {
    width: 280px;
    min-width: 240px;
    flex-shrink: 0;
    border-left: 1px solid var(--pipeline-border);
    overflow-y: auto;
    padding: 16px;
    background: var(--pipeline-bg);
}

.contact-card-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--pipeline-slate-light);
    font-size: 13px;
    text-align: center;
}

.contact-card-header {
    margin-bottom: 16px;
}

.contact-card-header h3 {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 600;
    color: var(--pipeline-slate);
}

.contact-card-field {
    margin-bottom: 10px;
}

.contact-card-field label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--pipeline-slate-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 3px;
}

.contact-card-field input,
.contact-card-field select,
.contact-card-field textarea {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--pipeline-border);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-family: var(--font-body);
    background: #fff;
    color: var(--pipeline-slate);
    box-sizing: border-box;
}

.contact-card-field input:focus,
.contact-card-field select:focus,
.contact-card-field textarea:focus {
    outline: none;
    border-color: var(--pipeline-green);
}

.contact-card-field textarea {
    min-height: 60px;
    resize: vertical;
}

.contact-card-field .from-callrail {
    font-size: 10px;
    color: var(--pipeline-slate-light);
    font-weight: 400;
}

.contact-card-save {
    width: 100%;
    padding: 8px;
    background: var(--pipeline-green);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: var(--font-body);
    margin-top: 12px;
    transition: background 0.15s;
}

.contact-card-save:hover {
    background: #005a33;
}

.contact-card-divider {
    border: none;
    border-top: 1px solid var(--pipeline-border);
    margin: 16px 0;
}

.contact-card-stats {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
    color: var(--pipeline-slate-light);
}

.contact-card-stats span {
    display: flex;
    justify-content: space-between;
}

.contact-card-stats strong {
    color: var(--pipeline-slate);
}

/* Mobile: hide third pane */
@media (max-width: 1024px) {
    .activity-contact-pane {
        display: none;
    }
}

/* Hide client info section in job cards when inside sales detail pane (moved to contact card) */
#sales-detail .data-section.client-level {
    display: none;
}

.activity-badge.form { background: #e0e7ff; color: #3730a3; }

/* ============ ACTIVITY COMPOSE BAR ============ */
.activity-compose {
    display: flex;
    gap: 8px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--pipeline-border);
    background: var(--pipeline-warm-gray);
    background-color: #f8f7f4;
    position: sticky;
    top: -16px;
    margin: -16px -16px 12px;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.activity-compose-input {
    background: #fff;
}

.activity-compose-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--pipeline-border);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-family: var(--font-body);
    outline: none;
}

.activity-compose-input:focus {
    border-color: var(--pipeline-green);
}

.activity-compose-send {
    padding: 8px 16px;
    background: var(--pipeline-green);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: var(--font-body);
}

.activity-compose-send:hover {
    background: #005a33;
}

/* ============ FAQ EDIT ACTIONS ============ */
.faq-actions {
    margin-left: auto;
    display: flex;
    gap: 6px;
}

.faq-edit-btn,
.faq-remove-btn {
    padding: 3px 10px;
    border: 1px solid var(--pipeline-border);
    border-radius: var(--radius-md);
    background: #fff;
    color: var(--pipeline-slate-light);
    font-size: 11px;
    cursor: pointer;
    font-family: var(--font-body);
    transition: all 0.15s;
}

.faq-edit-btn:hover { color: var(--pipeline-green); border-color: var(--pipeline-green); }
.faq-remove-btn:hover { color: #991b1b; border-color: #fca5a5; }

.faq-edit-textarea {
    width: 100%;
    min-height: 100px;
    padding: 10px;
    border: 1px solid var(--pipeline-green);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-family: var(--font-body);
    line-height: 1.5;
    resize: vertical;
    margin-bottom: 8px;
    box-sizing: border-box;
}

.faq-save-edit-btn {
    padding: 6px 16px;
    background: var(--pipeline-green);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 12px;
    cursor: pointer;
    font-family: var(--font-body);
}

/* ============ CLICKABLE PHONE LINKS ============ */
.activity-call-link {
    text-decoration: none;
    font-size: 12px;
    opacity: 0.4;
    transition: opacity 0.15s;
    cursor: pointer;
}

.activity-row:hover .activity-call-link {
    opacity: 1;
}

.contact-card-phone-row {
    display: flex;
    gap: 6px;
    align-items: center;
}

.contact-card-phone-row input {
    flex: 1;
}

.contact-call-btn {
    text-decoration: none;
    font-size: 16px;
    padding: 4px;
    border-radius: var(--radius-md);
    transition: background 0.15s;
}

.contact-call-btn:hover {
    background: rgba(0, 113, 64, 0.1);
}

/* Date range inside overview panel */
.overview-date-range {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
    padding: 8px 0 0;
}

/* ================================================================
   STYLE POLISH v3.8.0
   Premium refinements: typography, depth, micro-interactions
   Appended by a113 — CSS-only, no structure changes
   ================================================================ */

/* ============ TYPOGRAPHY REFINEMENTS ============ */

#pipeline-dashboard {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    letter-spacing: -0.01em;
}

/* Use display font for all headings and prominent text */
.pipeline-header h2,
.pipeline-modal-header h3,
.trends-title,
.faq-service-name,
.project-list-header h3,
.activity-detail-header h3,
.contact-card-header h3,
.sms-thread-header h3,
.caller-history-modal h3 {
    font-family: var(--font-display);
    letter-spacing: -0.025em;
    font-weight: 700;
}

/* Refined stat values with tabular numbers */
.pipeline-stats .stat-value,
.summary-value,
.category-value,
.calls-stat-value {
    font-family: var(--font-display);
    letter-spacing: -0.03em;
    font-weight: 800;
}

/* Crisper label text */
.pipeline-stats .stat-label,
.summary-label,
.section-label,
.form-row label,
.modal-form-row label,
.contact-card-field label {
    font-family: var(--font-display);
    letter-spacing: 0.06em;
    font-weight: 600;
}

/* ============ BASE CONTAINER REFINEMENTS ============ */

#pipeline-dashboard {
    background: linear-gradient(180deg, var(--pipeline-cream) 0%, var(--pipeline-warm-gray) 100%);
    min-height: 100vh;
}

/* ============ STAT CARDS — ELEVATED ============ */

.pipeline-stats .stat {
    background: #fff;
    border: 1px solid var(--pipeline-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    padding: 18px var(--space-lg);
    position: relative;
    overflow: hidden;
}

.pipeline-stats .stat::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--pipeline-border);
    transition: background var(--transition-base);
}

.pipeline-stats .stat:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card-hover);
}

.pipeline-stats .stat:hover::after {
    background: var(--pipeline-green);
}

.pipeline-stats .stat.warning::after {
    background: var(--status-warning);
}

.pipeline-stats .stat.success::after {
    background: var(--status-won);
}

.pipeline-stats .stat-value {
    font-size: 24px;
    color: var(--pipeline-slate);
}

/* ============ TAB BAR — POLISHED ============ */

.pipeline-view-toggle {
    background: rgba(0, 0, 0, 0.04);
    border-radius: var(--radius-lg);
    padding: 4px;
    gap: 2px;
    border: 1px solid var(--pipeline-border);
}

.view-btn {
    padding: 10px 20px;
    border-radius: calc(var(--radius-lg) - 2px);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-display);
    letter-spacing: -0.01em;
    color: var(--pipeline-slate-light);
    transition: all var(--transition-base);
    position: relative;
}

.view-btn:hover {
    color: var(--pipeline-slate);
    background: rgba(255,255,255,0.7);
}

.view-btn.active {
    background: #fff;
    color: var(--pipeline-green-dark);
    box-shadow: var(--shadow-sm), 0 0 0 1px rgba(0,0,0,0.03);
    font-weight: 700;
}

/* ============ CARD BASE — REFINED ELEVATION ============ */

.person-card,
.job-card,
.project-card {
    background: #fff;
    border: 1px solid var(--pipeline-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    transition: all var(--transition-base);
}

.person-card:hover,
.job-card:hover,
.project-card:hover {
    border-color: var(--pipeline-border-dark);
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-1px);
}

.person-card.expanded,
.job-card.expanded,
.project-card.expanded {
    border-color: var(--pipeline-green-light);
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(46, 107, 74, 0.08);
}

/* ============ CARD HEADERS — REFINED ============ */

.person-header,
.job-card-header,
.project-card-header {
    padding: 16px 18px;
    transition: background var(--transition-fast);
}

.person-header:hover,
.job-card-header:hover,
.project-card-header:hover {
    background: var(--pipeline-green-subtle);
}

.person-name,
.job-service,
.project-service {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 14px;
    letter-spacing: -0.01em;
}

/* ============ STATUS BADGES — REFINED ============ */

.deal-badge,
.job-status,
.job-row-status,
.project-status-quick,
.call-status,
.activity-badge {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: 0.04em;
    border-radius: var(--radius-sm);
}

.deal-badge {
    padding: 4px 10px;
    font-size: 10px;
}

/* ============ EXPAND ICONS — REFINED ============ */

.person-expand-icon,
.job-card-expand-icon,
.project-expand-icon,
.job-expand-icon,
.job-row-expand {
    width: 24px;
    height: 24px;
    background: var(--pipeline-bg);
    border-radius: var(--radius-full);
    transition: all var(--transition-base);
    font-size: 12px;
}

.person-card:hover .person-expand-icon,
.job-card:hover .job-card-expand-icon,
.project-card:hover .project-expand-icon {
    background: var(--pipeline-green-bg);
    color: var(--pipeline-green);
}

/* ============ CARD DETAILS — REFINED ============ */

.person-details,
.job-card-details,
.project-details {
    background: var(--pipeline-warm-gray);
    border-top: 1px solid var(--pipeline-border);
    animation: slideReveal 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.person-details::before,
.job-card-details::before,
.project-details::before {
    height: 6px;
    background: linear-gradient(180deg, rgba(0,0,0,0.03) 0%, transparent 100%);
}

/* ============ DATA SECTIONS — REFINED ============ */

.data-section {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--pipeline-border);
    transition: box-shadow var(--transition-base);
}

.data-section:hover {
    box-shadow: var(--shadow-md);
}

.data-section.client-level {
    border-top: 3px solid var(--pipeline-slate);
}

.data-section.job-level {
    border-top: 3px solid var(--pipeline-green);
}

.section-header {
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--pipeline-border);
}

.section-label {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.07em;
    color: var(--pipeline-slate);
}

.section-hint {
    background: var(--pipeline-bg);
    border-radius: var(--radius-full);
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 500;
}

/* ============ JOB ROWS — REFINED ============ */

.job-row {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    transition: all var(--transition-base);
}

.job-row:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.job-row.expanded {
    box-shadow: var(--shadow-lg);
}

.job-row-header {
    padding: 14px 18px;
}

.job-row-service {
    font-family: var(--font-display);
    font-weight: 700;
}

.job-row-category {
    background: var(--pipeline-bg);
    border-radius: var(--radius-full);
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 600;
}

.job-row-details {
    background: var(--pipeline-warm-gray);
}

/* ============ CATEGORY CARDS — REFINED ============ */

.category-card {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: var(--space-lg);
    transition: all var(--transition-base);
}

.category-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-card-hover);
    border-color: var(--pipeline-green-light);
}

.category-name {
    font-family: var(--font-display);
    font-weight: 700;
}

.category-value {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 20px;
}

.category-bar {
    height: 6px;
    border-radius: var(--radius-full);
    background: var(--pipeline-bg);
}

.category-bar-fill {
    border-radius: var(--radius-full);
    background: linear-gradient(90deg, var(--pipeline-green-dark), var(--pipeline-green-light));
}

/* ============ FILTER PILLS — REFINED ============ */

.filter-btn {
    border-radius: var(--radius-full);
    padding: 8px 16px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.01em;
    border: 1px solid var(--pipeline-border);
    transition: all var(--transition-fast);
}

.filter-btn:hover {
    background: var(--pipeline-green-subtle);
    border-color: var(--pipeline-green-light);
    color: var(--pipeline-green);
}

.filter-btn.active {
    background: var(--pipeline-green);
    color: #fff;
    border-color: var(--pipeline-green);
    box-shadow: 0 2px 4px rgba(46, 107, 74, 0.2);
}

/* ============ INPUT FIELDS — REFINED ============ */

.attribution-form-inline input,
.attribution-form-inline select,
.job-form input,
.job-form select,
.job-form textarea,
.job-row-form input,
.job-row-form select,
.job-row-form textarea,
.client-contact-form input,
.client-contact-form select,
.modal-form-row input,
.modal-form-row select,
.modal-form-row textarea,
.contact-card-field input,
.contact-card-field select,
.contact-card-field textarea {
    border-radius: var(--radius-md);
    border: 1.5px solid var(--pipeline-border);
    background: #fff;
    font-size: 14px;
    transition: all var(--transition-fast);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.03);
}

.attribution-form-inline input:hover,
.attribution-form-inline select:hover,
.job-form input:hover,
.job-form select:hover,
.job-form textarea:hover,
.job-row-form input:hover,
.job-row-form select:hover,
.job-row-form textarea:hover,
.client-contact-form input:hover,
.client-contact-form select:hover,
.modal-form-row input:hover,
.modal-form-row select:hover,
.modal-form-row textarea:hover,
.contact-card-field input:hover,
.contact-card-field select:hover,
.contact-card-field textarea:hover {
    border-color: var(--pipeline-border-dark);
}

.attribution-form-inline input:focus,
.attribution-form-inline select:focus,
.job-form input:focus,
.job-form select:focus,
.job-form textarea:focus,
.job-row-form input:focus,
.job-row-form select:focus,
.job-row-form textarea:focus,
.client-contact-form input:focus,
.client-contact-form select:focus,
.modal-form-row input:focus,
.modal-form-row select:focus,
.modal-form-row textarea:focus,
.contact-card-field input:focus,
.contact-card-field select:focus,
.contact-card-field textarea:focus {
    outline: none;
    border-color: var(--pipeline-green);
    box-shadow: var(--shadow-focus);
    background: #fff;
}

/* ============ BUTTONS — PREMIUM ============ */

.client-save-btn,
.job-save-btn,
.row-save-btn,
.add-entry-btn,
.modal-submit-btn,
.contact-card-save,
.faq-search-btn,
.sms-compose-send,
.activity-compose-send {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: 0.01em;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.add-entry-btn {
    background: var(--pipeline-green);
    box-shadow: 0 1px 3px rgba(46, 107, 74, 0.2);
    padding: 10px 22px;
}

.add-entry-btn:hover {
    background: var(--pipeline-green-dark);
    box-shadow: 0 4px 8px rgba(46, 107, 74, 0.25);
    transform: translateY(-1px);
}

.modal-cancel-btn {
    font-family: var(--font-display);
    font-weight: 600;
    border-radius: var(--radius-md);
}

/* ============ MODAL — PREMIUM ============ */

.pipeline-modal-overlay {
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.pipeline-modal {
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl), 0 0 0 1px rgba(0,0,0,0.05);
    border: none;
    animation: modalAppear 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.pipeline-modal-header {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--pipeline-border);
}

.pipeline-modal-header h3 {
    font-size: 18px;
    font-weight: 700;
}

/* ============ ACTIVITY LAYOUT — REFINED ============ */

.activity-layout {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--pipeline-border);
    overflow: hidden;
}

.activity-sidebar {
    background: #fff;
}

.activity-toolbar {
    background: var(--pipeline-warm-gray);
    border-bottom: 1px solid var(--pipeline-border);
    padding: 12px;
    gap: 8px;
}

.activity-search {
    border-radius: var(--radius-md);
    padding: 8px 12px;
    font-size: 13px;
    border: 1.5px solid var(--pipeline-border);
    transition: all var(--transition-fast);
}

.activity-search:focus {
    border-color: var(--pipeline-green);
    box-shadow: var(--shadow-focus);
}

.activity-type-filter,
.activity-status-filter {
    border-radius: var(--radius-md);
    border: 1.5px solid var(--pipeline-border);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 12px;
}

.activity-row {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    transition: all var(--transition-fast);
}

.activity-row:hover {
    background: var(--pipeline-green-subtle);
}

.activity-row.selected {
    background: var(--pipeline-green-bg);
    border-left: 3px solid var(--pipeline-green);
    box-shadow: inset 0 0 0 1px rgba(46, 107, 74, 0.06);
}

.activity-row-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 13px;
}

.activity-detail {
    background: var(--pipeline-warm-gray);
    padding: 20px;
}

.activity-detail-header {
    border-bottom: 2px solid var(--pipeline-border);
    padding-bottom: 14px;
    margin-bottom: 18px;
}

.activity-detail-header h3 {
    font-size: 20px;
}

.activity-empty-state {
    font-family: var(--font-display);
    font-weight: 500;
    color: var(--pipeline-slate-light);
}

/* Activity contact pane refinements */
.activity-contact-pane {
    background: #fff;
    border-left: 1px solid var(--pipeline-border);
}

.contact-card-header h3 {
    font-family: var(--font-display);
    font-weight: 700;
}

.contact-card-save {
    border-radius: var(--radius-md);
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(46, 107, 74, 0.15);
}

.contact-card-save:hover {
    background: var(--pipeline-green-dark);
    box-shadow: 0 3px 6px rgba(46, 107, 74, 0.2);
}

/* ============ CALLS VIEW — REFINED ============ */

.calls-stat {
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--pipeline-border);
    transition: all var(--transition-base);
}

.calls-stat:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-1px);
}

.calls-stat-value {
    font-family: var(--font-display);
    font-weight: 800;
}

.calls-stat-label {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 10px;
}

.call-card {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xs);
    transition: all var(--transition-base);
}

.call-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--pipeline-green-light);
    transform: translateY(-1px);
}

.call-name {
    font-family: var(--font-display);
    font-weight: 700;
}

.call-status {
    border-radius: var(--radius-sm);
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: 0.04em;
}

.calls-dropdown,
.calls-date-input,
.calls-search input {
    border-radius: var(--radius-md);
    border: 1.5px solid var(--pipeline-border);
    transition: all var(--transition-fast);
}

.calls-dropdown:focus,
.calls-date-input:focus,
.calls-search input:focus {
    border-color: var(--pipeline-green);
    box-shadow: var(--shadow-focus);
}

.page-btn {
    border-radius: var(--radius-md);
    font-family: var(--font-display);
    font-weight: 600;
    transition: all var(--transition-fast);
}

.page-btn:hover {
    border-color: var(--pipeline-green);
    color: var(--pipeline-green);
    background: var(--pipeline-green-subtle);
}

/* ============ FAQ TAB — REFINED ============ */

.faq-sub-tab {
    border-radius: var(--radius-md);
    font-family: var(--font-display);
    font-weight: 600;
    transition: all var(--transition-base);
}

.faq-sub-tab.active {
    box-shadow: var(--shadow-sm);
}

.faq-service-group {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: all var(--transition-base);
}

.faq-service-group:hover {
    box-shadow: var(--shadow-md);
}

.faq-service-header {
    padding: 16px 18px;
}

.faq-service-name {
    font-weight: 700;
    letter-spacing: -0.01em;
}

.faq-service-count {
    border-radius: var(--radius-full);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 11px;
}

.faq-question {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.01em;
}

.faq-search-input {
    border-radius: var(--radius-md);
    border: 1.5px solid var(--pipeline-border);
    padding: 12px 18px;
    transition: all var(--transition-fast);
}

.faq-search-input:focus {
    border-color: var(--pipeline-green);
    box-shadow: var(--shadow-focus);
}

.faq-search-btn {
    border-radius: var(--radius-md);
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(46, 107, 74, 0.15);
}

/* ============ TRENDS TAB — REFINED ============ */

.trends-title {
    font-family: var(--font-display);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.trends-chart-wrapper {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--pipeline-border);
}

.trends-insight-card {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
    border: 1px solid #bbf7d0;
}

.trends-keyword-label {
    font-family: var(--font-display);
    font-weight: 600;
    border-radius: var(--radius-sm);
}

/* ============ SMS VIEW — REFINED ============ */

.sms-layout {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--pipeline-border);
}

.sms-sidebar {
    background: #fff;
}

.sms-conv-item {
    transition: all var(--transition-fast);
}

.sms-conv-item:hover {
    background: var(--pipeline-green-subtle);
}

.sms-conv-item.selected {
    background: var(--pipeline-green-bg);
    border-left: 3px solid var(--pipeline-green);
}

.sms-conv-name {
    font-family: var(--font-display);
    font-weight: 700;
}

.sms-bubble {
    border-radius: 18px;
    box-shadow: var(--shadow-xs);
}

.sms-bubble-inbound {
    background: var(--pipeline-bg);
    border-bottom-left-radius: 6px;
}

.sms-bubble-outbound {
    background: var(--pipeline-green);
    border-bottom-right-radius: 6px;
    box-shadow: 0 2px 4px rgba(46, 107, 74, 0.15);
}

.sms-search-input,
.sms-compose-input {
    border-radius: var(--radius-full);
    border: 1.5px solid var(--pipeline-border);
    transition: all var(--transition-fast);
}

.sms-search-input:focus,
.sms-compose-input:focus {
    border-color: var(--pipeline-green);
    box-shadow: var(--shadow-focus);
}

.sms-compose-send {
    border-radius: var(--radius-full);
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(46, 107, 74, 0.15);
}

.sms-unread-badge {
    background: var(--pipeline-green);
    border-radius: var(--radius-full);
    font-family: var(--font-display);
    font-weight: 800;
}

.sms-date-separator span {
    background: var(--pipeline-bg);
    border-radius: var(--radius-full);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.02em;
}

/* ============ OVERVIEW PANEL — REFINED ============ */

.overview-toggle {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 8px 0;
    color: var(--pipeline-slate-light);
}

.overview-toggle:hover {
    color: var(--pipeline-green);
}

.pipeline-trend-chart {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--pipeline-border);
}

/* Chart mode toggle refinement */
.chart-mode-toggle {
    background: var(--pipeline-bg);
    border-radius: var(--radius-md);
    padding: 3px;
    border: 1px solid var(--pipeline-border);
}

.chart-mode-btn {
    border-radius: calc(var(--radius-md) - 2px);
    font-family: var(--font-display);
    font-weight: 600;
    padding: 5px 14px;
}

.chart-mode-btn.active {
    background: #fff;
    box-shadow: var(--shadow-xs);
    color: var(--pipeline-green-dark);
}

/* ============ SALES TAB — REFINED ============ */

.sales-deal-card {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    transition: all var(--transition-base);
    padding: 14px 16px;
}

.sales-deal-card:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-1px);
}

.sales-deal-card.active {
    border-color: var(--pipeline-green);
    box-shadow: var(--shadow-md), 0 0 0 1px rgba(46, 107, 74, 0.08);
}

.sales-deal-service {
    font-family: var(--font-display);
    font-weight: 700;
}

.sales-deal-value {
    font-family: var(--font-display);
    font-weight: 800;
}

/* ============ ATTRIBUTION PILLS — REFINED ============ */

.person-attribution {
    border-radius: var(--radius-full);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 11px;
    padding: 3px 10px;
}

/* ============ CALLER HISTORY / TIMELINE — REFINED ============ */

.caller-history-summary span {
    border-radius: var(--radius-sm);
    font-family: var(--font-display);
    font-weight: 600;
}

.timeline-item {
    padding: 14px 0;
    transition: background var(--transition-fast);
}

.timeline-item:hover {
    background: var(--pipeline-green-subtle);
}

.timeline-item.expanded {
    background: var(--pipeline-green-subtle);
    border-left: 3px solid var(--pipeline-green);
    padding-left: 12px;
    margin-left: -12px;
    border-radius: var(--radius-sm);
}

.timeline-type {
    font-family: var(--font-display);
    font-weight: 700;
}

.call-tag {
    border-radius: var(--radius-sm);
    font-family: var(--font-display);
    font-weight: 600;
}

.call-transcript {
    border-radius: var(--radius-lg);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.04);
}

/* ============ STAGGERED ANIMATIONS — SMOOTHER ============ */

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

.person-card,
.job-card,
.category-card,
.call-card {
    animation: fadeInUp var(--transition-slow) cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

/* Smoother stagger */
.pipeline-people .person-card:nth-child(1),
.pipeline-jobs .job-card:nth-child(1),
.category-grid .category-card:nth-child(1),
.calls-list .call-card:nth-child(1) { animation-delay: 0ms; }
.pipeline-people .person-card:nth-child(2),
.pipeline-jobs .job-card:nth-child(2),
.category-grid .category-card:nth-child(2),
.calls-list .call-card:nth-child(2) { animation-delay: 40ms; }
.pipeline-people .person-card:nth-child(3),
.pipeline-jobs .job-card:nth-child(3),
.category-grid .category-card:nth-child(3),
.calls-list .call-card:nth-child(3) { animation-delay: 80ms; }
.pipeline-people .person-card:nth-child(4),
.pipeline-jobs .job-card:nth-child(4),
.category-grid .category-card:nth-child(4),
.calls-list .call-card:nth-child(4) { animation-delay: 120ms; }
.pipeline-people .person-card:nth-child(5),
.pipeline-jobs .job-card:nth-child(5),
.category-grid .category-card:nth-child(5),
.calls-list .call-card:nth-child(5) { animation-delay: 160ms; }
.pipeline-people .person-card:nth-child(n+6),
.pipeline-jobs .job-card:nth-child(n+6),
.category-grid .category-card:nth-child(n+6),
.calls-list .call-card:nth-child(n+6) { animation-delay: 200ms; }

/* ============ LOADING STATE — REFINED ============ */

.pipeline-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--pipeline-border);
    border-top-color: var(--pipeline-green);
    border-radius: 50%;
}

.pipeline-loading p {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--pipeline-slate-light);
    letter-spacing: -0.01em;
}

/* ============ ERROR & EMPTY STATES — REFINED ============ */

.pipeline-error {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    font-family: var(--font-display);
    font-weight: 600;
}

.pipeline-empty {
    font-family: var(--font-display);
    font-weight: 500;
}

/* ============ SCROLLBAR HIDING — Cross-browser ============ */
#pipeline-dashboard * {
    scrollbar-width: none;
    -ms-overflow-style: none;
}
#pipeline-dashboard *::-webkit-scrollbar {
    display: none;
}

/* ============ SUBTLE SELECTION COLOR ============ */
#pipeline-dashboard ::selection {
    background: rgba(46, 107, 74, 0.15);
    color: var(--pipeline-slate);
}

/* ============ MOBILE POLISH ============ */
@media (max-width: 768px) {
    .pipeline-view-toggle {
        border-radius: var(--radius-md);
    }

    .view-btn {
        padding: 8px 14px;
        font-size: 12px;
        border-radius: calc(var(--radius-md) - 2px);
    }

    .activity-layout,
    .sms-layout {
        border-radius: var(--radius-md);
    }

    .pipeline-stats .stat {
        padding: 12px 16px;
    }

    .pipeline-stats .stat-value {
        font-size: 20px;
    }
}

/* Hourly Call Chart Toggle + Exclude Weekends */
#call-chart-toggle {
    font-size: 12px;
    margin-bottom: 4px;
}
#call-chart-toggle .chart-mode-btn {
    padding: 4px 10px;
    font-size: 12px;
}
.hourly-chart-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}
.hourly-chart-controls label {
    font-size: 12px;
    color: var(--pipeline-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-display);
    font-weight: 500;
}
.hourly-chart-controls input[type=checkbox] {
    accent-color: var(--pipeline-green);
    cursor: pointer;
}

/* Deal timeline items */
.timeline-deal .timeline-icon {
    font-size: 18px;
}
.timeline-deal .timeline-type {
    color: #b8860b;
    font-weight: 600;
}
.timeline-deal .deal-value {
    color: #2d5016;
    font-weight: 600;
    font-size: 13px;
    margin-left: 6px;
}
.timeline-item.timeline-deal {
    border-left: 3px solid #daa520;
    padding-left: 12px;
}

/* Deal rows in activity sidebar */
.activity-row-deal {
    border-left: 3px solid #daa520;
}

/* Activity filter chips (Facebook-style emoji toggles) */
.activity-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    width: 100%;
}
.activity-chip {
    padding: 4px 10px;
    border: 1px solid var(--pipeline-border);
    border-radius: 999px;
    background: #fff;
    font-size: 16px;
    font-family: var(--font-body);
    cursor: pointer;
    color: var(--pipeline-text);
    transition: background 0.12s, color 0.12s, border-color 0.12s, opacity 0.12s, filter 0.12s;
    line-height: 1.2;
    opacity: 0.45;
    filter: grayscale(0.6);
}
.activity-chip:hover {
    opacity: 0.8;
    filter: grayscale(0.2);
    border-color: var(--pipeline-green);
}
.activity-chip.active {
    background: var(--pipeline-green);
    border-color: var(--pipeline-green);
    opacity: 1;
    filter: none;
}
.activity-chip.active:hover {
    opacity: 1;
    filter: none;
}

/* ============ DETAIL CARD (deal / form inline expansion) ============ */
.timeline-expand.detail-card {
    margin-top: 10px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid var(--pipeline-border);
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    font-size: 13px;
    line-height: 1.45;
}
.timeline-deal.expanded .timeline-expand.detail-card {
    border-left: 3px solid #daa520;
}
.timeline-form.expanded .timeline-expand.detail-card {
    border-left: 3px solid #6366f1;
}
.detail-card-section {
    margin-bottom: 14px;
}
.detail-card-section:last-child {
    margin-bottom: 0;
}
.detail-card-section h4 {
    margin: 0 0 8px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--pipeline-muted, #6b7280);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}
.card-count {
    background: var(--pipeline-bg, #f4f3f0);
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 600;
    color: var(--pipeline-muted, #6b7280);
    text-transform: none;
    letter-spacing: 0;
}
.card-kv {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 6px 14px;
}
.card-kv-row {
    display: contents;
}
.card-kv-key {
    font-weight: 500;
    color: var(--pipeline-muted, #6b7280);
    font-size: 12px;
    padding-top: 2px;
}
.card-kv-val {
    color: var(--pipeline-text, #1f2937);
    word-break: break-word;
}
.card-kv-val a {
    color: var(--pipeline-green);
    text-decoration: none;
}
.card-kv-val a:hover {
    text-decoration: underline;
}
.card-empty {
    color: #9ca3af;
    font-style: italic;
    font-size: 12px;
}
.card-empty-state {
    padding: 8px;
    color: #9ca3af;
    font-style: italic;
    text-align: center;
}
.card-money { color: #2d5016; }
.card-money-win { color: #15803d; font-size: 14px; }
.card-sub { color: var(--pipeline-muted, #6b7280); font-size: 11px; font-weight: 400; }
.card-notes {
    background: #fffbea;
    border-left: 3px solid #facc15;
    padding: 10px 12px;
    border-radius: 4px;
    white-space: pre-wrap;
    color: var(--pipeline-text, #1f2937);
}
.activity-filter-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.activity-filter-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--pipeline-muted, #6b7280);
    padding-left: 2px;
}
.source-calls { display: flex; flex-direction: column; gap: 10px; }
.source-call {
    background: #fafafa;
    border-left: 3px solid #6366f1;
    border-radius: 4px;
    padding: 8px 12px;
}
.source-call-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 12px;
}
.source-call-date { font-weight: 600; color: var(--pipeline-text, #1f2937); }
.source-call-link {
    color: #4f46e5;
    text-decoration: none;
    font-weight: 500;
}
.source-call-link:hover { text-decoration: underline; }
.source-snippet {
    margin: 6px 0 0;
    padding: 6px 10px;
    border-left: 2px solid #c7d2fe;
    background: #fff;
    font-style: italic;
    color: var(--pipeline-muted, #4b5563);
    font-size: 13px;
    line-height: 1.5;
}
.timeline-item .timeline-expand-icon {
    margin-left: auto;
    color: var(--pipeline-muted, #6b7280);
    font-size: 10px;
    transition: transform 0.15s;
}
.timeline-deal, .timeline-form {
    cursor: pointer;
}
