/**
 * Journey Panel Styles
 * Styles for campaign journeys, journey builder, and analytics
 */

/* ============================================================================
   JOURNEY GROUPED VIEW
   ============================================================================ */

.journey-groups {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.journey-group {
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all 0.2s ease;
}

/* Light mode: visible card with shadow */
:root:not([data-theme="dark"]) .journey-group {
    border-color: #d1d5db;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Dark mode: subtle, no harsh borders */
[data-theme="dark"] .journey-group {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: none;
}

.journey-group:hover {
    transform: translateY(-1px);
}

:root:not([data-theme="dark"]) .journey-group:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .journey-group:hover {
    background: rgba(255, 255, 255, 0.05);
}

.journey-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    cursor: pointer;
    transition: background 0.2s ease;
}

/* Light mode: subtle background for header distinction */
:root:not([data-theme="dark"]) .journey-header {
    background: linear-gradient(to right, rgba(0, 0, 0, 0.02), transparent);
}

.journey-header:hover {
    background: var(--bg-hover);
}

:root:not([data-theme="dark"]) .journey-header:hover {
    background: rgba(0, 0, 0, 0.04);
}

.journey-expand-icon {
    width: 20px;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.journey-group.expanded .journey-expand-icon {
    transform: rotate(0deg);
}

.journey-icon {
    font-size: 24px;
}

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

.journey-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.journey-meta {
    font-size: 12px;
    color: var(--text-muted);
}

.journey-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

/* Journey-level action buttons - muted/neutral style */
.journey-actions .icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    color: var(--text-muted);
    background: transparent;
    border: none;
}

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

.journey-actions .icon-btn.danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* Journey status toggle button */
.journey-actions .journey-toggle {
    width: 36px;
    height: 28px;
    border-radius: 14px;
    font-size: 11px;
}

.journey-actions .journey-toggle.active {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.journey-actions .journey-toggle.active:hover {
    background: rgba(16, 185, 129, 0.25);
}

.journey-actions .journey-toggle.paused {
    background: rgba(107, 114, 128, 0.15);
    color: #6b7280;
    border: 1px solid rgba(107, 114, 128, 0.3);
}

.journey-actions .journey-toggle.paused:hover {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.3);
}

.journey-steps {
    border-top: 1px solid var(--border-color);
    padding: 8px 0;
    background: var(--bg-primary);
}

/* Light mode: slight inset appearance for steps area */
:root:not([data-theme="dark"]) .journey-steps {
    background: #fafafa;
    border-top-color: #e5e7eb;
}

/* Journey Step */
.journey-step {
    display: flex;
    align-items: flex-start;
    padding: 12px 20px 12px 24px;
    margin: 0 8px;
    border-radius: 8px;
    transition: all 0.15s ease;
}

.journey-step:hover {
    background: rgba(var(--theme-primary-rgb), 0.04);
}

[data-theme="dark"] .journey-step:hover {
    background: rgba(255, 255, 255, 0.03);
}

.step-connector {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-right: 16px;
    min-width: 32px;
}

.step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--theme-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.step-line {
    width: 2px;
    height: 36px;
    background: var(--border-color);
    margin-top: 4px;
}

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

.step-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.step-header i {
    font-size: 14px;
}

.step-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.step-status {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.step-meta {
    font-size: 12px;
    color: var(--text-muted);
}

.step-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.journey-step:hover .step-actions {
    opacity: 1;
}

/* Campaign step action buttons - use theme primary color */
.step-actions .icon-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    font-size: 12px;
    color: var(--theme-primary);
    background: rgba(var(--theme-primary-rgb), 0.1);
    border: 1px solid rgba(var(--theme-primary-rgb), 0.2);
}

.step-actions .icon-btn:hover {
    background: rgba(var(--theme-primary-rgb), 0.2);
    color: var(--theme-primary);
}

.step-actions .icon-btn.danger {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
}

.step-actions .icon-btn.danger:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* Standalone Campaigns */
.standalone-campaigns {
    margin-top: 24px;
}

.standalone-campaign {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 10px;
    transition: all 0.2s ease;
    /* Light mode defaults */
    background: #fff;
    border: 1px solid #d1d5db;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
}

/* Dark mode: subtle backgrounds, no harsh borders */
[data-theme="dark"] .standalone-campaign {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: none;
}

.standalone-campaign:hover {
    transform: translateY(-2px);
}

:root:not([data-theme="dark"]) .standalone-campaign:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #9ca3af;
}

