/* Active Job Banner */
.active-job-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    background: linear-gradient(135deg, rgba(119, 95, 255, 0.08) 0%, rgba(119, 95, 255, 0.03) 100%);
    border: 1px solid rgba(119, 95, 255, 0.3);
    border-radius: 12px;
    margin-bottom: 20px;
}

.active-job-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    animation: pulse 1.5s ease-in-out infinite;
    flex-shrink: 0;
}

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

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

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

.active-job-state {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--primary);
    background: rgba(119, 95, 255, 0.15);
    padding: 2px 8px;
    border-radius: 4px;
}

.active-job-activity {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.active-job-progress {
    display: flex;
    align-items: center;
    gap: 10px;
}

.active-job-progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.active-job-progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.active-job-progress-text {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    min-width: 40px;
}

/* Active Ingestion Banner - Differentiated Style */
.active-ingestion-banner {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(16, 185, 129, 0.03) 100%);
    border-color: rgba(16, 185, 129, 0.3);
}

.ingestion-indicator {
    background: var(--success);
}

.ingestion-state {
    color: var(--success);
    background: rgba(16, 185, 129, 0.15);
}

.ingestion-progress-fill {
    background: var(--success);
}

.active-ingestion-counts {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 6px;
}

/* Overview Dashboard Styles */

.overview-dashboard {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
    padding: 24px;
    min-height: 0;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
}

.overview-column {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-height: 0;
}

.overview-column-main {
    min-width: 0;
}

.overview-column-jobs {
    min-width: 0;
}

.overview-section {
    background: var(--light-card);
    border-radius: 12px;
    border: 1px solid var(--light-border);
    overflow: hidden;
}

.overview-section-full {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.overview-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--light-border);
    background: var(--bg-subtle);
}

.overview-section-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.overview-link {
    font-size: 0.85rem;
    color: var(--primary);
    text-decoration: none;
}

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

/* Stats Grid */
.overview-stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    padding: 20px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-subtle);
    border-radius: 10px;
    border: 1px solid var(--light-border);
}

.stat-icon {
    font-size: 1.5rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--light-card);
    border-radius: 10px;
    border: 1px solid var(--light-border);
}

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

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card-clickable {
    cursor: pointer;
    transition: all 0.2s ease;
}

.stat-card-clickable:hover {
    background: var(--light-card);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(119, 95, 255, 0.15);
}

.stat-card-clickable:hover .stat-icon {
    background: rgba(119, 95, 255, 0.1);
    border-color: rgba(119, 95, 255, 0.3);
}

/* Processing Section */
.overview-processing {
    padding: 20px;
}

/* Active Processing Panel */
.processing-status-panel {
    background: linear-gradient(135deg, rgba(119, 95, 255, 0.08) 0%, rgba(119, 95, 255, 0.03) 100%);
    border: 1px solid rgba(119, 95, 255, 0.25);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 20px;
}

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

.processing-status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.processing-status-indicator.active {
    background: var(--primary);
    animation: pulse 1.5s ease-in-out infinite;
}

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

.processing-status-state {
    font-weight: 600;
    color: var(--primary);
    font-size: 0.95rem;
}

.processing-status-header .btn {
    margin-left: auto;
}

.processing-status-activity {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    min-height: 1.4em;
}

.processing-status-progress-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.processing-status-progress-bar {
    flex: 1;
    height: 8px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.processing-status-progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.processing-status-progress-text {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary);
    min-width: 45px;
    text-align: right;
}

.processing-status-details {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Idle State */
.processing-idle {
    margin-bottom: 20px;
}

.processing-idle-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-subtle);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.processing-idle-icon {
    font-size: 0.8rem;
}

.processing-idle-status.completed {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success);
}

.processing-idle-status.failed {
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger);
}

.processing-actions {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.processing-action-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.processing-action-group label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.processing-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.4;
}

.processing-reprocess {
    display: flex;
    gap: 10px;
    align-items: center;
}

.processing-reprocess .select-dropdown {
    flex: 1;
}

.processing-divider {
    height: 1px;
    background: var(--light-border);
}

/* Snapshots Section */
.overview-snapshots {
    padding: 16px 20px;
}

.snapshots-loading {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.snapshots-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 20px;
    color: var(--text-muted);
    text-align: center;
}

.snapshots-empty .icon {
    font-size: 1.5rem;
    margin-bottom: 8px;
    opacity: 0.5;
}

.snapshots-empty p {
    margin: 0 0 12px 0;
    font-size: 0.9rem;
}

