/* =============================================================================
   Agentic SDR Configuration Management - Styles
   Modern, clean, professional UI with responsive design
   ============================================================================= */

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    
    --bg-color: #f8fafc;
    --surface-color: #ffffff;
    --border-color: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
}

/* =============================================================================
   Navigation
   ============================================================================= */

.navbar {
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1050;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.nav-brand img,
.login-logo img,
.reset-logo img {
    display: inline-block;
    background: transparent;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    mix-blend-mode: normal;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Role Badges */
.role-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    width: auto;
    min-width: fit-content;
}

.system-admin-badge {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: 2px solid rgba(255,255,255,0.3);
    box-shadow: 0 2px 4px rgba(245, 87, 108, 0.3);
}

.client-admin-badge {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: 2px solid rgba(255,255,255,0.3);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.client-user-badge {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: 2px solid rgba(255,255,255,0.3);
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.introducer-badge {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
    border: 2px solid rgba(255,255,255,0.3);
    box-shadow: 0 2px 4px rgba(139, 92, 246, 0.3);
    font-size: 0.7rem;
    padding: 4px 10px;
}

/* User Info */
.user-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

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

/* User dropdown (trigger button + popup menu) */
.user-dropdown-wrapper {
    position: relative;
    display: inline-block;
}
.user-dropdown-trigger {
    cursor: pointer;
}
.user-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    min-width: 180px;
    padding: 8px 0;
    background: white;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
}
.user-dropdown-menu.show {
    display: block;
}
.user-dropdown-item {
    display: block;
    padding: 8px 16px;
    font-size: 0.875rem;
    color: var(--text-primary, #374151);
    text-decoration: none;
}
.user-dropdown-name {
    font-weight: 600;
}
.user-dropdown-roles {
    color: var(--text-secondary, #6b7280);
    font-size: 0.8125rem;
}
.user-dropdown-logout {
    cursor: pointer;
    color: var(--primary-color, #2563eb);
}
.user-dropdown-logout:hover {
    background: #f3f4f6;
}

.client-dropdown {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--surface-color);
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    min-width: 200px;
}

.client-dropdown:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* =============================================================================
   Flash Messages
   ============================================================================= */

.flash-messages {
    max-width: 1400px;
    margin: 1rem auto;
    padding: 0 2rem;
}

.flash-message {
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.flash-success {
    background-color: #d1fae5;
    border-left: 4px solid var(--success-color);
    color: #065f46;
}

.flash-error {
    background-color: #fee2e2;
    border-left: 4px solid var(--danger-color);
    color: #991b1b;
}

.flash-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
}

.flash-close:hover {
    opacity: 1;
}

/* =============================================================================
   Main Content
   ============================================================================= */

.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.container {
    width: 100%;
}

/* =============================================================================
   Hero Section
   ============================================================================= */

.hero-section {
    text-align: center;
    padding: 3rem 0;
}

.hero-section h1 {
    font-size: 2.5125rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.hero-subtitle {
    font-size: 1.6875rem;
    color: var(--text-secondary);
    margin-top: 1.5rem;
    margin-bottom: 2rem;
}

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

/* Welcome Section (not logged in) */
.welcome-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0;
    background: transparent;
    border-radius: var(--radius-lg);
    max-width: 933px;
    margin: 2rem auto;
}

.welcome-section-logos {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
    flex: 0 0 auto;
}

.welcome-section-logo-link {
    display: block;
    line-height: 0;
}

.welcome-section-link-ai-logo {
    display: block;
    height: 60px;
    width: auto;
    max-width: 100%;
}

.welcome-section-plus {
    font-family: Arial, sans-serif;
    font-size: 36px;
}

.welcome-section-holy-trinity-logo {
    display: block;
    height: 90px;
    width: auto;
    max-width: 100%;
}

.welcome-section-profile-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    flex: 0 0 auto;
}

.welcome-section-linkedin-link {
    display: block;
    line-height: 0;
}

.welcome-section-logo {
    display: block;
    width: 48px;
    height: 48px;
}

.welcome-section-profile {
    display: block;
    width: 292px;
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.welcome-section h2 {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.welcome-section p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1.05rem;
}

.btn-lg {
    padding: 14px 32px;
    font-size: 1.1rem;
}

/* System Administration Section */
.system-admin-section {
    background: linear-gradient(135deg, rgba(240, 147, 251, 0.08) 0%, rgba(245, 87, 108, 0.08) 100%);
    border: 2px solid #f093fb;
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 32px;
}

.system-admin-section h2 {
    color: #f5576c;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.section-icon {
    margin-right: 8px;
}

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.section {
    margin-bottom: 32px;
}

.section h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--text-primary);
}

/* =============================================================================
   Page Header
   ============================================================================= */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.page-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

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

.nav-breadcrumbs .page-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
    padding: 0;
}

.breadcrumb-link {
    color: var(--primary-color);
    text-decoration: none;
}

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

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

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

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.client-card {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.client-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.card-header h2 {
    font-size: 1.25rem;
    margin: 0;
}

.card-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

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

.card-action {
    color: var(--primary-color);
    font-size: 0.875rem;
    font-weight: 500;
}

/* =============================================================================
   Badges
   ============================================================================= */

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-success {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

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

.badge-secondary {
    background-color: #f1f5f9;
    color: #475569;
}

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

/* =============================================================================
   Sections
   ============================================================================= */

.section {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.section h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

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

.info-section {
    background-color: #dbeafe;
    border: 1px solid #93c5fd;
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
}

.info-section h3 {
    margin-bottom: 1rem;
}

.feature-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 0.5rem;
}

.feature-list li {
    padding: 0.5rem 0;
}

/* =============================================================================
   Configuration Lists
   ============================================================================= */

.config-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.config-item {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.config-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.config-item-header {
    margin-bottom: 1rem;
}

.config-item-header h3 {
    font-size: 1.125rem;
    margin: 0 0 0.5rem 0;
}

.config-meta {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    margin-bottom: 0.25rem;
}

.config-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.config-badges {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.config-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.875rem;
}

.config-action {
    color: var(--primary-color);
    font-weight: 500;
}

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

/* =============================================================================
   Category Sections
   ============================================================================= */

.category-section {
    margin-bottom: 2.5rem;
}

.category-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.variables-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    min-width: 0;
}

/* =============================================================================
   Text Editing Boxes - Full Width
   ============================================================================= */

.variable-edit textarea,
.variable-edit input[type="text"],
.multiline-editor,
.dict-editor,
.text-editor {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* =============================================================================
   Variable Items
   ============================================================================= */

.variable-item {
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--bg-color);
    transition: all 0.2s ease;
    position: relative;
    min-width: 0;
}

.variable-item:hover {
    border-color: var(--primary-color);
}

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

.variable-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.variable-help {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: var(--info-color);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: help;
}

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

.text-display, .multiline-display {
    padding: 0.5rem;
    background-color: var(--surface-color);
    border-radius: var(--radius-sm);
    word-wrap: break-word;
}

.multiline-display {
    white-space: pre-wrap;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
}

.boolean-display {
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    background-color: var(--info-color);
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
}

.list-display {
    list-style: none;
}

.list-display li {
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    background-color: var(--surface-color);
    border-left: 3px solid var(--primary-color);
    border-radius: var(--radius-sm);
}

/* Static list display for client users - normal background */
.static-list-display {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin: 0.5rem 0;
    font-size: 0.95rem;
    line-height: 1.6;
}

.static-text-display {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin: 0.5rem 0;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Highlight individual bullet content */
.static-list-display .highlight-bullet {
    background-color: #fef3c7;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    display: inline-block;
    margin: 0.125rem 0;
}

.dict-display,
pre.dict-display {
    padding: 0.5rem;
    background-color: var(--surface-color);
    border-radius: var(--radius-sm);
    word-wrap: break-word;
    white-space: pre-wrap;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
}

/* =============================================================================
   Form Controls
   ============================================================================= */

.form-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.98rem; /* Reduced from 1.3125rem by 25% */
    background-color: var(--surface-color);
    color: var(--text-primary);
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

/* Ensure textareas wrap content properly on all screen sizes */
textarea.form-control {
    resize: vertical;
    overflow-wrap: break-word;
    word-wrap: break-word;
    white-space: pre-wrap;
    min-width: 0;
    max-width: 100%;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.code-editor {
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.75rem;
}

/* =============================================================================
   List Editor
   ============================================================================= */

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

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

.list-item-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.list-item-row input {
    flex: 1;
}

.delete-item-btn {
    padding: 0.5rem 0.75rem;
    background-color: var(--danger-color);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.875rem;
    transition: background-color 0.2s ease;
}

.delete-item-btn:hover {
    background-color: #dc2626;
}

/* =============================================================================
   System Section
   ============================================================================= */

.system-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.system-section-header:hover h2 {
    color: var(--primary-color);
}

.toggle-icon {
    font-size: 1.25rem;
    transition: transform 0.3s ease;
}

.toggle-icon.collapsed {
    transform: rotate(-90deg);
}

.system-section-content {
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.system-section-content.collapsed {
    max-height: 0 !important;
}

/* =============================================================================
   Buttons
   ============================================================================= */

.btn {
    padding: 0.5rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

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

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

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #475569;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: #059669;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

/* =============================================================================
   Variable Actions
   ============================================================================= */

.edit-variable-btn {
    margin-top: 0.75rem;
    width: 100%;
}

.variable-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.cancel-variable-btn,
.save-variable-btn {
    flex: 1;
}

.variable-edit .edit-variable-btn {
    display: none;
}

.variable-view .variable-actions {
    display: none;
}

/* =============================================================================
   Save Notification
   ============================================================================= */

.save-notification {
    position: fixed;
    top: 80px;
    right: 2rem;
    background-color: var(--info-color);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.save-notification.success {
    background-color: var(--success-color);
}

.save-notification.error {
    background-color: var(--danger-color);
}

/* =============================================================================
   Empty State
   ============================================================================= */

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

/* =============================================================================
   Error Page
   ============================================================================= */

.error-page {
    text-align: center;
    padding: 5rem 2rem;
}

.error-page h1 {
    font-size: 6rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
}

.error-message {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

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

@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
    }
    
    .nav-container {
        padding: 1rem;
    }
    
    .page-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .header-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .card-grid {
        grid-template-columns: 1fr;
    }
    
    .feature-list {
        grid-template-columns: 1fr;
    }
    
    .action-bar-content {
        padding: 1rem;
    }

    .welcome-section {
        flex-wrap: wrap;
        row-gap: 1rem;
        column-gap: 0.75rem;
    }

    .welcome-section-logos {
        order: 1;
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 0.75rem;
    }

    .welcome-section-profile-wrapper {
        order: 2;
        width: 100%;
    }

    .welcome-section-profile {
        width: 260px;
    }
}

@media (max-width: 640px) {
    .welcome-section-logos {
        flex-direction: column;
        align-items: center;
    }
}

/* =============================================================================
   Section Headers and Actions
   ============================================================================= */

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

.section-header h2 {
    margin: 0;
}

/* =============================================================================
   Configuration Actions
   ============================================================================= */

.config-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.config-actions .btn {
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
}

.config-actions .btn-danger {
    background-color: #e53e3e;
    border-color: #e53e3e;
    color: white;
}

.config-actions .btn-success {
    background-color: #38a169;
    border-color: #38a169;
    color: white;
}

.config-actions .btn-success:hover {
    background-color: #2f855a;
    border-color: #2f855a;
}

.config-actions .btn-success:disabled {
    background-color: #a0aec0;
    border-color: #a0aec0;
    cursor: not-allowed;
}

.config-actions .btn-danger:hover {
    background-color: #c53030;
    border-color: #c53030;
    color: white;
}

.config-actions .btn-danger:disabled {
    background-color: #94a3b8;
    border-color: #94a3b8;
    cursor: not-allowed;
}

/* =============================================================================
   Notifications
   ============================================================================= */

.notification {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* =============================================================================
   Modal Styles
   ============================================================================= */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-header h3 {
    margin: 0;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

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

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-color);
}

/* =============================================================================
   Form Styles
   ============================================================================= */

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: border-color 0.2s ease;
    background-color: var(--surface-color);
}

.form-group select {
    cursor: pointer;
}

.form-group select:disabled {
    background-color: var(--bg-color);
    cursor: not-allowed;
    opacity: 0.6;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-help {
    display: block;
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* =============================================================================
   Button Loading States
   ============================================================================= */

.btn-loading {
    display: none;
}

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

/* =============================================================================
   Pipeline Trace Styles
   ============================================================================= */

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

.page-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.pipeline-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.pipeline-trace-container {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.pipeline-trace {
    height: 400px;
    overflow-y: auto;
    background-color: #1a1a1a;
    color: #e0e0e0;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    padding: 1rem;
}

.pipeline-trace-content {
    min-height: 100%;
}

.trace-line {
    margin-bottom: 0.25rem;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.trace-time {
    color: #888;
    font-size: 0.75rem;
    margin-right: 0.5rem;
}

.pipeline-trace::-webkit-scrollbar {
    width: 8px;
}

.pipeline-trace::-webkit-scrollbar-track {
    background: #2a2a2a;
}

.pipeline-trace::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

.pipeline-trace::-webkit-scrollbar-thumb:hover {
    background: #777;
}

/* Pipeline trace icons */
.icon-play::before {
    content: "▶";
    margin-right: 0.25rem;
}

.icon-spinner::before {
    content: "⟳";
    margin-right: 0.25rem;
    animation: spin 1s linear infinite;
}

.icon-trash::before {
    content: "🗑";
    margin-right: 0.25rem;
}

.icon-refresh::before {
    content: "↻";
    margin-right: 0.25rem;
}

.icon-file-text::before {
    content: "📝";
    margin-right: 0.25rem;
}

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

/* =============================================================================
   Client Dashboard Specific Styles
   ============================================================================= */

/* Filter dropdowns and labels on client dashboard */
.filter-dropdown {
    font-size: 0.98rem !important; /* Reduced from 1.3125rem by 25% */
    padding: 0.75rem !important; /* Increased padding for better touch targets */
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    max-width: 100%;
    box-sizing: border-box;
}

/* Enable word wrap for dropdown options */
.filter-dropdown option {
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Filter labels on client dashboard */
.filter-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-row label {
    font-size: 0.98rem !important; /* Reduced from 1.3125rem by 25% */
    font-weight: 500;
}

/* =============================================================================
   Pipeline Monitor Styles
   ============================================================================= */

.pipeline-monitor-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.pipeline-status {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);  /* Changed from text-secondary for better visibility */
    margin-left: 1rem;
}

.pipeline-monitor-container {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.pipeline-monitor {
    height: 300px;
    overflow-y: auto;
    background-color: #1a1a1a;
    color: #e0e0e0;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    padding: 1rem;
}

.pipeline-monitor-content {
    min-height: 100%;
}

.monitor-line {
    margin-bottom: 0.25rem;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.monitor-time {
    color: #888;
    font-size: 0.75rem;
    margin-right: 0.5rem;
}

.pipeline-monitor::-webkit-scrollbar {
    width: 8px;
}

.pipeline-monitor::-webkit-scrollbar-track {
    background: #2a2a2a;
}

.pipeline-monitor::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

.pipeline-monitor::-webkit-scrollbar-thumb:hover {
    background: #777;
}

/* Pipeline monitor icons */
.icon-stop::before {
    content: "⏹";
    margin-right: 0.25rem;
}

.icon-spinner::before {
    content: "⟳";
    margin-right: 0.25rem;
    animation: spin 1s linear infinite;
}

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

.icon-pause::before {
    content: "⏸";
    margin-right: 0.25rem;
}

.icon-play::before {
    content: "▶";
    margin-right: 0.25rem;
}

/* =============================================================================
   Create Client Section
   ============================================================================= */

.create-client-section {
    text-align: center;
    padding: 2rem 0;
    margin: 2rem 0;
}

.btn-create-client {
    font-size: 1.1rem;
    padding: 0.75rem 2rem;
}

/* =============================================================================
   Modal Styles
   ============================================================================= */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: var(--radius-md);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

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

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color 0.2s;
}

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

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* =============================================================================
   Form Styles
   ============================================================================= */

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

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

.form-info {
    margin-top: 1rem;
    padding: 0.75rem;
    background-color: var(--bg-color);
    border-left: 3px solid var(--primary-color);
    font-size: 0.9rem;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
}

/* =============================================================================
   Config Name Editing
   ============================================================================= */

.config-name-container {
    margin-bottom: 0.5rem;
}

.config-name-view {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.config-name-view h1 {
    margin: 0;
    display: inline-block;
}

.edit-config-name-link {
    font-size: 0.875rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.edit-config-name-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.config-name-edit {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.config-name-input {
    font-size: 1.875rem;
    font-weight: 700;
    padding: 0.5rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    flex: 1;
    max-width: 500px;
    transition: border-color 0.2s;
}

.config-name-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* =============================================================================
   Client Selector Bar
   ============================================================================= */

.client-selector-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding: 0.75rem 0;
}

.client-selector-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.client-selector-dropdown {
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: var(--surface-color);
    color: var(--text-primary);
    font-size: 1.07rem; /* Reduced from 1.425rem by 25% */
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    min-width: 200px;
}

.client-selector-dropdown:hover {
    border-color: var(--primary-color);
}

.client-selector-dropdown:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* =============================================================================
   Prospect Management Section
   ============================================================================= */

.prospect-management-section {
    margin-bottom: 2rem;
}

.prospect-management-container {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.prospect-lists-panel,
.list-members-panel,
.prospects-panel {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
}

.prospect-lists-panel label,
.list-members-panel label,
.prospects-panel label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-size: 1.07rem; /* Reduced from 1.425rem by 25% */
}

.checkbox-list {
    width: 100%;
    min-height: 250px;
    max-height: 400px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.5rem;
    overflow-y: auto;
    background-color: var(--surface-color);
    min-width: 300px; /* Match client page requirement */
}

.checkbox-item {
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.15s;
}

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

.checkbox-item:hover {
    background-color: var(--bg-color);
}

.checkbox-item label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    margin: 0;
    user-select: none;
}

.checkbox-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    min-width: 20px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.checkbox-item span {
    flex: 1;
    font-size: 1.07rem; /* Reduced from 1.425rem by 25% */
    color: var(--text-primary);
}

.prospect-divider {
    padding: 0.75rem 0.5rem;
    font-weight: bold;
    background-color: #f0f0f0;
    color: #000000;
    border-bottom: 1px solid var(--border-color);
    user-select: none;
    cursor: default;
}

/* Indent checkbox items that follow prospect dividers to show hierarchy */
.prospect-divider + .checkbox-item {
    padding-left: 2rem; /* Indent target list items under their prospect group */
}

.empty-message {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
}

/* Selectable items (single-select, no checkboxes) */
.selectable-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.15s, border-left 0.15s;
    user-select: none;
    font-size: 1.07rem; /* Reduced from 1.425rem by 25% */
    color: var(--text-primary);
    border-left: 3px solid transparent;
}

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

.selectable-item:hover {
    background-color: var(--bg-color);
}

.selectable-item.selected {
    background-color: rgba(37, 99, 235, 0.1);
    border-left-color: var(--primary-color);
    font-weight: 600;
}

.panel-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--surface-color);
    cursor: pointer;
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1;
    color: var(--text-primary);
    transition: all 0.2s;
}

.btn-icon:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.btn-icon:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.inline-form {
    margin-top: 0.75rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-color);
}

.inline-form input.form-control {
    width: 100%;
    margin-bottom: 0.75rem;
}

.inline-form-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.prospects-panel .btn-sm {
    margin-top: 0.75rem;
    width: 100%;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .prospect-management-container {
        flex-direction: column;
    }
    
    .prospect-lists-panel,
    .list-members-panel,
    .prospects-panel {
        width: 100%;
    }
}

/* =============================================================================
   Pipeline Run Section
   ============================================================================= */

.pipeline-run-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.pipeline-run-controls {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
}

.pipeline-control-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.pipeline-selector-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1.125rem; /* Reduced from 1.5rem by 25% */
    white-space: nowrap;
}

.pipeline-selector-dropdown {
    flex: 1;
    max-width: 400px;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: var(--surface-color);
    color: var(--text-primary);
    font-size: 1.125rem; /* Reduced from 1.5rem by 25% */
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.pipeline-selector-dropdown:hover {
    border-color: var(--primary-color);
}

.pipeline-selector-dropdown:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Wider dropdown for completed runs to accommodate longer text */
#completedRunsSelector {
    max-width: 560px;  /* 40% wider than standard 400px */
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .pipeline-run-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    /* Override container max-width on mobile to allow full width */
    .pipeline-run-controls > div {
        max-width: 100% !important;
        width: 100% !important;
    }
    
    .pipeline-control-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .pipeline-selector-dropdown {
        max-width: none;
        width: 100%;
    }
    
    /* Ensure filter dropdowns don't overflow on mobile */
    .filter-dropdown {
        max-width: 100% !important;
        width: 100% !important;
        min-width: 0 !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        white-space: normal !important;
    }
    
    /* Specific overrides for pipeline dropdowns */
    #prospectListSelector,
    #pipelineConfigSelector,
    #personListSelector,
    #engagementConfigSelector {
        max-width: 100% !important;
        width: 100% !important;
        min-width: 0 !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        white-space: normal !important;
    }
    
    /* Ensure filter rows stack properly on mobile */
    .filter-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-row label {
        margin-bottom: 0.5rem;
    }
}

/* =============================================================================
   Pipeline Run Detail Page
   ============================================================================= */

.run-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.overview-item {
    padding: 1rem;
    background-color: var(--bg-color);
    border-radius: var(--radius-sm);
}

.overview-item label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.overview-item span {
    font-size: 1rem;
    color: var(--text-primary);
}

.params-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

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

.param-card h3 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.param-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
}

.param-version {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0 0 1rem 0;
}

.param-info {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0 0 1rem 0;
}

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

.metric-card {
    padding: 1.5rem;
    background-color: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    text-align: center;
}

.metric-card.metric-success {
    border-color: var(--success-color);
    background-color: rgba(16, 185, 129, 0.05);
}

.metric-card.metric-danger {
    border-color: var(--danger-color);
    background-color: rgba(239, 68, 68, 0.05);
}

.metric-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.metric-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.prospects-snapshot {
    margin-top: 1rem;
    padding: 1rem;
    background-color: var(--bg-color);
    border-radius: var(--radius-sm);
    max-height: 400px;
    overflow-y: auto;
}

.prospects-list {
    list-style: none;
    padding: 0;
    margin: 0;
    column-count: 3;
    column-gap: 2rem;
}

.prospects-list li {
    padding: 0.5rem 0;
    break-inside: avoid;
}

.error-box {
    margin-top: 1rem;
    padding: 1rem;
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger-color);
    border-radius: var(--radius-sm);
}

.error-box pre {
    margin: 0;
    color: var(--danger-color);
    white-space: pre-wrap;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 0.875rem;
}

.log-actions {
    margin-top: 1rem;
}

@media (max-width: 768px) {
    .prospects-list {
        column-count: 1;
    }
    
    .params-grid,
    .metrics-grid {
        grid-template-columns: 1fr;
    }
}

/* =============================================================================
   Pipeline Monitor Autoscroll Toggle
   ============================================================================= */

.autoscroll-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    user-select: none;
    padding: 0.5rem 0.75rem;
    background-color: var(--bg-color);
    border-radius: var(--radius-sm);
    transition: background-color 0.2s;
}

.autoscroll-toggle:hover {
    background-color: var(--border-color);
}

.autoscroll-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.autoscroll-toggle span {
    cursor: pointer;
}

/* =============================================================================
   Prospects Overview Section
   ============================================================================= */

.prospects-overview-section {
    margin-bottom: 2rem;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: -0.5rem;
    margin-bottom: 1rem;
}

.more-prospects-section {
    margin-top: 1.5rem;
}

.collapsible-toggle {
    width: 100%;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background-color 0.2s, border-color 0.2s;
}

.collapsible-toggle:hover {
    background-color: var(--border-color);
    border-color: var(--text-secondary);
}

.toggle-icon {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-color);
    width: 20px;
    text-align: center;
}

.toggle-text {
    flex: 1;
}

.toggle-count {
    color: var(--text-secondary);
    font-weight: normal;
    font-size: 0.9rem;
}

.collapsible-content {
    margin-top: 1rem;
}

.table-container {
    overflow-x: auto;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.prospects-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1rem;
    background-color: var(--surface-color);
    table-layout: fixed;
}

/* Column width distribution for Prospects Researched table */
/* First 3 columns equally distributed, last column sized to fit label */
.prospects-table .prospect-col {
    width: calc((100% - 120px) / 3);
}

.prospects-table .research-run-col {
    width: calc((100% - 120px) / 3);
}

.prospects-table .research-config-col {
    width: calc((100% - 120px) / 3);
}

.prospects-table .suspects-col {
    width: 120px; /* Increased from 90px to accommodate full label */
    padding-right: 20px !important; /* Increased right padding to ensure label is fully visible */
    padding-left: 15px; /* Ensure left padding is set */
}

/* Column width distribution for Client Person Reports table */
/* First 4 columns equally distributed, last column narrowed to fit label */
#clientPersonReportsTable th:nth-child(1),
#clientPersonReportsTable th:nth-child(2),
#clientPersonReportsTable th:nth-child(3),
#clientPersonReportsTable th:nth-child(4) {
    width: calc((100% - 100px) / 4);
}

#clientPersonReportsTable th:nth-child(5),
#clientPersonReportsTable td:nth-child(5) {
    width: 100px;
    padding-right: 15px !important;
}