[data-theme="dark"] .standalone-campaign:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
}

.campaign-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

[data-theme="dark"] .campaign-icon {
    background: var(--bg-primary);
}

.campaign-icon i {
    font-size: 18px;
}

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

.campaign-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.campaign-meta {
    font-size: 12px;
    color: var(--text-muted);
}

.campaign-actions {
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.standalone-campaign:hover .campaign-actions {
    opacity: 1;
}

/* Empty states */
.journey-empty-steps {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

.journey-empty-steps i {
    margin-right: 8px;
}

.journey-empty-steps a {
    color: var(--theme-primary);
    text-decoration: none;
}

.journey-empty-steps a:hover {
    text-decoration: underline;
}

/* ============================================================================
   JOURNEY BUILDER MODAL
   ============================================================================ */

#journeyBuilderModal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.journey-builder {
    background: var(--bg-primary);
    border-radius: 16px;
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.builder-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.builder-header h2 {
    margin: 0;
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.builder-steps {
    display: flex;
    gap: 24px;
    margin-top: 16px;
}

.journey-builder-step {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
}

.journey-builder-step.active {
    color: var(--theme-primary);
    font-weight: 600;
}

.journey-builder-step.completed {
    color: #10b981;
}

.journey-builder-step .step-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid currentColor;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.journey-builder-step.active .step-dot {
    background: var(--theme-primary);
    border-color: var(--theme-primary);
    color: white;
}

.journey-builder-step.completed .step-dot {
    background: #10b981;
    border-color: #10b981;
    color: white;
}

.builder-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.builder-step-content {
    min-height: 300px;
}

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

.builder-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

/* Template Options - Card Grid */
.template-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

/* Template Card - Like Campaign Targeting UI */
.template-card {
    display: flex;
    gap: 16px;
    padding: 16px 20px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    background: var(--bg-primary);
}

.template-card:hover {
    border-color: var(--theme-primary);
    background: var(--bg-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.template-card.selected {
    border-color: var(--theme-primary);
    background: linear-gradient(135deg, rgba(var(--theme-primary-rgb), 0.08), rgba(var(--theme-primary-rgb), 0.04));
    box-shadow: 0 0 0 3px rgba(var(--theme-primary-rgb), 0.15);
}

.template-card-check {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 18px;
    color: var(--border-color);
    transition: all 0.2s ease;
}

.template-card.selected .template-card-check {
    color: var(--theme-primary);
}

.template-card-check i {
    transition: transform 0.2s ease;
}

.template-card.selected .template-card-check i {
    transform: scale(1.1);
}

.template-card-icon {
    font-size: 32px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: 12px;
    flex-shrink: 0;
}

.template-card.selected .template-card-icon {
    background: rgba(var(--theme-primary-rgb), 0.15);
}

.template-card-content {
    flex: 1;
    min-width: 0;
    padding-right: 24px; /* Space for checkmark */
}

.template-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.template-card-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.template-card.selected .template-card-name {
    color: var(--theme-primary);
}

.template-card-steps {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--bg-secondary);
    color: var(--text-muted);
    font-weight: 500;
}

.template-card.selected .template-card-steps {
    background: var(--theme-primary);
    color: white;
}

.template-card-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 8px;
}

.template-card-footer {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-muted);
}

.template-card-footer i {
    font-size: 10px;
    color: var(--theme-primary);
}

/* Legacy classes (keep for compatibility) */
.template-option {
    display: flex;
    gap: 16px;
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.template-option:hover {
    border-color: var(--theme-primary);
    background: var(--bg-hover);
}

.template-option.selected {
    border-color: var(--theme-primary);
    background: rgba(var(--theme-primary-rgb), 0.1);
}

.template-icon {
    font-size: 28px;
    width: 40px;
    text-align: center;
}

.template-info {
    flex: 1;
}

.template-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.template-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.template-meta {
    font-size: 11px;
    color: var(--text-muted);
}

/* Step Builder */
.journey-steps-builder {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    min-height: 120px;
}

.steps-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

.steps-empty i {
    margin-right: 8px;
}

.builder-step-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.builder-step-row:last-child {
    border-bottom: none;
}

.step-drag-handle {
    color: var(--text-muted);
    cursor: grab;
}

.step-number-badge {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--theme-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
}

.step-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.step-name-input input {
    width: 100%;
}

.step-config {
    display: flex;
    align-items: center;
    gap: 16px;
}

.step-delay {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.form-input.compact,
.form-select.compact {
    padding: 6px 10px;
    font-size: 13px;
}

/* Step status badge (for existing steps in edit mode) */
.step-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: 8px;
}

.step-status-badge.active {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.step-status-badge.draft {
    background: rgba(107, 114, 128, 0.15);
    color: #6b7280;
}

.step-status-badge.paused {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

/* Existing vs new step styling */
.builder-step-row.existing {
    background: var(--bg-secondary);
}

.builder-step-row.new {
    background: rgba(59, 130, 246, 0.05);
    border-left: 3px solid var(--theme-primary);
}

/* Step name input with status */
.step-name-input {
    display: flex;
    align-items: center;
}

.step-name-input input {
    flex: 1;
}

/* Flow step badge for new items */
.flow-step-badge {
    display: inline-flex;
    padding: 2px 6px;
    background: var(--theme-primary);
    color: white;
    font-size: 9px;
    font-weight: 600;
    border-radius: 3px;
    margin-left: 8px;
    text-transform: uppercase;
}

.flow-step-new {
    border-left: 2px solid var(--theme-primary);
    padding-left: 10px;
}

/* Review */
.review-summary {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 16px;
}

.review-item {
    display: flex;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.review-item label {
    font-size: 13px;
    color: var(--text-muted);
    width: 120px;
}

.review-item span {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
}

.review-flow {
    margin-top: 16px;
}

.flow-visualization {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.flow-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.flow-step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--theme-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.flow-step-content {
    flex: 1;
    padding: 4px 0 20px;
    position: relative;
}

.flow-step:not(:last-child) .flow-step-content::before {
    content: '';
    position: absolute;
    left: -26px;
    top: 32px;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.flow-step-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.flow-step-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.flow-arrow {
    display: none;
}

.review-notice {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 8px;
    margin-top: 24px;
    font-size: 13px;
    color: var(--text-secondary);
}

.review-notice i {
    color: #3b82f6;
    flex-shrink: 0;
    margin-top: 2px;
}

/* ============================================================================
   JOURNEY ANALYTICS MODAL
   ============================================================================ */

#journeyAnalyticsModal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

#journeyAnalyticsModal .modal-content {
    background: var(--bg-primary);
    border-radius: 16px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.analytics-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.analytics-stat {
    text-align: center;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--theme-primary);
}

.stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.funnel-visualization {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.funnel-step {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.funnel-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.funnel-label .step-num {
    color: var(--text-muted);
    margin-right: 4px;
}

.funnel-bar-container {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 24px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
}

.funnel-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--theme-primary), rgba(var(--theme-primary-rgb), 0.7));
    border-radius: 4px;
    transition: width 0.5s ease;
}

.funnel-value {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    padding-right: 12px;
}

/* ============================================================================
   VIEW TOGGLE
   ============================================================================ */

.view-toggle {
    display: flex;
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 4px;
    gap: 4px;
}

.view-toggle-option {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.view-toggle-option:hover {
    color: var(--text-primary);
}

.view-toggle-option.active {
    background: var(--theme-primary);
    color: white;
}

/* ============================================================================
   ICON BUTTON
   ============================================================================ */

.icon-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

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

.icon-btn.danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* ============================================================================
   SMART ACTIVITY FILTERS (renamed from Activity Targeting)
   ============================================================================ */

.smart-activity-section {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 20px;
    margin-top: 16px;
}

.smart-activity-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.smart-activity-header h4 {
    margin: 0;
    font-size: 15px;
    color: var(--text-primary);
}

.smart-activity-header .badge {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--theme-primary);
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-type-select {
    margin-bottom: 16px;
}

.filter-type-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.filter-type-option {
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-type-option:hover {
    border-color: var(--theme-primary);
}

.filter-type-option.selected {
    border-color: var(--theme-primary);
    background: rgba(var(--theme-primary-rgb), 0.1);
}

.filter-type-option i {
    font-size: 18px;
    color: var(--theme-primary);
}

.filter-type-option .label {
    font-size: 13px;
    font-weight: 500;
}

/* Score Threshold Filter */
.score-threshold-config {
    padding: 16px;
    background: var(--bg-primary);
    border-radius: 8px;
    margin-top: 12px;
}

.score-presets {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.score-preset {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.score-preset:hover,
.score-preset.active {
    border-color: var(--theme-primary);
    background: rgba(var(--theme-primary-rgb), 0.1);
    color: var(--theme-primary);
}

.score-range-inputs {
    display: flex;
    align-items: center;
    gap: 12px;
}

.score-range-inputs input {
    width: 80px;
}

.score-range-inputs span {
    color: var(--text-muted);
}

/* Campaign Goal Filter */
.campaign-goal-config {
    padding: 16px;
    background: var(--bg-primary);
    border-radius: 8px;
    margin-top: 12px;
}

.campaign-selector {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin: 12px 0;
}

.campaign-selector-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
}

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

.campaign-selector-item:hover {
    background: var(--bg-hover);
}

.campaign-selector-item.selected {
    background: rgba(var(--theme-primary-rgb), 0.1);
}

.campaign-goal-icon {
    font-size: 14px;
}

.campaign-goal-info {
    flex: 1;
}

.campaign-goal-name {
    font-size: 13px;
    font-weight: 500;
}

.campaign-goal-type {
    font-size: 11px;
    color: var(--text-muted);
}

.recency-option {
    margin-top: 12px;
}

.recency-option label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.recency-option select {
    margin-left: 8px;
}

/* ============================================================================
   SELECTOR MODALS (Campaign & Journey Selection)
   ============================================================================ */

.selector-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.selector-modal {
    background: var(--bg-primary);
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.25s ease;
    overflow: hidden;
}

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

.selector-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 0;
}

.selector-modal-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.selector-modal-title i {
    font-size: 20px;
    color: var(--theme-primary);
}

.selector-modal-title i[style*="color: #8b5cf6"] {
    color: #8b5cf6 !important;
}

.selector-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

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

.selector-modal-subtitle {
    padding: 8px 24px 16px;
    font-size: 13px;
    color: var(--text-muted);
}

.selector-modal-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 16px;
    max-height: 400px;
}

.selector-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    margin-bottom: 8px;
    background: var(--bg-secondary);
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.selector-item:hover {
    background: var(--bg-hover);
    border-color: var(--theme-primary);
    transform: translateX(4px);
}

.selector-item:hover .selector-item-action {
    opacity: 1;
    color: var(--theme-primary);
}

.selector-item-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(59, 130, 246, 0.05));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.selector-item-icon i {
    font-size: 18px;
    color: #3b82f6;
}

.selector-item-icon.journey {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(139, 92, 246, 0.05));
}

.selector-item-icon.journey i {
    color: #8b5cf6;
}

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

.selector-item-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.selector-item-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.selector-item-action {
    opacity: 0.4;
    color: var(--text-muted);
    font-size: 16px;
    transition: all 0.15s ease;
}

.selector-modal-footer {
    padding: 16px 24px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid var(--border-color);
    margin-top: 8px;
}

/* Light mode adjustments */
:root:not([data-theme="dark"]) .selector-modal {
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.15);
}

:root:not([data-theme="dark"]) .selector-item {
    background: #f8fafc;
    border-color: #e2e8f0;
}

:root:not([data-theme="dark"]) .selector-item:hover {
    background: #fff;
    border-color: var(--theme-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