.snapshots-current {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-subtle);
    border-radius: 8px;
    margin-bottom: 12px;
}

.snapshots-current-icon {
    font-size: 1.25rem;
}

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

.snapshots-current-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.snapshots-current-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.snapshots-list-compact {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.snapshot-item-compact {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-subtle);
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.snapshot-item-compact:hover {
    background: var(--light-card);
    border-color: var(--light-border);
}

.snapshot-item-compact.active {
    background: rgba(119, 95, 255, 0.08);
    border-color: rgba(119, 95, 255, 0.3);
}

.snapshot-item-icon {
    font-size: 1rem;
    opacity: 0.7;
}

.snapshot-item-name {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.snapshot-item-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.snapshot-item-active-badge {
    font-size: 0.75rem;
    color: var(--primary);
    background: rgba(119, 95, 255, 0.15);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

/* Danger Zone Section */
.overview-section-danger {
    border-color: rgba(220, 53, 69, 0.3);
}

.overview-section-danger .overview-section-header {
    background: rgba(220, 53, 69, 0.05);
    border-bottom-color: rgba(220, 53, 69, 0.2);
}

.overview-section-danger .overview-section-header h3 {
    color: var(--danger);
}

.danger-zone-content {
    padding: 16px 20px;
}

.danger-zone-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 16px;
    background: var(--bg-subtle);
    border-radius: 8px;
    border: 1px solid rgba(220, 53, 69, 0.2);
}

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

.danger-zone-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.danger-zone-description {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.btn-danger {
    background: var(--danger);
    color: white;
    border: none;
    flex-shrink: 0;
}

.btn-danger:hover {
    background: #c82333;
}

/* Jobs List */
.overview-jobs-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.overview-jobs-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--text-muted);
    text-align: center;
}

.overview-jobs-empty .icon {
    font-size: 2rem;
    margin-bottom: 8px;
    opacity: 0.5;
}

.overview-jobs-empty p {
    margin: 0;
    font-size: 0.9rem;
}

.overview-job-item {
    padding: 14px 16px;
    background: var(--bg-subtle);
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 3px solid var(--text-muted);
}

.overview-job-item.active {
    border-left-color: var(--primary);
    background: rgba(119, 95, 255, 0.05);
}

.overview-job-item.completed {
    border-left-color: var(--success);
}

.overview-job-item.failed {
    border-left-color: var(--danger);
}

.overview-job-item.stopped {
    border-left-color: var(--warning);
}

.overview-job-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.overview-job-state {
    font-size: 0.85rem;
    font-weight: 600;
}

.overview-job-state.active { color: var(--primary); }
.overview-job-state.completed { color: var(--success); }
.overview-job-state.failed { color: var(--danger); }
.overview-job-state.stopped { color: var(--warning); }
.overview-job-state.queued { color: var(--text-muted); }

.overview-job-time {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.overview-job-activity {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.overview-job-progress {
    display: flex;
    align-items: center;
    gap: 10px;
}

.overview-job-progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.overview-job-progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.overview-job-progress-text {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    min-width: 40px;
    text-align: right;
}

.overview-job-error {
    font-size: 0.8rem;
    color: var(--danger);
    margin-top: 6px;
    padding: 6px 10px;
    background: rgba(220, 53, 69, 0.1);
    border-radius: 4px;
}

/* Responsive */
@media (max-width: 1200px) {
    .overview-dashboard {
        grid-template-columns: 1fr;
    }

    .overview-stats {
        grid-template-columns: repeat(3, 1fr);
    }

    .overview-column-jobs {
        max-height: 400px;
    }
}

@media (max-width: 768px) {
    .overview-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .processing-reprocess {
        flex-direction: column;
    }

    .processing-reprocess .select-dropdown {
        width: 100%;
    }
}

/* Height-constrained screens */
@media (max-height: 800px) {
    .overview-dashboard {
        max-height: none;
        height: auto;
        overflow: visible;
    }

    .overview-column {
        overflow: visible;
    }

    .overview-section-full {
        flex: none;
        max-height: 400px;
        overflow-y: auto;
    }

    .overview-jobs-list {
        max-height: 300px;
    }
}

@media (max-height: 600px) {
    .overview-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        padding: 12px;
    }

    .stat-card {
        padding: 10px;
    }

    .stat-icon {
        width: 36px;
        height: 36px;
        font-size: 1.2rem;
    }

    .stat-value {
        font-size: 1.2rem;
    }

    .overview-section-full {
        max-height: 300px;
    }

    .overview-jobs-list {
        max-height: 200px;
    }
}