.prospects-table thead {
    background-color: var(--bg-color);
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.prospects-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background-color: var(--bg-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.prospects-table td {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.prospects-table tbody tr:hover {
    background-color: var(--bg-color);
}

.prospects-table tbody tr:last-child td {
    border-bottom: none;
}

.prospect-name-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.prospect-name-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Mobile card view - hidden by default */
.prospects-card-view {
    display: none;
}

/* Responsive behavior */
@media (max-width: 768px) {
    /* Hide table view on mobile */
    .prospects-table-view {
        display: none;
    }
    
    /* Show card view on mobile */
    .prospects-card-view {
        display: block;
    }
    
    .prospect-card {
        background: var(--surface-color);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
        padding: 15px;
        margin-bottom: 15px;
        box-shadow: var(--shadow-sm);
    }
    
    .prospect-card-header {
        font-size: 1.1rem;
        font-weight: 600;
        margin-bottom: 12px;
        padding-bottom: 10px;
        border-bottom: 1px solid var(--border-color);
    }
    
    .prospect-card-row {
        display: flex;
        justify-content: space-between;
        padding: 8px 0;
        border-bottom: 1px solid var(--bg-color);
    }
    
    .prospect-card-row:last-child {
        border-bottom: none;
    }
    
    .prospect-card-label {
        font-weight: 600;
        color: var(--text-secondary);
        font-size: 0.85rem;
    }
    
    .prospect-card-value {
        color: var(--text-primary);
        text-align: right;
    }
}

/* Tablet adjustments */
@media (max-width: 1024px) and (min-width: 769px) {
    .prospects-table {
        font-size: 0.9rem;
    }
    
    .prospects-table th,
    .prospects-table td {
        padding: 12px;
    }
}

/* Small mobile adjustments */
@media (max-width: 576px) {
    .prospect-card {
        padding: 12px;
    }
    
    .prospect-card-header {
        font-size: 1rem;
    }
    
    .prospect-card-label,
    .prospect-card-value {
        font-size: 0.8rem;
    }
}

/* =============================================================================
   Search Agent Prompt Section
   ============================================================================= */

.search-agent-prompt-section {
    background: linear-gradient(135deg, rgba(102, 51, 153, 0.05) 0%, rgba(102, 51, 153, 0.08) 100%);
    border: 2px solid #663399;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
}

.search-agent-prompt-section h2 {
    color: #663399;
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.search-agent-prompt-display {
    background: white;
    border: 1px solid #d1d5db;
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-top: 1rem;
}

.search-agent-prompt-content {
    color: black;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0;
    max-height: 400px;
    overflow-y: auto;
}

/* Subsection styling for Research Prompts */
.subsection {
    margin: 2rem 0 1rem 0;
    padding: 1rem;
    background-color: var(--bg-secondary, #f8f9fa);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary-color, #2563eb);
}

.subsection h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.125rem;
    color: var(--text-primary, #1f2937);
    font-weight: 600;
}

.subsection-description {
    margin: 0 0 1rem 0;
    font-size: 0.875rem;
    color: var(--text-secondary, #6b7280);
    line-height: 1.4;
}

/* Planner prompt styling */
.planner-prompt-display {
    background: white;
    border: 1px solid #d1d5db;
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-top: 1rem;
}

.planner-prompt-content {
    font-style: italic;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    color: #374151;
    margin: 0;
    white-space: pre-line;
}

.report-writer-prompt-content {
    font-style: italic;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    color: #374151;
    margin: 0;
    white-space: pre-line;
}

.loading-spinner {
    text-align: center;
    padding: 20px;
    color: #666;
    font-style: italic;
}

.error {
    color: #dc3545;
    padding: 10px;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin: 10px 0;
}

.config-var-link {
    color: #2563eb;
    text-decoration: underline;
    cursor: pointer;
    font-weight: 500;
    transition: color 0.2s ease;
}

.config-var-link:hover {
    color: #1d4ed8;
    text-decoration: none;
}

.highlighted-template {
    background-color: #fef3c7;
    padding: 2px 4px;
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.highlighted-template-non-clickable {
    background-color: #fef3c7;
    padding: 2px 4px;
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    color: #6b7280;
    font-style: italic;
}

/* User prompt styling */
.planner-user-prompt-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

/* h4 styling removed since User Prompt heading was removed */

.planner-user-prompt-display {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-top: 1rem;
}

.planner-user-prompt-content {
    font-style: italic;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    color: #475569;
    margin: 0;
    white-space: pre-line;
}

/* =============================================================================
   Prospect Detail Page
   ============================================================================= */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

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

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

.info-label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.info-value {
    color: var(--text-primary);
    font-size: 1rem;
}

.info-value a {
    color: var(--primary-color);
    text-decoration: none;
}

.info-value a:hover {
    text-decoration: underline;
}

.runs-timeline {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.run-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s;
}

.run-card:hover {
    box-shadow: var(--shadow-md);
}

.run-header {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.run-title {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.run-title h3 {
    margin: 0;
    font-size: 1.25rem;
}

.run-link {
    color: var(--primary-color);
    text-decoration: none;
}

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

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-completed {
    background-color: #d1fae5;
    color: #065f46;
}

.status-failed {
    background-color: #fee2e2;
    color: #991b1b;
}

.status-running {
    background-color: #dbeafe;
    color: #1e40af;
}

.status-stopped {
    background-color: #fef3c7;
    color: #92400e;
}

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

.run-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.detail-row {
    display: flex;
    gap: 0.75rem;
}

.detail-label {
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 120px;
}

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

.artifacts-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.artifacts-section h4 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    color: var(--text-primary);
}

.artifacts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

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

.artifact-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.artifact-icon {
    font-size: 2rem;
    line-height: 1;
}

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

.artifact-type {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.company-report-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.company-report-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.artifact-filename {
    font-size: 0.875rem;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.artifact-download {
    font-size: 1.5rem;
    color: var(--primary-color);
    text-decoration: none;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: background-color 0.2s;
}

.artifact-download:hover {
    background-color: var(--border-color);
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.empty-state p {
    margin: 0.5rem 0;
}

.expandable-placeholder {
    background: var(--bg-color);
    border: 2px dashed var(--border-color);
}

.placeholder-text {
    color: var(--text-secondary);
    font-style: italic;
    margin: 0;
}

/* Responsive adjustments for prospect detail */
@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .artifacts-grid {
        grid-template-columns: 1fr;
    }
    
    .detail-row {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .detail-label {
        min-width: auto;
    }
}

/* =============================================================================
   Collapsible Subsection Styles
   ============================================================================= */

.collapsible-subsection {
    margin-bottom: 1rem;
}

.collapsible-header {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e5e7eb;
    transition: background-color 0.2s ease;
}

.collapsible-header.collapsed {
    /* Initial state - collapsed */
}

.collapsible-header:hover {
    background-color: #f9fafb;
    border-radius: 4px;
}

.collapsible-icon {
    margin-right: 0.5rem;
    transition: transform 0.2s ease;
    font-size: 0.8rem;
    color: #6b7280;
}

.collapsible-header.collapsed .collapsible-icon {
    transform: rotate(-90deg);
}

.collapsible-content {
    padding: 1rem 0;
}

/* =============================================================================
   Count Badges
   ============================================================================= */

.favorites-count {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.875rem;
    font-weight: 600;
    min-width: 32px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

/* Stop Pipeline Button Styles */
.btn-stop-pipeline {
    background-color: #ef4444 !important;
    border-color: #ef4444 !important;
    color: white !important;
}

.btn-stop-pipeline:hover:not(:disabled) {
    background-color: #dc2626 !important;
    border-color: #dc2626 !important;
}

.btn-stop-pipeline:disabled,
.btn-stop-pipeline.stopping {
    background-color: #fca5a5 !important;
    border-color: #fca5a5 !important;
    color: white !important;
    opacity: 1 !important;
    cursor: not-allowed;
}
