/* Ingestion Tab Styles */

.ingestion-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 24px;
    padding: 24px;
    min-height: 0;
    max-height: calc(100vh - 180px);
    overflow-y: auto;
}

@media (max-width: 900px) {
    .ingestion-layout {
        grid-template-columns: 1fr;
        max-height: none;
    }

    .ingestion-sources-content,
    .ingestion-runs-content {
        max-height: 400px;
    }
}

@media (max-height: 700px) {
    .ingestion-layout {
        max-height: none;
        height: auto;
    }

    .ingestion-sources-content,
    .ingestion-runs-content {
        max-height: 300px;
    }
}

.ingestion-sources-panel {
    background: var(--panel-bg);
    border: 1px solid var(--light-border);
    border-radius: 8px;
    overflow: hidden;
}

.ingestion-sources-header {
    padding: 16px;
    border-bottom: 1px solid var(--light-border);
    font-weight: 600;
}

.ingestion-sources-content {
    padding: 16px;
    overflow-y: auto;
    max-height: calc(100vh - 280px);
}

.ingestion-source-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--light-border);
    border-radius: 8px;
    margin-bottom: 12px;
}

.ingestion-source-card:last-child {
    margin-bottom: 0;
}

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

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

.ingestion-source-key {
    font-size: 12px;
    color: var(--text-muted);
    font-family: monospace;
}

.ingestion-source-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Ingestion Runs Panel */

.ingestion-runs-panel {
    background: var(--panel-bg);
    border: 1px solid var(--light-border);
    border-radius: 8px;
    overflow: hidden;
}

.ingestion-runs-header {
    padding: 16px;
    border-bottom: 1px solid var(--light-border);
    font-weight: 600;
}

.ingestion-runs-content {
    padding: 16px;
    overflow-y: auto;
    max-height: calc(100vh - 280px);
}

.ingestion-run-card {
    padding: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--light-border);
    border-radius: 8px;
    margin-bottom: 12px;
}

.ingestion-run-card:last-child {
    margin-bottom: 0;
}

.ingestion-run-card.active {
    border-color: var(--primary-color);
    background: var(--bg-primary-subtle);
}

.ingestion-run-card.completed {
    border-left: 4px solid var(--success-color);
}

.ingestion-run-card.warning {
    border-left: 4px solid var(--warning-color);
}

.ingestion-run-card.failed {
    border-left: 4px solid var(--error-color);
}

.ingestion-run-card.stopped {
    border-left: 4px solid var(--text-muted);
}

.ingestion-run-card.queued {
    border-left: 4px solid var(--info-color);
}

.ingestion-run-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.ingestion-run-source {
    font-weight: 600;
    color: var(--text-primary);
}

.ingestion-run-state {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.ingestion-run-state.active {
    background: var(--primary-light);
    color: var(--primary-color);
}

.ingestion-run-state.completed {
    background: var(--success-light);
    color: var(--success-color);
}

.ingestion-run-state.warning {
    background: var(--warning-light);
    color: var(--warning-color);
}

.ingestion-run-state.failed {
    background: var(--error-light);
    color: var(--error-color);
}

.ingestion-run-state.stopped {
    background: var(--bg-secondary);
    color: var(--text-muted);
}

.ingestion-run-state.queued {
    background: var(--info-light);
    color: var(--info-color);
}

.ingestion-run-phase {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.ingestion-run-progress {
    margin-bottom: 8px;
}

.ingestion-run-counts {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.ingestion-run-progress-bar {
    height: 4px;
    background: var(--bg-secondary);
    border-radius: 2px;
    overflow: hidden;
}

.ingestion-run-progress-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.ingestion-run-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ingestion-run-time {
    font-size: 12px;
    color: var(--text-muted);
}

.ingestion-run-error {
    margin-top: 8px;
    padding: 8px;
    background: var(--error-light);
    border-radius: 4px;
    color: var(--error-color);
    font-size: 12px;
}

/* Ingest Modal Styles */

.ingestion-source-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ingestion-source-option {
    padding: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--light-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ingestion-source-option:hover {
    border-color: var(--primary-color);
    background: var(--bg-primary-subtle);
}

/* Overview Ingestion Integration */

.overview-job-brand {
    font-weight: 600;
    color: var(--text-primary);
}

.overview-job-source {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

/* Credential Hint */

.ingestion-source-inputs-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ingestion-source-inputs-hint::before {
    content: "🔐";
    font-size: 10px;
}

/* Expandable Run Details */
.ingestion-run-card {
    cursor: pointer;
    transition: all 0.2s ease;
}

.ingestion-run-card:hover {
    background: var(--bg-hover, rgba(0,0,0,0.02));
}

.ingestion-run-card.expanded {
    background: var(--bg-primary-subtle, rgba(119, 95, 255, 0.03));
}

.ingestion-run-details {
    display: none;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--light-border);
    font-size: 13px;
}

.ingestion-run-card.expanded .ingestion-run-details {
    display: block;
}

.ingestion-run-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
}

.ingestion-run-detail-label {
    color: var(--text-muted);
}

.ingestion-run-detail-value {
    color: var(--text-primary);
    font-weight: 500;
}

.ingestion-run-expand-hint {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 8px;
    opacity: 0;
    transition: opacity 0.2s;
}

.ingestion-run-card:hover .ingestion-run-expand-hint {
    opacity: 1;
}

/* Checkpoint indicator */
.ingestion-source-checkpoint {
    border-left: 3px solid var(--primary-color);
}

.ingestion-source-actions {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
}

/* Checkpoint Modal Styles */
.checkpoint-modal-subtitle {
    margin-bottom: 20px;
    color: var(--text-primary);
    font-size: 14px;
}

.checkpoint-steps-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checkpoint-step-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--light-bg);
    border-radius: 10px;
    border: 1px solid var(--light-border);
}

.checkpoint-step-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

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

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

.checkpoint-step-name {
    font-weight: 600;
    display: block;
    color: var(--text-primary);
}

.checkpoint-step-desc {
    font-size: 13px;
    color: var(--text-muted);
    display: block;
    margin-top: 4px;
    line-height: 1.4;
}

.checkpoint-step-clear {
    background: none;
    border: none;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px 8px;
    margin: -4px -8px -4px 8px;
    border-radius: 6px;
    transition: all 0.15s;
    flex-shrink: 0;
}

.checkpoint-step-clear:hover {
    background: var(--error-light);
    color: var(--error-color);
}

.checkpoint-modal-hint {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--light-border);
}

.checkpoint-modal-empty {
    color: var(--text-muted);
    text-align: center;
    padding: 20px;
}
